blob: 1661c94683fd872372bf4a9dd437fe8d510c1226 [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.
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080081 BleScanStateChanged ble_scan_state_changed = 2 [(module) = "bluetooth"];
Chenjie Yubd1a28f2018-07-17 14:55:19 -070082 ProcessStateChanged process_state_changed = 3;
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080083 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Bookatzc1a050a2017-10-10 15:49:28 -070084 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;
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -080098 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
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;
Muhammad Qureshidbe9e812020-01-25 07:41:39 -0800140 CallStateChanged call_state_changed = 61 [(module) = "telecom"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800141 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
142 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
143 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
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;
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800147 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
148 68 [(module) = "bluetooth"];
Bookatz48d362e2018-11-06 15:49:08 -0800149 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700150 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800151 SpeakerImpedanceReported speaker_impedance_reported = 71;
152 HardwareFailed hardware_failed = 72;
153 PhysicalDropDetected physical_drop_detected = 73;
154 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800155 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
156 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Andrew Chantb56388b2018-03-22 21:07:33 -0700157 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800158 AppCrashOccurred app_crash_occurred = 78;
159 ANROccurred anr_occurred = 79;
160 WTFOccurred wtf_occurred = 80;
161 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700162 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800163 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700164 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700165 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700166 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800167 BiometricAcquired biometric_acquired = 87;
168 BiometricAuthenticated biometric_authenticated = 88;
169 BiometricErrorOccurred biometric_error_occurred = 89;
Will Brockmanfbaa7912019-10-24 15:15:09 -0400170 UiEventReported ui_event_reported = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700171 BatteryHealthSnapshot battery_health_snapshot = 91;
172 SlowIo slow_io = 92;
173 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700174 PhoneServiceStateChanged phone_service_state_changed = 94;
175 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100176 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700177 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700178 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700179 // TODO: service state change is very noisy shortly after boot, as well
180 // as at other transitions - coming out of doze, device plugged in, etc.
181 // Consider removing this if it becomes a problem
182 ServiceStateChanged service_state_changed = 99;
183 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800184 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800185 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000186 DevicePolicyEvent device_policy_event = 103;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800187 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
188 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
189 105 [(module) = "docsui"];
190 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
191 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
192 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
193 108 [(module) = "docsui"];
194 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
195 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
196 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
197 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800198 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
199 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000200 AppCompacted app_compacted = 115;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800201 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800202 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800203 117 [(module) = "docsui"];
204 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
205 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
206 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
207 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000208 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000209 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800210 GnssNiEventReported gnss_ni_event_reported = 124;
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800211 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
212 125 [(module) = "bluetooth"];
213 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
214 126 [(module) = "bluetooth"];
215 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
216 127 [(module) = "bluetooth"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000217 AppDowngraded app_downgraded = 128;
218 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
219 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800220 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
221 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800222 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800223 NfcErrorOccurred nfc_error_occurred = 134;
224 NfcStateChanged nfc_state_changed = 135;
225 NfcBeamOccurred nfc_beam_occurred = 136;
226 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
227 NfcTagOccurred nfc_tag_occurred = 138;
228 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
229 SeStateChanged se_state_changed = 140;
230 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800231 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800232 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800233 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800234 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800235 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800236 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800237 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800238 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Kweku Adams8845d012018-12-11 20:06:45 -0800239 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800240 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
241 151 [(module) = "bluetooth"];
242 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
243 152 [(module) = "bluetooth"];
244 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
245 153 [(module) = "bluetooth"];
246 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
247 154 [(module) = "bluetooth"];
248 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
249 155 [(module) = "bluetooth"];
250 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
251 156 [(module) = "bluetooth"];
252 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
253 157 [(module) = "bluetooth"];
254 BluetoothDeviceFailedContactCounterReported
255 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
256 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
257 159 [(module) = "bluetooth"];
258 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
259 160 [(module) = "bluetooth"];
260 BluetoothQualityReportReported bluetooth_quality_report_reported =
261 161 [(module) = "bluetooth"];
262 BluetoothDeviceInfoReported bluetooth_device_info_reported =
263 162 [(module) = "bluetooth"];
264 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
265 163 [(module) = "bluetooth"];
266 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
267 164 [(module) = "bluetooth"];
268 BluetoothBondStateChanged bluetooth_bond_state_changed =
269 165 [(module) = "bluetooth"];
270 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
271 166 [(module) = "bluetooth"];
272 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
273 167 [(module) = "bluetooth"];
Alex Salod7c3eef2019-01-25 14:43:27 -0800274 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800275 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700276 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800277 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800278 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800279 DeviceIdentifierAccessDenied device_identifier_access_denied =
280 172 [(module) = "telephony_common"];
Steven Wu552f63f2019-02-05 13:41:36 -0500281 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800282 AssistGestureStageReported assist_gesture_stage_reported = 174;
283 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
284 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800285 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000286 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800287 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700288 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800289 180 [(module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000290 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800291 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000292 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700293 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700294 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
295 TombStoneOccurred tomb_stone_occurred = 186;
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800296 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
297 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700298 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800299 188 [(module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700300 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800301 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800302 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800303 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
304 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
305 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
306 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
307 MediametricsCodecReported mediametrics_codec_reported = 195;
308 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
309 MediametricsExtractorReported mediametrics_extractor_reported = 197;
310 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
311 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
312 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700313 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800314 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
315 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800316 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Adam He420947c2019-01-23 15:59:09 -0800317 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
318 ContentCaptureServiceEvents content_capture_service_events = 207;
319 ContentCaptureSessionEvents content_capture_session_events = 208;
320 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700321 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100322 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800323 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100324 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800325 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100326 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800327 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100328 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800329 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100330 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800331 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100332 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800333 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100334 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800335 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100336 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800337 218 [(module) = "permissioncontroller"];
338 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
339 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
340 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
341 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -0700342 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800343 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700344 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
345 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Emilian Peev6729f372019-08-29 09:14:09 -0700346 CameraActionEvent camera_action_event = 227;
atrost01a20932019-08-28 15:40:37 +0100347 AppCompatibilityChangeReported app_compatibility_change_reported =
348 228 [(allow_from_any_uid) = true];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800349 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800350 VmsClientConnectionStateChanged vms_client_connection_state_changed =
351 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800352 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
353 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700354 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800355 235 [(module) = "mediaprovider"];
356 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700357 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800358 237 [(module) = "mediaprovider"];
Kenny Root4eacaaa2020-01-08 20:48:13 -0800359 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238;
Keun young Park3e033cb2019-12-18 11:27:35 -0800360 BootTimeEventDuration boot_time_event_duration_reported = 239;
361 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported = 240;
362 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
363 BootTimeEventErrorCode boot_time_event_error_code_reported = 242;
Nikita Ioffe41dd57e2020-01-10 16:05:08 +0000364 UserspaceRebootReported userspace_reboot_reported = 243;
Will Brockman079fdaa2020-01-12 16:45:03 -0500365 NotificationReported notification_reported = 244;
366 NotificationPanelReported notification_panel_reported = 245;
367 NotificationChannelModified notification_panel_modified = 246;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +0000368 IntegrityCheckResultReported integrity_check_result_reported = 247;
369 IntegrityRulesPushed integrity_rules_pushed = 248;
Jordan Liubedfa702019-12-20 15:08:45 -0800370 CellBroadcastMessageReported cb_message_reported =
371 249 [(module) = "cellbroadcast"];
372 CellBroadcastMessageError cb_message_error =
373 250 [(module) = "cellbroadcast"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000374 }
David Chenc8a43242017-10-17 16:23:28 -0700375
David Chen6e3e6cb2018-01-03 16:14:06 -0800376 // Pulled events will start at field 10000.
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000377 // Next: 10071
David Chenc8a43242017-10-17 16:23:28 -0700378 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800379 WifiBytesTransfer wifi_bytes_transfer = 10000;
380 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
381 MobileBytesTransfer mobile_bytes_transfer = 10002;
382 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800383 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800384 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800385 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800386 CpuTimePerFreq cpu_time_per_freq = 10008;
387 CpuTimePerUid cpu_time_per_uid = 10009;
388 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800389 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800390 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800391 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800392 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800393 SystemElapsedRealtime system_elapsed_realtime = 10014;
394 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800395 CpuActiveTime cpu_active_time = 10016;
396 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000397 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800398 RemainingBatteryCapacity remaining_battery_capacity = 10019;
399 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800400 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100401 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100402 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100403 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000404 DiskStats disk_stats = 10025;
405 DirectoryUsage directory_usage = 10026;
406 AppSize app_size = 10027;
407 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700408 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700409 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800410 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700411 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700412 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800413 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700414 ProcessCpuTime process_cpu_time = 10035;
Misha Wagner5a51e002018-10-03 15:04:09 +0100415 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700416 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800417 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
418 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
419 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000420 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800421 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800422 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800423 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000424 DebugElapsedClock debug_elapsed_clock = 10046;
425 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800426 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800427 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800428 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800429 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000430 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000431 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800432 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
433 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000434 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true];
Carmen Agimofa769c152019-03-04 14:39:14 +0000435 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700436 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700437 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200438 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100439 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700440 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
441 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100442 ProcessMemorySnapshot process_memory_snapshot = 10064;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800443 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Chris Wrencdea3b72019-11-22 16:58:17 -0500444 NotificationRemoteViews notification_remote_views = 10066;
Stanislav Zholninccb82e42019-11-29 18:59:49 +0000445 DangerousPermissionStateSampled dangerous_permission_state_sampled = 10067;
Stan Iliev637ba5e2019-08-16 13:43:08 -0400446 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin606454c2019-11-27 15:31:49 +0000447 RuntimeAppOpsAccess runtime_app_ops_access = 10069;
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000448 IonHeapSize ion_heap_size = 10070;
David Chenc8a43242017-10-17 16:23:28 -0700449 }
yroa1fe77c2018-02-26 14:22:54 -0800450
Bookatz76aafcf2018-09-17 16:17:10 -0700451 // DO NOT USE field numbers above 100,000 in AOSP.
452 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
453 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100454
455 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700456}
457
Yao Chend54f9dd2017-10-17 17:37:48 +0000458/**
Yangster-mac20877162017-12-22 17:19:39 -0800459 * This proto represents a node of an attribution chain.
460 * Note: All attribution chains are represented as a repeated field of type
461 * AttributionNode. It is understood that in such arrays, the order is that
462 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000463 */
Yangster-mac20877162017-12-22 17:19:39 -0800464message AttributionNode {
465 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800466 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800467
Yangster-mac20877162017-12-22 17:19:39 -0800468 // The (optional) string tag for an element in the attribution chain. If the
469 // element has no tag, it is encoded as an empty string.
470 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700471}
472
Yangster-mac48b3d622018-08-18 12:38:11 -0700473message KeyValuePair {
474 optional int32 key = 1;
475 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700476 int32 value_int = 2;
477 int64 value_long = 3;
478 string value_str = 4;
479 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700480 }
481}
482
483message KeyValuePairsAtom {
484 optional int32 uid = 1;
485 repeated KeyValuePair pairs = 2;
486}
487
Yao Chend54f9dd2017-10-17 17:37:48 +0000488/*
489 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800490 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000491 *
492 * RULES:
493 * - The field ids for each atom must start at 1, and count upwards by 1.
494 * Skipping field ids is not allowed.
495 * - These form an API, so renaming, renumbering or removing fields is
496 * not allowed between android releases. (This is not currently enforced,
497 * but there will be a tool to enforce this restriction).
498 * - The types must be built-in protocol buffer types, namely, no sub-messages
499 * are allowed (yet). The bytes type is also not allowed.
500 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800501 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000502 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800503 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000504 * - A field that is a uid should be a string field, tagged with the [xxx]
505 * annotation. The generated code on android will be represented by UIDs,
506 * and those UIDs will be translated in xxx to those strings.
507 *
508 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700509 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000510 * - If there is a UID, it goes first. Think in an object-oriented fashion.
511 * *****************************************************************************
512 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700513
Yao Chend54f9dd2017-10-17 17:37:48 +0000514/**
Tej Singha72344992019-04-17 18:55:08 -0700515 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700516 * Logs when the Thermal service HAL notifies the throttling start/stop events.
517 *
518 * Logged from:
519 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
520 */
521message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700522 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700523 optional android.os.TemperatureTypeEnum sensor_type = 1;
524
Maggie White442b6312019-04-05 16:26:44 -0700525 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700526 enum State {
527 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700528 START = 1; // START indicated that throttling was triggered.
529 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700530 }
Yangster-mace16189a2018-08-26 12:20:16 -0700531 optional State state = 2;
532
533 optional float temperature = 3;
534}
535
536/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000537 * Logs when the screen state changes.
538 *
539 * Logged from:
540 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
541 */
542message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800543 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700544 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700545}
Yao Chend54f9dd2017-10-17 17:37:48 +0000546
547/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700548 * Logs that the process state of the uid, as determined by ActivityManager
549 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000550 *
551 * Logged from:
552 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
553 */
Bookatzc1a050a2017-10-10 15:49:28 -0700554message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700555 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000556
Bookatzdb026a22018-01-10 19:01:56 -0800557 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700558 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000559}
560
561/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700562 * Logs process state change of a process, as per the activity manager.
563 *
564 * Logged from:
565 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
566 */
567message ProcessStateChanged {
568 optional int32 uid = 1;
569 optional string process_name = 2;
570 optional string package_name = 3;
571 // TODO: remove this when validation is done
572 optional int64 version = 5;
573 // The state, from frameworks/base/core/proto/android/app/enums.proto.
574 optional android.app.ProcessStateEnum state = 4;
575}
576
577/**
578 * Logs when ActivityManagerService sleep state is changed.
579 *
580 * Logged from:
581 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
582 */
583message ActivityManagerSleepStateChanged {
584 // TODO: import frameworks proto
585 enum State {
586 UNKNOWN = 0;
587 ASLEEP = 1;
588 AWAKE = 2;
589 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700590 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700591}
592
593/**
594 * Logs when system memory state changes.
595 *
596 * Logged from:
597 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
598 */
599message MemoryFactorStateChanged {
600 // TODO: import frameworks proto
601 enum State {
602 MEMORY_UNKNOWN = 0;
603 NORMAL = 1; // normal.
604 MODERATE = 2; // moderate memory pressure.
605 LOW = 3; // low memory.
606 CRITICAL = 4; // critical memory.
607
608 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700609 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700610}
611
612/**
613 * Logs when app is using too much cpu, according to ActivityManagerService.
614 *
615 * Logged from:
616 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
617 */
618message ExcessiveCpuUsageReported {
619 optional int32 uid = 1;
620 optional string process_name = 2;
621 optional string package_name = 3;
622 // package version. TODO: remove this when validation is done
623 optional int64 version = 4;
624}
625
626/**
627 * Logs when a cached process is killed, along with its pss.
628 *
629 * Logged from:
630 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
631 */
632message CachedKillReported {
633 optional int32 uid = 1;
634 optional string process_name = 2;
635 optional string package_name = 3;
636 // TODO: remove this when validation is done
637 optional int64 version = 5;
638 optional int64 pss = 4;
639}
640
641/**
642 * Logs when memory stats of a process is reported.
643 *
644 * Logged from:
645 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
646 */
647message ProcessMemoryStatReported {
648 optional int32 uid = 1;
649 optional string process_name = 2;
650 optional string package_name = 3;
651 //TODO: remove this when validation is done
652 optional int64 version = 9;
653 optional int64 pss = 4;
654 optional int64 uss = 5;
655 optional int64 rss = 6;
656 enum Type {
657 ADD_PSS_INTERNAL_SINGLE = 0;
658 ADD_PSS_INTERNAL_ALL_MEM = 1;
659 ADD_PSS_INTERNAL_ALL_POLL = 2;
660 ADD_PSS_EXTERNAL = 3;
661 ADD_PSS_EXTERNAL_SLOW = 4;
662 }
663 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800664 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700665}
666
667/**
Bookatzc1a050a2017-10-10 15:49:28 -0700668 * Logs that a process started, finished, crashed, or ANRed.
669 *
670 * Logged from:
671 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
672 */
673message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700674 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700675
David Chen0b5c90c2018-01-25 16:51:49 -0800676 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800677 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700678
Bookatzddccf0a2017-11-28 16:48:14 -0800679 // What lifecycle state the process changed to.
680 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800681 enum State {
682 FINISHED = 0;
683 STARTED = 1;
684 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800685 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800686 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700687}
688
Bookatzc1a050a2017-10-10 15:49:28 -0700689/**
690 * Logs when the ble scan state changes.
691 *
692 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700693 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700694 */
695message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800696 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700697
698 enum State {
699 OFF = 0;
700 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700701 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
702 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700703 }
704 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700705
Bookatze5ec0b42018-03-26 13:34:56 -0700706 // Does the scan have a filter.
707 optional bool is_filtered = 3;
708 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
709 optional bool is_first_match = 4;
710 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
711 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700712}
713
714/**
715 * Logs reporting of a ble scan finding results.
716 *
717 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700718 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700719 */
Bookatzae6738e2018-09-13 11:38:56 -0700720// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700721message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800722 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700723
724 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800725 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700726}
727
728/**
729 * Logs when a sensor state changes.
730 *
731 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700732 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700733 */
734message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800735 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700736
Bookatzc1a050a2017-10-10 15:49:28 -0700737 // The id (int) of the sensor.
738 optional int32 sensor_id = 2;
739
740 enum State {
741 OFF = 0;
742 ON = 1;
743 }
744 optional State state = 3;
745}
746
Bookatzc1a050a2017-10-10 15:49:28 -0700747/**
748 * Logs when GPS state changes.
749 *
750 * Logged from:
751 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
752 */
753message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800754 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700755
756 enum State {
757 OFF = 0;
758 ON = 1;
759 }
760 optional State state = 2;
761}
762
Bookatz48d362e2018-11-06 15:49:08 -0800763/**
764 * Logs when GPS signal quality.
765 *
766 * Logged from:
767 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
768 */
769message GpsSignalQualityChanged {
770 optional android.server.location.GpsSignalQualityEnum level = 1;
771}
772
Bookatzc1a050a2017-10-10 15:49:28 -0700773
774/**
775 * Logs when a sync manager sync state changes.
776 *
777 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700778 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700779 */
780message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800781 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700782
David Chen0b5c90c2018-01-25 16:51:49 -0800783 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800784 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700785
786 enum State {
787 OFF = 0;
788 ON = 1;
789 }
790 optional State state = 3;
791}
792
Yangster-mac96353002018-09-05 11:18:55 -0700793/*
794 * Deferred job stats.
795 *
796 * Logged from:
797 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
798*/
799message DeferredJobStatsReported {
800 repeated AttributionNode attribution_node = 1;
801
802 // Number of jobs deferred.
803 optional int32 num_jobs_deferred = 2;
804
805 // Time since the last job runs.
806 optional int64 time_since_last_job_millis = 3;
807}
808
Bookatzc1a050a2017-10-10 15:49:28 -0700809/**
810 * Logs when a job scheduler job state changes.
811 *
812 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700813 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700814 */
815message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800816 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700817
818 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800819 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700820
821 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800822 FINISHED = 0;
823 STARTED = 1;
824 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700825 }
826 optional State state = 3;
827
Tej Singh33a412b2018-03-16 18:43:59 -0700828 // The reason a job has stopped.
829 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700830 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700831 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100832
833 // The standby bucket of the app that scheduled the job. These match the framework constants
834 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
835 // already assigned 0.
836 enum Bucket {
837 UNKNOWN = -1;
838 ACTIVE = 0;
839 WORKING_SET = 1;
840 FREQUENT = 2;
841 RARE = 3;
842 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800843 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100844 }
845 optional Bucket standby_bucket = 5 [default = UNKNOWN];
846
847 // The job id (as assigned by the app).
848 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700849}
850
851/**
852 * Logs when the audio state changes.
853 *
854 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700855 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700856 */
857message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800858 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700859
860 enum State {
861 OFF = 0;
862 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700863 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
864 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700865 }
866 optional State state = 2;
867}
868
869/**
870 * Logs when the video codec state changes.
871 *
872 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700873 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700874 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800875message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800876 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700877
878 enum State {
879 OFF = 0;
880 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700881 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
882 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700883 }
884 optional State state = 2;
885}
886
887/**
888 * Logs when the flashlight state changes.
889 *
890 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700891 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700892 */
893message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800894 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700895
896 enum State {
897 OFF = 0;
898 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700899 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
900 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700901 }
902 optional State state = 2;
903}
904
905/**
906 * Logs when the camera state changes.
907 *
908 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700909 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700910 */
911message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800912 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700913
914 enum State {
915 OFF = 0;
916 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700917 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
918 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700919 }
920 optional State state = 2;
921}
922
923/**
924 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000925 *
926 * Logged from:
927 * TODO
928 */
Bookatzd6746242017-10-24 18:39:35 -0700929message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -0800930 repeated AttributionNode attribution_node = 1
931 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +0000932
Bookatz1a1b0462018-01-12 11:47:03 -0800933 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
934 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristineed615642020-01-02 12:53:41 -0800935 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY];
936 ;
Bookatzc1a050a2017-10-10 15:49:28 -0700937
938 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristineed615642020-01-02 12:53:41 -0800939 optional string tag = 3 [(state_field_option).option = PRIMARY];
Bookatzc1a050a2017-10-10 15:49:28 -0700940
941 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800942 RELEASE = 0;
943 ACQUIRE = 1;
944 CHANGE_RELEASE = 2;
945 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700946 }
tsaichristineed615642020-01-02 12:53:41 -0800947 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Bookatzc1a050a2017-10-10 15:49:28 -0700948}
949
950/**
Bookatzc1a050a2017-10-10 15:49:28 -0700951 * Logs when a partial wakelock is considered 'long' (over 1 min).
952 *
953 * Logged from:
954 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
955 */
956message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800957 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700958
Yao Chend54f9dd2017-10-17 17:37:48 +0000959 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
960 optional string tag = 2;
961
Bookatzc1a050a2017-10-10 15:49:28 -0700962 // TODO: I have no idea what this is.
963 optional string history_tag = 3;
964
965 enum State {
966 OFF = 0;
967 ON = 1;
968 }
969 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000970}
971
Bookatzc1a050a2017-10-10 15:49:28 -0700972/**
Bookatza66083f2018-09-20 17:24:00 -0700973 * Logs when the device is interactive, according to the PowerManager Notifier.
974 *
975 * Logged from:
976 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
977 */
978message InteractiveStateChanged {
979 enum State {
980 OFF = 0;
981 ON = 1;
982 }
983 optional State state = 1;
984}
985
986/**
Bookatzc1a050a2017-10-10 15:49:28 -0700987 * Logs Battery Saver state change.
988 *
989 * Logged from:
990 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
991 */
992message BatterySaverModeStateChanged {
993 enum State {
994 OFF = 0;
995 ON = 1;
996 }
997 optional State state = 1;
998}
999
1000/**
1001 * Logs Doze mode state change.
1002 *
1003 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001004 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001005 */
1006message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001007 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001008}
1009
1010
1011/**
1012 * Logs state change of Doze mode including maintenance windows.
1013 *
1014 * Logged from:
1015 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1016 */
1017message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001018 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001019}
1020
1021/**
1022 * Logs screen brightness level.
1023 *
1024 * Logged from:
1025 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1026 */
1027message ScreenBrightnessChanged {
1028 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1029 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001030}
1031
1032/**
1033 * Logs battery level (percent full, from 0 to 100).
1034 *
1035 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001036 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001037 */
1038message BatteryLevelChanged {
1039 // Battery level. Should be in [0, 100].
1040 optional int32 battery_level = 1;
1041}
1042
1043/**
1044 * Logs change in charging status of the device.
1045 *
1046 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001047 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001048 */
1049message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001050 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1051 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001052}
1053
1054/**
1055 * Logs whether the device is plugged in, and what power source it is using.
1056 *
1057 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001058 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001059 */
1060message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001061 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1062 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001063}
1064
Bookatz8c6571b2017-10-24 15:04:41 -07001065/**
1066 * Logs when an app's wakeup alarm fires.
1067 *
1068 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001069 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001070 */
1071message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001072 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001073
1074 // Name of the wakeup alarm.
1075 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001076
1077 // Name of source package (for historical reasons, since BatteryStats tracked it).
1078 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001079
1080 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1081 enum Bucket {
1082 UNKNOWN = 0;
1083 EXEMPTED = 5;
1084 ACTIVE = 10;
1085 WORKING_SET = 20;
1086 FREQUENT = 30;
1087 RARE = 40;
1088 NEVER = 50;
1089 }
1090 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1091 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001092}
1093
1094/**
1095 * Logs when an an app causes the mobile radio to change state.
1096 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1097 *
1098 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001099 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001100 */
1101message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001102 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001103
Bookatz1a1b0462018-01-12 11:47:03 -08001104 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1105 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001106}
1107
1108/**
1109 * Logs when an an app causes the wifi radio to change state.
1110 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1111 *
1112 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001113 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001114 */
1115message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001116 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001117
Bookatz1a1b0462018-01-12 11:47:03 -08001118 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1119 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001120}
1121
1122/**
1123 * Logs kernel wakeup reasons and aborts.
1124 *
1125 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001126 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001127 */
1128message KernelWakeupReported {
1129 // Name of the kernel wakeup reason (or abort).
1130 optional string wakeup_reason_name = 1;
1131
1132 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001133 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001134}
1135
1136/**
Bookatzda1798c2018-12-13 14:16:00 -08001137 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001138 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001139 *
1140 * Logged from:
1141 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1142 */
1143message WifiEnabledStateChanged {
1144 enum State {
1145 OFF = 0;
1146 ON = 1;
1147 }
1148 optional State state = 1;
1149}
1150
1151/**
1152 * 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 -08001153 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1154 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001155 *
1156 * Logged from:
1157 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1158 */
1159message WifiRunningStateChanged {
1160 repeated AttributionNode attribution_node = 1;
1161
1162 enum State {
1163 OFF = 0;
1164 ON = 1;
1165 }
1166 optional State state = 2;
1167}
1168
1169/**
Bookatze5885242017-10-24 20:10:31 -07001170 * Logs wifi locks held by an app.
1171 *
1172 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001173 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001174 */
1175message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001176 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001177
1178 enum State {
1179 OFF = 0;
1180 ON = 1;
1181 }
1182 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001183
1184 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1185 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001186}
1187
1188/**
1189 * Logs wifi signal strength changes.
1190 *
1191 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001192 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001193 */
1194message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001195 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1196 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001197}
1198
1199/**
1200 * Logs wifi scans performed by an app.
1201 *
1202 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001203 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001204 */
1205message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001206 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001207
1208 enum State {
1209 OFF = 0;
1210 ON = 1;
1211 }
1212 optional State state = 2;
1213}
1214
1215/**
Tej Singh4503e102018-01-04 14:35:01 -08001216 * Logs wifi multicast locks held by an app
1217 *
1218 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001219 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001220 */
1221message WifiMulticastLockStateChanged {
1222 repeated AttributionNode attribution_node = 1;
1223
1224 enum State {
1225 OFF = 0;
1226 ON = 1;
1227 }
1228 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001229
1230 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001231}
1232
1233/**
Tej Singh1ea42892018-01-19 09:27:00 -08001234 * Logs shutdown reason and duration on next boot.
1235 *
1236 * Logged from:
1237 * frameworks/base/core/java/com/android/server/BootReceiver.java
1238 */
1239message ShutdownSequenceReported {
1240 // True if shutdown is for a reboot. Default: false if we do not know.
1241 optional bool reboot = 1;
1242
1243 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1244 optional string reason = 2;
1245
1246 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1247 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001248 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001249
1250 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001251 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001252}
1253
Tej Singh6483ea42018-01-25 17:45:49 -08001254
1255/**
1256 * Logs boot reason and duration.
1257 *
1258 * Logged from:
1259 * system/core/bootstat/bootstat.cpp
1260 */
1261message BootSequenceReported {
1262 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1263 // Default: "<EMPTY>" if not available.
1264 optional string bootloader_reason = 1;
1265
1266 // Reason for system boot. Eg. bootloader, reboot,userrequested
1267 // Default: "<EMPTY>" if not available.
1268 optional string system_reason = 2;
1269
1270 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001271 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001272
1273 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001274 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001275
1276 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001277 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001278
1279 // Time since last boot in ms. Default: 0 if not available.
1280 optional int64 time_since_last_boot = 6;
1281}
1282
Tej Singhc477d9c2018-02-05 18:31:39 -08001283
1284/**
1285 * Logs call state and disconnect cause (if applicable).
1286 *
1287 * Logged from:
1288 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1289 */
1290message CallStateChanged {
1291 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1292 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1293 optional android.telecom.CallStateEnum call_state = 1;
1294
1295 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1296 // This value is only applicable when the call_state is DISCONNECTED, and
1297 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1298 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1299 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1300
1301 // True if the call is self-managed, which are apps that use the
1302 // telecom infrastructure to make their own calls.
1303 optional bool self_managed = 3;
1304
1305 // True if call is external. External calls are calls on connected Wear
1306 // devices but show up in Telecom so the user can pull them onto the device.
1307 optional bool external_call = 4;
1308}
1309
Tej Singh1ea42892018-01-19 09:27:00 -08001310/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001311 * Logs keyguard state. The keyguard is the lock screen.
1312 *
1313 * Logged from:
1314 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1315 */
1316message KeyguardStateChanged {
1317 enum State {
1318 UNKNOWN = 0;
1319 // The keyguard is hidden when the phone is unlocked.
1320 HIDDEN = 1;
1321 // The keyguard is shown when the phone is locked (screen turns off).
1322 SHOWN= 2;
1323 // The keyguard is occluded when something is overlaying the keyguard.
1324 // Eg. Opening the camera while on the lock screen.
1325 OCCLUDED = 3;
1326 }
1327 optional State state = 1;
1328}
1329
1330/**
1331 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1332 * prompts the user to enter a password (pattern, pin, etc).
1333 *
1334 * Logged from:
1335 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1336 */
1337
1338message KeyguardBouncerStateChanged {
1339 enum State {
1340 UNKNOWN = 0;
1341 // Bouncer is hidden, either as a result of successfully entering the
1342 // password, screen timing out, or user going back to lock screen.
1343 HIDDEN = 1;
1344 // This is when the user is being prompted to enter the password.
1345 SHOWN = 2;
1346 }
1347 optional State state = 1;
1348}
1349
1350/**
1351 * Logs the result of entering a password into the keyguard bouncer.
1352 *
1353 * Logged from:
1354 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1355 */
1356message KeyguardBouncerPasswordEntered {
1357 enum BouncerResult {
1358 UNKNOWN = 0;
1359 // The password entered was incorrect.
1360 FAILURE = 1;
1361 // The password entered was correct.
1362 SUCCESS = 2;
1363 }
1364 optional BouncerResult result = 1;
1365}
1366
Tej Singha883b372018-02-15 11:30:01 -08001367/*
1368 * Logs changes to the configuration of the device. The configuration is defined
1369 * in frameworks/base/core/java/android/content/res/Configuration.java
1370 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1371 * Please go there to interpret the possible values each field can be.
1372 *
1373 * Logged from:
1374 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1375 */
1376message ResourceConfigurationChanged {
1377 // Bit mask of color capabilities of the screen.
1378 // Contains information about the color gamut and hdr mode of the screen.
1379 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001380 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001381
1382 // The target screen density being rendered to.
1383 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001384 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001385
1386 // Current user preference for the scaling factor for fonts,
1387 // relative to the base density scaling.
1388 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001389 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001390
1391 // Flag indicating whether the hard keyboard is hidden.
1392 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001393 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001394
1395 // The type of keyboard attached to the device.
1396 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1397 optional int32 keyboard = 5;
1398
1399 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1400 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001401 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001402
1403 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1404 // 0 if undefined.
1405 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1406 optional int32 mcc = 7;
1407
1408 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1409 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1410 // MNC_ZERO symbol defined in Configuration.java.
1411 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1412 optional int32 mnc = 8;
1413
1414 // The kind of navigation available on the device.
1415 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1416 optional int32 navigation = 9;
1417
1418 // Flag indicating whether the navigation is available.
1419 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001420 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001421
1422 // Overall orientation of the screen.
1423 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1424 optional int32 orientation = 11;
1425
1426 // The current height of the available screen space, in dp units.
1427 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001428 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001429
1430 // Bit mask of overall layout of the screen.
1431 // Contains information about screen size, whether the screen is wider/taller
1432 // than normal, whether the screen layout is right-tl-left or left-to-right,
1433 // and whether the screen has a rounded shape.
1434 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001435 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001436
1437 // Current width of the available screen space, in dp units.
1438 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001439 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001440
1441 // The smallest screen size an application will see in normal operation.
1442 // This is the smallest value of both screenWidthDp and screenHeightDp
1443 // in portrait and landscape.
1444 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001445 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001446
1447 // The type of touch screen attached to the device.
1448 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1449 optional int32 touchscreen = 16;
1450
1451 // Bit mask of the ui mode.
1452 // Contains information about the overall ui mode of the device.
1453 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1454 // Also contains information about whether the device is in night mode.
1455 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001456 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001457}
1458
Tej Singheee317b2018-03-07 19:28:05 -08001459
1460/**
1461 * Logs changes in the connection state of the mobile radio.
1462 *
1463 * Logged from:
1464 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1465 */
1466message MobileConnectionStateChanged {
1467 // States are from the state machine DataConnection.java.
1468 enum State {
1469 UNKNOWN = 0;
1470 // The connection is inactive, or disconnected.
1471 INACTIVE = 1;
1472 // The connection is being activated, or connecting.
1473 ACTIVATING = 2;
1474 // The connection is active, or connected.
1475 ACTIVE = 3;
1476 // The connection is disconnecting.
1477 DISCONNECTING = 4;
1478 // The connection is disconnecting after creating a connection.
1479 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1480 }
1481 optional State state = 1;
1482 // For multi-sim phones, this distinguishes between the sim cards.
1483 optional int32 sim_slot_index = 2;
1484 // Used to identify the connection. Starts at 0 and increments by 1 for
1485 // every new network created. Resets whenever the device reboots.
1486 optional int32 data_connection_id = 3;
1487 // A bitmask for the capabilities of this connection.
1488 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1489 // Default value (if we have no information): 0
1490 optional int64 capabilities = 4;
1491 // If this connection has internet.
1492 // This just checks if the DEFAULT bit of capabilities is set.
1493 optional bool has_internet = 5;
1494}
1495
1496/**
1497 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1498 *
1499 * Logged from:
1500 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1501 */
1502message MobileRadioTechnologyChanged {
1503 optional android.telephony.NetworkTypeEnum state = 1;
1504 // For multi-sim phones, this distinguishes between the sim cards.
1505 optional int32 sim_slot_index = 2;
1506}
1507
Andrew Chantb56388b2018-03-22 21:07:33 -07001508/**
1509 * Logs the VID and PID of any connected USB devices.
1510 *
1511 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1512 *
1513 * Logged by Vendor.
1514 */
1515message UsbDeviceAttached {
1516 optional int32 vid = 1;
1517 optional int32 pid = 2;
1518 optional bool has_audio = 3;
1519 optional bool has_hid = 4;
1520 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001521 enum State {
1522 STATE_DISCONNECTED = 0;
1523 STATE_CONNECTED = 1;
1524 }
1525 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001526 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001527}
1528
Tej Singheee317b2018-03-07 19:28:05 -08001529
Tej Singhdd7bd352018-02-09 19:33:15 -08001530/**
Tej Singh5d991e12018-03-09 19:48:11 -08001531 * Logs when Bluetooth is enabled and disabled.
1532 *
1533 * Logged from:
1534 * services/core/java/com/android/server/BluetoothManagerService.java
1535 */
1536message BluetoothEnabledStateChanged {
1537 repeated AttributionNode attribution_node = 1;
1538 // Whether or not bluetooth is enabled on the device.
1539 enum State {
1540 UNKNOWN = 0;
1541 ENABLED = 1;
1542 DISABLED = 2;
1543 }
1544 optional State state = 2;
1545 // The reason for being enabled/disabled.
1546 // Eg. Airplane mode, crash, application request.
1547 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1548 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001549 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001550}
1551
1552/**
Jack Hed9837c82019-01-09 01:19:13 -08001553 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001554 *
1555 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001556 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1557 *
1558 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001559 */
1560message BluetoothConnectionStateChanged {
1561 // The state of the connection.
1562 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1563 optional android.bluetooth.ConnectionStateEnum state = 1;
1564 // An identifier that can be used to match connect and disconnect events.
1565 // Currently is last two bytes of a hash of a device level ID and
1566 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001567 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001568 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001569 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1570 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001571 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001572 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001573 // An identifier that can be used to match events for this device.
1574 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1575 // Salt: Randomly generated 256 bit value
1576 // Hash algorithm: HMAC-SHA256
1577 // Size: 32 byte
1578 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001579 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001580}
1581
1582/**
1583 * Logs when a Bluetooth device connects and disconnects over ACL
1584 *
1585 * Logged from:
1586 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1587 *
1588 * Next Tag: 3
1589 */
1590message BluetoothAclConnectionStateChanged {
1591 // An identifier that can be used to match events for this device.
1592 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1593 // Salt: Randomly generated 256 bit value
1594 // Hash algorithm: HMAC-SHA256
1595 // Size: 32 byte
1596 // Default: null or empty if the device identifier is not known
1597 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1598 // The state of the connection.
1599 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1600 optional android.bluetooth.ConnectionStateEnum state = 2;
1601}
1602
1603/**
1604 * Logs when a Bluetooth device connects and disconnects over SCO
1605 *
1606 * Logged from:
1607 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1608 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1609 *
1610 * Next Tag: 4
1611 */
1612message BluetoothScoConnectionStateChanged {
1613 // An identifier that can be used to match events for this device.
1614 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1615 // Salt: Randomly generated 256 bit value
1616 // Hash algorithm: HMAC-SHA256
1617 // Size: 32 byte
1618 // Default: null or empty if the device identifier is not known
1619 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1620 // The state of the connection.
1621 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1622 optional android.bluetooth.ConnectionStateEnum state = 2;
1623 // Codec used for this SCO connection
1624 // Default: UNKNOWN
1625 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001626}
1627
Jack Hec27040a2019-01-09 20:54:41 -08001628/**
1629 * Logged when active device of a profile changes
1630 *
1631 * Logged from:
1632 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1633 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1634 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1635 */
1636message BluetoothActiveDeviceChanged {
1637 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1638 // From android.bluetooth.BluetoothProfile
1639 optional int32 bt_profile = 1;
1640 // An identifier that can be used to match events for this new active device.
1641 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1642 // Salt: Randomly generated 256 bit value
1643 // Hash algorithm: HMAC-SHA256
1644 // Size: 32 byte
1645 // Default: null or empty if there is no active device for this profile
1646 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1647}
1648
Jack Heab86dbd22018-12-18 15:43:27 -08001649// Logs when there is an event affecting Bluetooth device's link layer connection.
1650// - This event is triggered when there is a related HCI command or event
1651// - Users of this metrics can deduce Bluetooth device's connection state from these events
1652// - HCI commands are logged before the command is sent, after receiving command status, and after
1653// receiving command complete
1654// - HCI events are logged when they arrive
1655//
1656// Low level log from system/bt
1657//
1658// Bluetooth classic commands:
1659// - CMD_CREATE_CONNECTION
1660// - CMD_DISCONNECT
1661// - CMD_CREATE_CONNECTION_CANCEL
1662// - CMD_ACCEPT_CONNECTION_REQUEST
1663// - CMD_REJECT_CONNECTION_REQUEST
1664// - CMD_SETUP_ESCO_CONNECTION
1665// - CMD_ACCEPT_ESCO_CONNECTION
1666// - CMD_REJECT_ESCO_CONNECTION
1667// - CMD_ENH_SETUP_ESCO_CONNECTION
1668// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1669//
1670// Bluetooth low energy commands:
1671// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1672// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1673// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1674// - CMD_BLE_CLEAR_WHITE_LIST
1675// - CMD_BLE_ADD_WHITE_LIST
1676// - CMD_BLE_REMOVE_WHITE_LIST
1677//
1678// Bluetooth classic events:
1679// - EVT_CONNECTION_COMP
1680// - EVT_CONNECTION_REQUEST
1681// - EVT_DISCONNECTION_COMP
1682// - EVT_ESCO_CONNECTION_COMP
1683// - EVT_ESCO_CONNECTION_CHANGED
1684//
1685// Bluetooth low energy meta events:
1686// - BLE_EVT_CONN_COMPLETE_EVT
1687// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1688//
1689// Next tag: 10
1690message BluetoothLinkLayerConnectionEvent {
1691 // An identifier that can be used to match events for this device.
1692 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1693 // Salt: Randomly generated 256 bit value
1694 // Hash algorithm: HMAC-SHA256
1695 // Size: 32 byte
1696 // Default: null or empty if the device identifier is not known
1697 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1698 // Connection handle of this connection if available
1699 // Range: 0x0000 - 0x0EFF (12 bits)
1700 // Default: 0xFFFF if the handle is unknown
1701 optional int32 connection_handle = 2;
1702 // Direction of the link
1703 // Default: DIRECTION_UNKNOWN
1704 optional android.bluetooth.DirectionEnum direction = 3;
1705 // Type of this link
1706 // Default: LINK_TYPE_UNKNOWN
1707 optional android.bluetooth.LinkTypeEnum type = 4;
1708
1709 // Reason metadata for this link layer connection event, rules for interpretation:
1710 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1711 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1712 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1713 // set and valid, ignore hci_ble_event
1714
1715 // HCI command associated with this event
1716 // Default: CMD_UNKNOWN
1717 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1718 // HCI event associated with this event
1719 // Default: EVT_UNKNOWN
1720 optional android.bluetooth.hci.EventEnum hci_event = 6;
1721 // HCI BLE meta event associated with this event
1722 // Default: BLE_EVT_UNKNOWN
1723 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1724 // HCI command status code if this is triggerred by hci_cmd
1725 // Default: STATUS_UNKNOWN
1726 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1727 // HCI reason code associated with this event
1728 // Default: STATUS_UNKNOWN
1729 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1730}
1731
Howard Roe103fe22019-01-17 16:52:16 -08001732/**
1733 * Logs when a module is rolled back by Watchdog.
1734 *
1735 * Logged from: Rollback Manager
1736 */
1737message WatchdogRollbackOccurred {
1738 enum RollbackType {
1739 UNKNOWN = 0;
1740 ROLLBACK_INITIATE = 1;
1741 ROLLBACK_SUCCESS = 2;
1742 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001743 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001744 }
1745 optional RollbackType rollback_type = 1;
1746
1747 optional string package_name = 2;
1748
1749 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001750
1751 enum RollbackReasonType {
1752 REASON_UNKNOWN = 0;
1753 REASON_NATIVE_CRASH = 1;
1754 REASON_EXPLICIT_HEALTH_CHECK = 2;
1755 REASON_APP_CRASH = 3;
1756 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001757 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001758 }
1759 optional RollbackReasonType rollback_reason = 4;
1760
1761 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1762 // is initiated. Empty if the package is unknown.
1763 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001764}
1765
Jack Hec27040a2019-01-09 20:54:41 -08001766/**
1767 * Logs when there is a change in Bluetooth A2DP playback state
1768 *
1769 * Logged from:
1770 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1771 */
1772message BluetoothA2dpPlaybackStateChanged {
1773 // An identifier that can be used to match events for this device.
1774 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1775 // Salt: Randomly generated 256 bit value
1776 // Hash algorithm: HMAC-SHA256
1777 // Size: 32 byte
1778 // Default: null or empty if the device identifier is not known
1779 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1780 // Current playback state
1781 // Default: PLAYBACK_STATE_UNKNOWN
1782 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1783 // Current audio coding mode
1784 // Default: AUDIO_CODING_MODE_UNKNOWN
1785 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1786}
1787
1788/**
1789 * Logs when there is a change in A2DP codec config for a particular remote device
1790 *
1791 * Logged from:
1792 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1793 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1794 */
1795message BluetoothA2dpCodecConfigChanged {
1796 // An identifier that can be used to match events for this device.
1797 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1798 // Salt: Randomly generated 256 bit value
1799 // Hash algorithm: HMAC-SHA256
1800 // Size: 32 byte
1801 // Default: null or empty if the device identifier is not known
1802 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1803 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1804 // Default SOURCE_CODEC_TYPE_INVALID
1805 optional int32 codec_type = 2;
1806 // Codec priroity, the higher the more preferred, -1 for disabled
1807 // Default: CODEC_PRIORITY_DEFAULT
1808 optional int32 codec_priority = 3;
1809 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1810 // Default: SAMPLE_RATE_NONE
1811 optional int32 sample_rate = 4;
1812 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1813 // Default: BITS_PER_SAMPLE_NONE
1814 optional int32 bits_per_sample = 5;
1815 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1816 // Default: CHANNEL_MODE_NONE
1817 optional int32 channel_mode = 6;
1818 // Codec specific values
1819 // Default 0
1820 optional int64 codec_specific_1 = 7;
1821 optional int64 codec_specific_2 = 8;
1822 optional int64 codec_specific_3 = 9;
1823 optional int64 codec_specific_4 = 10;
1824}
1825
1826/**
1827 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1828 * Each codec's capability is logged separately due to statsd restriction
1829 *
1830 * Logged from:
1831 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1832 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1833 */
1834message BluetoothA2dpCodecCapabilityChanged {
1835 // An identifier that can be used to match events for this device.
1836 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1837 // Salt: Randomly generated 256 bit value
1838 // Hash algorithm: HMAC-SHA256
1839 // Size: 32 byte
1840 // Default: null or empty if the device identifier is not known
1841 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1842 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1843 // Default SOURCE_CODEC_TYPE_INVALID
1844 optional int32 codec_type = 2;
1845 // Codec priroity, the higher the more preferred, -1 for disabled
1846 // Default: CODEC_PRIORITY_DEFAULT
1847 optional int32 codec_priority = 3;
1848 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1849 // in BluetoothCodecConfig
1850 // Default: empty and SAMPLE_RATE_NONE for individual item
1851 optional int32 sample_rate = 4;
1852 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1853 // in BluetoothCodecConfig
1854 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1855 optional int32 bits_per_sample = 5;
1856 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1857 // BluetoothCodecConfig
1858 // Default: empty and CHANNEL_MODE_NONE for individual item
1859 optional int32 channel_mode = 6;
1860 // Codec specific values
1861 // Default 0
1862 optional int64 codec_specific_1 = 7;
1863 optional int64 codec_specific_2 = 8;
1864 optional int64 codec_specific_3 = 9;
1865 optional int64 codec_specific_4 = 10;
1866}
1867
1868/**
1869 * Logs when A2DP failed to read from PCM source.
1870 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1871 *
1872 * Logged from:
1873 * system/bt
1874 */
1875message BluetoothA2dpAudioUnderrunReported {
1876 // An identifier that can be used to match events for this device.
1877 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1878 // Salt: Randomly generated 256 bit value
1879 // Hash algorithm: HMAC-SHA256
1880 // Size: 32 byte
1881 // Default: null or empty if the device identifier is not known
1882 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1883 // Encoding interval in nanoseconds
1884 // Default: 0
1885 optional int64 encoding_interval_nanos = 2;
1886 // Number of bytes of PCM data that could not be read from the source
1887 // Default: 0
1888 optional int32 num_missing_pcm_bytes = 3;
1889}
1890
1891/**
1892 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1893 * buffer queue is full and we have to drop data
1894 *
1895 * Logged from:
1896 * system/bt
1897 */
1898message BluetoothA2dpAudioOverrunReported {
1899 // An identifier that can be used to match events for this device.
1900 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1901 // Salt: Randomly generated 256 bit value
1902 // Hash algorithm: HMAC-SHA256
1903 // Size: 32 byte
1904 // Default: null or empty if the device identifier is not known
1905 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1906 // Encoding interval in nanoseconds
1907 // Default: 0
1908 optional int64 encoding_interval_nanos = 2;
1909 // Number of buffers dropped in this event
1910 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1911 // Default: 0
1912 optional int32 num_dropped_buffers = 3;
1913 // Number of encoded buffers dropped in this event
1914 // Default 0
1915 optional int32 num_dropped_encoded_frames = 4;
1916 // Number of encoded bytes dropped in this event
1917 // Default: 0
1918 optional int32 num_dropped_encoded_bytes = 5;
1919}
1920
1921/**
1922 * Logs when we receive reports regarding a device's RSSI value
1923 *
1924 * Logged from:
1925 * system/bt
1926 */
1927message BluetoothDeviceRssiReported {
1928 // An identifier that can be used to match events for this device.
1929 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1930 // Salt: Randomly generated 256 bit value
1931 // Hash algorithm: HMAC-SHA256
1932 // Size: 32 byte
1933 // Default: null or empty if the device identifier is not known
1934 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1935 // Connection handle of this connection if available
1936 // Range: 0x0000 - 0x0EFF (12 bits)
1937 // Default: 0xFFFF if the handle is unknown
1938 optional int32 connection_handle = 2;
1939 // HCI command status code if this is triggerred by hci_cmd
1940 // Default: STATUS_UNKNOWN
1941 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1942 // BR/EDR
1943 // Range: -128 ≤ N ≤ 127 (signed integer)
1944 // Units: dB
1945 // LE:
1946 // Range: -127 to 20, 127 (signed integer)
1947 // Units: dBm
1948 // Invalid when an out of range value is reported
1949 optional int32 rssi = 4;
1950}
1951
1952/**
1953 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1954 *
1955 * Logged from:
1956 * system/bt
1957 */
1958message BluetoothDeviceFailedContactCounterReported {
1959 // An identifier that can be used to match events for this device.
1960 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1961 // Salt: Randomly generated 256 bit value
1962 // Hash algorithm: HMAC-SHA256
1963 // Size: 32 byte
1964 // Default: null or empty if the device identifier is not known
1965 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1966 // Connection handle of this connection if available
1967 // Range: 0x0000 - 0x0EFF (12 bits)
1968 // Default: 0xFFFF if the handle is unknown
1969 optional int32 connection_handle = 2;
1970 // HCI command status code if this is triggerred by hci_cmd
1971 // Default: STATUS_UNKNOWN
1972 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1973 // Number of consecutive failed contacts for a connection corresponding to the Handle
1974 // Range: uint16_t, 0-0xFFFF
1975 // Default: 0xFFFFF
1976 optional int32 failed_contact_counter = 4;
1977}
1978
1979/**
1980 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1981 *
1982 * Logged from:
1983 * system/bt
1984 */
1985message BluetoothDeviceTxPowerLevelReported {
1986 // An identifier that can be used to match events for this device.
1987 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1988 // Salt: Randomly generated 256 bit value
1989 // Hash algorithm: HMAC-SHA256
1990 // Size: 32 byte
1991 // Default: null or empty if the device identifier is not known
1992 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1993 // Connection handle of this connection if available
1994 // Range: 0x0000 - 0x0EFF (12 bits)
1995 // Default: 0xFFFF if the handle is unknown
1996 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001997 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001998 // Default: STATUS_UNKNOWN
1999 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2000 // Range: -30 ≤ N ≤ 20
2001 // Units: dBm
2002 // Invalid when an out of range value is reported
2003 optional int32 transmit_power_level = 4;
2004}
Jack Heab86dbd22018-12-18 15:43:27 -08002005
Tej Singh5d991e12018-03-09 19:48:11 -08002006/**
Jack He1021a612019-01-20 21:22:46 -08002007 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2008 * receiving an HCI command from the host
2009 *
2010 * Logged from: system/bt
2011 */
2012message BluetoothHciTimeoutReported {
2013 // HCI command associated with this event
2014 // Default: CMD_UNKNOWN
2015 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2016}
2017
2018/**
2019 * Logs when we receive Bluetooth Link Quality Report event from the controller
2020 * See Android Bluetooth HCI specification for more details
2021 *
2022 * Note: all count and bytes field are counted since last event
2023 *
2024 * Logged from: system/bt
2025 */
2026message BluetoothQualityReportReported {
2027 // Quality report ID
2028 // Original type: uint8_t
2029 // Default: BQR_ID_UNKNOWN
2030 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2031 // Packet type of the connection
2032 // Original type: uint8_t
2033 // Default: BQR_PACKET_TYPE_UNKNOWN
2034 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2035 // Connection handle of the connection
2036 // Original type: uint16_t
2037 optional int32 connection_handle = 3;
2038 // Performing Role for the connection
2039 // Original type: uint8_t
2040 optional int32 connection_role = 4;
2041 // Current Transmit Power Level for the connection. This value is the same as the controller's
2042 // response to the HCI_Read_Transmit_Power_Level HCI command
2043 // Original type: uint8_t
2044 optional int32 tx_power_level = 5;
2045 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2046 // absolute receiver signal strength value
2047 // Original type: int8_t
2048 optional int32 rssi = 6;
2049 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2050 // channels used by the link currently
2051 // Original type: uint8_t
2052 optional int32 snr = 7;
2053 // Indicates the number of unused channels in AFH_channel_map
2054 // Original type: uint8_t
2055 optional int32 unused_afh_channel_count = 8;
2056 // Indicates the number of the channels which are interfered and quality is bad but are still
2057 // selected for AFH
2058 // Original type: uint8_t
2059 optional int32 afh_select_unideal_channel_count = 9;
2060 // Current Link Supervision Timeout Setting
2061 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2062 // Original type: uint16_t
2063 optional int32 lsto = 10;
2064 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2065 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2066 // 0x01 (Piconet Clock)
2067 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2068 // Original type: uint32_t
2069 optional int64 connection_piconet_clock = 11;
2070 // The count of retransmission
2071 // Original type: uint32_t
2072 optional int64 retransmission_count = 12;
2073 // The count of no RX
2074 // Original type: uint32_t
2075 optional int64 no_rx_count = 13;
2076 // The count of NAK (Negative Acknowledge)
2077 // Original type: uint32_t
2078 optional int64 nak_count = 14;
2079 // Controller timestamp of last TX ACK
2080 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2081 // Original type: uint32_t
2082 optional int64 last_tx_ack_timestamp = 15;
2083 // The count of Flow-off (STOP)
2084 // Original type: uint32_t
2085 optional int64 flow_off_count = 16;
2086 // Controller timestamp of last Flow-on (GO)
2087 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2088 // Original type: uint32_t
2089 optional int64 last_flow_on_timestamp = 17;
2090 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2091 // Original type: uint32_t
2092 optional int64 buffer_overflow_bytes = 18;
2093 // Buffer underflow count (in byte) since last event
2094 // Original type: uint32_t
2095 optional int64 buffer_underflow_bytes = 19;
2096}
2097
2098/**
2099 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2100 *
2101 * Notes:
2102 * - Each event can be partially filled as we might learn different pieces of device
2103 * information at different time
2104 * - Multiple device info events can be combined to give more complete picture
2105 * - When multiple device info events tries to describe the same information, the
2106 * later one wins
2107 *
2108 * Logged from:
2109 * packages/apps/Bluetooth
2110 */
Jack Heaea26982019-04-04 11:19:48 -07002111message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002112 // An identifier that can be used to match events for this device.
2113 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2114 // Salt: Randomly generated 256 bit value
2115 // Hash algorithm: HMAC-SHA256
2116 // Size: 32 byte
2117 // Default: null or empty if the device identifier is not known
2118 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2119 // Where is this device info obtained from
2120 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2121 // Name of the data source
2122 // For EXTERNAL: package name of the data source
2123 // For INTERNAL: null for general case, component name otherwise
2124 optional string source_name = 3;
2125 // Name of the manufacturer of this device
2126 optional string manufacturer = 4;
2127 // Model of this device
2128 optional string model = 5;
2129 // Hardware version of this device
2130 optional string hardware_version = 6;
2131 // Software version of this device
2132 optional string software_version = 7;
2133}
2134
2135/**
2136 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2137 * device, as documented by the Bluetooth Core HCI specification
2138 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2139 * Vol 2, Part E, Page 1118
2140 *
2141 * Logged from:
2142 * system/bt
2143 */
2144message BluetoothRemoteVersionInfoReported {
2145 // Connection handle of the connection
2146 // Original type: uint16_t
2147 optional int32 connection_handle = 1;
2148 // HCI command status code
2149 // Default: STATUS_UNKNOWN
2150 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2151 // 1 byte Version of current LMP in the remote controller
2152 optional int32 lmp_version = 3;
2153 // 2 bytes LMP manufacturer code of the remote controller
2154 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2155 optional int32 lmp_manufacturer_code = 4;
2156 // 4 bytes subversion of the LMP in the remote controller
2157 optional int32 lmp_subversion = 5;
2158}
2159
2160/**
2161 * Logs when certain Bluetooth SDP attributes are discovered
2162 * Constant definitions are from:
2163 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2164 *
2165 * Current logged attributes:
2166 * - BluetoothProfileDescriptorList
2167 * - Supported Features Bitmask
2168 *
2169 * Logged from:
2170 * system/bt
2171 */
2172message BluetoothSdpAttributeReported {
2173 // An identifier that can be used to match events for this device.
2174 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2175 // Salt: Randomly generated 256 bit value
2176 // Hash algorithm: HMAC-SHA256
2177 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2178 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2179 // Original type: uint16_t
2180 optional int32 protocol_uuid = 2;
2181 // Short form UUIDs used to identify Bluetooth SDP attribute types
2182 // Original type: uint16_t
2183 optional int32 attribute_id = 3;
2184 // Attribute value for the particular attribute
2185 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2186}
2187
2188/**
2189 * Logs when bond state of a Bluetooth device changes
2190 *
2191 * Logged from:
2192 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2193 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2194 */
2195message BluetoothBondStateChanged {
2196 // An identifier that can be used to match events for this device.
2197 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2198 // Salt: Randomly generated 256 bit value
2199 // Hash algorithm: HMAC-SHA256
2200 // Size: 32 byte
2201 // Default: null or empty if the device identifier is not known
2202 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2203 // Preferred transport type to remote dual mode device
2204 // Default: TRANSPORT_AUTO means no preference
2205 optional android.bluetooth.TransportTypeEnum transport = 2;
2206 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2207 // Default: UNKNOWN
2208 optional android.bluetooth.DeviceTypeEnum type = 3;
2209 // Current bond state (NONE, BONDING, BONDED)
2210 // Default: BOND_STATE_UNKNOWN
2211 optional android.bluetooth.BondStateEnum bond_state = 4;
2212 // Bonding sub state
2213 // Default: BOND_SUB_STATE_UNKNOWN
2214 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2215 // Unbond Reason
2216 // Default: UNBOND_REASON_UNKNOWN
2217 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2218}
2219
2220/**
2221 * Logs there is an event related Bluetooth classic pairing
2222 *
2223 * Logged from:
2224 * system/bt
2225 */
2226message BluetoothClassicPairingEventReported {
2227 // An identifier that can be used to match events for this device.
2228 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2229 // Salt: Randomly generated 256 bit value
2230 // Hash algorithm: HMAC-SHA256
2231 // Size: 32 byte
2232 // Default: null or empty if the device identifier is not known
2233 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2234 // Connection handle of this connection if available
2235 // Range: 0x0000 - 0x0EFF (12 bits)
2236 // Default: 0xFFFF if the handle is unknown
2237 optional int32 connection_handle = 2;
2238 // HCI command associated with this event
2239 // Default: CMD_UNKNOWN
2240 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2241 // HCI event associated with this event
2242 // Default: EVT_UNKNOWN
2243 optional android.bluetooth.hci.EventEnum hci_event = 4;
2244 // HCI command status code if this is triggerred by hci_cmd
2245 // Default: STATUS_UNKNOWN
2246 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2247 // HCI reason code associated with this event
2248 // Default: STATUS_UNKNOWN
2249 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002250 // A status value related to this specific event
2251 // Default: 0
2252 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002253}
2254
2255/**
2256 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2257 *
2258 * Logged from:
2259 * system/bt
2260 */
2261message BluetoothSmpPairingEventReported {
2262 // An identifier that can be used to match events for this device.
2263 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2264 // Salt: Randomly generated 256 bit value
2265 // Hash algorithm: HMAC-SHA256
2266 // Size: 32 byte
2267 // Default: null or empty if the device identifier is not known
2268 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2269 // SMP command sent or received over L2CAP
2270 // Default: CMD_UNKNOWN
2271 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2272 // Whether this command is sent or received
2273 // Default: DIRECTION_UNKNOWN
2274 optional android.bluetooth.DirectionEnum direction = 3;
2275 // SMP failure reason code
2276 // Default: PAIRING_FAIL_REASON_DEFAULT
2277 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2278}
2279
2280/**
Jack He815cdba2019-01-30 17:24:55 -08002281 * Logs when a Bluetooth socket’s connection state changed
2282 *
2283 * Logged from:
2284 * system/bt
2285 */
2286message BluetoothSocketConnectionStateChanged {
2287 // An identifier that can be used to match events for this device.
2288 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2289 // Salt: Randomly generated 256 bit value
2290 // Hash algorithm: HMAC-SHA256
2291 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002292 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002293 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002294 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002295 // Default 0 when unknown or don't care
2296 optional int32 port = 2;
2297 // Socket type as mentioned in
2298 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2299 // Default: SOCKET_TYPE_UNKNOWN
2300 optional android.bluetooth.SocketTypeEnum type = 3;
2301 // Socket connection state
2302 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2303 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2304 // Number of bytes sent to remote device during this connection
2305 optional int64 tx_bytes = 5;
2306 // Number of bytes received from remote device during this connection
2307 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002308 // Socket owner's UID
2309 optional int32 uid = 7 [(is_uid) = true];
2310 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2311 // |port| must be spawned by |server_port|
2312 // Default 0 when unknown or don't care
2313 optional int32 server_port = 8;
2314 // Whether this is a server listener socket
2315 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002316}
2317
2318/**
Jack He71426802019-04-02 13:32:52 -07002319 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2320 *
2321 * Logged from:
2322 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2323 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2324 *
2325 */
2326message BluetoothClassOfDeviceReported {
2327 // An identifier that can be used to match events for this device.
2328 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2329 // Salt: Randomly generated 256 bit value
2330 // Hash algorithm: HMAC-SHA256
2331 // Size: 32 byte
2332 // Default: null or empty if this is a server listener socket
2333 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2334 // Class of Device (CoD) value including both Major, Minor device class and service class
2335 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2336 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2337 // Default: 0
2338 optional int32 class_of_device = 2;
2339}
2340
2341/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002342 * Logs when something is plugged into or removed from the USB-C connector.
2343 *
2344 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002345 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002346 */
2347message UsbConnectorStateChanged {
2348 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002349 STATE_DISCONNECTED = 0;
2350 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002351 }
2352 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002353 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002354 // Last active session in ms.
2355 // 0 when the port is in connected state.
2356 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002357}
2358
2359/**
2360 * Logs the reported speaker impedance.
2361 *
2362 * Logged from:
2363 * Vendor audio implementation.
2364 */
2365message SpeakerImpedanceReported {
2366 optional int32 speaker_location = 1;
2367 optional int32 impedance = 2;
2368}
2369
2370/**
2371 * Logs the report of a failed hardware.
2372 *
2373 * Logged from:
2374 * Vendor HALs.
2375 *
2376 */
2377message HardwareFailed {
2378 enum HardwareType {
2379 HARDWARE_FAILED_UNKNOWN = 0;
2380 HARDWARE_FAILED_MICROPHONE = 1;
2381 HARDWARE_FAILED_CODEC = 2;
2382 HARDWARE_FAILED_SPEAKER = 3;
2383 HARDWARE_FAILED_FINGERPRINT = 4;
2384 }
2385 optional HardwareType hardware_type = 1;
2386
Maggie White6dcd8572019-01-31 14:11:50 -08002387 /**
2388 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002389 * the same hardware_type. The specific locations are vendor defined integers,
2390 * referring to board-specific numbering schemes.
2391 */
2392 optional int32 hardware_location = 2;
2393
Maggie White6dcd8572019-01-31 14:11:50 -08002394 /**
2395 * failure_code is specific to the HardwareType of the failed hardware.
2396 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002397 */
Maggie White6dcd8572019-01-31 14:11:50 -08002398 enum HardwareErrorCode {
2399 UNKNOWN = 0;
2400 COMPLETE = 1;
2401 SPEAKER_HIGH_Z = 2;
2402 SPEAKER_SHORT = 3;
2403 FINGERPRINT_SENSOR_BROKEN = 4;
2404 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002405 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002406 }
2407 optional int32 failure_code = 3;
2408}
2409
2410/**
2411 * Log an event when the device has been physically dropped.
2412 * Reported from the /vendor partition.
2413 */
2414message PhysicalDropDetected {
2415 // Confidence that the event was actually a drop, 0 -> 100
2416 optional int32 confidence_pctg = 1;
2417 // Peak acceleration of the drop, in 1/1000s of a g.
2418 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002419 // Duration of freefall in ms
2420 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002421}
2422
2423/**
2424 * Log bucketed battery charge cycles.
2425 *
2426 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002427 * a given charge point. For example, if 10 cycle buckets are
2428 * initialized, bucket 1 is the lowest 1/10th of the battery,
2429 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002430 *
2431 * Logged from:
2432 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2433 */
2434message ChargeCyclesReported {
2435 optional int32 cycle_bucket_1 = 1;
2436 optional int32 cycle_bucket_2 = 2;
2437 optional int32 cycle_bucket_3 = 3;
2438 optional int32 cycle_bucket_4 = 4;
2439 optional int32 cycle_bucket_5 = 5;
2440 optional int32 cycle_bucket_6 = 6;
2441 optional int32 cycle_bucket_7 = 7;
2442 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002443 optional int32 cycle_bucket_9 = 9;
2444 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002445}
2446
2447/**
Howard Roa46b6582018-09-18 16:45:02 -07002448 * Log battery health snapshot.
2449 *
2450 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2451 * are snapshotted periodically over 24hrs.
2452 */
2453message BatteryHealthSnapshot {
2454 enum BatterySnapshotType {
2455 UNKNOWN = 0;
2456 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2457 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2458 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2459 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2460 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2461 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2462 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2463 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2464 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2465 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2466 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2467 }
2468 optional BatterySnapshotType type = 1;
2469 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002470 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002471 // Voltage Battery Voltage, in microVolts.
2472 optional int32 voltage_micro_volt = 3;
2473 // Current Battery current, in microAmps.
2474 optional int32 current_micro_amps = 4;
2475 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2476 optional int32 open_circuit_micro_volt = 5;
2477 // Resistance Battery Resistance, in microOhms.
2478 optional int32 resistance_micro_ohm = 6;
2479 // Level Battery Level, as % of full.
2480 optional int32 level_percent = 7;
2481}
2482
2483/**
2484 * Log slow I/O operations on the primary storage.
2485 */
2486message SlowIo {
2487 // Classifications of IO Operations.
2488 enum IoOperation {
2489 UNKNOWN = 0;
2490 READ = 1;
2491 WRITE = 2;
2492 UNMAP = 3;
2493 SYNC = 4;
2494 }
2495 optional IoOperation operation = 1;
2496
2497 // The number of slow IO operations of this type over 24 hours.
2498 optional int32 count = 2;
2499}
2500
2501/**
2502 * Log battery caused shutdown with the last recorded voltage.
2503 */
2504message BatteryCausedShutdown {
2505 // The last recorded battery voltage prior to shutdown.
2506 optional int32 last_recorded_micro_volt = 1;
2507}
2508
2509/**
Tej Singha72344992019-04-17 18:55:08 -07002510 * Logs when ThermalService receives throttling events.
2511 *
2512 * Logged from:
2513 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2514 */
2515message ThermalThrottlingSeverityStateChanged {
2516 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2517 optional android.os.TemperatureTypeEnum sensor_type = 1;
2518
2519 // The name of the temperature source. Eg. CPU0
2520 optional string sensor_name = 2;
2521
2522 // Temperature in tenths of a degree C.
2523 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2524 optional int32 temperature_deci_celsius = 3;
2525
2526 // Relative severity of the throttling, see enum definition.
2527 optional android.os.ThrottlingSeverityEnum severity = 4;
2528}
2529
2530/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002531 * Logs the duration of a davey (jank of >=700ms) when it occurs
2532 *
2533 * Logged from:
2534 * frameworks/base/libs/hwui/JankTracker.cpp
2535 */
2536message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002537 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002538 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002539
Tej Singhbb8554a2018-01-26 11:59:14 -08002540 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002541 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002542}
2543
2544/**
Bookatze5885242017-10-24 20:10:31 -07002545 * Logs phone signal strength changes.
2546 *
2547 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002548 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002549 */
2550message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002551 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2552 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002553}
2554
Yangster4ccebea2018-10-09 17:09:02 -07002555
2556/**
2557 * Logs when the phone state, sim state or signal strength changes
2558 *
2559 * Logged from:
2560 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2561 */
2562message PhoneServiceStateChanged {
2563 optional android.telephony.ServiceStateEnum state = 1;
2564 optional android.telephony.SimStateEnum sim_state = 2;
2565 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2566}
2567
2568/**
2569 * Logs when the phone becomes on or off.
2570 *
2571 * Logged from:
2572 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2573 */
2574message PhoneStateChanged {
2575 enum State {
2576 OFF = 0;
2577 ON = 1;
2578 }
2579 optional State state = 1;
2580}
2581
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002582message BackGesture {
2583 enum BackType {
2584 DEFAULT_BACK_TYPE = 0;
2585 COMPLETED = 1;
2586 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2587 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2588 INCOMPLETE = 4;
2589 }
2590 optional BackType type = 1;
2591
2592 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2593 enum WindowHorizontalLocation {
2594 DEFAULT_LOCATION = 0;
2595 LEFT = 1;
2596 RIGHT = 2;
2597 }
2598 optional WindowHorizontalLocation x_location = 3;
2599}
2600
2601message ExclusionRectStateChanged {
2602 optional string component_name = 1; // if not available, simply packageName
2603 optional int32 requested_height = 2; // px
2604 optional int32 rejected_height = 3; // px
2605
2606 enum WindowHorizontalLocation {
2607 DEFAULT_LOCATION = 0;
2608 LEFT = 1;
2609 RIGHT = 2;
2610 }
2611 optional WindowHorizontalLocation x_location = 4;
2612 optional bool landscape = 5;
2613 optional bool splitscreen = 6;
2614 optional int32 duration_millis = 7;
2615}
2616
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002617message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002618 optional android.stats.launcher.LauncherAction action = 1;
2619 optional android.stats.launcher.LauncherState src_state = 2;
2620 optional android.stats.launcher.LauncherState dst_state = 3;
2621 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002622 optional bool is_swipe_up_enabled = 5;
2623}
2624
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002625message StyleUIChanged {
2626 optional android.stats.style.Action action = 1;
2627 optional int32 color_package_hash = 2;
2628 optional int32 font_package_hash = 3;
2629 optional int32 shape_package_hash = 4;
2630 optional int32 clock_package_hash = 5;
2631 optional int32 launcher_grid = 6;
2632 optional int32 wallpaper_category_hash = 7;
2633 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002634 optional int32 color_preference = 9;
2635 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002636}
2637
David Chenc28b2bb2017-10-24 12:52:52 -07002638/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002639 * Logs when Settings UI has changed.
2640 *
2641 * Logged from:
2642 * packages/apps/Settings
2643 */
2644message SettingsUIChanged {
2645 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002646 * Where this SettingsUIChange event comes from. For example, if
2647 * it's a PAGE_VISIBLE event, where the page is opened from.
2648 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002649 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002650
2651 /**
2652 * What the UI action is.
2653 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002654 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002655
2656 /**
2657 * Where the action is happening
2658 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002659 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002660
2661 /**
2662 * What preference changed in this event.
2663 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002664 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002665
2666 /**
2667 * The new value of the changed preference.
2668 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002669 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002670}
2671
2672/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002673 * Logs basic timing information about touch events.
2674 * Reported at most every 5 minutes while device is being interacted with.
2675 *
2676 * Logged from:
2677 * frameworks/native/services/inputflinger
2678 */
2679message TouchEventReported {
2680 /**
2681 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002682 * and the standard deviation of the time spent processing touchscreen events
2683 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002684 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002685 * On supported devices, the starting point is taken during the hard interrupt inside the
2686 * kernel touch driver. On all other devices, the starting point is taken inside
2687 * the kernel's input event subsystem upon receipt of the input event.
2688 * The ending point is taken inside InputDispatcher, just after the input event
2689 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002690 */
2691 // Minimum value
2692 optional float latency_min_micros = 1;
2693 // Maximum value
2694 optional float latency_max_micros = 2;
2695 // Average value
2696 optional float latency_mean_micros = 3;
2697 // Standard deviation
2698 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002699 // Number of touch events (input_event) in this report
2700 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002701}
2702
2703/**
Philip Quinn0eded622019-01-29 12:46:28 -08002704 * Logs gesture classification and timing information for touch events.
2705 *
2706 * Logged from:
2707 * frameworks/base/core/java/android/view/GestureDetector.java
2708 * frameworks/base/core/java/android/view/View.java
2709 */
2710message TouchGestureClassified {
2711 // The source of the classification (e.g. Java class name).
2712 optional string source = 1;
2713
2714 enum Classification {
2715 UNKNOWN_CLASSIFICATION = 0;
2716 SINGLE_TAP = 1;
2717 DOUBLE_TAP = 2;
2718 LONG_PRESS = 3;
2719 DEEP_PRESS = 4;
2720 SCROLL = 5;
2721 }
2722 // The classification of the gesture.
2723 optional Classification classification = 2;
2724
2725 // The interval from the start of a touch event stream until the
2726 // classification was made.
2727 optional int32 latency_millis = 3;
2728
2729 // The distance from the location of the first touch event to the
2730 // location of the touch event when the classification was made.
2731 optional float displacement_px = 4;
2732}
2733
2734/**
David Chenc28b2bb2017-10-24 12:52:52 -07002735 * Logs that a setting was updated.
2736 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002737 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002738 * The tag and is_default allow resetting of settings to default values based on the specified
2739 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2740 */
2741message SettingChanged {
2742 // The name of the setting.
2743 optional string setting = 1;
2744
2745 // The change being imposed on this setting. May represent a number, eg "3".
2746 optional string value = 2;
2747
2748 // The new value of this setting. For most settings, this is same as value. For some settings,
2749 // value is +X or -X where X represents an element in a set. For example, if the previous value
2750 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2751 // The +/- feature is currently only used for location_providers_allowed.
2752 optional string new_value = 3;
2753
2754 // The previous value of this setting.
2755 optional string prev_value = 4;
2756
2757 // The tag used with the is_default for resetting sets of settings. This is generally null.
2758 optional string tag = 5;
2759
Bookatz90867622018-01-31 15:05:57 -08002760 // True if this setting with tag should be resettable.
2761 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002762
David Chenbd789912018-03-16 17:19:55 -07002763 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002764 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002765
2766 enum ChangeReason {
2767 UPDATED = 1; // Updated can be an insertion or an update.
2768 DELETED = 2;
2769 }
2770 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002771}
Chenjie Yub3dda412017-10-24 13:41:59 -07002772
Chenjie Yu05013b32017-11-21 10:21:41 -08002773/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002774 * Logs activity going to foreground or background
2775 *
2776 * Logged from:
2777 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2778 */
2779message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002780 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002781 optional string pkg_name = 2;
2782 optional string class_name = 3;
2783
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002784 enum State {
2785 BACKGROUND = 0;
2786 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002787 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002788 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002789}
David Chenc8a43242017-10-17 16:23:28 -07002790
2791/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002792 * Logs when a volume entered low Storage state.
2793 * Logged from:
2794 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2795 */
2796message LowStorageStateChanged {
2797 // Volume that ran out of storage.
2798 optional string volume_description = 1;
2799
2800 enum State {
2801 UNKNOWN = 0;
2802 OFF = 1;
2803 ON = 2;
2804 }
2805 optional State state = 2;
2806}
2807
2808/**
2809 * Logs when an app is downgraded.
2810 * Logged from:
2811 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2812 */
2813message AppDowngraded {
2814 optional string package_name = 1;
2815 // Size of the package (all data) before being downgraded.
2816 optional int64 size_in_bytes_before = 2;
2817 // Size of the package (all data) after being downgraded.
2818 optional int64 size_in_bytes_after = 3;
2819
2820 optional bool aggressive = 4;
2821}
2822
2823/**
2824 * Logs when an app is optimized after being downgraded.
2825 * Logged from:
2826 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2827 */
2828message AppOptimizedAfterDowngraded {
2829 optional string package_name = 1;
2830}
2831
2832/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002833 * Logs whenever an app is installed on external storage.
2834 * Logged from:
2835 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2836 */
2837message AppInstallOnExternalStorageReported {
2838 // The type of external storage.
2839 optional android.stats.storage.ExternalStorageType storage_type = 1;
2840 // The name of the package that is installed on the sd card.
2841 optional string package_name = 2;
2842}
2843
2844/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002845 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002846 * Logged from:
2847 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2848 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002849message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002850 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002851
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002852 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002853
2854 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002855 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002856 optional string process_name = 3;
2857
2858 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002859 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002860
2861 optional string package_name = 5;
2862
2863 enum InstantApp {
2864 UNAVAILABLE = 0;
2865 FALSE = 1;
2866 TRUE = 2;
2867 }
2868 optional InstantApp is_instant_app = 6;
2869
2870 enum ForegroundState {
2871 UNKNOWN = 0;
2872 BACKGROUND = 1;
2873 FOREGROUND = 2;
2874 }
2875 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002876
2877 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002878}
David Chen9e3808c2017-11-20 17:25:34 -08002879
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002880/**
2881 * Logs when a WTF (What a Terrible Failure) happened.
2882 * Logged from:
2883 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2884 */
2885message WTFOccurred {
2886 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002887
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002888 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002889
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002890 // The name of the process.
2891 // system_server if it is not by an app
2892 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002893
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002894 // The pid if available. -1 means not available.
2895 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002896
2897 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002898}
2899
2900/**
2901 * Logs when system server reports low memory.
2902 * Logged from:
2903 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2904 */
2905message LowMemReported {
2906}
2907
2908/**
2909 * Logs when an app ANR (App Not Responding) occurs.
2910 * Logged from:
2911 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2912 */
2913message ANROccurred {
2914 optional int32 uid = 1 [(is_uid) = true];
2915
2916 optional string process_name = 2;
2917
2918 optional string short_component_name = 3;
2919
2920 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002921
2922 enum InstantApp {
2923 UNAVAILABLE = 0;
2924 FALSE = 1;
2925 TRUE = 2;
2926 }
2927 optional InstantApp is_instant_app = 5;
2928
2929 enum ForegroundState {
2930 UNKNOWN = 0;
2931 BACKGROUND = 1;
2932 FOREGROUND = 2;
2933 }
2934 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002935
2936 optional android.server.ErrorSource error_source = 7;
2937
2938 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002939}
2940
Bookatza7020bd2018-08-28 16:29:35 -07002941/**
2942 * Logs when the vibrator state changes.
2943 * Logged from:
2944 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2945 */
2946message VibratorStateChanged {
2947 repeated AttributionNode attribution_node = 1;
2948
2949 enum State {
2950 OFF = 0;
2951 ON = 1;
2952 }
2953 optional State state = 2;
2954
2955 // Duration (in milliseconds) requested to keep the vibrator on.
2956 // Only applicable for State == ON.
2957 optional int64 duration_millis = 3;
2958}
2959
David Chen0a368b22017-12-06 16:28:16 -08002960/*
2961 * Allows other apps to push events into statsd.
2962 * Logged from:
2963 * frameworks/base/core/java/android/util/StatsLog.java
2964 */
David Chen0b5c90c2018-01-25 16:51:49 -08002965message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002966 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002967 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002968
2969 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2970 optional int32 label = 2;
2971
2972 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2973 // predicates for the metrics).
2974 enum State {
2975 UNKNOWN = 0;
2976 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2977 STOP = 2;
2978 START = 3;
2979 }
2980 optional State state = 3;
2981}
2982
David Chen9e3808c2017-11-20 17:25:34 -08002983/**
Bookatz7948c872018-09-04 12:58:33 -07002984 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2985 * For example, this could be due to the user manually changing the time.
2986 *
2987 * Logged from:
2988 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2989 */
2990message WallClockTimeShifted {
2991 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2992 optional int64 wall_clock_timestamp_millis = 1;
2993}
2994
2995/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002996 * Logs when statsd detects an anomaly.
2997 *
2998 * Logged from:
2999 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3000 */
3001message AnomalyDetected {
3002 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003003 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003004
Yangster-mac94e197c2018-01-02 16:03:03 -08003005 // Id of the config whose anomaly detection alert fired.
3006 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003007
Yangster-mac94e197c2018-01-02 16:03:03 -08003008 // Id of the alert (i.e. name of the anomaly that was detected).
3009 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003010}
3011
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003012message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003013 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003014 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003015
3016 // The app package name.
3017 optional string pkg_name = 2;
3018
3019 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003020 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003021 WARM = 1;
3022 HOT = 2;
3023 COLD = 3;
3024 }
3025 // The transition type.
3026 optional TransitionType type = 3;
3027
3028 // The activity name.
3029 optional string activity_name = 4;
3030
3031 // The name of the calling app. Empty if not set.
3032 optional string calling_pkg_name = 5;
3033
3034 // Whether the app is an instant app.
3035 optional bool is_instant_app = 6;
3036
3037 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003038 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003039
Bookatz80d11a02018-01-16 10:46:35 -08003040 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003041
David Chen0b5c90c2018-01-25 16:51:49 -08003042 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003043 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003044 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003045 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003046 optional int32 bind_application_delay_millis = 11;
3047 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003048
3049 // Empty if not set.
3050 optional string launch_token = 13;
3051
Calin Juravle759fbda2018-02-20 19:52:30 +00003052 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003053 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003054
3055 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003056 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003057}
3058
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003059message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003060 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003061 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003062
3063 // The app package name.
3064 optional string pkg_name = 2;
3065
3066 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003067 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003068 WARM = 1;
3069 HOT = 2;
3070 COLD = 3;
3071 }
3072 // The transition type.
3073 optional TransitionType type = 3;
3074
3075 // The activity name.
3076 optional string activity_name = 4;
3077}
3078
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003079message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003080 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003081 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003082
3083 // The app package name.
3084 optional string pkg_name = 2;
3085
3086 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003087 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003088 WITH_BUNDLE = 1;
3089 WITHOUT_BUNDLE = 2;
3090 }
3091 // The transition type.
3092 optional TransitionType type = 3;
3093
3094 // The activity name.
3095 optional string activity_name = 4;
3096
3097 optional bool transition_process_running = 5;
3098
3099 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003100 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003101}
3102
Bookatz8fcd09a2017-12-18 13:01:10 -08003103/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003104 * Logs a picture-in-picture action
3105 * Logged from:
3106 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3107 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3108 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3109 */
3110message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003111 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003112 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003113
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003114 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003115
Chenjie Yu52cacc62017-12-08 18:11:45 -08003116 enum State {
3117 ENTERED = 1;
3118 EXPANDED_TO_FULL_SCREEN = 2;
3119 MINIMIZED = 3;
3120 DISMISSED = 4;
3121 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003122 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003123}
3124
3125/**
Chenjie Yue8904192017-12-08 19:12:57 -08003126 * Logs overlay action
3127 * Logged from:
3128 * services/core/java/com/android/server/wm/Session.java
3129 */
3130message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003131 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003132
tsaichristine10978642019-09-10 14:12:49 -07003133 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003134
3135 optional bool using_alert_window = 3;
3136
3137 enum State {
3138 ENTERED = 1;
3139 EXITED = 2;
3140 }
tsaichristine10978642019-09-10 14:12:49 -07003141 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003142}
3143
Chenjie Yuccfe6452018-01-30 11:33:21 -08003144/*
3145 * Logs foreground service starts and stops.
3146 * Note that this is not when a service starts or stops, but when it is
3147 * considered foreground.
3148 * Logged from
3149 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3150 */
3151message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003152 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003153 // package_name + "/" + class_name
3154 optional string short_name = 2;
3155
3156 enum State {
3157 ENTER = 1;
3158 EXIT = 2;
3159 }
3160 optional State state = 3;
3161}
3162
Chenjie Yue8904192017-12-08 19:12:57 -08003163/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003164 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3165 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3166 * attributed back to the parent (host) uid. One example is Chrome.
3167 *
3168 * Logged from:
3169 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3170 */
3171message IsolatedUidChanged {
3172 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003173 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003174 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003175 optional int32 parent_uid = 1;
3176
3177 optional int32 isolated_uid = 2;
3178
3179 // We expect an isolated uid to be removed before if it's used for another parent uid.
3180 enum Event {
3181 REMOVED = 0;
3182 CREATED = 1;
3183 }
3184 optional Event event = 3;
3185}
3186
3187/*
3188 * Logs the reception of an incoming network packet causing the main system to wake up for
3189 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3190 * and processed by WakeupController.cpp.
3191 */
3192message PacketWakeupOccurred {
3193 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3194 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003195 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003196 // The interface name on which the packet was received.
3197 optional string iface = 2;
3198 // The ethertype value of the packet.
3199 optional int32 ethertype = 3;
3200 // String representation of the destination MAC address of the packet.
3201 optional string destination_hardware_address = 4;
3202 // String representation of the source address of the packet if this was an IP packet.
3203 optional string source_ip = 5;
3204 // String representation of the destination address of the packet if this was an IP packet.
3205 optional string destination_ip = 6;
3206 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3207 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3208 // families.
3209 optional int32 ip_next_header = 7;
3210 // The source port if this was a TCP or UDP packet.
3211 optional int32 source_port = 8;
3212 // The destination port if this was a TCP or UDP packet.
3213 optional int32 destination_port = 9;
3214}
3215
3216/*
3217 * Logs the memory stats for an app on startup.
3218 * Logged from:
3219 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3220 */
3221message AppStartMemoryStateCaptured {
3222 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003223 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003224
3225 // The process name.
3226 optional string process_name = 2;
3227
3228 // The activity name.
3229 optional string activity_name = 3;
3230
3231 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003232 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003233
3234 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003235 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003236
3237 // RSS
3238 optional int64 rss_in_bytes = 6;
3239
3240 // CACHE
3241 optional int64 cache_in_bytes = 7;
3242
3243 // SWAP
3244 optional int64 swap_in_bytes = 8;
3245}
3246
3247/*
3248 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3249 * for LMK event.
3250 * Logged from:
3251 * system/core/lmkd/lmkd.c
3252 */
3253message LmkStateChanged {
3254 enum State {
3255 UNKNOWN = 0;
3256 START = 1;
3257 STOP = 2;
3258 }
3259 optional State state = 1;
3260}
3261
3262/*
3263 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3264 * Logged from:
3265 * system/core/lmkd/lmkd.c
3266 */
3267message LmkKillOccurred {
3268 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003269 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003270
3271 // The process name.
3272 optional string process_name = 2;
3273
3274 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003275 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003276
3277 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003278 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003279
3280 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003281 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003282
3283 // RSS
3284 optional int64 rss_in_bytes = 6;
3285
3286 // CACHE
3287 optional int64 cache_in_bytes = 7;
3288
3289 // SWAP
3290 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003291
3292 // The elapsed real time of start of the process.
3293 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003294
3295 // Min oom adj score considered by lmkd.
3296 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003297}
3298
Rajeev Kumar51b54602018-03-01 12:18:26 -08003299/*
3300 * Logs when the ActivityManagerService detects that an app died.
3301 *
3302 * Logged from:
3303 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3304 */
3305message AppDied {
3306 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003307 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003308}
3309
Howard Ro21a039c2018-08-06 14:55:47 -07003310/**
3311 * An atom for generic metrics logging. Available from Android Q.
3312 */
3313message GenericAtom {
3314 // The uid of the application that sent this custom atom.
3315 optional int32 uid = 1 [(is_uid) = true];
3316
3317 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003318 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003319}
3320
Tej Singhd6d6d772018-09-05 17:41:25 -07003321/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003322 * Atom for simple logging of user interaction and impression events, such as "the user touched
3323 * this button" or "this dialog was displayed".
3324 * Keep the UI event stream clean: don't use for system or background events.
3325 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003326 *
3327 * Logged from:
3328 * frameworks/base/services/core/java/com/android/server/
3329 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003330 */
3331message UiEventReported {
3332 // The event_id.
3333 optional int32 event_id = 1;
3334 // The event's source or target uid and package, if applicable.
3335 // For example, the package posting a notification, or the destination package of a share.
3336 optional int32 uid = 2 [(is_uid) = true];
3337 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003338 // An identifier used to disambiguate which logs refer to a particular instance of some
3339 // UI element. Useful when there might be multiple instances simultaneously active.
3340 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003341}
3342
3343/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003344 * Reports a notification was created or updated.
3345 *
3346 * Logged from:
3347 * frameworks/base/services/core/java/com/android/server/notification/
3348 */
3349message NotificationReported {
3350 // The event_id (as for UiEventReported).
3351 optional int32 event_id = 1;
3352 // The notifying app's uid and package.
3353 optional int32 uid = 2 [(is_uid) = true];
3354 optional string package_name = 3;
3355 // A small system-assigned identifier for the notification.
3356 // Locally probably-unique, but expect collisions across users and/or days.
3357 optional int32 instance_id = 4;
3358 // The app-assigned notification ID and tag
3359 optional int32 notification_id = 5;
3360 optional string notification_tag = 6;
3361 optional string channel_id = 7; // App-assigned channel ID
3362
3363 // Grouping information
3364 optional string group_id = 8; // Group the notification currently belongs to
3365 optional int32 group_instance_id = 9; // Instance_id of the group-summary notification
3366 optional bool is_group_summary = 10; // Tags the group-summary notification
3367
3368 // Attributes
3369 optional string category = 11; // App-assigned notification category (API-defined strings)
3370 optional int32 style = 12; // App-assigned notification style
3371 optional int32 num_people = 13; // Number of Person records attached to the notification
3372
3373 // Ordering, importance and interruptiveness
3374
3375 optional int32 position = 14; // Position in NotificationManager's list
3376
3377 optional android.stats.sysui.NotificationImportance importance = 15;
3378 optional int32 alerting = 16; // Bitfield, 1=buzz 2=beep 4=blink
3379
3380 enum NotificationImportanceExplanation {
3381 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3382 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3383 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3384 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3385 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3386 // Like _APP, but based on pre-channels priority signal.
3387 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3388 }
3389
3390 optional NotificationImportanceExplanation importance_source = 17;
3391 optional android.stats.sysui.NotificationImportance importance_initial = 18;
3392 optional NotificationImportanceExplanation importance_initial_source = 19;
3393 optional android.stats.sysui.NotificationImportance importance_asst = 20;
3394 optional int32 assistant_hash = 21;
3395 optional float assistant_ranking_score = 22;
3396}
3397
3398message Notification {
3399 // The notifying app's uid and package.
3400 optional int32 uid = 1 [(is_uid) = true];
3401 optional string package_name = 2;
3402 // A small system-assigned identifier for the notification.
3403 optional int32 instance_id = 3;
3404
3405 // Grouping information.
3406 optional int32 group_instance_id = 4;
3407 optional bool is_group_summary = 5;
3408
3409 // The section of the shade that the notification is in.
3410 // See NotificationSectionsManager.PriorityBucket.
3411 enum NotificationSection {
3412 SECTION_UNKNOWN = 0;
3413 SECTION_PEOPLE = 1;
3414 SECTION_ALERTING = 2;
3415 SECTION_SILENT = 3;
3416 }
3417 optional NotificationSection section = 6;
3418}
3419
3420message NotificationList {
3421 repeated Notification notifications = 1; // An ordered sequence of notifications.
3422}
3423
3424/**
3425 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3426 *
3427 * Logged from:
3428 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3429 */
3430message NotificationPanelReported {
3431 // The event_id (as for UiEventReported).
3432 optional int32 event_id = 1;
3433 optional int32 num_notifications = 2;
3434 // The notifications in the panel, in the order that they appear there.
3435 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3436}
3437
3438/**
3439 * Reports a notification channel, or channel group, was created, updated, or deleted.
3440 *
3441 * Logged from:
3442 * frameworks/base/services/core/java/com/android/server/notification/
3443 */
3444message NotificationChannelModified {
3445 // The event_id (as for UiEventReported).
3446 optional int32 event_id = 1;
3447 // The notifying app's uid and package.
3448 optional int32 uid = 2 [(is_uid) = true];
3449 optional string package_name = 3;
3450 // App-assigned notification channel ID or channel-group ID
3451 optional string channel_id = 4;
3452 // Previous importance setting, if applicable
3453 optional android.stats.sysui.NotificationImportance old_importance = 5;
3454 // New importance setting
3455 optional android.stats.sysui.NotificationImportance importance = 6;
3456}
3457
3458
3459/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003460 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003461 *
3462 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003463 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003464 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003465message BiometricAcquired {
3466 // Biometric modality that was acquired.
3467 optional android.hardware.biometrics.ModalityEnum modality = 1;
3468 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3469 optional int32 user = 2;
3470 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3471 optional bool is_crypto = 3;
3472 // Action that the device is performing. Acquired messages are only expected for enroll and
3473 // authenticate. Other actions may indicate an error.
3474 optional android.hardware.biometrics.ActionEnum action = 4;
3475 // The client that this acquisition was received for.
3476 optional android.hardware.biometrics.ClientEnum client = 5;
3477 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3478 optional int32 acquire_info = 6;
3479 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3480 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003481 // Dictates if this message should trigger additional debugging.
3482 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003483}
3484
3485/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003486 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003487 *
3488 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003489 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003490 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003491message BiometricAuthenticated {
3492 // Biometric modality that was used.
3493 optional android.hardware.biometrics.ModalityEnum modality = 1;
3494 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3495 optional int32 user = 2;
3496 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3497 // storage.
3498 optional bool is_crypto = 3;
3499 // The client that this acquisition was received for.
3500 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003501 // If authentication requires user confirmation. See BiometricPrompt's
3502 // setRequireConfirmation(bool) method.
3503 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003504
Kevin Chyn1741a072019-01-17 11:54:40 -08003505 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003506 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003507 REJECTED = 1;
3508 PENDING_CONFIRMATION = 2;
3509 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003510 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003511
3512 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003513 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003514 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3515 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3516 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3517 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003518 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003519 // Dictates if this message should trigger additional debugging.
3520 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003521}
3522
3523/**
3524 * Logs when a biometric error occurs.
3525 *
3526 * Logged from:
3527 * frameworks/base/services/core/java/com/android/server/biometrics
3528 */
3529message BiometricErrorOccurred {
3530 // Biometric modality that was used.
3531 optional android.hardware.biometrics.ModalityEnum modality = 1;
3532 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3533 optional int32 user = 2;
3534 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3535 optional bool is_crypto = 3;
3536 // Action that the device is performing.
3537 optional android.hardware.biometrics.ActionEnum action = 4;
3538 // The client that this acquisition was received for.
3539 optional android.hardware.biometrics.ClientEnum client = 5;
3540 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3541 // are unique to modality.
3542 optional int32 error_info = 6;
3543 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3544 // by the vendor and not specified by the HIDL interface.
3545 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003546 // Dictates if this message should trigger additional debugging.
3547 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003548 // Time spent during the authentication attempt.
3549 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003550}
3551
3552/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003553 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003554 * Logged from:
3555 * frameworks/base/services/core/java/com/android/server/biometrics
3556 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003557message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003558 // Biometric modality.
3559 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003560 // Type of issue detected.
3561 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003562 // Dictates if this message should trigger additional debugging.
3563 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003564}
Howard Ro688ae182018-09-25 00:09:36 -07003565
joshmccloskey6f952b22019-03-25 20:59:35 -07003566/**
3567 * Logs when a biometric enrollment occurs.
3568 *
3569 * Logged from:
3570 * frameworks/base/services/core/java/com/android/server/biometrics
3571 */
3572message BiometricEnrolled {
3573 // Biometric modality that was used.
3574 optional android.hardware.biometrics.ModalityEnum modality = 1;
3575 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3576 optional int32 user = 2;
3577 // The amount of time the enrollment took in milliseconds.
3578 optional int64 latency_millis = 3;
3579 // Whether or not the enrollment was successful.
3580 optional bool success = 4;
3581}
3582
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003583/*
Tej Singh0d176952019-01-16 19:10:54 -08003584 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003585 */
Tej Singh0d176952019-01-16 19:10:54 -08003586message FlagFlipUpdateOccurred {
3587 // If the event is from a flag config package, specify the package name.
3588 optional string flag_flip_package_name = 1;
3589
3590 // The order id of the package
3591 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003592}
3593
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003594/**
3595 * Potential experiment ids that goes with a train install.
3596 */
3597message TrainExperimentIds {
3598 repeated int64 experiment_id = 1;
3599}
3600
Yangster-macb89807e2018-11-15 21:10:57 -08003601/*
3602 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003603 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003604 */
3605message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003606 // Name of the train.
3607 optional string train_name = 1;
3608 // Version code for a "train" of packages that need to be installed atomically
3609 optional int64 train_version_code = 2;
3610 // After installation of this package, device requires a restart.
3611 optional bool requires_staging = 3;
3612 // Rollback should be enabled for this install.
3613 optional bool rollback_enabled = 4;
3614 // Requires low latency monitoring if possible.
3615 optional bool requires_low_latency_monitor = 5;
3616
Yangster-macb89807e2018-11-15 21:10:57 -08003617 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003618 UNKNOWN = 0;
3619 INSTALL_REQUESTED = 1;
3620 INSTALL_STARTED = 2;
3621 INSTALL_STAGED_NOT_READY = 3;
3622 INSTALL_STAGED_READY = 4;
3623 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003624 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3625 // and INSTALL_FAILURE_COMMIT.
3626 INSTALL_FAILURE = 6 [deprecated = true];
3627 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003628 INSTALL_CANCELLED = 7;
3629 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003630 INSTALLER_ROLLBACK_INITIATED = 9;
3631 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3632 INSTALLER_ROLLBACK_STAGED = 11;
3633 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3634 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3635 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3636 INSTALLER_ROLLBACK_SUCCESS = 15;
3637 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003638 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3639 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3640 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3641 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3642 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3643 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003644 INSTALL_FAILURE_DOWNLOAD = 23;
3645 INSTALL_FAILURE_STATE_MISMATCH = 24;
3646 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003647 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003648 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003649 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003650 // Possible experiment ids for monitoring this push.
3651 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3652 // user id
3653 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003654 optional int32 reason = 9;
Yangster-macb89807e2018-11-15 21:10:57 -08003655}
3656
Tej Singhc9203082019-05-03 13:42:23 -07003657/* Test atom, is not logged anywhere */
3658message TestAtomReported {
3659 repeated AttributionNode attribution_node = 1;
3660 optional int32 int_field = 2;
3661 optional int64 long_field = 3;
3662 optional float float_field = 4;
3663 optional string string_field = 5;
3664 optional bool boolean_field = 6;
3665 enum State {
3666 UNKNOWN = 0;
3667 OFF = 1;
3668 ON = 2;
3669 }
3670 optional State state = 7;
3671 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3672}
3673
Maggie Whitefc1aa592018-11-28 21:55:23 -08003674/** Represents USB port overheat event. */
3675message UsbPortOverheatEvent {
3676 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3677 optional int32 plug_temperature_deci_c = 1;
3678
3679 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3680 optional int32 max_temperature_deci_c = 2;
3681
3682 /* Time between USB plug event and overheat threshold trip, in seconds. */
3683 optional int32 time_to_overheat_secs = 3;
3684
3685 /* Time between overheat threshold trip and hysteresis, in seconds. */
3686 optional int32 time_to_hysteresis_secs = 4;
3687
3688 /* Time between hysteresis and active mitigation ending, in seconds. */
3689 optional int32 time_to_inactive_secs = 5;
3690};
3691
Maggie White8735b852019-01-18 11:40:49 -08003692/**
3693 * Logs total effective full charge and discharge cycles on a battery.
3694 * Here are some examples of one effective cycle:
3695 * 1) the battery charges from 0% to 100% and drains back to 0%,
3696 * 2) charging from 50% to 100% and draining back to 50% twice.
3697 * Pulled from:
3698 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3699 */
3700message BatteryCycleCount {
3701 /* Number of total charge and discharge cycles on the system battery. */
3702 optional int32 cycle_count = 1;
3703}
3704
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003705/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003706 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3707 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003708 * Pulled from:
3709 * StatsCompanionService
3710 */
3711
Carmen Agimof12dec122019-03-06 16:14:38 +00003712message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003713
Carmen Agimof12dec122019-03-06 16:14:38 +00003714 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003715 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003716 PUBLIC = 1;
3717 PRIVATE = 2;
3718 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003719 }
3720
Carmen Agimof12dec122019-03-06 16:14:38 +00003721 // The type of external storage.
3722 optional android.stats.storage.ExternalStorageType storage_type = 1;
3723 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3724 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003725 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003726 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003727}
3728
Yangster-macb89807e2018-11-15 21:10:57 -08003729/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003730 * Logs when a connection becomes available and lost.
3731 * Logged in StatsCompanionService.java
3732 */
3733message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003734 // Id of the network.
3735 optional int32 net_id = 1;
3736
3737 enum State {
3738 UNKNOWN = 0;
3739 CONNECTED = 1;
3740 DISCONNECTED = 2;
3741 }
3742 // Connected state of a network.
3743 optional State state = 2;
3744}
3745
3746/**
3747 * Logs when a service starts and stops.
3748 * Logged from:
3749 * services/core/java/com/android/server/am/ActiveServices.java
3750 */
3751message ServiceStateChanged {
3752
3753 optional int32 uid = 1 [(is_uid) = true];
3754
3755 optional string package_name = 2;
3756
3757 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003758
3759 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003760 START = 1;
3761 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003762 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003763
3764 optional State state = 4;
3765}
3766
3767/**
3768 * Logs when a service is launched.
3769 * Logged from:
3770 * services/core/java/com/android/server/am/ActiveServices.java
3771 */
3772message ServiceLaunchReported {
3773
3774 optional int32 uid = 1 [(is_uid) = true];
3775
3776 optional string package_name = 2;
3777
3778 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003779}
Howard Ro688ae182018-09-25 00:09:36 -07003780
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003781/**
3782 * Logs when a hidden API is used.
3783 *
3784 * Logged from:
3785 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3786 */
3787message HiddenApiUsed {
3788 // The uid of the app making the hidden access.
3789 optional int32 uid = 1 [(is_uid) = true];
3790
3791 // Signature of the method or field accessed.
3792 optional string signature = 2;
3793
3794 enum AccessMethod {
3795 NONE = 0;
3796 REFLECTION = 1;
3797 JNI = 2;
3798 LINKING = 3;
3799 }
3800
3801 // Type of access.
3802 optional AccessMethod access_method = 3;
3803
3804 // Whether the access was prevented or not.
3805 optional bool access_denied = 4;
3806}
3807
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003808/**
3809 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3810 * - When user sees privacy chip
3811 * - When user clicks privacy chip
3812 * - How does the user exit the Privacy Dialog
3813 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003814 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3815 */
3816message PrivacyIndicatorsInteracted {
3817
3818 enum Type {
3819 UNKNOWN = 0;
3820 CHIP_VIEWED = 1;
3821 CHIP_CLICKED = 2;
3822 DIALOG_PRIVACY_SETTINGS = 3;
3823 DIALOG_DISMISS = 4;
3824 DIALOG_LINE_ITEM = 5;
3825 }
3826
3827 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3828
3829 // Used if the type is LINE_ITEM
3830 optional string package_name = 2;
3831}
3832
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003833/**
3834 * Logs information about a package that is moved from the internal to external storage and vice
3835 * versa.
3836 * It logs the package name, the type of the external storage where the package is installed
3837 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3838 * and the move type: if it's from internal to external or the other way around.
3839 *
3840 * Logged from:
3841 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3842 */
3843message AppMovedStorageReported {
3844 enum MoveType {
3845 UNKNOWN = 0;
3846 TO_EXTERNAL = 1;
3847 TO_INTERNAL = 2;
3848 }
3849 // The type of the external storage.
3850 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3851 // The type of move.
3852 optional MoveType move_type = 2;
3853 // The name of the package that was moved.
3854 optional string package_name = 3;
3855}
3856
jianjin8f2dee02019-03-29 14:03:08 -07003857/**
3858 * Logs when system server watchdog occurs.
3859 * Logged from:
3860 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3861 */
3862message SystemServerWatchdogOccurred {
3863 optional string subject = 1;
3864}
3865
3866/**
3867 * Logs when new file added to tombstones.
3868 * Logged from:
3869 * frameworks/base/core/java/com/android/server/BootReceiver.java
3870 */
3871message TombStoneOccurred {
3872}
3873
Hai Zhang5d3328d2019-04-13 21:25:06 +08003874/*
3875 * Information about a role request
3876 *
3877 * Logged from:
3878 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3879 */
3880message RoleRequestResultReported {
3881 // UID of application requesting the role
3882 optional int32 requesting_uid = 1;
3883
3884 // Package name of application requesting the role
3885 optional string requesting_package_name = 2;
3886
3887 // The role to be granted
3888 optional string role_name = 3;
3889
3890 // The count of applications qualifying for the role
3891 optional int32 qualifying_count = 4;
3892
3893 // UID of application current granted the role
3894 optional int32 current_uid = 5;
3895
3896 // Package name of application current granted the role
3897 optional string current_package_name = 6;
3898
3899 // UID of another application that user chose to grant the role to, instead of the requesting
3900 // application
3901 optional int32 granted_another_uid = 7;
3902
3903 // Package name of another application that user chose to grant the role to, instead of the
3904 // requesting application
3905 optional string granted_another_package_name = 8;
3906
3907 enum Result {
3908 UNDEFINED = 0;
3909 // role request was ignored
3910 IGNORED = 1;
3911 // role request was ignored because it's already granted
3912 IGNORED_ALREADY_GRANTED = 2;
3913 // role request was ignored because the application isn't qualified
3914 IGNORED_NOT_QUALIFIED = 3;
3915 // role request was ignored because user said it should be always denied
3916 IGNORED_USER_ALWAYS_DENIED = 4;
3917 // role was granted by user action
3918 USER_GRANTED = 5;
3919 // role was denied by user action
3920 USER_DENIED = 6;
3921 // role was denied by user granting another application the role
3922 USER_DENIED_GRANTED_ANOTHER = 7;
3923 // role was denied and set to be always denied by the user
3924 USER_DENIED_WITH_ALWAYS = 8;
3925 }
3926 // The result of the role request
3927 optional Result result = 9;
3928}
3929
Mark Tabrya824a642019-11-05 12:26:12 -08003930/**
3931 * Logs when a Vehicle Maps Service client's connection state has changed
3932 *
3933 * Logged from:
3934 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3935 */
3936message VmsClientConnectionStateChanged {
3937 // The UID of the VMS client app
3938 optional int32 uid = 1 [(is_uid) = true];
3939
3940 enum State {
3941 UNKNOWN = 0;
3942 // Attempting to connect to the client
3943 CONNECTING = 1;
3944 // Client connection established
3945 CONNECTED = 2;
3946 // Client connection closed unexpectedly
3947 DISCONNECTED = 3;
3948 // Client connection closed by VMS
3949 TERMINATED = 4;
3950 // Error establishing the client connection
3951 CONNECTION_ERROR = 5;
3952 }
3953
3954 optional State state = 2;
3955}
3956
Jeff Sharkey6bd21572019-11-15 20:45:33 -07003957/**
3958 * Logs when MediaProvider has successfully finished scanning a storage volume.
3959 *
3960 * Logged from:
3961 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
3962 */
3963message MediaProviderScanEvent {
3964 enum Reason {
3965 // Scan triggered due to unknown reason
3966 UNKNOWN = 0;
3967 // Scan triggered due to storage volume being mounted
3968 MOUNTED = 1;
3969 // Scan triggered due to explicit user action or app request
3970 DEMAND = 2;
3971 // Scan triggered due to idle maintenance
3972 IDLE = 3;
3973 }
3974
3975 // Volume type that this event pertains to
3976 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3977 // Reason why this scan was triggered
3978 optional Reason reason = 2;
3979 // Total number of files scanned
3980 optional int64 item_count = 3;
3981 // Duration of scan, normalized per file
3982 optional float normalized_duration_millis = 4;
3983 // Number of database inserts, normalized per file
3984 optional float normalized_insert_count = 5;
3985 // Number of database updates, normalized per file
3986 optional float normalized_update_count = 6;
3987 // Number of database deletes, normalized per file
3988 optional float normalized_delete_count = 7;
3989}
3990
3991/**
3992 * Logs when an app has asked MediaProvider to delete media belonging to the user.
3993 *
3994 * Logged from:
3995 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3996 */
3997message MediaProviderDeletionEvent {
3998 // Volume type that this event pertains to
3999 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4000 // Device timestamp when this deletion event occurred
4001 optional int64 timestamp_millis = 2;
4002 // App that requested deletion
4003 optional string package_name = 3;
4004 // Number of items that were deleted
4005 optional int32 item_count = 4;
4006}
4007
4008/**
4009 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4010 *
4011 * Logged from:
4012 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4013 */
4014message MediaProviderPermissionEvent {
4015 enum Result {
4016 UNKNOWN = 0;
4017 USER_GRANTED = 1;
4018 AUTO_GRANTED = 2;
4019 USER_DENIED = 3;
4020 USER_DENIED_WITH_PREJUDICE = 4;
4021 AUTO_DENIED = 5;
4022 }
4023
4024 // Volume type that this event pertains to
4025 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4026 // Device timestamp when this permission event occurred
4027 optional int64 timestamp_millis = 2;
4028 // App that requested permission
4029 optional string package_name = 3;
4030 // Number of items that were requested
4031 optional int32 item_count = 4;
4032 // Result of this request
4033 optional Result result = 5;
4034}
4035
4036/**
4037 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4038 *
4039 * Logged from:
4040 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4041 */
4042message MediaProviderSchemaChange {
4043 // Volume type that this event pertains to
4044 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4045 // Old database version code
4046 optional int32 version_from = 2;
4047 // New database version code
4048 optional int32 version_to = 3;
4049 // Total number of files in database
4050 optional int64 item_count = 4;
4051 // Duration of schema change, normalized per file
4052 optional float normalized_duration_millis = 5;
4053}
4054
4055/**
4056 * Logs when MediaProvider has finished an idle maintenance job.
4057 *
4058 * Logged from:
4059 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4060 */
4061message MediaProviderIdleMaintenance {
4062 // Volume type that this event pertains to
4063 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4064
4065 // Total number of files in database
4066 optional int64 item_count = 2;
4067 // Duration of idle maintenance, normalized per file
4068 optional float normalized_duration_millis = 3;
4069 // Number of thumbnails found to be stale, normalized per file
4070 optional float normalized_stale_thumbnails = 4;
4071 // Number of items found to be expired, normalized per file
4072 optional float normalized_expired_media = 5;
4073}
4074
Keun young Park3e033cb2019-12-18 11:27:35 -08004075/**
4076 * Represents boot time event with duration in ms.
4077 *
4078 * Logged from: bootstat and various system server components. Check each enums for details.
4079 */
4080message BootTimeEventDuration {
4081 enum DurationEvent {
4082 UNKNOWN = 0;
4083 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4084 ABSOLUTE_BOOT_TIME = 1;
4085 // Bootloader's 1st stage execution time.
4086 // Logged from bootstat.
4087 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4088 // Bootloader's 1st stage loading time.
4089 // Logged from bootstat.
4090 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4091 // Bootloader's kernel loading time.
4092 // Logged from bootstat.
4093 BOOTLOADER_KERNEL_LOAD = 4;
4094 // Bootloader's 2nd stage execution time.
4095 // Logged from bootstat.
4096 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4097 // Bootloader's 2nd stage loading time.
4098 // Logged from bootstat.
4099 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4100 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4101 // for locked device.
4102 // Logged from bootstat.
4103 BOOTLOADER_UI_WAIT = 7;
4104 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4105 // Logged from bootstat.
4106 BOOTLOADER_TOTAL = 8;
4107 // Shutdown duration inside init for the reboot before the current boot up.
4108 // Logged from f/b/services/.../BootReceiver.java.
4109 SHUTDOWN_DURATION = 9;
4110 // Total time for mounting of disk devices during bootup.
4111 // Logged from f/b/services/.../BootReceiver.java.
4112 MOUNT_DEFAULT_DURATION = 10;
4113 // Total time for early stage mounting of disk devices during bootup.
4114 // Logged from f/b/services/.../BootReceiver.java.
4115 MOUNT_EARLY_DURATION = 11;
4116 // Total time for late stage mounting of disk devices during bootup.
4117 // Logged from f/b/services/.../BootReceiver.java.
4118 MOUNT_LATE_DURATION = 12;
4119 // Average time to scan non-system app after OTA
4120 // Logged from f/b/services/.../PackageManagerService.java
4121 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4122 // Time to initialize Package manager after OTA
4123 // Logged from f/b/services/.../PackageManagerService.java
4124 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4125 // Time to scan all system app from Package manager after OTA
4126 // Logged from f/b/services/.../PackageManagerService.java
4127 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4128 // Init's total time for cold boot stage.
4129 // Logged from bootstat.
4130 COLDBOOT_WAIT = 16;
4131 // Init's total time for initializing selinux.
4132 // Logged from bootstat.
4133 SELINUX_INIT = 17;
4134 // Time since last factory reset.
4135 // Logged from bootstat.
4136 FACTORY_RESET_TIME_SINCE_RESET = 18;
4137 }
4138
4139 // Type of the event.
4140 optional DurationEvent event = 1;
4141 // Duration of the event in ms.
4142 optional int64 duration_millis = 2;
4143}
4144
4145/**
4146 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4147 * since boot-up.
4148 *
4149 * Logged from: bootstat and various system server components. Check each enums for details.
4150 */
4151message BootTimeEventElapsedTime {
4152 enum ElapsedTimeEvent {
4153 UNKNOWN = 0;
4154 // Time when init starts 1st stage. Logged from bootstat.
4155 ANDROID_INIT_STAGE_1 = 1;
4156 // Time when sys.boot_completed prop is set.
4157 // Logged from bootstat.
4158 BOOT_COMPLETE = 2;
4159 // BOOT_COMPLETE for encrypted device.
4160 BOOT_COMPLETE_ENCRYPTION = 3;
4161 // BOOT_COMPLETE for device with no encryption.
4162 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4163 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
4164 BOOT_COMPLETE_POST_DESCRYPT = 5;
4165 // BOOT_COMPLETE after factory reset.
4166 FACTORY_RESET_BOOT_COMPLETE = 6;
4167 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4168 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
4169 // BOOT_COMPLETE_POST_DESCRYPT after factory reset.
4170 FACTORY_RESET_BOOT_COMPLETE_POST_DESCRYPT = 8;
4171 // BOOT_COMPLETE after OTA.
4172 OTA_BOOT_COMPLETE = 9;
4173 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4174 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
4175 // BOOT_COMPLETE_POST_DESCRYPT after OTA.
4176 OTA_BOOT_COMPLETE_POST_DESCRYPT = 11;
4177 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4178 // Logged from f/b/services/.../UserController.java
4179 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4180 // Time when the system starts sending BOOT_COMPLETED broadcast.
4181 // Logged from f/b/services/.../UserController.java
4182 FRAMEWORK_BOOT_COMPLETED = 13;
4183 // Time when the package manager starts init.
4184 // Logged from f/b/services/.../SystemServer.java
4185 PACKAGE_MANAGER_INIT_START = 14;
4186 // Time when package manager is ready
4187 // Logged from f/b/services/.../SystemServer.java
4188 PACKAGE_MANAGER_INIT_READY = 15;
4189 // Represents the time when user has entered unlock credential for system with user pin.
4190 // Logged from bootstat.
4191 POST_DECRYPT = 16;
4192 // Represents the start of zygote's init.
4193 // Logged from zygote itself.
4194 ZYGOTE_INIT_START = 17;
4195 // Represents the start of secondary zygote's init.
4196 // TODO: add logging to zygote
4197 SECONDARY_ZYGOTE_INIT_START = 18;
4198 // Represents the start of system server's init.
4199 // Logged from f/b/services/.../SystemServer.java
4200 SYSTEM_SERVER_INIT_START = 19;
4201 // Represents the completion of system server's init.
4202 // Logged from f/b/services/.../SystemServer.java
4203 SYSTEM_SERVER_READY = 20;
4204 // Represents the start of launcher during boot-up.
4205 // TODO: add logging
4206 LAUNCHER_START = 21;
4207 // Represents the completion of launcher's initial rendering. User can use other apps from
4208 // launcher from this point.
4209 // TODO: add logging
4210 LAUNCHER_SHOWN = 22;
4211 }
4212
4213 // Type of the event.
4214 optional ElapsedTimeEvent event = 1;
4215 // Time since bootup for the event.
4216 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4217 optional int64 time_millis = 2;
4218}
4219
4220/**
4221 * Boot time events with UTC time.
4222 *
4223 * Logged from: bootstat and various system server components. Check each enums for details.
4224 */
4225message BootTimeEventUtcTime {
4226 enum UtcTimeEvent {
4227 UNKNOWN = 0;
4228 // Time of the bootstat's marking of 1st boot after the last factory reset.
4229 // Logged from bootstat.
4230 FACTORY_RESET_RESET_TIME = 1;
4231 // The time when bootstat records FACTORY_RESET_* events. This is close to
4232 // BOOT_COMPLETE time for the current bootup.
4233 // Logged from bootstat.
4234 FACTORY_RESET_CURRENT_TIME = 2;
4235 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4236 // Logged from bootstat.
4237 FACTORY_RESET_RECORD_VALUE = 3;
4238 }
4239
4240 // Type of the event.
4241 optional UtcTimeEvent event = 1;
4242 // UTC time for the event.
4243 optional int64 utc_time_secs = 2;
4244}
4245
4246/**
4247 * Boot time events representing specific error code during bootup.
4248 * Meaning of error code can be different per each event type.
4249 *
4250 * Logged from: bootstat and various system server components. Check each enums for details.
4251 */
4252message BootTimeEventErrorCode {
4253 enum ErrorCodeEvent {
4254 UNKNOWN = 0;
4255 // Linux error code for time() call to get the current UTC time.
4256 // Logged from bootstat.
4257 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4258 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4259 // as UMOUNT_STAT_* from init/reboot.cpp.
4260 // Logged from f/b/services/.../BootReceiver.java.
4261 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004262 // Reprepsents fie system mounting error code of /data partition for the current boot.
4263 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004264 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004265 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004266 }
4267
4268 // Type of the event.
4269 optional ErrorCodeEvent event = 1;
4270 // error code defined per each event type.
4271 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4272 // FS_MGR_FS_STAT.
4273 optional int32 error_code = 2;
4274}
4275
Chenjie Yubbcbc602018-02-05 16:51:52 -08004276//////////////////////////////////////////////////////////////////////
4277// Pulled atoms below this line //
4278//////////////////////////////////////////////////////////////////////
4279
4280/**
David Chenc8a43242017-10-17 16:23:28 -07004281 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4282 *
4283 * Pulled from:
4284 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4285 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004286message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004287 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004288
4289 optional int64 rx_bytes = 2;
4290
4291 optional int64 rx_packets = 3;
4292
4293 optional int64 tx_bytes = 4;
4294
4295 optional int64 tx_packets = 5;
4296}
4297
4298/**
4299 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4300 *
4301 * Pulled from:
4302 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4303 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004304message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004305 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004306
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004307 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4308 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004309
4310 optional int64 rx_bytes = 3;
4311
4312 optional int64 rx_packets = 4;
4313
4314 optional int64 tx_bytes = 5;
4315
4316 optional int64 tx_packets = 6;
4317}
4318
4319/**
4320 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4321 *
4322 * Pulled from:
4323 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4324 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004325message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004326 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004327
4328 optional int64 rx_bytes = 2;
4329
4330 optional int64 rx_packets = 3;
4331
4332 optional int64 tx_bytes = 4;
4333
4334 optional int64 tx_packets = 5;
4335}
4336
4337/**
4338 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4339 *
4340 * Pulled from:
4341 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4342 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004343message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004344 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004345
Yao Chenc40a19d2018-03-15 16:48:25 -07004346 // 1 denotes foreground and 0 denotes background. This is called Set in
4347 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004348 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004349
4350 optional int64 rx_bytes = 3;
4351
4352 optional int64 rx_packets = 4;
4353
4354 optional int64 tx_bytes = 5;
4355
4356 optional int64 tx_packets = 6;
4357}
4358
4359/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004360 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4361 *
4362 * Pulled from:
4363 * StatsCompanionService
4364 */
4365message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004366 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004367
4368 optional int64 rx_bytes = 2;
4369
4370 optional int64 tx_bytes = 3;
4371}
4372
4373/**
David Chenc8a43242017-10-17 16:23:28 -07004374 * Pulls the kernel wakelock durations. This atom is adapted from
4375 * android/internal/os/KernelWakelockStats.java
4376 *
4377 * Pulled from:
4378 * StatsCompanionService using KernelWakelockReader.
4379 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004380message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004381 optional string name = 1;
4382
4383 optional int32 count = 2;
4384
4385 optional int32 version = 3;
4386
Yangster-maca8a30442018-10-13 23:46:34 -07004387 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004388}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004389
Chenjie Yu05013b32017-11-21 10:21:41 -08004390/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004391 * Pulls low power state information. If power.stats HAL is not available, this
4392 * includes platform and subsystem sleep state information,
4393 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4394 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004395 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004396 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004397 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4398 * as defined in:
4399 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004400 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004401message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004402 // Subsystem name
4403 optional string subsystem_name = 1;
4404 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4405 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004406 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4407 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004408 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004409 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004410 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004411 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004412 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004413}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004414
Chenjie Yu05013b32017-11-21 10:21:41 -08004415/**
Bookatz92da2832018-11-01 18:10:03 -07004416 * Pulls on-device power measurement information.
4417 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4418 * Pulled from:
4419 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4420 */
4421message OnDevicePowerMeasurement {
4422 // Name of the subsystem (to which the rail belongs).
4423 optional string subsystem_name = 1;
4424
4425 // Rail name. The rail lies within the subsystem.
4426 optional string rail_name = 2;
4427
4428 // Time (in ms since boot) at which the rail energy value was measured.
4429 // This may differ slightly from the time that statsd logs this information.
4430 optional uint64 measurement_timestamp_millis = 3;
4431
4432 // Accumulated energy used via the rail since device boot in uWs.
4433 optional uint64 energy_microwatt_secs = 4;
4434}
4435
4436/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004437 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004438 * Pulls the time the cpu spend on the frequency index. Frequency index
4439 * starts from highest to lowest. The value should be monotonically
4440 * increasing since boot. However, if there is a cpu
4441 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004442 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004443message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004444 optional uint32 cluster = 1;
4445 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004446 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004447}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004448
Chenjie Yu05013b32017-11-21 10:21:41 -08004449/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004450 * Pulls Cpu Time Per Uid.
4451 * Note that isolated process uid time should be attributed to host uids.
4452 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004453message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004454 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004455 optional uint64 user_time_micros = 2;
4456 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004457}
4458
4459/**
4460 * Pulls Cpu Time Per Uid per frequency.
4461 * Note that isolated process uid time should be attributed to host uids.
4462 * For each uid, we order the time by descending frequencies.
4463 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004464message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004465 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004466 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004467 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004468}
Hugo Benichi884970e2017-11-14 22:42:46 +09004469
Chenjie Yu05013b32017-11-21 10:21:41 -08004470/**
4471 * Pulls Wifi Controller Activity Energy Info
4472 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004473message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004474 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004475 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004476 // stack reported state
4477 // TODO: replace this with proto enum
4478 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004479 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004480 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004481 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004482 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004483 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004484 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004485 // product of current(mA), voltage(V) and time(ms)
4486 optional uint64 controller_energy_used = 6;
4487}
4488
4489/**
4490 * Pulls Modem Activity Energy Info
4491 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004492message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004493 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004494 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004495 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004496 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004497 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004498 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004499 /**
4500 * Tx power index
4501 * index 0 = tx_power < 0dBm
4502 * index 1 = 0dBm < tx_power < 5dBm
4503 * index 2 = 5dBm < tx_power < 15dBm
4504 * index 3 = 15dBm < tx_power < 20dBm
4505 * index 4 = tx_power > 20dBm
4506 */
4507 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004508 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004509 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004510 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004511 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004512 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004513 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004514 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004515 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004516 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004517 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004518 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004519 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004520 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004521}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004522
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004523/**
4524 * Pulls Bluetooth Activity Energy Info
4525 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4526 */
4527message BluetoothActivityInfo {
4528 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004529 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004530 // bluetooth stack state
4531 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004532 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004533 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004534 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004535 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004536 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004537 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004538 // product of current(mA), voltage(V) and time(ms)
4539 optional uint64 energy_used = 6;
4540}
4541
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004542/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004543 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004544 *
4545 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004546 */
4547message ProcessMemoryState {
4548 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004549 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004550
4551 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004552 // Usually package name, "system" for system server.
4553 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004554 optional string process_name = 2;
4555
Rafal Slawikda51b932018-12-13 16:31:33 +00004556 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004557 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004558
4559 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004560 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004561
4562 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004563 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004564
Rajeev Kumar90235992018-01-29 11:06:48 -08004565 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004566 // Value is read from memory.stat, field total_rss if per-app memory
4567 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004568 optional int64 rss_in_bytes = 6;
4569
4570 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004571 // Value is read from memory.stat, field total_cache if per-app memory
4572 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004573 optional int64 cache_in_bytes = 7;
4574
4575 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004576 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004577 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004578 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004579
Rafal Slawik203c3db2019-09-25 19:53:01 +01004580 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004581 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004582
Rafal Slawik203c3db2019-09-25 19:53:01 +01004583 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4584 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004585
Rafal Slawik203c3db2019-09-25 19:53:01 +01004586 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4587 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004588}
4589
4590/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004591 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004592 *
4593 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4594 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004595 *
4596 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004597 */
4598message ProcessMemoryHighWaterMark {
4599 // The uid if available. -1 means not available.
4600 optional int32 uid = 1 [(is_uid) = true];
4601
Rafal Slawikda51b932018-12-13 16:31:33 +00004602 // The process name.
4603 // Usually package name or process cmdline.
4604 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004605 optional string process_name = 2;
4606
Rafal Slawik239b6802019-09-09 18:46:01 +01004607 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4608 // computed by converting kilobytes to bytes.
4609 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4610
Rafal Slawik3bea8952018-11-15 12:39:33 +00004611 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4612 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004613 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004614}
4615
4616/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004617 * Logs the memory stats for a process.
4618 *
4619 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4620 * and for selected native processes.
4621 */
4622message ProcessMemorySnapshot {
4623 // The uid if available. -1 means not available.
4624 optional int32 uid = 1 [(is_uid) = true];
4625
4626 // The process name.
4627 // Usually package name or process cmdline.
4628 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4629 optional string process_name = 2;
4630
4631 // The pid of the process.
4632 // Allows to disambiguate instances of the process.
4633 optional int32 pid = 3;
4634
4635 // The current OOM score adjustment value.
4636 // Read from ProcessRecord for managed processes.
4637 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4638 optional int32 oom_score_adj = 4;
4639
4640 // The current RSS of the process.
4641 // VmRSS from /proc/pid/status.
4642 optional int32 rss_in_kilobytes = 5;
4643
4644 // The current anon RSS of the process.
4645 // RssAnon from /proc/pid/status.
4646 optional int32 anon_rss_in_kilobytes = 6;
4647
4648 // The current swap size of the process.
4649 // VmSwap from /proc/pid/status.
4650 optional int32 swap_in_kilobytes = 7;
4651
4652 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4653 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4654}
4655
4656/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004657 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004658 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004659message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004660 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004661}
4662
4663/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004664 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004665 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004666message SystemUptime {
4667 // Milliseconds since the system was booted.
4668 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4669 // for external input).
4670 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004671 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004672}
4673
4674/*
4675 * Reads from /proc/uid_concurrent_active_time which has the format:
4676 * active: X (X is # cores)
4677 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4678 * [uid1]: [time-0] [time-1] [time-2] ... ...
4679 * ...
4680 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4681 * The file contains a monotonically increasing count of time for a single boot.
4682 */
4683message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004684 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004685 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004686}
4687
4688/**
4689 * Reads from /proc/uid_concurrent_policy_time which has the format:
4690 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4691 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4692 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4693 * ...
4694 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4695 * The file contains a monotonically increasing count of time for a single boot.
4696 */
4697message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004698 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004699 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004700 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004701}
4702
4703/*
4704 * Pulls free disk space, for data, system partition and temporary directory.
4705 */
4706message DiskSpace {
4707 // available bytes in data partition
4708 optional uint64 data_available_bytes = 1;
4709 // available bytes in system partition
4710 optional uint64 system_available_bytes = 2;
4711 // available bytes in download cache or temp directories
4712 optional uint64 temp_available_bytes = 3;
4713}
Tej Singhbf972d92018-01-10 20:51:13 -08004714
4715/**
4716 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004717 *
4718 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004719 */
4720message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004721 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004722}
4723
4724/**
4725 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004726 * Pulled from:
4727 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004728 */
4729message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004730 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004731}
4732
4733/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004734 * Pulls battery voltage.
4735 * Pulled from:
4736 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4737 */
4738message BatteryVoltage {
4739 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004740 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004741}
4742
4743/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004744 * Pulls battery level (percent full, from 0 to 100).
4745 *
4746 * Pulled from:
4747 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4748 */
4749message BatteryLevel {
4750 // Battery level. Should be in [0, 100].
4751 optional int32 battery_level = 1;
4752}
4753
4754/**
Tej Singhd89137e2018-03-26 14:51:40 -07004755 * Pulls the temperature of various parts of the device.
4756 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004757 *
Maggie White442b6312019-04-05 16:26:44 -07004758 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004759 */
4760message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004761 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004762 optional android.os.TemperatureTypeEnum sensor_location = 1;
4763
4764 // The name of the temperature source. Eg. CPU0
4765 optional string sensor_name = 2;
4766
Tej Singhd89137e2018-03-26 14:51:40 -07004767 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004768 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004769 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004770
4771 // Relative severity of the throttling, see enum definition.
4772 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004773}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004774
4775/**
4776 * Pulls the statistics of calls to Binder.
4777 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004778 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4779 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004780 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004781 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004782 */
4783message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004784 // UID of the process responsible for the binder transaction. It will be set if the process
4785 // executing the binder transaction attribute the transaction to another uid using
4786 // Binder.setThreadWorkSource().
4787 //
4788 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004789 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004790 // UID of the process executing the binder transaction.
4791 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004792 // Fully qualified class name of the API call.
4793 //
4794 // This is a system server class name.
4795 //
4796 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4797 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4798 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4799 // commonly used APIs.
4800 optional string service_class_name = 2;
4801 // Method name of the API call. It can also be a transaction code if we cannot
4802 // resolve it to a name. See Binder#getTransactionName.
4803 //
4804 // This is a system server method name.
4805 optional string service_method_name = 3;
4806 // Total number of API calls.
4807 optional int64 call_count = 4;
4808 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4809 optional bool screen_interactive = 13;
4810 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4811 // call_count will be equal to recorded_call_count.
4812 //
4813 // If recorded_call_count is different than call_count, it means data collection has been
4814 // sampled. All the fields below will be sampled in this case.
4815 optional int64 recorded_call_count = 12;
4816 // Number of exceptions thrown by the API.
4817 optional int64 recorded_exception_count = 5;
4818 // Total latency of all API calls.
4819 // Average can be computed using total_latency_micros / recorded_call_count.
4820 optional int64 recorded_total_latency_micros = 6;
4821 // Maximum latency of one API call.
4822 optional int64 recorded_max_latency_micros = 7;
4823 // Total CPU usage of all API calls.
4824 // Average can be computed using total_cpu_micros / recorded_call_count.
4825 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4826 optional int64 recorded_total_cpu_micros = 8;
4827 // Maximum CPU usage of one API call.
4828 optional int64 recorded_max_cpu_micros = 9;
4829 // Maximum parcel reply size of one API call.
4830 optional int64 recorded_max_reply_size_bytes = 10;
4831 // Maximum parcel request size of one API call.
4832 optional int64 recorded_max_request_size_bytes = 11;
4833}
4834
4835/**
4836 * Pulls the statistics of exceptions during calls to Binder.
4837 *
4838 * Binder stats are cumulative from boot unless somebody reset the data using
4839 * > adb shell dumpsys binder_calls_stats --reset
4840 */
4841message BinderCallsExceptions {
4842 // Exception class name, e.g. java.lang.IllegalArgumentException.
4843 //
4844 // This is an exception class name thrown by the system server.
4845 optional string exception_class_name = 1;
4846 // Total number of exceptions.
4847 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004848}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004849
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004850/**
4851 * Pulls the statistics of message dispatching on HandlerThreads.
4852 *
4853 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4854 * config on the device.
4855 *
4856 * Next tag: 11
4857 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004858message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004859 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004860 optional int32 uid = 1 [(is_uid) = true];
4861
4862 // Fully qualified class name of the handler target class.
4863 //
4864 // This field does not contain PII. This is a system server class name.
4865 optional string handler_class_name = 2;
4866
4867 // The name of the thread that runs the Looper.
4868 //
4869 // This field does not contain PII. This is a system server thread name.
4870 optional string looper_thread_name = 3;
4871
4872 // The name of the dispatched message.
4873 //
4874 // This field does not contain PII. This is a system server constant or class
4875 // name.
4876 optional string message_name = 4;
4877
4878 // Total number of successfully dispatched messages.
4879 optional int64 message_count = 5;
4880
4881 // Total number of messages that failed dispatching.
4882 optional int64 exception_count = 6;
4883
4884 // Total number of processed messages we have data recorded for. If we
4885 // collected data for all the messages, message_count will be equal to
4886 // recorded_message_count.
4887 //
4888 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004889 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004890 optional int64 recorded_message_count = 7;
4891
4892 // Total latency of all processed messages.
4893 // Average can be computed using recorded_total_latency_micros /
4894 // recorded_message_count.
4895 optional int64 recorded_total_latency_micros = 8;
4896
4897 // Total CPU usage of all processed message.
4898 // Average can be computed using recorded_total_cpu_micros /
4899 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004900 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004901 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004902
4903 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4904 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004905
4906 // Max recorded CPU usage of all processed messages.
4907 optional int64 recorded_max_cpu_micros = 11;
4908
4909 // Max recorded latency of all processed messages.
4910 optional int64 recorded_max_latency_micros = 12;
4911
4912 // Total number of messages we tracked the dispatching delay for. If we
4913 // collected data for all the messages, message_count will be equal to
4914 // recorded_delay_message_count.
4915 //
4916 // If recorded_delay_message_count is different than message_count, it means data
4917 // collection has been sampled or/and not all messages specified the target dispatch time.
4918 // The fields below will be sampled in this case.
4919 optional int64 recorded_delay_message_count = 13;
4920
4921 // Total dispatching delay of all processed messages.
4922 // Calculated as a difference between the target dispatching time (Message.when)
4923 // and the actual dispatching time.
4924 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4925 optional int64 recorded_total_delay_millis = 14;
4926
4927 // Max dispatching delay of all processed messages.
4928 // Calculated as a difference between the target dispatching time (Message.when)
4929 // and the actual dispatching time.
4930 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004931}
Tej Singh86dc9db2018-09-06 00:39:57 +00004932
4933/**
4934 * Pulls disk information, such as write speed and latency.
4935 */
4936message DiskStats {
4937 // Time taken to open, write 512B to, and close a file.
4938 // -1 if error performing the check.
4939 optional int64 data_write_latency_millis = 1;
4940
4941 optional bool file_based_encryption = 2;
4942
4943 // Recent disk write speed in kB/s.
4944 // -1 if error querying storageed.
4945 // 0 if data is unavailable.
4946 optional int32 recent_disk_write_speed = 3;
4947}
4948
4949
4950/**
4951 * Free and total bytes of the Data, Cache, and System partition.
4952 */
4953message DirectoryUsage {
4954 enum Directory {
4955 UNKNOWN = 0;
4956 DATA = 1;
4957 CACHE = 2;
4958 SYSTEM = 3;
4959 }
4960 optional Directory directory = 1;
4961 optional int64 free_bytes = 2;
4962 optional int64 total_bytes = 3;
4963}
4964
4965
4966/**
4967 * Size of an application: apk size, data size, and cache size.
4968 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4969 * Information is only reported for apps with the primary user (user 0).
4970 * Sizes are aggregated by package name.
4971 */
4972message AppSize {
4973 // Including uids will involve modifying diskstats logic.
4974 optional string package_name = 1;
4975 // App size in bytes. -1 if unavailable.
4976 optional int64 app_size_bytes = 2;
4977 // App data size in bytes. -1 if unavailable.
4978 optional int64 app_data_size_bytes = 3;
4979 // App cache size in bytes. -1 if unavailable.
4980 optional int64 app_cache_size_bytes = 4;
4981 // Time that the cache file was produced.
4982 // Uses System.currentTimeMillis(), which is wall clock time.
4983 optional int64 cache_time_millis = 5;
4984}
4985
4986
4987/**
4988 * Size of a particular category. Eg: photos, videos.
4989 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4990 */
4991message CategorySize {
4992 enum Category {
4993 UNKNOWN = 0;
4994 APP_SIZE = 1;
4995 APP_DATA_SIZE = 2;
4996 APP_CACHE_SIZE = 3;
4997 PHOTOS = 4;
4998 VIDEOS = 5;
4999 AUDIO = 6;
5000 DOWNLOADS = 7;
5001 SYSTEM = 8;
5002 OTHER = 9;
5003 }
5004 optional Category category = 1;
5005 // Category size in bytes.
5006 optional int64 size_bytes = 2;
5007 // Time that the cache file was produced.
5008 // Uses System.currentTimeMillis(), which is wall clock time.
5009 optional int64 cache_time_millis = 3;
5010}
Tej Singhd6d6d772018-09-05 17:41:25 -07005011
5012/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005013 * Pulls per uid I/O stats. The stats are cumulative since boot.
5014 *
5015 * Read/write bytes are I/O events from a storage device
5016 * Read/write chars are data requested by read/write syscalls, and can be
5017 * satisfied by caching.
5018 *
5019 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5020 */
5021message DiskIo {
5022 optional int32 uid = 1 [(is_uid) = true];
5023 optional int64 fg_chars_read = 2;
5024 optional int64 fg_chars_write = 3;
5025 optional int64 fg_bytes_read = 4;
5026 optional int64 fg_bytes_write = 5;
5027 optional int64 bg_chars_read = 6;
5028 optional int64 bg_chars_write = 7;
5029 optional int64 bg_bytes_read = 8;
5030 optional int64 bg_bytes_write = 9;
5031 optional int64 fg_fsync = 10;
5032 optional int64 bg_fsync= 11;
5033}
5034
5035
5036/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005037 * Pulls the number of fingerprints for each user.
5038 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005039 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005040 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005041message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005042 // The associated user. Eg: 0 for owners, 10+ for others.
5043 // Defined in android/os/UserHandle.java
5044 optional int32 user = 1;
5045 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005046 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005047}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005048
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005049/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005050 * Pulls the number of faces for each user.
5051 *
5052 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5053 */
5054message NumFacesEnrolled {
5055 // The associated user. Eg: 0 for owners, 10+ for others.
5056 // Defined in android/os/UserHandle.java
5057 optional int32 user = 1;
5058 // Number of faces registered to that user.
5059 optional int32 num_faces_enrolled = 2;
5060}
5061/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005062 * A mapping of role holder -> role
5063 */
5064message RoleHolder {
5065 // uid of the role holder
5066 optional int32 uid = 1 [(is_uid) = true];
5067
5068 // package name of the role holder
5069 optional string package_name = 2;
5070
5071 // the role held
5072 optional string role = 3;
5073}
5074
Yangsteraf9aee72018-10-12 09:26:16 -07005075message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005076 // These are all in byte resolution.
5077 optional int64 min = 1 [deprecated = true];
5078 optional int64 average = 2 [deprecated = true];
5079 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005080
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005081 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5082 // int64 fields.
5083 optional int32 mean_kb = 4;
5084 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005085}
5086
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005087// A reduced subset of process states; reducing the number of possible states allows more
5088// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5089enum ProcessStateAggregated {
5090 PROCESS_STATE_UNKNOWN = 0;
5091 // Persistent system process.
5092 PROCESS_STATE_PERSISTENT = 1;
5093 // Top activity; actually any visible activity.
5094 PROCESS_STATE_TOP = 2;
5095 // Process binding to top or a foreground service.
5096 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5097 // Processing running a foreground service.
5098 PROCESS_STATE_FGS = 4;
5099 // Important foreground process (ime, wallpaper, etc).
5100 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5101 // Important background process.
5102 PROCESS_STATE_BACKGROUND = 6;
5103 // Process running a receiver.
5104 PROCESS_STATE_RECEIVER = 7;
5105 // All kinds of cached processes.
5106 PROCESS_STATE_CACHED = 8;
5107}
5108
5109// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005110message ProcessStatsStateProto {
5111 optional android.service.procstats.ScreenState screen_state = 1;
5112
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005113 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005114
5115 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5116 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005117 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5118
5119 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005120
5121 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005122 optional int64 duration_millis = 4 [deprecated = true];
5123 // Same as above, but with minute resolution so it fits into an int32.
5124 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005125
5126 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005127 optional int64 realtime_duration_millis = 9 [deprecated = true];
5128 // Same as above, but with minute resolution so it fits into an int32.
5129 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005130
5131 // # of samples taken
5132 optional int32 sample_size = 5;
5133
5134 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005135 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005136
5137 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005138 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005139
5140 // RSS is memory resident for this process
5141 optional AggStats rss = 8;
5142}
5143
5144// Next Tag: 7
5145message ProcessStatsProto {
5146 // Name of process.
5147 optional string process = 1;
5148
5149 // Uid of the process.
5150 optional int32 uid = 2;
5151
5152 // Information about how often kills occurred
5153 message Kill {
5154 // Count of excessive CPU kills
5155 optional int32 cpu = 1;
5156
5157 // Count of kills when cached
5158 optional int32 cached = 2;
5159
5160 // PSS stats during cached kill
5161 optional AggStats cached_pss = 3;
5162 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005163 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005164
5165 // Time and memory spent in various states.
5166 repeated ProcessStatsStateProto states = 5;
5167
5168 // Total time process has been running... screen_state, memory_state, and process_state
5169 // will not be set.
5170 optional ProcessStatsStateProto total_running_state = 6;
5171}
5172
5173message PackageServiceOperationStatsProto {
5174 // Operate enum: Started, Foreground, Bound, Executing
5175 optional android.service.procstats.ServiceOperationState operation = 1;
5176
5177 // Number of times the service was in this operation.
5178 optional int32 count = 2;
5179
5180 // Information about a state the service can be in.
5181 message StateStats {
5182 // Screen state enum.
5183 optional android.service.procstats.ScreenState screen_state = 1;
5184 // Memory state enum.
5185 optional android.service.procstats.MemoryState memory_state = 2;
5186
5187 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005188 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005189 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005190 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005191 }
5192 repeated StateStats state_stats = 3;
5193}
5194
5195message PackageServiceStatsProto {
5196 // Name of service component.
5197 optional string service_name = 1;
5198
5199 // The operation stats.
5200 // The package_name, package_uid, package_version, service_name will not be set to save space.
5201 repeated PackageServiceOperationStatsProto operation_stats = 2;
5202}
5203
5204message PackageAssociationSourceProcessStatsProto {
5205 // Uid of the process.
5206 optional int32 process_uid = 1;
5207 // Process name.
5208 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005209 // Package name.
5210 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005211 // Total count of the times this association appeared.
5212 optional int32 total_count = 3;
5213
5214 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005215 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005216
5217 // Total count of the times this association became actively impacting its target process.
5218 optional int32 active_count = 5;
5219
5220 // Information on one source in this association.
5221 message StateStats {
5222 // Process state enum.
5223 optional android.service.procstats.ProcessState process_state = 1;
5224 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005225 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005226 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005227 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005228 }
5229 repeated StateStats active_state_stats = 6;
5230}
5231
5232message PackageAssociationProcessStatsProto {
5233 // Name of the target component.
5234 optional string component_name = 1;
5235 // Information on one source in this association.
5236 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5237}
5238
5239
5240message ProcessStatsPackageProto {
5241 // Name of package.
5242 optional string package = 1;
5243
5244 // Uid of the package.
5245 optional int32 uid = 2;
5246
5247 // Version of the package.
5248 optional int64 version = 3;
5249
5250 // Stats for each process running with the package loaded in to it.
5251 repeated ProcessStatsProto process_stats = 4;
5252
5253 // Stats for each of the package's services.
5254 repeated PackageServiceStatsProto service_stats = 5;
5255
5256 // Stats for each association with the package.
5257 repeated PackageAssociationProcessStatsProto association_stats = 6;
5258}
5259
5260message ProcessStatsSectionProto {
5261 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005262 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005263
5264 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005265 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005266
5267 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005268 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005269
5270 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005271 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005272
5273 // System runtime library. e.g. "libdvm.so", "libart.so".
5274 optional string runtime = 5;
5275
5276 // whether kernel reports swapped pss.
5277 optional bool has_swapped_pss = 6;
5278
5279 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5280 enum Status {
5281 STATUS_UNKNOWN = 0;
5282 STATUS_COMPLETE = 1;
5283 STATUS_PARTIAL = 2;
5284 STATUS_SHUTDOWN = 3;
5285 STATUS_SYSPROPS = 4;
5286 }
5287 repeated Status status = 7;
5288
Chenjie Yub2ecc792019-01-17 10:27:26 -08005289 // Number of pages available of various types and sizes, representation fragmentation.
5290 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5291
Yangsteraf9aee72018-10-12 09:26:16 -07005292 // Stats for each process.
5293 repeated ProcessStatsProto process_stats = 8;
5294
5295 // Stats for each package.
5296 repeated ProcessStatsPackageProto package_stats = 9;
5297}
5298
Chenjie Yub2ecc792019-01-17 10:27:26 -08005299message ProcessStatsAvailablePagesProto {
5300 // Node these pages are in (as per /proc/pagetypeinfo)
5301 optional int32 node = 1;
5302
5303 // Zone these pages are in (as per /proc/pagetypeinfo)
5304 optional string zone = 2;
5305
5306 // Label for the type of these pages (as per /proc/pagetypeinfo)
5307 optional string label = 3;
5308
5309 // Distribution of number of pages available by order size. First entry in array is
5310 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5311 repeated int32 pages_per_order = 4;
5312}
5313
Chenjie Yu12e5e672018-09-14 15:54:59 -07005314/**
5315 * Pulled from ProcessStatsService.java
5316 */
5317message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005318 optional ProcessStatsSectionProto proc_stats_section = 1;
5319}
5320
Chenjie Yuf910b7802019-01-11 16:08:20 -08005321/**
5322 * Pulled from ProcessStatsService.java
5323 */
5324message ProcStatsPkgProc {
5325 optional ProcessStatsSectionProto proc_stats_section = 1;
5326}
5327
Chris Wrencdea3b72019-11-22 16:58:17 -05005328// Next Tag: 2
5329message PackageRemoteViewInfoProto {
5330 optional string package_name = 1;
5331 // add per-package additional info here (like channels)
5332}
5333
5334// Next Tag: 2
5335message NotificationRemoteViewsProto {
5336 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5337}
5338
5339/**
5340 * Pulled from NotificationManagerService.java
5341 */
5342message NotificationRemoteViews {
5343 optional NotificationRemoteViewsProto notification_remote_views = 1;
5344}
5345
Yangsteraf9aee72018-10-12 09:26:16 -07005346message PowerProfileProto {
5347 optional double cpu_suspend = 1;
5348
5349 optional double cpu_idle = 2;
5350
5351 optional double cpu_active = 3;
5352
5353 message CpuCluster {
5354 optional int32 id = 1;
5355 optional double cluster_power = 2;
5356 optional int32 cores = 3;
5357 repeated int64 speed = 4;
5358 repeated double core_power = 5;
5359 }
5360
5361 repeated CpuCluster cpu_cluster = 40;
5362
5363 optional double wifi_scan = 4;
5364
5365 optional double wifi_on = 5;
5366
5367 optional double wifi_active = 6;
5368
5369 optional double wifi_controller_idle = 7;
5370
5371 optional double wifi_controller_rx = 8;
5372
5373 optional double wifi_controller_tx = 9;
5374
5375 repeated double wifi_controller_tx_levels = 10;
5376
5377 optional double wifi_controller_operating_voltage = 11;
5378
5379 optional double bluetooth_controller_idle = 12;
5380
5381 optional double bluetooth_controller_rx = 13;
5382
5383 optional double bluetooth_controller_tx = 14;
5384
5385 optional double bluetooth_controller_operating_voltage = 15;
5386
5387 optional double modem_controller_sleep = 16;
5388
5389 optional double modem_controller_idle = 17;
5390
5391 optional double modem_controller_rx = 18;
5392
5393 repeated double modem_controller_tx = 19;
5394
5395 optional double modem_controller_operating_voltage = 20;
5396
5397 optional double gps_on = 21;
5398
5399 repeated double gps_signal_quality_based = 22;
5400
5401 optional double gps_operating_voltage = 23;
5402
5403 optional double bluetooth_on = 24;
5404
5405 optional double bluetooth_active = 25;
5406
5407 optional double bluetooth_at_cmd = 26;
5408
5409 optional double ambient_display = 27;
5410
5411 optional double screen_on = 28;
5412
5413 optional double radio_on = 29;
5414
5415 optional double radio_scanning = 30;
5416
5417 optional double radio_active = 31;
5418
5419 optional double screen_full = 32;
5420
5421 optional double audio = 33;
5422
5423 optional double video = 34;
5424
5425 optional double flashlight = 35;
5426
5427 optional double memory = 36;
5428
5429 optional double camera = 37;
5430
5431 optional double wifi_batched_scan = 38;
5432
5433 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005434}
Chenjie Yuab530202018-09-26 12:39:20 -07005435
5436/**
5437 * power_profile.xml and other constants for power model calculations.
5438 * Pulled from PowerProfile.java
5439 */
5440message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005441 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005442}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005443
5444/**
arangelovd5db50e2018-10-12 20:24:39 +01005445 * Logs when a user restriction was added or removed.
5446 *
5447 * Logged from:
5448 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5449 */
5450message UserRestrictionChanged {
5451 // The raw string of the user restriction as defined in UserManager.
5452 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5453 optional string restriction = 1;
5454 // Whether the restriction is enabled or disabled.
5455 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005456}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005457
5458/**
5459 * Pulls process user time and system time. Puller takes a snapshot of all pids
5460 * in the system and returns cpu stats for those that are working at the time.
5461 * Dead pids will be dropped. Kernel processes are excluded.
5462 * Min cool-down is 5 sec.
5463 */
5464message ProcessCpuTime {
5465 optional int32 uid = 1 [(is_uid) = true];
5466
5467 optional string process_name = 2;
5468 // Process cpu time in user space, cumulative from boot/process start
5469 optional int64 user_time_millis = 3;
5470 // Process cpu time in system space, cumulative from boot/process start
5471 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005472}
Misha Wagner5a51e002018-10-03 15:04:09 +01005473
5474/**
5475 * Pulls the CPU usage for each thread.
5476 *
5477 * Read from /proc/$PID/task/$TID/time_in_state files.
5478 *
5479 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5480 * time_in_state files not being present on some phones, have not been addressed. These should be
5481 * considered before a public release.
5482 */
5483message CpuTimePerThreadFreq {
5484 // UID that owns the process.
5485 optional int32 uid = 1 [(is_uid) = true];
5486 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005487 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005488 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005489 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005490 // Name of the process taken from `/proc/$PID/cmdline`.
5491 optional string process_name = 4;
5492 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5493 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005494
5495 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5496 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5497 // frequencies are given here as the alternative is sending eight separate atoms. This method
5498 // significantly reduces the amount of data created
5499 optional int32 frequency1_khz = 6;
5500 optional int32 time1_millis = 7;
5501 optional int32 frequency2_khz = 8;
5502 optional int32 time2_millis = 9;
5503 optional int32 frequency3_khz = 10;
5504 optional int32 time3_millis = 11;
5505 optional int32 frequency4_khz = 12;
5506 optional int32 time4_millis = 13;
5507 optional int32 frequency5_khz = 14;
5508 optional int32 time5_millis = 15;
5509 optional int32 frequency6_khz = 16;
5510 optional int32 time6_millis = 17;
5511 optional int32 frequency7_khz = 18;
5512 optional int32 time7_millis = 19;
5513 optional int32 frequency8_khz = 20;
5514 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005515}
Bookatz75ee6042018-11-09 12:27:37 -08005516
5517/**
Bookatz366a4432018-11-20 09:42:33 -08005518 * Pulls information about the device's build.
5519 */
5520message BuildInformation {
5521 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5522 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5523 optional string fingerprint = 1;
5524
5525 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5526 optional string brand = 2;
5527
5528 // Build.PRODUCT. The name of the overall product.
5529 optional string product = 3;
5530
5531 // Build.DEVICE. The name of the industrial design.
5532 optional string device = 4;
5533
5534 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5535 optional string version_release = 5;
5536
5537 // Build.ID. E.g. a label like "M4-rc20".
5538 optional string id = 6;
5539
5540 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5541 // represent this build.
5542 optional string version_incremental = 7;
5543
5544 // Build.TYPE. The type of build, like "user" or "eng".
5545 optional string type = 8;
5546
5547 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5548 optional string tags = 9;
5549}
5550
5551/**
Adam He420947c2019-01-23 15:59:09 -08005552 * Logs information about mismatched caller for content capture.
5553 *
5554 * Logged from:
5555 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5556 */
5557message ContentCaptureCallerMismatchReported {
5558 optional string intended_package = 1;
5559 optional string calling_package = 2;
5560}
5561
5562/**
5563 * Logs information about content capture service events.
5564 *
5565 * Logged from:
5566 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5567 */
5568message ContentCaptureServiceEvents {
5569 // The type of event.
5570 enum Event {
5571 UNKNOWN = 0;
5572 ON_CONNECTED = 1;
5573 ON_DISCONNECTED = 2;
5574 SET_WHITELIST = 3;
5575 SET_DISABLED = 4;
5576 ON_USER_DATA_REMOVED = 5;
5577 }
5578 optional Event event = 1;
5579 // component/package of content capture service.
5580 optional string service_info = 2;
5581 // component/package of target.
5582 // it's a concatenated list of component/package for SET_WHITELIST event
5583 // separated by " ".
5584 optional string target_info = 3;
5585}
5586
5587/**
5588 * Logs information about content capture session events.
5589 *
5590 * Logged from:
5591 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5592 */
5593message ContentCaptureSessionEvents {
5594 // The type of event.
5595 enum Event {
5596 UNKNOWN = 0;
5597 ON_SESSION_STARTED = 1;
5598 ON_SESSION_FINISHED = 2;
5599 SESSION_NOT_CREATED = 3;
5600 }
5601 optional int32 session_id = 1;
5602 optional Event event = 2;
5603 // (n/a on session finished)
5604 optional int32 state_flags = 3;
5605 // component/package of content capture service.
5606 optional string service_info = 4;
5607 // component/package of app.
5608 // (n/a on session finished)
5609 optional string app_info = 5;
5610 optional bool is_child_session = 6;
5611}
5612
5613/**
5614 * Logs information about session being flushed.
5615 *
5616 * Logged from:
5617 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5618 */
5619message ContentCaptureFlushed {
5620 optional int32 session_id = 1;
5621 // component/package of content capture service.
5622 optional string service_info = 2;
5623 // component/package of app.
5624 optional string app_info = 3;
5625 // session start/finish events
5626 optional int32 child_session_started = 4;
5627 optional int32 child_session_finished = 5;
5628 // count of view events.
5629 optional int32 view_appeared_count = 6;
5630 optional int32 view_disappeared_count = 7;
5631 optional int32 view_text_changed_count = 8;
5632
5633 // Flush stats.
5634 optional int32 max_events = 9;
5635 optional int32 idle_flush_freq = 10;
5636 optional int32 text_flush_freq = 11;
5637 optional int32 flush_reason = 12;
5638}
5639
5640/**
Bookatz75ee6042018-11-09 12:27:37 -08005641 * Pulls on-device BatteryStats power use calculations for the overall device.
5642 */
5643message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005644 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5645 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5646 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5647 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08005648}
5649
5650/**
5651 * Pulls on-device BatteryStats power use calculations broken down by uid.
5652 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5653 * that is attributed to non-uid items. They must all be included to get the total power use.
5654 */
5655message DeviceCalculatedPowerBlameUid {
5656 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5657 optional int32 uid = 1 [(is_uid) = true];
5658
Bookatz3dbc13a2018-12-21 12:16:51 -08005659 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5660 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5661 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08005662}
5663
5664/**
5665 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5666 * drain type.
5667 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5668 * is attributed uids. They must all be included to get the total power use.
5669 */
5670message DeviceCalculatedPowerBlameOther {
5671 // The type of item whose power use is being reported.
5672 enum DrainType {
5673 AMBIENT_DISPLAY = 0;
5674 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5675 BLUETOOTH = 2;
5676 CAMERA = 3;
5677 // Cell-standby
5678 CELL = 4;
5679 FLASHLIGHT = 5;
5680 IDLE = 6;
5681 MEMORY = 7;
5682 // Amount that total computed drain exceeded the drain estimated using the
5683 // battery level changes and capacity.
5684 OVERCOUNTED = 8;
5685 PHONE = 9;
5686 SCREEN = 10;
5687 // Amount that total computed drain was below the drain estimated using the
5688 // battery level changes and capacity.
5689 UNACCOUNTED = 11;
5690 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5691 WIFI = 13;
5692 }
5693 optional DrainType drain_type = 1;
5694
Bookatz3dbc13a2018-12-21 12:16:51 -08005695 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5696 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5697 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005698}
arangelov4e994062018-11-13 16:12:38 +00005699
5700/**
5701 * Logs device policy features.
5702 *
5703 * Logged from:
5704 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5705 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5706 */
5707message DevicePolicyEvent {
5708 // The event id - unique for each event.
5709 optional android.stats.devicepolicy.EventId event_id = 1;
5710 // The admin package name.
5711 optional string admin_package_name = 2;
5712 // A generic integer parameter.
5713 optional int32 integer_value = 3;
5714 // A generic boolean parameter.
5715 optional bool boolean_value = 4;
5716 // A parameter specifying a time period in milliseconds.
5717 optional uint64 time_period_millis = 5;
5718 // A parameter specifying a list of package names, bundle extras or string parameters.
5719 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5720}
shawnlinea5b66b2018-11-13 15:05:29 +08005721
5722/**
5723 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5724 *
5725 * Logged from:
5726 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5727 */
5728message DocsUILaunchReported {
5729 optional android.stats.docsui.LaunchAction launch_action = 1;
5730 optional bool has_initial_uri = 2;
5731 optional android.stats.docsui.MimeType mime_type = 3;
5732 optional android.stats.docsui.Root initial_root = 4;
5733}
5734
5735/**
5736 * Logs root/app visited event in file managers/picker. Call this when the user
5737 * taps on root/app in hamburger menu.
5738 *
5739 * Logged from:
5740 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5741 */
5742message DocsUIRootVisitedReported {
5743 optional android.stats.docsui.ContextScope scope = 1;
5744 optional android.stats.docsui.Root root = 2;
5745}
5746
5747/**
5748 * Logs file operation stats. Call this when a file operation has completed.
5749 *
5750 * Logged from:
5751 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5752 */
5753message DocsUIFileOperationReported {
5754 optional android.stats.docsui.Provider provider = 1;
5755 optional android.stats.docsui.FileOperation file_op = 2;
5756}
5757
5758/**
5759 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5760 * mode.
5761 *
5762 * Logged from:
5763 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5764 */
5765message DocsUIFileOperationCopyMoveModeReported {
5766 optional android.stats.docsui.FileOperation file_op = 1;
5767 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5768}
5769
5770
5771/**
5772 * Logs file sub operation stats. Call this when a file operation has failed.
5773 *
5774 * Logged from:
5775 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5776 */
5777message DocsUIFileOperationFailureReported {
5778 optional android.stats.docsui.Authority authority = 1;
5779 optional android.stats.docsui.SubFileOperation sub_op = 2;
5780}
5781
5782/**
5783* Logs the cancellation of a file operation. Call this when a job is canceled
5784*
5785* Logged from:
5786* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5787*/
5788message DocsUIFileOperationCanceledReported {
5789 optional android.stats.docsui.FileOperation file_op = 1;
5790}
5791
5792/**
5793 * Logs startup time in milliseconds.
5794 *
5795 * Logged from:
5796 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5797 */
5798message DocsUIStartupMsReported {
5799 optional int32 startup_millis = 1;
5800}
5801
5802/**
5803 * Logs the action that was started by user.
5804 *
5805 * Logged from:
5806 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5807 */
5808message DocsUIUserActionReported {
5809 optional android.stats.docsui.UserAction action = 1;
5810}
5811
5812/**
5813 * Logs the invalid type when invalid scoped access is requested.
5814 *
5815 * Logged from:
5816 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5817 */
5818message DocsUIInvalidScopedAccessRequestReported {
5819 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005820}
Ben Murdochbab399f2018-12-06 11:01:38 +00005821
5822/**
shawnlina75e82d2019-01-07 10:31:12 +08005823 * Logs the package name that launches docsui picker mode.
5824 *
5825 * Logged from:
5826 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5827 */
5828message DocsUIPickerLaunchedFromReported {
5829 optional string package_name = 1;
5830}
5831
5832/**
5833 * Logs the search type.
5834 *
5835 * Logged from:
5836 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5837 */
5838message DocsUISearchTypeReported {
5839 optional android.stats.docsui.SearchType search_type = 1;
5840}
5841
5842/**
5843 * Logs the search mode.
5844 *
5845 * Logged from:
5846 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5847 */
5848message DocsUISearchModeReported {
5849 optional android.stats.docsui.SearchMode search_mode = 1;
5850}
5851
5852/**
5853 * Logs the pick result information.
5854 *
5855 * Logged from:
5856 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5857 */
5858message DocsUIPickResultReported {
5859 optional int32 total_action_count = 1;
5860 optional int64 duration_millis = 2;
5861 optional int32 file_count= 3;
5862 optional bool is_searching = 4;
5863 optional android.stats.docsui.Root picked_from = 5;
5864 optional android.stats.docsui.MimeType mime_type = 6;
5865 optional int32 repeatedly_pick_times = 7;
5866}
5867
5868/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005869 * Logs when an app's memory is compacted.
5870 *
5871 * Logged from:
5872 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5873 */
5874message AppCompacted {
5875 // The pid of the process being compacted.
5876 optional int32 pid = 1;
5877
5878 // The name of the process being compacted.
5879 optional string process_name = 2;
5880
5881 // The type of compaction.
5882 enum Action {
5883 UNKNOWN = 0;
5884 SOME = 1;
5885 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005886 PERSISTENT = 3;
5887 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005888 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005889 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005890
5891 // Total RSS in kilobytes consumed by the process prior to compaction.
5892 optional int64 before_rss_total_kilobytes = 4;
5893
5894 // File RSS in kilobytes consumed by the process prior to compaction.
5895 optional int64 before_rss_file_kilobytes = 5;
5896
5897 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5898 optional int64 before_rss_anon_kilobytes = 6;
5899
5900 // Swap in kilobytes consumed by the process prior to compaction.
5901 optional int64 before_swap_kilobytes = 7;
5902
5903 // Total RSS in kilobytes consumed by the process after compaction.
5904 optional int64 after_rss_total_kilobytes = 8;
5905
5906 // File RSS in kilobytes consumed by the process after compaction.
5907 optional int64 after_rss_file_kilobytes = 9;
5908
5909 // Anonymous RSS in kilobytes consumed by the process after compaction.
5910 optional int64 after_rss_anon_kilobytes = 10;
5911
5912 // Swap in kilobytes consumed by the process after compaction.
5913 optional int64 after_swap_kilobytes = 11;
5914
5915 // The time taken to perform compaction in milliseconds.
5916 optional int64 time_to_compact_millis = 12;
5917
5918 // The last compaction action performed for this app.
5919 optional Action last_action = 13;
5920
Ben Murdoch01720b82018-12-19 18:03:44 +00005921 // The last time that compaction was attempted on this process in milliseconds
5922 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5923 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005924
Ben Murdoch885c21b2019-03-15 18:02:04 +00005925 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005926 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005927
5928 // The process state at the time of compaction.
5929 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005930
5931 // Free ZRAM in kilobytes before compaction.
5932 optional int64 before_zram_free_kilobytes = 17;
5933
5934 // Free ZRAM in kilobytes after compaction.
5935 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005936}
lifr157fc552018-12-12 16:38:04 +08005937
5938/**
lifrb6b90b62019-03-29 00:40:17 +08005939 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5940 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5941 *
lifr1f74b052019-04-16 22:16:30 +08005942 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5943 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5944 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5945 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005946 */
5947message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005948 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005949
lifr1f74b052019-04-16 22:16:30 +08005950 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005951
5952 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005953 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005954
lifr1f74b052019-04-16 22:16:30 +08005955 // Only valid for event_type = EVENT_GETADDRINFO.
5956 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005957
lifr1f74b052019-04-16 22:16:30 +08005958 // Flags passed to android_res_nsend() defined in multinetwork.h
5959 // Only valid for event_type = EVENT_RESNSEND.
5960 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005961
lifrad9becc2019-05-20 11:04:41 +08005962 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005963
5964 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005965 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005966
5967 // Additional pass-through fields opaque to statsd.
5968 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005969 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005970
5971 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5972 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005973}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005974
5975/**
5976 * Logs when a data stall event occurs.
5977 *
5978 * Log from:
5979 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5980 */
5981message DataStallEvent {
5982 // Data stall evaluation type.
5983 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5984 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5985 optional int32 evaluation_type = 1;
5986 // See definition in data_stall_event.proto.
5987 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5988 // See definition in data_stall_event.proto.
5989 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5990 // See definition in data_stall_event.proto.
5991 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5992 // See definition in data_stall_event.proto.
5993 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5994 // See definition in data_stall_event.proto.
5995 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5996}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005997
5998/*
5999 * Logs when RescueParty resets some set of experiment flags.
6000 *
6001 * Logged from:
6002 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6003 */
6004message RescuePartyResetReported {
6005 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6006 optional int32 rescue_level = 1;
6007}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006008
6009/**
6010 * Logs when signed config is received from an APK, and if that config was applied successfully.
6011 * Logged from:
6012 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6013 */
6014message SignedConfigReported {
6015 enum Type {
6016 UNKNOWN_TYPE = 0;
6017 GLOBAL_SETTINGS = 1;
6018 }
6019 optional Type type = 1;
6020
6021 // The final status of the signed config received.
6022 enum Status {
6023 UNKNOWN_STATUS = 0;
6024 APPLIED = 1;
6025 BASE64_FAILURE_CONFIG = 2;
6026 BASE64_FAILURE_SIGNATURE = 3;
6027 SECURITY_EXCEPTION = 4;
6028 INVALID_CONFIG = 5;
6029 OLD_CONFIG = 6;
6030 SIGNATURE_CHECK_FAILED = 7;
6031 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006032 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006033 }
6034 optional Status status = 2;
6035
6036 // The version of the signed config processed.
6037 optional int32 version = 3;
6038
6039 // The package name that the config was extracted from.
6040 optional string from_package = 4;
6041
6042 enum Key {
6043 NO_KEY = 0;
6044 DEBUG = 1;
6045 PRODUCTION = 2;
6046 }
6047 // Which key was used to verify the config.
6048 optional Key verified_with = 5;
6049}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006050
6051/*
6052 * Logs GNSS Network-Initiated (NI) location events.
6053 *
6054 * Logged from:
6055 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6056 */
6057message GnssNiEventReported {
6058 // The type of GnssNiEvent.
6059 enum EventType {
6060 UNKNOWN = 0;
6061 NI_REQUEST = 1;
6062 NI_RESPONSE = 2;
6063 }
6064 optional EventType event_type = 1;
6065
6066 // An ID generated by HAL to associate NI notifications and UI responses.
6067 optional int32 notification_id = 2;
6068
6069 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006070 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006071
6072 // NI requires notification.
6073 optional bool need_notify = 4;
6074
6075 // NI requires verification.
6076 optional bool need_verify = 5;
6077
6078 // NI requires privacy override, no notification/minimal trace.
6079 optional bool privacy_override = 6;
6080
6081 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6082 // seconds.
6083 optional int32 timeout = 7;
6084
6085 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006086 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006087
6088 // String representing the requester of the network inititated location request.
6089 optional string requestor_id = 9;
6090
6091 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6092 // network initiated location request.
6093 optional string text = 10;
6094
6095 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006096 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006097
6098 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006099 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006100
6101 // True if SUPL ES is enabled.
6102 optional bool is_supl_es_enabled = 13;
6103
6104 // True if GNSS location is enabled.
6105 optional bool is_location_enabled = 14;
6106
6107 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006108 optional android.server.location.GnssUserResponseType user_response = 15;
6109}
6110
6111/**
6112 * Logs GNSS non-framework (NFW) location notification.
6113 *
6114 * Logged from:
6115 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6116 */
6117message GnssNfwNotificationReported {
6118 // Package name of the Android proxy application representing the non-framework entity that
6119 // requested location. Set to empty string if unknown.
6120 optional string proxy_app_package_name = 1;
6121
6122 // Protocol stack that initiated the non-framework location request.
6123 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6124
6125 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6126 // set to empty string. This field is opaque to the framework and used for logging purposes.
6127 optional string other_protocol_stack_name = 3;
6128
6129 // Source initiating/receiving the location information.
6130 optional android.server.location.NfwRequestor requestor = 4;
6131
6132 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6133 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6134 // and used for logging purposes.
6135 optional string requestor_id = 5;
6136
6137 // Indicates whether location information was provided for this request.
6138 optional android.server.location.NfwResponseType response_type = 6;
6139
6140 // True if the device is in user initiated emergency session.
6141 optional bool in_emergency_mode = 7;
6142
6143 // True if cached location is provided.
6144 optional bool is_cached_location = 8;
6145
6146 // True if proxy app permission mismatch between framework and GNSS HAL.
6147 optional bool is_permission_mismatched = 9;
6148}
6149
6150/**
6151 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6152 *
6153 * Logged from:
6154 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6155 */
6156message GnssConfigurationReported {
6157 // SUPL host name.
6158 optional string supl_host = 1;
6159
6160 // SUPL port number.
6161 optional int32 supl_port = 2;
6162
6163 // C2K host name.
6164 optional string c2k_host = 3;
6165
6166 // C2K port number.
6167 optional int32 c2k_port = 4;
6168
6169 // The SUPL version requested by Carrier.
6170 optional int32 supl_ver = 5;
6171
6172 // The SUPL mode.
6173 optional android.server.location.SuplMode supl_mode = 6;
6174
6175 // True if NI emergency SUPL restrictions is enabled.
6176 optional bool supl_es = 7;
6177
6178 // LTE Positioning Profile settings
6179 optional android.server.location.LppProfile lpp_profile = 8;
6180
6181 // Positioning protocol on A-Glonass system.
6182 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6183
6184 // True if emergency PDN is used. Otherwise, regular PDN is used.
6185 optional bool use_emergency_pdn_for_emergency_supl= 10;
6186
6187 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6188 optional android.server.location.GpsLock gps_lock = 11;
6189
6190 // Number of seconds to extend the emergency session duration post emergency call.
6191 optional int32 es_extension_sec = 12;
6192
6193 // The full list of package names of proxy Android applications representing the non-framework
6194 // location access entities (on/off the device) for which the framework user has granted
6195 // non-framework location access permission. The package names are concatenated in one string
6196 // with spaces as separators.
6197 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006198}
Jack Yu95b64f32018-12-13 18:26:11 +08006199
6200/**
6201 * Logs when a NFC device's error occurred.
6202 * Logged from:
6203 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6204 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6205 */
6206message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006207 enum Type {
6208 UNKNOWN = 0;
6209 CMD_TIMEOUT = 1;
6210 ERROR_NOTIFICATION = 2;
6211 AID_OVERFLOW = 3;
6212 }
6213 optional Type type = 1;
6214 // If it's nci cmd timeout, log the timeout command.
6215 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006216
Alex Salod7c3eef2019-01-25 14:43:27 -08006217 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006218}
6219
6220/**
6221 * Logs when a NFC device's state changed event
6222 * Logged from:
6223 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6224 */
6225message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006226 enum State {
6227 UNKNOWN = 0;
6228 OFF = 1;
6229 ON = 2;
6230 ON_LOCKED = 3; // Secure Nfc enabled.
6231 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6232 }
6233 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006234}
6235
6236/**
6237 * Logs when a NFC Beam Transaction occurred.
6238 * Logged from:
6239 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6240 */
6241message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006242 enum Operation {
6243 UNKNOWN = 0;
6244 SEND = 1;
6245 RECEIVE = 2;
6246 }
6247 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006248}
6249
6250/**
6251 * Logs when a NFC Card Emulation Transaction occurred.
6252 * Logged from:
6253 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6254 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6255 */
6256message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006257 enum Category {
6258 UNKNOWN = 0;
6259 HCE_PAYMENT = 1;
6260 HCE_OTHER = 2;
6261 OFFHOST = 3;
6262 }
6263 // Transaction belongs to HCE payment or HCE other category, or offhost.
6264 optional Category category = 1;
6265 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6266 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006267}
6268
6269/**
6270 * Logs when a NFC Tag event occurred.
6271 * Logged from:
6272 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6273 */
6274message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006275 enum Type {
6276 UNKNOWN = 0;
6277 URL = 1;
6278 BT_PAIRING = 2;
6279 PROVISION = 3;
6280 WIFI_CONNECT = 4;
6281 APP_LAUNCH = 5;
6282 OTHERS = 6;
6283 }
6284 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006285}
6286
6287/**
6288 * Logs when Hce transaction triggered
6289 * Logged from:
6290 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6291 */
6292message NfcHceTransactionOccurred {
6293 // The latency period(in microseconds) it took for the first HCE data
6294 // exchange.
6295 optional uint32 latency_micros = 1;
6296}
6297
6298/**
6299 * Logs when SecureElement state event changed
6300 * Logged from:
6301 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6302 */
6303message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006304 enum State {
6305 UNKNOWN = 0;
6306 INITIALIZED = 1;
6307 DISCONNECTED = 2;
6308 CONNECTED = 3;
6309 HALCRASH = 4;
6310 }
6311 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006312
Alex Salod7c3eef2019-01-25 14:43:27 -08006313 optional string state_change_reason = 2;
6314 // SIMx or eSEx.
6315 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006316}
6317
6318/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006319 * Information about a permission grant request
6320 */
6321message PermissionGrantRequestResultReported {
6322 // unique value identifying an API call. A API call might result in multiple of these atoms
6323 optional int64 request_id = 1;
6324
6325 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006326 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006327
6328 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006329 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006330
6331 // The permission to be granted
6332 optional string permission_name = 4;
6333
6334 // If the permission was explicitly requested via the API or added by the system
6335 optional bool is_implicit = 5;
6336
6337 enum Result {
6338 UNDEFINED = 0;
6339 // permission request was ignored
6340 IGNORED = 1;
6341 // permission request was ignored because it was user fixed
6342 IGNORED_USER_FIXED = 2;
6343 // permission request was ignored because it was policy fixed
6344 IGNORED_POLICY_FIXED = 3;
6345 // permission was granted by user action
6346 USER_GRANTED = 4;
6347 // permission was automatically granted
6348 AUTO_GRANTED = 5;
6349 // permission was denied by user action
6350 USER_DENIED = 6;
6351 // permission was denied with prejudice by the user
6352 USER_DENIED_WITH_PREJUDICE = 7;
6353 // permission was automatically denied
6354 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006355 // permission request was ignored because permission is restricted
6356 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006357 // one time permission was granted by user action
6358 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006359 // user ignored request by leaving the request screen without choosing any option
6360 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006361 // user granted the permission after being linked to settings
6362 USER_GRANTED_IN_SETTINGS = 12;
6363 // user denied the permission after being linked to settings
6364 USER_DENIED_IN_SETTINGS = 13;
6365 // user denied the permission with prejudice after being linked to settings
6366 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6367 // permission was automatically revoked after one-time permission expired
6368 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006369 }
6370 // The result of the permission grant
6371 optional Result result = 6;
6372}
6373
6374/**
Jack Yu95b64f32018-12-13 18:26:11 +08006375 * Logs when Omapi API used
6376 * Logged from:
6377 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6378 */
6379message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006380 enum Operation {
6381 UNKNOWN = 0;
6382 OPEN_CHANNEL = 1;
6383 }
6384 optional Operation operation = 1;
6385 // SIMx or eSEx.
6386 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006387
Alex Salod7c3eef2019-01-25 14:43:27 -08006388 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006389}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006390
6391/**
Alex Saloa060aee2019-01-21 14:36:41 -08006392 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6393 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006394 * Logged from:
6395 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6396 */
6397message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006398 optional int64 dispatch_latency_millis = 1;
6399}
6400
6401/**
6402 * Logs AttentionManagerService attention check result.
6403 *
6404 * Logged from:
6405 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6406 */
6407message AttentionManagerServiceResultReported {
6408 // See core/java/android/service/attention/AttentionService.java
6409 enum AttentionCheckResult {
6410 UNKNOWN = 20;
6411 ATTENTION_SUCCESS_ABSENT = 0;
6412 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006413 ATTENTION_FAILURE_UNKNOWN = 2;
6414 ATTENTION_FAILURE_CANCELLED = 3;
6415 ATTENTION_FAILURE_PREEMPTED = 4;
6416 ATTENTION_FAILURE_TIMED_OUT = 5;
6417 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006418 }
6419 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006420}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006421
6422/**
6423 * Logs when an adb connection changes state.
6424 *
6425 * Logged from:
6426 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6427 */
6428message AdbConnectionChanged {
6429 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6430 // previously selected for this system.
6431 optional int64 last_connection_time_millis = 1;
6432
6433 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6434 // to reconnect via adb without user interaction.
6435 optional int64 auth_window_millis = 2;
6436
6437 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6438 optional android.debug.AdbConnectionStateEnum state = 3;
6439
6440 // True if the 'always allow' option was selected for this system.
6441 optional bool always_allow = 4;
6442}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006443
6444/*
6445 * Logs the reported speech DSP status.
6446 *
6447 * Logged from:
6448 * Vendor audio implementation.
6449 */
6450message SpeechDspStatReported {
6451 // The total Speech DSP uptime in milliseconds.
6452 optional int32 total_uptime_millis = 1;
6453 // The total Speech DSP downtime in milliseconds.
6454 optional int32 total_downtime_millis = 2;
6455 optional int32 total_crash_count = 3;
6456 optional int32 total_recover_count = 4;
6457}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006458
6459/**
6460 * Logs USB connector contaminant status.
6461 *
6462 * Logged from: USB Service.
6463 */
6464message UsbContaminantReported {
6465 optional string id = 1;
6466 optional android.service.usb.ContaminantPresenceStatus status = 2;
6467}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006468
6469/**
6470 * This atom is for debugging purpose.
6471 */
6472message DebugElapsedClock {
6473 // Monotically increasing value for each pull.
6474 optional int64 pull_count = 1;
6475 // Time from System.elapsedRealtime.
6476 optional int64 elapsed_clock_millis = 2;
6477 // Time from System.elapsedRealtime.
6478 optional int64 same_elapsed_clock_millis = 3;
6479 // Diff between current elapsed time and elapsed time from previous pull.
6480 optional int64 elapsed_clock_diff_millis = 4;
6481
6482 enum Type {
6483 TYPE_UNKNOWN = 0;
6484 ALWAYS_PRESENT = 1;
6485 PRESENT_ON_ODD_PULLS = 2;
6486 }
6487 // Type of behavior for the pulled data.
6488 optional Type type = 5;
6489}
6490
6491/**
6492 * This atom is for debugging purpose.
6493 */
6494message DebugFailingElapsedClock {
6495 // Monotically increasing value for each pull.
6496 optional int64 pull_count = 1;
6497 // Time from System.elapsedRealtime.
6498 optional int64 elapsed_clock_millis = 2;
6499 // Time from System.elapsedRealtime.
6500 optional int64 same_elapsed_clock_millis = 3;
6501 // Diff between current elapsed time and elapsed time from previous pull.
6502 optional int64 elapsed_clock_diff_millis = 4;
6503}
Steven Wuacef6bb2019-01-23 14:21:17 -05006504
6505/** Logs System UI bubbles event changed.
6506 *
6507 * Logged from:
6508 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6509 */
6510message BubbleUIChanged {
6511
6512 // The app package that is posting the bubble.
6513 optional string package_name = 1;
6514
6515 // The notification channel that is posting the bubble.
6516 optional string notification_channel = 2;
6517
6518 // The notification id associated with the posted bubble.
6519 optional int32 notification_id = 3;
6520
6521 // The position of the bubble within the bubble stack.
6522 optional int32 position = 4;
6523
6524 // The total number of bubbles within the bubble stack.
6525 optional int32 total_number = 5;
6526
6527 // User interactions with the bubble.
6528 enum Action {
6529 UNKNOWN = 0;
6530 POSTED = 1;
6531 UPDATED = 2;
6532 EXPANDED = 3;
6533 COLLAPSED = 4;
6534 DISMISSED = 5;
6535 STACK_DISMISSED = 6;
6536 STACK_MOVED = 7;
6537 HEADER_GO_TO_APP = 8;
6538 HEADER_GO_TO_SETTINGS = 9;
6539 PERMISSION_OPT_IN = 10;
6540 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006541 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006542 SWIPE_LEFT = 13;
6543 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006544 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04006545 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006546 }
6547 optional Action action = 6;
6548
6549 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6550 optional float normalized_x_position = 7;
6551 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006552
6553 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6554 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006555
6556 // Whether the bubble is an on-going one.
6557 optional bool is_ongoing = 10;
6558
6559 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006560 // This is deprecated and the value should be ignored.
6561 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006562}
Kweku Adams8845d012018-12-11 20:06:45 -08006563
6564/**
Steven Wu552f63f2019-02-05 13:41:36 -05006565 * Logs System UI bubbles developer errors.
6566 *
6567 * Logged from:
6568 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6569 */
6570message BubbleDeveloperErrorReported {
6571
6572 // The app package that is posting the bubble.
6573 optional string package_name = 1;
6574
6575 // Bubble developer error type enums.
6576 enum Error {
6577 UNKNOWN = 0;
6578 ACTIVITY_INFO_MISSING = 1;
6579 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6580 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6581 }
6582 optional Error error = 2 [default = UNKNOWN];
6583}
6584
6585/**
Kweku Adams8845d012018-12-11 20:06:45 -08006586 * Logs that a constraint for a scheduled job has changed.
6587 *
6588 * Logged from:
6589 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6590 */
6591message ScheduledJobConstraintChanged {
6592 repeated AttributionNode attribution_node = 1;
6593
6594 // Name of the job.
6595 optional string job_name = 2;
6596
6597 optional com.android.server.job.ConstraintEnum constraint = 3;
6598
6599 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006600 UNKNOWN = 0;
6601 UNSATISFIED = 1;
6602 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006603 }
6604 optional State state = 4;
6605}
Alex Salod7c3eef2019-01-25 14:43:27 -08006606
6607/**
6608 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6609 * returns true.
6610 *
6611 * Logged from:
6612 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6613 */
6614message ScreenTimeoutExtensionReported {
6615 // Describes how many times in a row did the power manager reset the screen off timeout.
6616 optional uint32 consecutive_timeout_extended_count = 1;
6617}
Hui Yu885aca12019-01-10 17:11:34 -08006618
6619/*
6620* Logs number of milliseconds it takes to start a process.
6621* The definition of app process start time is from the app launch time to
6622* the time that Zygote finished forking the app process and loaded the
6623* application package's java classes.
6624
6625* This metric is different from AppStartOccurred which is for foreground
6626* activity only.
6627
6628* ProcessStartTime can report all processes (both foreground and background)
6629* start time.
6630*
6631* Logged from:
6632* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6633*/
6634message ProcessStartTime {
6635 // The uid of the ProcessRecord.
6636 optional int32 uid = 1 [(is_uid) = true];
6637
6638 // The process pid.
6639 optional int32 pid = 2;
6640
6641 // The process name.
6642 // Usually package name, "system" for system server.
6643 // Provided by ActivityManagerService.
6644 optional string process_name = 3;
6645
6646 enum StartType {
6647 UNKNOWN = 0;
6648 WARM = 1;
6649 HOT = 2;
6650 COLD = 3;
6651 }
6652
6653 // The start type.
6654 optional StartType type = 4;
6655
6656 // The elapsed realtime at the start of the process.
6657 optional int64 process_start_time_millis = 5;
6658
6659 // Number of milliseconds it takes to reach bind application.
6660 optional int32 bind_application_delay_millis = 6;
6661
6662 // Number of milliseconds it takes to finish start of the process.
6663 optional int32 process_start_delay_millis = 7;
6664
6665 // hostingType field in ProcessRecord, the component type such as "activity",
6666 // "service", "content provider", "broadcast" or other strings.
6667 optional string hosting_type = 8;
6668
6669 // hostingNameStr field in ProcessRecord. The component class name that runs
6670 // in this process.
6671 optional string hosting_name = 9;
6672}
6673
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006674/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006675 * Track Media Codec usage
6676 * Logged from:
6677 * frameworks/av/media/libstagefright/MediaCodec.cpp
6678 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6679 */
6680message MediametricsCodecReported {
6681 optional int64 timestamp_nanos = 1;
6682 optional string package_name = 2;
6683 optional int64 package_version_code = 3;
6684 optional int64 media_apex_version = 4;
6685
6686 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6687}
6688
6689/**
6690 * Track Media Extractor (pulling video/audio streams out of containers) usage
6691 * Logged from:
6692 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6693 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6694 */
6695message MediametricsExtractorReported {
6696 optional int64 timestamp_nanos = 1;
6697 optional string package_name = 2;
6698 optional int64 package_version_code = 3;
6699 optional int64 media_apex_version = 4;
6700
6701 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6702}
6703
6704/**
6705 * Track how we arbitrate between microphone/input requests.
6706 * Logged from
6707 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6708 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6709 */
6710message MediametricsAudiopolicyReported {
6711 optional int64 timestamp_nanos = 1;
6712 optional string package_name = 2;
6713 optional int64 package_version_code = 3;
6714 optional int64 media_apex_version = 4;
6715
6716 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6717}
6718
6719/**
6720 * Track how we arbitrate between microphone requests.
6721 * Logged from
6722 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6723 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6724 */
6725message MediametricsAudiorecordReported {
6726 optional int64 timestamp_nanos = 1;
6727 optional string package_name = 2;
6728 optional int64 package_version_code = 3;
6729 optional int64 media_apex_version = 4;
6730
6731 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6732}
6733
6734/**
6735 * Track how we arbitrate between microphone/input requests.
6736 * Logged from
6737 * frameworks/av/media/libnblog/ReportPerformance.cpp
6738 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6739 */
6740message MediametricsAudiothreadReported {
6741 optional int64 timestamp_nanos = 1;
6742 optional string package_name = 2;
6743 optional int64 package_version_code = 3;
6744 optional int64 media_apex_version = 4;
6745
6746 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6747}
6748
6749/**
6750 * Track how we arbitrate between microphone/input requests.
6751 * Logged from
6752 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6753 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6754 */
6755message MediametricsAudiotrackReported {
6756 optional int64 timestamp_nanos = 1;
6757 optional string package_name = 2;
6758 optional int64 package_version_code = 3;
6759 optional int64 media_apex_version = 4;
6760
6761 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6762}
6763
6764/**
6765 * Track information about DRM framework performance
6766 * Logged from
6767 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6768 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6769 */
6770message MediametricsMediadrmReported {
6771 optional int64 timestamp_nanos = 1;
6772 optional string package_name = 2;
6773 optional int64 package_version_code = 3;
6774 optional int64 media_apex_version = 4;
6775
6776 // vendor+description tell about which DRM plugin is in use on this device
6777 optional string vendor = 5;
6778 optional string description = 6;
6779 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6780 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6781}
6782
6783/**
6784 * Track information about the widevine DRM plugin performance
6785 * Logged from
6786 * vendor/widevine/libwvdrmengine/cdm/metrics
6787 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6788 */
6789message MediametricsDrmWidevineReported {
6790 optional int64 timestamp_nanos = 1;
6791 optional string package_name = 2;
6792 optional int64 package_version_code = 3;
6793 optional int64 media_apex_version = 4;
6794
6795 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6796}
6797
6798/**
6799 * Track information about recordings (e.g. camcorder)
6800 * Logged from
6801 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6802 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6803 */
6804message MediametricsRecorderReported {
6805 optional int64 timestamp_nanos = 1;
6806 optional string package_name = 2;
6807 optional int64 package_version_code = 3;
6808 optional int64 media_apex_version = 4;
6809
6810 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6811}
6812
6813/**
6814 * Track Media Player usage
6815 * Logged from:
6816 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6817 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6818 */
6819message MediametricsNuPlayerReported {
6820 optional int64 timestamp_nanos = 1;
6821 optional string package_name = 2;
6822 optional int64 package_version_code = 3;
6823 optional int64 media_apex_version = 4;
6824
6825 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6826}
6827
6828/**
Robert Shiha4beed32019-08-19 14:15:23 -07006829 * Track Legacy DRM usage
6830 * Logged from
6831 * frameworks/av/drm/drmserver/DrmManager.cpp
6832 */
6833message MediametricsDrmManagerReported {
6834 optional int64 timestamp_nanos = 1;
6835 optional string package_name = 2;
6836 optional int64 package_version_code = 3;
6837 optional int64 media_apex_version = 4;
6838
6839 enum Method {
6840 METHOD_NOT_FOUND = -1;
6841 GET_CONSTRAINTS = 0;
6842 GET_METADATA = 1;
6843 CAN_HANDLE = 2;
6844 PROCESS_DRM_INFO = 3;
6845 ACQUIRE_DRM_INFO = 4;
6846 SAVE_RIGHTS = 5;
6847 GET_ORIGINAL_MIME_TYPE = 6;
6848 GET_DRM_OBJECT_TYPE = 7;
6849 CHECK_RIGHTS_STATUS = 8;
6850 REMOVE_RIGHTS = 9;
6851 REMOVE_ALL_RIGHTS = 10;
6852 OPEN_CONVERT_SESSION = 11;
6853 OPEN_DECRYPT_SESSION = 12;
6854 }
6855
6856 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6857 optional string plugin_id = 5;
6858 optional string description = 6;
6859 optional Method method = 7;
6860 optional string mime_types = 8;
6861}
6862
6863/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006864 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00006865 * Pulled from: StatsCompanionService
6866*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006867message DangerousPermissionState {
6868 // Name of the permission
6869 optional string permission_name = 1;
6870
6871 // Uid of the package
6872 optional int32 uid = 2 [(is_uid) = true];
6873
6874 // Package requesting the permission
6875 optional string package_name = 3;
6876
6877 // If the permission is granted to the uid
6878 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006879
6880 // Permission flags as per android.content.pm.PermissionFlags
6881 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006882}
6883
Michael Groover4a0ca942019-01-24 17:41:25 -08006884/**
6885 * Logs when a package is denied access to a device identifier based on the new access requirements.
6886 *
6887 * Logged from:
6888 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6889 */
6890message DeviceIdentifierAccessDenied {
6891 // The name of the package denied access to the requested device identifier.
6892 optional string package_name = 1;
6893
6894 // The name of the device identifier method the package attempted to invoke.
6895 optional string method_name = 2;
6896
6897 // True if the package is preinstalled.
6898 optional bool is_preinstalled = 3;
6899
6900 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006901 // Starting from Android 11, this boolean is not set and will always be false.
6902 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006903}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006904
6905/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006906 * Pulls the ongoing mainline install train version code.
6907 * Pulled from StatsCompanionService
6908 */
6909message TrainInfo {
6910 optional int64 train_version_code = 1;
6911
6912 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006913
6914 optional string train_name = 3;
6915
6916 enum Status {
6917 UNKNOWN = 0;
6918 INSTALL_REQUESTED = 1;
6919 INSTALL_STARTED = 2;
6920 INSTALL_STAGED_NOT_READY = 3;
6921 INSTALL_STAGED_READY = 4;
6922 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006923 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6924 // and INSTALL_FAILURE_COMMIT.
6925 INSTALL_FAILURE = 6 [deprecated = true];
6926 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006927 INSTALL_CANCELLED = 7;
6928 INSTALLER_ROLLBACK_REQUESTED = 8;
6929 INSTALLER_ROLLBACK_INITIATED = 9;
6930 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6931 INSTALLER_ROLLBACK_STAGED = 11;
6932 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6933 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6934 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6935 INSTALLER_ROLLBACK_SUCCESS = 15;
6936 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006937 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6938 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6939 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6940 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6941 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6942 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006943 INSTALL_FAILURE_DOWNLOAD = 23;
6944 INSTALL_FAILURE_STATE_MISMATCH = 24;
6945 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08006946 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006947 }
6948 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006949}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006950
6951/**
6952 * Logs the gesture stage changed event.
6953 *
6954 * Logged from:
6955 * frameworks/base/packages/SystemUI/
6956 */
6957message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006958 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006959}
6960
6961/**
6962 * Logs the feedback type.
6963 *
6964 * Logged from:
6965 * frameworks/base/packages/SystemUI/
6966 */
6967message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006968 // Whether or not the gesture was used.
6969 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006970}
6971
6972/**
6973 * Logs the progress.
6974 *
6975 * Logged from:
6976 * frameworks/base/packages/SystemUI/
6977 */
6978message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006979 // [0,100] progress for the assist gesture.
6980 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006981}
Neil Fullerdb14b482019-02-05 19:44:44 +00006982
6983/*
6984 * Information about the time zone data on a device.
6985 */
6986message TimeZoneDataInfo {
6987 // A version identifier for the data set on device. e.g. "2018i"
6988 optional string tzdb_version = 1;
6989}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006990
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006991/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006992 * Logs the GPU stats global health information.
6993 *
6994 * Logged from:
6995 * frameworks/native/services/gpuservice/gpustats/
6996 */
6997message GpuStatsGlobalInfo {
6998 // Package name of the gpu driver.
6999 optional string driver_package_name = 1;
7000
7001 // Version name of the gpu driver.
7002 optional string driver_version_name = 2;
7003
7004 // Version code of the gpu driver.
7005 optional int64 driver_version_code = 3;
7006
7007 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7008 optional int64 driver_build_time = 4;
7009
7010 // Total count of the gl driver gets loaded.
7011 optional int64 gl_loading_count = 5;
7012
7013 // Total count of the gl driver fails to be loaded.
7014 optional int64 gl_loading_failure_count = 6;
7015
7016 // Total count of the Vulkan driver gets loaded.
7017 optional int64 vk_loading_count = 7;
7018
7019 // Total count of the Vulkan driver fails to be loaded.
7020 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007021
7022 // Api version of the system Vulkan driver.
7023 optional int32 vulkan_version = 9;
7024
7025 // Api version of the system CPU Vulkan driver.
7026 optional int32 cpu_vulkan_version = 10;
7027
7028 // Api version of the system GLES driver.
7029 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007030
7031 // Total count of the angle driver gets loaded.
7032 optional int64 angle_loading_count = 12;
7033
7034 // Total count of the angle driver fails to be loaded.
7035 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007036}
7037
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007038/**
7039 * GPU driver loading time info.
7040 */
7041message GpuDriverLoadingTime {
7042 // List of all the driver loading times for this app. The list size is
7043 // capped at 50.
7044 repeated int64 driver_loading_time = 1;
7045}
7046
7047/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007048 * Logs the GPU stats per app health information.
7049 *
7050 * Logged from:
7051 * frameworks/native/services/gpuservice/gpustats/
7052 */
7053message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007054 // Package name of the application that loads the gpu driver. Total number
7055 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007056 optional string app_package_name = 1;
7057
7058 // Version code of the gpu driver this app loads.
7059 optional int64 driver_version_code = 2;
7060
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007061 // gl driver loading time info.
7062 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7063 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007064
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007065 // Vulkan driver loading time info.
7066 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7067 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007068
7069 // Angle driver loading time info.
7070 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7071 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007072
7073 // CPU Vulkan implementation is in use.
7074 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007075
7076 // App is not doing pre-rotation correctly.
7077 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007078
7079 // App creates GLESv1 context.
7080 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007081}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007082
7083/*
7084 * Logs the size of the system ion heap.
7085 *
7086 * Pulled from StatsCompanionService.
7087 */
7088message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007089 // Deprecated due to limited support of ion stats in debugfs.
7090 // Use `IonHeapSize` instead.
7091 option deprecated = true;
7092
Rafal Slawikd4e87572019-03-12 13:08:38 +00007093 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007094 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007095 optional int64 size_in_bytes = 1;
7096}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007097
Rafal Slawik77987ed2019-06-17 12:28:23 +01007098/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007099 * Logs the total size of the ion heap.
7100 *
7101 * Pulled from StatsCompanionService.
7102 */
7103message IonHeapSize {
7104 // Total size of all ion heaps in kilobytes.
7105 // Read from: /sys/kernel/ion/total_heaps_kb.
7106 optional int32 total_size_kb = 1;
7107}
7108
7109/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007110 * Logs the per-process size of the system ion heap.
7111 *
7112 * Pulled from StatsCompanionService.
7113 */
7114message ProcessSystemIonHeapSize {
7115 // The uid if available. -1 means not available.
7116 optional int32 uid = 1 [(is_uid) = true];
7117
7118 // The process name (from /proc/PID/cmdline).
7119 optional string process_name = 2;
7120
7121 // Sum of sizes of all allocations.
7122 optional int32 total_size_in_kilobytes = 3;
7123
7124 // Number of allocations.
7125 optional int32 allocation_count = 4;
7126
7127 // Size of the largest allocation.
7128 optional int32 max_size_in_kilobytes = 5;
7129}
7130
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007131/**
7132 * Push network stack events.
7133 *
7134 * Log from:
7135 * frameworks/base/packages/NetworkStack/
7136 */
7137message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007138 // The id that indicates the event reported from NetworkStack.
7139 optional int32 event_id = 1;
7140 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007141 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7142}
Carmen Agimofa769c152019-03-04 14:39:14 +00007143
7144/**
7145 * Logs the apps that are installed on the external storage.
7146 * Pulled from:
7147 * StatsCompanionService
7148 */
7149message AppsOnExternalStorageInfo {
7150 // The type of the external storage.
7151 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7152 // The name of the package that is installed on the external storage.
7153 optional string package_name = 2;
7154}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007155
7156/**
7157 * Logs the settings related to Face.
7158 * Logged from:
7159 * frameworks/base/services/core/java/com/android/server/stats
7160 */
7161message FaceSettings {
7162 // Whether or not face unlock is allowed on Keyguard.
7163 optional bool unlock_keyguard_enabled = 1;
7164 // Whether or not face unlock dismisses the Keyguard.
7165 optional bool unlock_dismisses_keyguard = 2;
7166 // Whether or not face unlock requires attention.
7167 optional bool unlock_attention_required = 3;
7168 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7169 optional bool unlock_app_enabled = 4;
7170 // Whether or not face unlock always requires user confirmation.
7171 optional bool unlock_always_require_confirmation = 5;
7172 // Whether or not a diverse set of poses are required during enrollment.
7173 optional bool unlock_diversity_required = 6;
7174}
Maggie White442b6312019-04-05 16:26:44 -07007175
7176/**
7177 * Logs cooling devices maintained by the kernel.
7178 *
7179 * Pulled from StatsCompanionService.java
7180 */
7181message CoolingDevice {
7182 // The type of cooling device being reported. Eg. CPU, GPU...
7183 optional android.os.CoolingTypeEnum device_location = 1;
7184 // The name of the cooling device source. Eg. CPU0
7185 optional string device_name = 2;
7186 // Current throttle state of the cooling device. The value can any unsigned
7187 // integer between 0 and max_state defined in its driver. 0 means device is
7188 // not in throttling, higher value means deeper throttling.
7189 optional int32 state = 3;
7190}
Ben Blount763a5d52019-04-10 11:48:58 -07007191
7192/**
7193 * Intelligence has several counter-type events that don't warrant a
7194 * full separate atom. These are primarily API call counters but also include
7195 * counters for feature usage and specific failure modes.
7196 *
7197 * Logged from the Intelligence mainline module.
7198 */
7199message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007200 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007201 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007202 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007203 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007204 // How many times the event occured (to report a batch of high frequency events).
7205 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007206 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007207 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007208}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007209
7210/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007211 * Logs when Car Power state changed.
7212 *
7213 * Logged from:
7214 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7215 */
7216message CarPowerStateChanged {
7217 // States come from CpmsState in CarPowerManagementService.java.
7218 enum State {
7219 WAIT_FOR_VHAL = 0;
7220 ON = 1;
7221 SHUTDOWN_PREPARE = 2;
7222 WAIT_FOR_FINISH = 3;
7223 SUSPEND = 4;
7224 SIMULATE_SLEEP = 5;
7225 }
7226 optional State state = 1;
7227}
7228
7229/**
7230 * Logs whether GarageMode is entered.
7231 *
7232 * Logged from:
7233 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7234 */
7235message GarageModeInfo {
7236 // Whether GarageMode is entered.
7237 optional bool is_garage_mode = 1;
7238}
Martijn Coenencd95d462019-04-25 17:09:45 +02007239
7240/**
7241 * Historical app ops data per package.
7242 */
7243message AppOps {
7244 // Uid of the package requesting the op
7245 optional int32 uid = 1 [(is_uid) = true];
7246
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007247 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007248 optional string package_name = 2;
7249
7250 // operation id; maps to the OP_* constants in AppOpsManager.java
7251 optional int32 op_id = 3;
7252
7253 // The number of times the op was granted while the app was in the
7254 // foreground (only for trusted requests)
7255 optional int64 trusted_foreground_granted_count = 4;
7256
7257 // The number of times the op was granted while the app was in the
7258 // background (only for trusted requests)
7259 optional int64 trusted_background_granted_count = 5;
7260
7261 // The number of times the op was rejected while the app was in the
7262 // foreground (only for trusted requests)
7263 optional int64 trusted_foreground_rejected_count = 6;
7264
7265 // The number of times the op was rejected while the app was in the
7266 // background (only for trusted requests)
7267 optional int64 trusted_background_rejected_count = 7;
7268
7269 // For long-running operations, total duration of the operation
7270 // while the app was in the foreground (only for trusted requests)
7271 optional int64 trusted_foreground_duration_millis = 8;
7272
7273 // For long-running operations, total duration of the operation
7274 // while the app was in the background (only for trusted requests)
7275 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007276
7277 // Whether AppOps is guarded by Runtime permission
7278 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007279}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007280
7281/**
7282 * Location Manager API Usage information(e.g. API under usage,
7283 * API call's parameters).
7284 * Logged from:
7285 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7286 */
7287message LocationManagerApiUsageReported {
7288
7289 // Indicating if usage starts or usage ends.
7290 optional android.stats.location.UsageState state = 1;
7291
7292 // LocationManagerService's API in use.
7293 // We can identify which API from LocationManager is
7294 // invoking current LMS API by the combination of
7295 // API parameter(e.g. is_listener_null, is_intent_null,
7296 // is_location_request_null)
7297 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7298
7299 // Name of the package calling the API.
7300 optional string calling_package_name = 3;
7301
7302 // Type of the location provider.
7303 optional android.stats.location.ProviderType provider = 4;
7304
7305 // Quality of the location request
7306 optional android.stats.location.LocationRequestQuality quality = 5;
7307
7308 // The desired interval for active location updates, in milliseconds.
7309 // Bucketized to reduce cardinality.
7310 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7311
7312 // Minimum distance between location updates, in meters.
7313 // Bucketized to reduce cardinality.
7314 optional android.stats.location.SmallestDisplacementBucket
7315 bucketized_smallest_displacement = 7;
7316
7317 // The number of location updates.
7318 optional int64 num_updates = 8;
7319
7320 // The request expiration time, in millisecond since boot.
7321 // Bucketized to reduce cardinality.
7322 optional android.stats.location.ExpirationBucket
7323 bucketized_expire_in = 9;
7324
7325 // Type of Callback passed in for this API.
7326 optional android.stats.location.CallbackType callback_type = 10;
7327
7328 // The radius of the central point of the alert
7329 // region, in meters. Only for API REQUEST_GEOFENCE.
7330 // Bucketized to reduce cardinality.
7331 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7332
7333 // Activity Importance of API caller.
7334 // Categorized to 3 types that are interesting from location's perspective.
7335 optional android.stats.location.ActivityImportance activiy_importance = 12;
7336}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007337
7338/**
7339 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7340 */
7341message ReviewPermissionsFragmentResultReported {
7342 // unique value identifying a permission group change. A permission group change might result
7343 // in multiple of these atoms
7344 optional int64 change_id = 1;
7345
7346 // UID of package the permission belongs to
7347 optional int32 uid = 2 [(is_uid) = true];
7348
7349 // Name of package the permission belongs to
7350 optional string package_name = 3;
7351
7352 // The permission to be granted
7353 optional string permission_name = 4;
7354
7355 // The result of the permission grant
7356 optional bool permission_granted = 5;
7357}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007358
7359/**
7360* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7361* Logged from: RuntimePermissionUpdgradeController
7362*/
7363message RuntimePermissionsUpgradeResult {
7364 // Permission granted as result of upgrade
7365 optional string permission_name = 1;
7366
7367 // UID of package granted permission
7368 optional int32 uid = 2 [(is_uid) = true];
7369
7370 // Name of package granted permission
7371 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007372}
7373
7374/**
7375* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7376*/
7377message GrantPermissionsActivityButtonActions {
7378 // Permission granted as result of upgrade
7379 optional string permission_group_name = 1;
7380
7381 // UID of package granted permission
7382 optional int32 uid = 2 [(is_uid) = true];
7383
7384 // Name of package requesting permission
7385 optional string package_name = 3;
7386
7387 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7388 // LABEL_ constants in GrantPermissionActivity.java
7389 optional int32 buttons_presented = 4;
7390
7391 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7392 optional int32 button_clicked = 5;
7393}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007394
7395/**
7396 * Information about LocationAccessCheck notification presented to user
7397 */
7398message LocationAccessCheckNotificationAction {
7399
7400 // id which identifies single session of user interacting with permission controller
7401 optional int64 session_id = 1;
7402
7403 // Uid of package for which location access check is presented
7404 optional int32 package_uid = 2;
7405
7406 // Name of package for which location access check is presented
7407 optional string package_name = 3;
7408
7409 enum Result {
7410 UNDEFINED = 0;
7411 // notification was presented to the user
7412 NOTIFICATION_PRESENTED = 1;
7413 // notification was declined by the user
7414 NOTIFICATION_DECLINED = 2;
7415 // notification was clicked by the user
7416 NOTIFICATION_CLICKED = 3;
7417 }
7418
7419 // View / interaction recorded
7420 optional Result result = 4;
7421}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007422
7423/**
7424 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7425 */
7426message AppPermissionFragmentActionReported {
7427 // id which identifies single session of user interacting with permission controller
7428 optional int64 session_id = 1;
7429
7430 // unique value identifying a permission group change. A permission group change might result
7431 // in multiple of these atoms
7432 optional int64 change_id = 2;
7433
7434 // UID of package the permission belongs to
7435 optional int32 uid = 3 [(is_uid) = true];
7436
7437 // Name of package the permission belongs to
7438 optional string package_name = 4;
7439
7440 // The permission to be granted
7441 optional string permission_name = 5;
7442
7443 // The result of the permission grant
7444 optional bool permission_granted = 6;
7445}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007446
7447/**
7448* Information about a AppPermissionFragment viewed by user
7449*/
7450message AppPermissionFragmentViewed {
7451 // id which identifies single session of user interacting with permission controller
7452 optional int64 session_id = 1;
7453
7454 // UID of package for which permissions are viewed
7455 optional int32 uid = 2 [(is_uid) = true];
7456
7457 // Name of package for which permissions are viewed
7458 optional string package_name = 3;
7459
7460 // Permission group viewed
7461 optional string permission_group_name = 4;
7462}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007463
7464/**
7465* Information about a AppPermissionsFragment viewed by user
7466*/
7467message AppPermissionsFragmentViewed {
7468 // id which identifies single session of user interacting with permission controller
7469 optional int64 session_id = 1;
7470
7471 // id which identifies single view as every view might have several logging records
7472 // with different package information attached
7473 optional int64 view_id = 2;
7474
7475 // Permission group viewed
7476 optional string permission_group_name = 3;
7477
7478 // UID of package for which permissions are viewed
7479 optional int32 uid = 4 [(is_uid) = true];
7480
7481 // Name of package for which permissions are viewed
7482 optional string package_name = 5;
7483
7484 // Category in which permission is included
7485 enum Category {
7486 UNDEFINED = 0;
7487 ALLOWED = 1;
7488 ALLOWED_FOREGROUND = 2;
7489 DENIED = 3;
7490 }
7491 optional Category category = 6;
7492}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007493
7494/**
7495* Information about a PermissionAppsFragment viewed by user.
7496* Logged from ui/handheld/PermissionAppsFragment.java
7497*/
7498message PermissionAppsFragmentViewed {
7499 // id which identifies single session of user interacting with permission controller
7500 optional int64 session_id = 1;
7501
7502 // id which identifies single view as every view might have several logging records
7503 // with different package information attached
7504 optional int64 view_id = 2;
7505
7506 // Permission group viewed
7507 optional string permission_group_name = 3;
7508
7509 // UID of package for which permissions are viewed
7510 optional int32 uid = 4 [(is_uid) = true];
7511
7512 // Name of package for which permissions are viewed
7513 optional string package_name = 5;
7514
7515 // Category in which app is included
7516 enum Category {
7517 UNDEFINED = 0;
7518 ALLOWED = 1;
7519 ALLOWED_FOREGROUND = 2;
7520 DENIED = 3;
7521 }
7522 optional Category category = 6;
7523}
Tony Make2b1b672019-07-29 16:59:47 +01007524
7525/**
7526 * Logs when there is a smart selection related event.
7527 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7528 * Logged from: TextClassifierEventLogger.java
7529 */
7530message TextSelectionEvent {
7531 // A session ID.
7532 optional string session_id = 1;
7533
7534 // Event type of this event.
7535 optional android.stats.textclassifier.EventType event_type = 2;
7536
Tony Mak9c84bd22019-12-09 07:27:25 +00007537 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007538 optional string model_name = 3;
7539
7540 // Type of widget that was involved in triggering this event.
7541 optional android.stats.textclassifier.WidgetType widget_type = 4;
7542
7543 // Index of this event in a session.
7544 optional int32 event_index = 5;
7545
7546 // Entity type that is involved.
7547 optional string entity_type = 6;
7548
7549 // Relative word index of the start of the selection.
7550 optional int32 relative_word_start_index = 7;
7551
7552 // Relative word (exclusive) index of the end of the selection.
7553 optional int32 relative_word_end_index = 8;
7554
7555 // Relative word index of the start of the smart selection.
7556 optional int32 relative_suggested_word_start_index = 9;
7557
7558 // Relative word (exclusive) index of the end of the smart selection.
7559 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007560
7561 // Name of source package.
7562 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007563}
7564
7565/**
7566 * Logs when there is a smart linkify related event.
7567 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7568 * Logged from: TextClassifierEventLogger.java
7569 */
7570message TextLinkifyEvent {
7571 // A session ID.
7572 optional string session_id = 1;
7573
7574 // Event type of this event.
7575 optional android.stats.textclassifier.EventType event_type = 2;
7576
Tony Mak9c84bd22019-12-09 07:27:25 +00007577 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007578 optional string model_name = 3;
7579
7580 // Type of widget that was involved in triggering this event.
7581 optional android.stats.textclassifier.WidgetType widget_type = 4;
7582
7583 // Index of this event in a session.
7584 optional int32 event_index = 5;
7585
7586 // Entity type that is involved.
7587 optional string entity_type = 6;
7588
7589 // Number of links detected.
7590 optional int32 num_links = 7;
7591
7592 // The total length of all links.
7593 optional int32 linked_text_length = 8;
7594
7595 // Length of input text.
7596 optional int32 text_length = 9;
7597
7598 // Time spent on generating links in ms.
7599 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007600
7601 // Name of source package.
7602 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007603}
7604
7605/**
7606 * Logs when there is a conversation actions related event.
7607 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7608 * Logged from: TextClassifierEventLogger.java
7609 */
7610message ConversationActionsEvent {
7611 // A session ID.
7612 optional string session_id = 1;
7613
7614 // Event type of this event.
7615 optional android.stats.textclassifier.EventType event_type = 2;
7616
Tony Mak9c84bd22019-12-09 07:27:25 +00007617 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007618 optional string model_name = 3;
7619
7620 // Type of widget that was involved in triggering this event.
7621 optional android.stats.textclassifier.WidgetType widget_type = 4;
7622
7623 // The first entity type that is involved.
7624 optional string first_entity_type = 5;
7625
7626 // The second entity type that is involved.
7627 optional string second_entity_type = 6;
7628
7629 // The third entity type that is involved.
7630 optional string third_entity_type = 7;
7631
7632 // The score of the first entity type.
7633 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007634
7635 // Name of source package.
7636 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007637
7638 // Name of the annotator model that is involved in this event.
7639 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007640}
7641
7642/**
7643 * Logs when there is a language detection related event.
7644 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7645 * Logged from: TextClassifierEventLogger.java
7646 */
7647message LanguageDetectionEvent {
7648 // A session ID.
7649 optional string session_id = 1;
7650
7651 // Event type of this event.
7652 optional android.stats.textclassifier.EventType event_type = 2;
7653
Tony Mak9c84bd22019-12-09 07:27:25 +00007654 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007655 optional string model_name = 3;
7656
7657 // Type of widget that was involved in triggering this event.
7658 optional android.stats.textclassifier.WidgetType widget_type = 4;
7659
7660 // Detected language.
7661 optional string language_tag = 5;
7662
7663 // Score of the detected language.
7664 optional float score = 6;
7665
7666 // Position of this action.
7667 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007668
7669 // Name of source package.
7670 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007671}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007672
7673/**
7674 * Information about an OTA update attempt by update_engine.
7675 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7676 */
7677message UpdateEngineUpdateAttemptReported {
7678 // The number of attempts for the update engine to apply a given payload.
7679 optional int32 attempt_number = 1;
7680
7681 optional android.stats.otaupdate.PayloadType payload_type = 2;
7682
7683 // The total time in minutes for the update engine to apply a given payload.
7684 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7685 // it's increased when the system is sleeping.
7686 optional int32 duration_boottime_in_minutes = 3;
7687
7688 // The total time in minutes for the update engine to apply a given payload.
7689 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7690 // and it's not increased when the system is sleeping.
7691 optional int32 duration_monotonic_in_minutes = 4;
7692
7693 // The size of the payload in MiBs.
7694 optional int32 payload_size_mib = 5;
7695
7696 // The attempt result reported by the update engine for an OTA update.
7697 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7698
7699 // The error code reported by the update engine after an OTA update attempt
7700 // on A/B devices.
7701 optional android.stats.otaupdate.ErrorCode error_code = 7;
7702
7703 // The build fingerprint of the source system. The value is read from a
7704 // system property when the device takes the update. e.g.
7705 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7706 optional string source_fingerprint = 8;
7707}
7708
7709/**
7710 * Information about all the attempts the device make before finishing the
7711 * successful update.
7712 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7713 */
7714message UpdateEngineSuccessfulUpdateReported {
7715 // The number of attempts for the update engine to apply the payload for a
7716 // successful update.
7717 optional int32 attempt_count = 1;
7718
7719 optional android.stats.otaupdate.PayloadType payload_type = 2;
7720
7721 optional int32 payload_size_mib = 3;
7722
7723 // The total number of bytes downloaded by update_engine since the last
7724 // successful update.
7725 optional int32 total_bytes_downloaded_mib = 4;
7726
7727 // The ratio in percentage of the over-downloaded bytes compared to the
7728 // total bytes needed to successfully install the update. e.g. 200 if we
7729 // download 200MiB in total for a 100MiB package.
7730 optional int32 download_overhead_percentage = 5;
7731
7732 // The total time in minutes for the update engine to apply the payload for a
7733 // successful update.
7734 optional int32 total_duration_minutes = 6;
7735
7736 // The number of reboot of the device during a successful update.
7737 optional int32 reboot_count = 7;
7738}
Alec Mourie088e762019-07-02 13:10:55 -07007739
7740/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007741 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7742 * key to indicate whether it was successful or not.
7743 *
7744 * Logged from:
7745 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7746 */
7747message RebootEscrowRecoveryReported {
7748 optional bool successful = 1;
7749}
7750
7751/**
Alec Mourie088e762019-07-02 13:10:55 -07007752 * Global display pipeline metrics reported by SurfaceFlinger.
7753 * Pulled from:
7754 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7755 */
7756message SurfaceflingerStatsGlobalInfo {
7757 // Total number of frames presented during the tracing period
7758 optional int64 total_frames = 1;
7759 // Total number of frames missed
7760 optional int64 missed_frames = 2;
7761 // Total number of frames that fell back to client composition
7762 optional int64 client_composition_frames = 3;
7763 // Total time the display was turned on
7764 optional int64 display_on_millis = 4;
7765 // Total time that was spent performing animations.
7766 // This is derived from the present-to-present layer histogram
7767 optional int64 animation_millis = 5;
7768}
7769
7770/**
7771 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7772 * The number of layers uploaded will be restricted due to size limitations.
7773 * Pulled from:
7774 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7775 */
7776message SurfaceflingerStatsLayerInfo {
7777 // The layer for this set of metrics
7778 // For now we can infer that the package name is included in the layer
7779 // name.
7780 optional string layer_name = 1;
7781 // Total number of frames presented
7782 optional int64 total_frames = 2;
7783 // Total number of dropped frames while latching a buffer for this layer.
7784 optional int64 dropped_frames = 3;
7785 // Set of timings measured between successive presentation timestamps.
7786 optional FrameTimingHistogram present_to_present = 4
7787 [(android.os.statsd.log_mode) = MODE_BYTES];
7788 // Set of timings measured from when an app queued a buffer for
7789 // presentation, until the buffer was actually presented to the
7790 // display.
7791 optional FrameTimingHistogram post_to_present = 5
7792 [(android.os.statsd.log_mode) = MODE_BYTES];
7793 // Set of timings measured from when a buffer is ready to be presented,
7794 // until the buffer was actually presented to the display.
7795 optional FrameTimingHistogram acquire_to_present = 6
7796 [(android.os.statsd.log_mode) = MODE_BYTES];
7797 // Set of timings measured from when a buffer was latched by
7798 // SurfaceFlinger, until the buffer was presented to the display
7799 optional FrameTimingHistogram latch_to_present = 7
7800 [(android.os.statsd.log_mode) = MODE_BYTES];
7801 // Set of timings measured from the desired presentation to the actual
7802 // presentation time
7803 optional FrameTimingHistogram desired_to_present = 8
7804 [(android.os.statsd.log_mode) = MODE_BYTES];
7805 // Set of timings measured from when an app queued a buffer for
7806 // presentation, until the buffer was ready to be presented.
7807 optional FrameTimingHistogram post_to_acquire = 9
7808 [(android.os.statsd.log_mode) = MODE_BYTES];
7809}
7810
7811/**
7812 * Histogram of frame counts bucketed by time in milliseconds.
7813 * Because of size limitations, we hard-cap the number of buckets, with
7814 * buckets for corresponding to larger milliseconds being less precise.
7815 */
7816message FrameTimingHistogram {
7817 // Timings in milliseconds that describes a set of histogram buckets
7818 repeated int32 time_millis_buckets = 1;
7819 // Number of frames that match to each time_millis, i.e. the bucket
7820 // contents
7821 // It's required that len(time_millis) == len(frame_count)
7822 repeated int64 frame_counts = 2;
7823}
Emilian Peev6729f372019-08-29 09:14:09 -07007824
Emilian Peev6729f372019-08-29 09:14:09 -07007825/**
7826 * Information about camera facing and API level usage.
7827 * Logged from:
7828 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7829 */
7830message CameraActionEvent {
7831 // Camera session duration
7832 optional int64 duration = 1;
7833
7834 // Camera API level used
7835 optional int32 api_level = 2;
7836
7837 // Name of client package
7838 optional string package_name = 3;
7839
7840 // Camera facing
7841 enum Facing {
7842 UNKNOWN = 0;
7843 BACK = 1;
7844 FRONT = 2;
7845 EXTERNAL = 3;
7846 }
7847 optional Facing facing = 4;
7848}
atrost01a20932019-08-28 15:40:37 +01007849
7850/**
7851 * Logs when a compatibility change is affecting an app.
7852 *
7853 * Logged from:
7854 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7855 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7856 */
7857message AppCompatibilityChangeReported {
7858 // The UID of the app being affected by the compatibilty change.
7859 optional int32 uid = 1 [(is_uid) = true];
7860
7861 // The ID of the change affecting the app.
7862 optional int64 change_id = 2;
7863
7864 enum State {
7865 UNKNOWN_STATE = 0;
7866 ENABLED = 1;
7867 DISABLED = 2;
7868 LOGGED = 3;
7869 }
7870
7871 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7872 // logged otherwise.
7873 optional State state = 3;
7874
7875 enum Source {
7876 UNKNOWN_SOURCE = 0;
7877 APP_PROCESS = 1;
7878 SYSTEM_SERVER = 2;
7879 }
7880
7881 // Where it was logged from.
7882 optional Source source = 4;
7883
7884}
Hector Dearman40579f62019-11-01 13:19:30 +00007885
7886/**
7887 * Logged from
7888 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7889 */
7890message PerfettoUploaded {
7891 enum Event {
7892 PERFETTO_UNDEFINED = 0;
7893 PERFETTO_TRACE_BEGIN = 1;
7894 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7895 PERFETTO_ON_CONNECT = 3;
7896 PERFETTO_ON_TRACING_DISABLED = 4;
7897 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7898 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7899 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7900 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7901 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7902 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7903 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7904 PERFETTO_TRIGGER_BEGIN = 12;
7905 PERFETTO_TRIGGER_SUCCESS = 13;
7906 PERFETTO_TRIGGER_FAILURE = 14;
7907 PERFETTO_HIT_GUARDRAILS = 15;
7908 PERFETTO_ON_TIMEOUT = 16;
7909 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7910 }
7911
7912 // Which stage of the pipeline we are reporting from.
7913 optional Event event = 1;
7914
7915 // UUID matching the one set inside the SystemInfo trace packet.
7916 optional int64 trace_uuid_lsb = 2;
7917 optional int64 trace_uuid_msb = 3;
7918}
Mark Tabrya824a642019-11-05 12:26:12 -08007919
7920/**
7921 * Pulls client metrics on data transferred via Vehicle Maps Service.
7922 * Metrics are keyed by uid + layer.
7923 *
7924 * Pulled from:
7925 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7926 */
7927message VmsClientStats {
7928 // UID of the VMS client app
7929 optional int32 uid = 1 [(is_uid) = true];
7930
7931 // VMS layer definition
7932 optional int32 layer_type = 2;
7933 optional int32 layer_channel = 3;
7934 optional int32 layer_version = 4;
7935
7936 // Bytes and packets sent by the client for the layer
7937 optional int64 tx_bytes = 5;
7938 optional int64 tx_packets = 6;
7939
7940 // Bytes and packets received by the client for the layer
7941 optional int64 rx_bytes = 7;
7942 optional int64 rx_packets = 8;
7943
7944 // Bytes and packets dropped due to client error
7945 optional int64 dropped_bytes = 9;
7946 optional int64 dropped_packets = 10;
7947}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007948
7949/**
7950 * State of a dangerous permission requested by a package - sampled
7951 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
7952*/
7953message DangerousPermissionStateSampled {
7954 // Name of the permission
7955 optional string permission_name = 1;
7956
7957 // Uid of the package
7958 optional int32 uid = 2 [(is_uid) = true];
7959
7960 // If the permission is granted to the uid
7961 optional bool is_granted = 3;
7962
7963 // Permission flags as per android.content.pm.PermissionFlags
7964 optional int32 permission_flags = 4;
7965}
7966
Stan Iliev637ba5e2019-08-16 13:43:08 -04007967/**
7968 * HWUI renders pipeline type: GL (0) or Vulkan (1).
7969 */
7970enum PipelineType {
7971 GL = 0;
7972 VULKAN = 1;
7973}
7974
7975/**
7976 * HWUI stats for a given app.
7977 */
7978message GraphicsStats {
7979 // The package name of the app
7980 optional string package_name = 1;
7981
7982 // The version code of the app
7983 optional int64 version_code = 2;
7984
7985 // The start & end timestamps in UTC as
7986 // milliseconds since January 1, 1970
7987 // Compatible with java.util.Date#setTime()
7988 optional int64 stats_start = 3;
7989
7990 optional int64 stats_end = 4;
7991
7992 // HWUI renders pipeline type: GL or Vulkan.
7993 optional PipelineType pipeline = 5;
7994
7995 // Distinct frame count.
7996 optional int32 total_frames = 6;
7997
7998 // Number of "missed vsync" events.
7999 optional int32 missed_vsync_count = 7;
8000
8001 // Number of frames in triple-buffering scenario (high input latency)
8002 optional int32 high_input_latency_count = 8;
8003
8004 // Number of "slow UI thread" events.
8005 optional int32 slow_ui_thread_count = 9;
8006
8007 // Number of "slow bitmap upload" events.
8008 optional int32 slow_bitmap_upload_count = 10;
8009
8010 // Number of "slow draw" events.
8011 optional int32 slow_draw_count = 11;
8012
8013 // Number of frames that missed their deadline (aka, visibly janked)
8014 optional int32 missed_deadline_count = 12;
8015
8016 // The frame time histogram for the package
8017 optional FrameTimingHistogram cpu_histogram = 13
8018 [(android.os.statsd.log_mode) = MODE_BYTES];
8019
8020 // The gpu frame time histogram for the package
8021 optional FrameTimingHistogram gpu_histogram = 14
8022 [(android.os.statsd.log_mode) = MODE_BYTES];
8023
8024 // UI mainline module version.
8025 optional int64 version_ui_module = 15;
8026
8027 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8028 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8029 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8030 // more apps are running / rendering.
8031 optional bool is_today = 16;
8032}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008033
8034/**
8035 * Message related to dangerous (runtime) app ops access
8036 */
8037message RuntimeAppOpsAccess {
8038 // Uid of the package accessing app op
8039 optional int32 uid = 1 [(is_uid) = true];
8040
8041 // Name of the package accessing app op
8042 optional string package_name = 2;
8043
8044 // operation id; maps to the OP_* constants in AppOpsManager.java
8045 optional int32 op_id = 3;
8046
8047 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8048 // Features must be provided through manifest using <feature> tag available in R and above.
8049 optional string feature_id = 4;
8050
8051 // message related to app op access, limited to 600 chars by API
8052 optional string message = 5;
8053
8054 enum SamplingStrategy {
8055 DEFAULT = 0;
8056 UNIFORM = 1;
8057 RARELY_USED = 2;
8058 }
8059
8060 // sampling strategy used to collect this message
8061 optional SamplingStrategy sampling_strategy = 6;
8062}
8063
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008064/*
8065 * Logs userspace reboot outcome and duration.
8066 *
8067 * Logged from:
8068 * frameworks/base/core/java/com/android/server/BootReceiver.java
8069 */
8070message UserspaceRebootReported {
8071 // Possible outcomes of userspace reboot.
8072 enum Outcome {
8073 // Default value in case platform failed to determine the outcome.
8074 OUTCOME_UNKNOWN = 0;
8075 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8076 SUCCESS = 1;
8077 // Userspace reboot shutdown sequence was aborted.
8078 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8079 // Remounting userdata into checkpointing mode failed.
8080 FAILED_USERDATA_REMOUNT = 3;
8081 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8082 // reboot.
8083 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8084 }
8085 // Outcome of userspace reboot. Always set.
8086 optional Outcome outcome = 1;
8087 // Duration of userspace reboot in case it has a successful outcome.
8088 // Duration is measured as time between userspace reboot was initiated and until boot completed
8089 // (e.g. sys.boot_completed=1).
8090 optional int64 duration_millis = 2;
8091 // State of primary user's (user0) credential encryption storage.
8092 enum UserEncryptionState {
8093 // Default value.
8094 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8095 // Credential encrypted storage is unlocked.
8096 UNLOCKED = 1;
8097 // Credential encrypted storage is locked.
8098 LOCKED = 2;
8099 }
8100 // State of primary user's encryption storage at the moment boot completed. Always set.
8101 optional UserEncryptionState user_encryption_state = 3;
8102}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008103
8104/*
8105 * Logs integrity check information during each install.
8106 *
8107 * Logged from:
8108 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8109 */
8110message IntegrityCheckResultReported {
8111 optional string package_name = 1;
8112 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008113 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008114 optional string installer_package_name = 4;
8115 enum Response {
8116 UNKNOWN = 0;
8117 ALLOWED = 1;
8118 REJECTED = 2;
8119 FORCE_ALLOWED = 3;
8120 }
8121 optional Response response = 5;
8122 // An estimate on the cause of the response. This will only be populated for
8123 // REJECTED and FORCE_ALLOWED
8124 optional bool caused_by_app_cert_rule = 6;
8125 optional bool caused_by_installer_rule = 7;
8126}
8127
8128/**
8129 * Logs the information about the rules and the provider whenever rules are
8130 * pushed into AppIntegrityManager.
8131 *
8132 * Logged from:
8133 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8134 */
8135message IntegrityRulesPushed {
8136 optional bool success = 1;
8137 // Package name of the app that pushed the rules.
8138 optional string rule_provider = 2;
8139 // Version string of arbitrary format provided by the rule provider to
8140 // identify the rules.
8141 optional string rule_version = 3;
8142}
Jordan Liubedfa702019-12-20 15:08:45 -08008143
8144/**
8145 * Logs when a cell broadcast message is received on the device.
8146 *
8147 * Logged from CellBroadcastService module:
8148 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8149 */
8150message CellBroadcastMessageReported {
8151 // The type of Cell Broadcast message
8152 enum CbType {
8153 UNKNOWN_TYPE = 0;
8154 GSM = 1;
8155 CDMA = 2;
8156 CDMA_SPC = 3;
8157 }
8158
8159 // GSM, CDMA, CDMA-SCP
8160 optional CbType type = 1;
8161}
8162
8163/**
8164 * Logs when an error occurs while handling a cell broadcast message;
8165 *
8166 * Logged from CellBroadcastService module:
8167 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8168 */
8169message CellBroadcastMessageError {
8170 // The type of error raised when trying to handle a cell broadcast message
8171 enum ErrorType {
8172 UNKNOWN_TYPE = 0;
8173 CDMA_DECODING_ERROR = 1;
8174 CDMA_SCP_EMPTY = 2;
8175 CDMA_SCP_HANDLING_ERROR = 3;
8176 GSM_INVALID_HEADER_LENGTH = 4;
8177 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8178 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8179 GSM_INVALID_PDU = 7;
8180 GSM_INVALID_GEO_FENCING_DATA = 8;
8181 GSM_UMTS_INVALID_WAC = 9;
8182 FAILED_TO_INSERT_TO_DB = 10;
8183 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8184 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8185 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8186 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8187 }
8188
8189 // What kind of error occurred
8190 optional ErrorType type = 1;
8191
8192 // Exception message (or log message) associated with the error (max 1000 chars)
8193 optional string exception_message = 2;
8194}