blob: 052358bb83975d4c3ea7cbc6634d88fe2b858170 [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";
Robert Luo2f52f042020-05-11 16:39:24 +080027import "frameworks/base/core/proto/android/app/media_output_enum.proto";
Zhen Sun0bec8d42020-03-25 17:17:29 -070028import "frameworks/base/core/proto/android/app/tvsettings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080029import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080030import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080031import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080032import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080033import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080034import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080035import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080036import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080038import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080039import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080040import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080041import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080042import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070043import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080044import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080045import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080046import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080047import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
48import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070049import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
jasonwshsu81173e32020-03-27 15:22:03 +080050import "frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070051import "frameworks/base/core/proto/android/stats/enums.proto";
52import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070053import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070054import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080055import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070056import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000057import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080058import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050059import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080060import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080061import "frameworks/base/core/proto/android/telephony/enums.proto";
62import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080063import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010064import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070065import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080066
Yao Chend54f9dd2017-10-17 17:37:48 +000067/**
Stefan Lafonae2df012017-11-14 09:17:21 -080068 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000069 * raw stats log events from the Android system, also known as "atoms."
70 *
71 * This field contains a single oneof with all of the available messages.
72 * The stats-log-api-gen tool runs as part of the Android build and
73 * generates the android.util.StatsLog class, which contains the constants
74 * and methods that Android uses to log.
75 *
Stefan Lafonae2df012017-11-14 09:17:21 -080076 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000077 * Instead, statsd on Android constructs these messages synthetically,
78 * in the format defined here and in stats_log.proto.
79 */
Stefan Lafonae2df012017-11-14 09:17:21 -080080message Atom {
81 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070082 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070083 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070084 BleScanStateChanged ble_scan_state_changed = 2
85 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080086 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080087 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070088 SensorStateChanged sensor_state_changed =
89 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080090 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070091 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
92 ScheduledJobStateChanged scheduled_job_state_changed =
93 8 [(module) = "framework", (module) = "statsdtest"];
94 ScreenBrightnessChanged screen_brightness_changed =
95 9 [(module) = "framework", (module) = "statsdtest"];
96 WakelockStateChanged wakelock_state_changed =
97 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080098 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
99 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700100 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
101 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800102 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
103 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
104 14 [(module) = "framework"];
105 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
106 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
107 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
108 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800109 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700110 BatterySaverModeStateChanged battery_saver_mode_state_changed =
111 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800112 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
113 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700114 AudioStateChanged audio_state_changed =
115 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800116 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
117 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
118 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700119 UidProcessStateChanged uid_process_state_changed =
120 27 [(module) = "framework", (module) = "statsdtest"];
121 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
122 28 [(module) = "framework", (module) = "statsdtest"];
123 ScreenStateChanged screen_state_changed =
124 29 [(module) = "framework", (module) = "statsdtest"];
125 BatteryLevelChanged battery_level_changed =
126 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800127 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
tsaichristine1449fa42020-01-02 12:12:05 -0800128 PluggedStateChanged plugged_state_changed = 32
129 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800130 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800131 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800132 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
133 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800134 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
135 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
136 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700137 PhoneSignalStrengthChanged phone_signal_strength_changed =
138 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800139 SettingChanged setting_changed = 41 [(module) = "framework"];
140 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700141 42 [(module) = "framework", (module) = "statsdtest"];
142 IsolatedUidChanged isolated_uid_changed =
143 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800144 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
145 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800146 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800147 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800148 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700149 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800150 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
151 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800152 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800153 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800154 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800155 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800156 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
157 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800158 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800159 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700160 OverlayStateChanged overlay_state_changed =
161 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800162 ForegroundServiceStateChanged foreground_service_state_changed
163 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700164 CallStateChanged call_state_changed =
165 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800166 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
167 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
168 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800169 AppDied app_died = 65 [(module) = "framework"];
170 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
171 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800172 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
173 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800174 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
175 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800176 SpeakerImpedanceReported speaker_impedance_reported = 71;
177 HardwareFailed hardware_failed = 72;
178 PhysicalDropDetected physical_drop_detected = 73;
179 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800180 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
181 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800182 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700183 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 ANROccurred anr_occurred = 79 [(module) = "framework"];
185 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
186 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700187 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800188 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800189 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800190 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
191 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700192 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800193 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
194 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
195 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
196 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700197 BatteryHealthSnapshot battery_health_snapshot = 91;
198 SlowIo slow_io = 92;
199 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800200 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
201 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100202 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800203 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700205 // TODO: service state change is very noisy shortly after boot, as well
206 // as at other transitions - coming out of doze, device plugged in, etc.
207 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800208 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
209 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
210 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800211 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800212 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800213 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
214 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
215 105 [(module) = "docsui"];
216 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
217 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
218 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
219 108 [(module) = "docsui"];
220 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
221 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
222 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
223 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800224 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800225 WifiRunningStateChanged wifi_running_state_changed = 114
226 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800227 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800228 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800229 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800230 117 [(module) = "docsui"];
231 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
232 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
233 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
234 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800235 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
236 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
237 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800238 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
239 125 [(module) = "bluetooth"];
240 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
241 126 [(module) = "bluetooth"];
242 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
243 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800244 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000245 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800246 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
247 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
248 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800249 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800250 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
251 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
252 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
253 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
254 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
255 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800256 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
257 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800258 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
259 142 [(module) = "framework"];
260 AttentionManagerServiceResultReported attention_manager_service_result_reported =
261 143 [(module) = "framework"];
262 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800263 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800264 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800265 WatchdogRollbackOccurred watchdog_rollback_occurred =
266 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800267 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
268 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800269 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800270 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
271 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800272 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
273 151 [(module) = "bluetooth"];
274 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
275 152 [(module) = "bluetooth"];
276 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
277 153 [(module) = "bluetooth"];
278 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
279 154 [(module) = "bluetooth"];
280 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
281 155 [(module) = "bluetooth"];
282 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
283 156 [(module) = "bluetooth"];
284 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
285 157 [(module) = "bluetooth"];
286 BluetoothDeviceFailedContactCounterReported
287 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
288 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
289 159 [(module) = "bluetooth"];
290 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
291 160 [(module) = "bluetooth"];
292 BluetoothQualityReportReported bluetooth_quality_report_reported =
293 161 [(module) = "bluetooth"];
294 BluetoothDeviceInfoReported bluetooth_device_info_reported =
295 162 [(module) = "bluetooth"];
296 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
297 163 [(module) = "bluetooth"];
298 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
299 164 [(module) = "bluetooth"];
300 BluetoothBondStateChanged bluetooth_bond_state_changed =
301 165 [(module) = "bluetooth"];
302 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
303 166 [(module) = "bluetooth"];
304 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
305 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800306 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
307 168 [(module) = "framework"];
308 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700309 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800310 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800311 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800312 DeviceIdentifierAccessDenied device_identifier_access_denied =
313 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800314 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800315 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
316 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
317 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800318 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
319 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800320 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700321 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800322 180 [(module) = "permissioncontroller"];
323 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
324 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800325 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800326 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
327 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
328 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
329 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800330 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
331 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700332 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800333 188 [(module) = "intelligence"];
334 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
335 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800336 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800337 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800338 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
339 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
340 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
341 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
342 MediametricsCodecReported mediametrics_codec_reported = 195;
343 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
344 MediametricsExtractorReported mediametrics_extractor_reported = 197;
345 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
346 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
347 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700348 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800349 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
350 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800351 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800352 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
353 206 [(module) = "framework"];
354 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
355 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
356 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
357 LocationManagerApiUsageReported location_manager_api_usage_reported =
358 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100359 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800360 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100361 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100363 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100365 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800366 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100367 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800368 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100369 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800370 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100371 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800372 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100373 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800374 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800375 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
376 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
377 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
378 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800379 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800380 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700381 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
382 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800383 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100384 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800385 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800386 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800387 VmsClientConnectionStateChanged vms_client_connection_state_changed =
388 230 [(module) = "car"];
shafik43825842020-04-02 17:30:24 +0100389 MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
390 MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
391 MediaProviderPermissionRequested media_provider_permission_requested =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800392 235 [(module) = "mediaprovider"];
shafik43825842020-04-02 17:30:24 +0100393 MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
394 MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800395 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800396 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
397 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
398 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
399 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800400 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800401 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000402 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800403 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500404 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
405 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800406 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
407 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800408 CellBroadcastMessageReported cb_message_reported =
409 249 [(module) = "cellbroadcast"];
410 CellBroadcastMessageError cb_message_error =
411 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700412 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
413 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
414 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800415 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000416 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800417 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
418 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800419 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800420 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500421 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
422 RankingSelected ranking_selected = 260 [(module) = "framework"];
Zhen Sun7dbb51a2020-04-07 16:05:12 -0700423 TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -0800424 LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
Songchun Fanc296cf72020-03-31 18:38:52 -0700425 PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
Varun Shahacb56342019-12-18 11:45:38 -0800426 UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
427 UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
jasonwshsu81173e32020-03-27 15:22:03 +0800428 AccessibilityShortcutReported accessibility_shortcut_reported =
429 266 [(module) = "framework"];
jasonwshsu7b1be3e2020-04-27 15:21:07 +0800430 AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -0700431 DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -0700432 AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
Nate Myrene8f912bb2020-04-30 10:41:38 -0700433 AutoRevokeNotificationClicked auto_revoke_notification_clicked =
434 270 [(module) = "permissioncontroller"];
435 AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
436 271 [(module) = "permissioncontroller"];
437 AutoRevokedAppInteraction auto_revoked_app_interaction =
438 272 [(module) = "permissioncontroller", (module) = "settings"];
439 AppPermissionGroupsFragmentAutoRevokeAction
440 app_permission_groups_fragment_auto_revoke_action =
441 273 [(module) = "permissioncontroller"];
Changyeon Jo51ae3582020-04-14 09:41:00 -0700442 EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
Robert Leecccdc152020-04-23 13:22:46 +0800443 AudioPowerUsageDataReported audio_power_usage_data_reported = 275;
Henry Fange316ab62020-04-21 18:43:14 -0700444 TvTunerStateChanged tv_tuner_state_changed = 276 [(module) = "framework"];
Robert Luo2f52f042020-05-11 16:39:24 +0800445 MediaOutputOpSwitchReported mediaoutput_op_switch_reported =
446 277 [(module) = "settings"];
Jordan Liu900e5cb2020-05-29 09:44:59 -0700447 CellBroadcastMessageFiltered cb_message_filtered =
448 278 [(module) = "cellbroadcast"];
Henry Fang1ae85bb2020-05-28 18:07:03 -0700449 TvTunerDvrStatus tv_tuner_dvr_status = 279 [(module) = "framework"];
Henry Fangfd40c072020-06-01 14:59:17 -0700450 TvCasSessionOpenStatus tv_cas_session_open_status =
451 280 [(module) = "framework"];
Govinda Wassermane4640282020-04-30 09:30:56 -0400452 AssistantInvocationReported assistant_invocation_reported = 281 [(module) = "framework"];
Denny cy Leeca62fc42020-05-28 18:13:07 +0800453 DisplayWakeReported display_wake_reported = 282 [(module) = "framework"];
Mayank Gargda5ca012020-05-14 00:23:53 -0700454 CarUserHalModifyUserRequestReported car_user_hal_modify_user_request_reported =
455 283 [(module) = "car"];
456 CarUserHalModifyUserResponseReported car_user_hal_modify_user_response_reported =
457 284 [(module) = "car"];
458 CarUserHalPostSwitchResponseReported car_user_hal_post_switch_response_reported =
459 285 [(module) = "car"];
460 CarUserHalInitialUserInfoRequestReported car_user_hal_initial_user_info_request_reported =
461 286 [(module) = "car"];
462 CarUserHalInitialUserInfoResponseReported car_user_hal_initial_user_info_response_reported =
463 287 [(module) = "car"];
464 CarUserHalUserAssociationRequestReported car_user_hal_user_association_request_reported =
465 288 [(module) = "car"];
466 CarUserHalSetUserAssociationResponseReported car_user_hal_set_user_association_response_reported =
467 289 [(module) = "car"];
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700468
469 // StatsdStats tracks platform atoms with ids upto 500.
470 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000471 }
David Chenc8a43242017-10-17 16:23:28 -0700472
David Chen6e3e6cb2018-01-03 16:14:06 -0800473 // Pulled events will start at field 10000.
Denny cy Leeca62fc42020-05-28 18:13:07 +0800474 // Next: 10081
David Chenc8a43242017-10-17 16:23:28 -0700475 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800476 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
477 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700478 MobileBytesTransfer mobile_bytes_transfer =
479 10002 [(module) = "framework", (truncate_timestamp) = true];
480 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
481 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800482 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
483 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700484 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800485 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700486 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800487 CpuTimePerUidFreq cpu_time_per_uid_freq =
488 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800489 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
490 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
491 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
492 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
493 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700494 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700495 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700496 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700497 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800498 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
499 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700500 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800501 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800502 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800503 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800504 DiskStats disk_stats = 10025 [(module) = "framework"];
505 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
506 AppSize app_size = 10027 [(module) = "framework"];
507 CategorySize category_size = 10028 [(module) = "framework"];
508 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800509 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800510 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
511 DiskIo disk_io = 10032 [(module) = "framework"];
512 PowerProfile power_profile = 10033 [(module) = "framework"];
513 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
514 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
515 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700516 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800517 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
518 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
519 10040 [(module) = "framework"];
520 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
521 10041 [(module) = "framework"];
522 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800523 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800524 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800525 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800526 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
527 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
528 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
529 RoleHolder role_holder = 10049 [(module) = "framework"];
530 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800531 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800532 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
533 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800534 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
535 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800536 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
537 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
538 FaceSettings face_settings = 10058 [(module) = "framework"];
539 CoolingDevice cooling_device = 10059 [(module) = "framework"];
540 AppOps app_ops = 10060 [(module) = "framework"];
541 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700542 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
543 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800544 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800545 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800546 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
547 DangerousPermissionStateSampled dangerous_permission_state_sampled =
548 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400549 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000550 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000551 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200552 PackageNotificationPreferences package_notification_preferences =
553 10071 [(module) = "framework"];
554 PackageNotificationChannelPreferences package_notification_channel_preferences =
555 10072 [(module) = "framework"];
556 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
557 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800558 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800559 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700560 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
561 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
562 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
563 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800564 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Denny cy Leeca62fc42020-05-28 18:13:07 +0800565 //10081 free for use
junyulai8d1a6092020-05-07 13:38:15 +0800566 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700567 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
568 10083 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700569 }
yroa1fe77c2018-02-26 14:22:54 -0800570
Bookatz76aafcf2018-09-17 16:17:10 -0700571 // DO NOT USE field numbers above 100,000 in AOSP.
572 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
573 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100574
575 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700576}
577
Yao Chend54f9dd2017-10-17 17:37:48 +0000578/**
Yangster-mac20877162017-12-22 17:19:39 -0800579 * This proto represents a node of an attribution chain.
580 * Note: All attribution chains are represented as a repeated field of type
581 * AttributionNode. It is understood that in such arrays, the order is that
582 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000583 */
Yangster-mac20877162017-12-22 17:19:39 -0800584message AttributionNode {
585 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800586 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800587
Yangster-mac20877162017-12-22 17:19:39 -0800588 // The (optional) string tag for an element in the attribution chain. If the
589 // element has no tag, it is encoded as an empty string.
590 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700591}
592
Yangster-mac48b3d622018-08-18 12:38:11 -0700593message KeyValuePair {
594 optional int32 key = 1;
595 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700596 int32 value_int = 2;
597 int64 value_long = 3;
598 string value_str = 4;
599 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700600 }
601}
602
603message KeyValuePairsAtom {
604 optional int32 uid = 1;
605 repeated KeyValuePair pairs = 2;
606}
607
Yao Chend54f9dd2017-10-17 17:37:48 +0000608/*
609 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800610 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000611 *
612 * RULES:
613 * - The field ids for each atom must start at 1, and count upwards by 1.
614 * Skipping field ids is not allowed.
615 * - These form an API, so renaming, renumbering or removing fields is
616 * not allowed between android releases. (This is not currently enforced,
617 * but there will be a tool to enforce this restriction).
618 * - The types must be built-in protocol buffer types, namely, no sub-messages
619 * are allowed (yet). The bytes type is also not allowed.
620 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800621 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000622 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800623 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000624 * - A field that is a uid should be a string field, tagged with the [xxx]
625 * annotation. The generated code on android will be represented by UIDs,
626 * and those UIDs will be translated in xxx to those strings.
627 *
628 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700629 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000630 * - If there is a UID, it goes first. Think in an object-oriented fashion.
631 * *****************************************************************************
632 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700633
Yao Chend54f9dd2017-10-17 17:37:48 +0000634/**
Tej Singha72344992019-04-17 18:55:08 -0700635 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700636 * Logs when the Thermal service HAL notifies the throttling start/stop events.
637 *
638 * Logged from:
639 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
640 */
641message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700642 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700643 optional android.os.TemperatureTypeEnum sensor_type = 1;
644
Maggie White442b6312019-04-05 16:26:44 -0700645 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700646 enum State {
647 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700648 START = 1; // START indicated that throttling was triggered.
649 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700650 }
Yangster-mace16189a2018-08-26 12:20:16 -0700651 optional State state = 2;
652
653 optional float temperature = 3;
654}
655
656/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000657 * Logs when the screen state changes.
658 *
659 * Logged from:
660 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
661 */
662message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800663 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800664 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700665 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700666}
Yao Chend54f9dd2017-10-17 17:37:48 +0000667
668/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700669 * Logs that the process state of the uid, as determined by ActivityManager
670 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000671 *
672 * Logged from:
673 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
674 */
Bookatzc1a050a2017-10-10 15:49:28 -0700675message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700676 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000677
Bookatzdb026a22018-01-10 19:01:56 -0800678 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800679 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700680 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000681}
682
683/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700684 * Logs process state change of a process, as per the activity manager.
685 *
686 * Logged from:
687 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
688 */
689message ProcessStateChanged {
690 optional int32 uid = 1;
691 optional string process_name = 2;
692 optional string package_name = 3;
693 // TODO: remove this when validation is done
694 optional int64 version = 5;
695 // The state, from frameworks/base/core/proto/android/app/enums.proto.
696 optional android.app.ProcessStateEnum state = 4;
697}
698
699/**
700 * Logs when ActivityManagerService sleep state is changed.
701 *
702 * Logged from:
703 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
704 */
705message ActivityManagerSleepStateChanged {
706 // TODO: import frameworks proto
707 enum State {
708 UNKNOWN = 0;
709 ASLEEP = 1;
710 AWAKE = 2;
711 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700712 optional State state = 1
713 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700714}
715
716/**
717 * Logs when system memory state changes.
718 *
719 * Logged from:
720 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
721 */
722message MemoryFactorStateChanged {
723 // TODO: import frameworks proto
724 enum State {
725 MEMORY_UNKNOWN = 0;
726 NORMAL = 1; // normal.
727 MODERATE = 2; // moderate memory pressure.
728 LOW = 3; // low memory.
729 CRITICAL = 4; // critical memory.
730
731 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700732 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700733}
734
735/**
736 * Logs when app is using too much cpu, according to ActivityManagerService.
737 *
738 * Logged from:
739 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
740 */
741message ExcessiveCpuUsageReported {
742 optional int32 uid = 1;
743 optional string process_name = 2;
744 optional string package_name = 3;
745 // package version. TODO: remove this when validation is done
746 optional int64 version = 4;
747}
748
749/**
750 * Logs when a cached process is killed, along with its pss.
751 *
752 * Logged from:
753 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
754 */
755message CachedKillReported {
756 optional int32 uid = 1;
757 optional string process_name = 2;
758 optional string package_name = 3;
759 // TODO: remove this when validation is done
760 optional int64 version = 5;
761 optional int64 pss = 4;
762}
763
764/**
xshu2c3d9e42019-09-26 17:54:02 -0700765 * Logs the change in wifi health.
766 *
767 * Logged from:
768 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
769 */
770message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800771 enum Band {
772 UNKNOWN = 0;
773 // All of 2.4GHz band
774 BAND_2G = 1;
775 // Frequencies in the range of [5150, 5250) GHz
776 BAND_5G_LOW = 2;
777 // Frequencies in the range of [5250, 5725) GHz
778 BAND_5G_MIDDLE = 3;
779 // Frequencies in the range of [5725, 5850) GHz
780 BAND_5G_HIGH = 4;
781 // Frequencies in the range of [5925, 6425) GHz
782 BAND_6G_LOW = 5;
783 // Frequencies in the range of [6425, 6875) GHz
784 BAND_6G_MIDDLE = 6;
785 // Frequencies in the range of [6875, 7125) GHz
786 BAND_6G_HIGH = 7;
787 }
xshu2c3d9e42019-09-26 17:54:02 -0700788 // duration this stat is obtained over in milliseconds
789 optional int32 duration_millis = 1;
790 // whether wifi is classified as sufficient for the user's data traffic, determined
791 // by whether the calculated throughput exceeds the average demand within |duration_millis|
792 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700793 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800794 optional bool is_cell_data_available = 3;
795 // the Band bucket the connected network is on
796 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700797}
798
799/**
800 * Logged when wifi detects a significant change in connection failure rate.
801 *
802 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
803 *
804 */
805message WifiFailureStatReported {
806 enum AbnormalityType {
807 UNKNOWN = 0;
808 SIGNIFICANT_INCREASE = 1;
809 SIGNIFICANT_DECREASE = 2;
810 SIMPLY_HIGH = 3;
811 }
812 enum FailureType {
813 FAILURE_UNKNOWN = 0;
814 FAILURE_CONNECTION = 1;
815 FAILURE_ASSOCIATION_REJECTION = 2;
816 FAILURE_ASSOCIATION_TIMEOUT = 3;
817 FAILURE_AUTHENTICATION = 4;
818 FAILURE_NON_LOCAL_DISCONNECTION = 5;
819 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
820 }
821 // Reason for uploading this stat
822 optional AbnormalityType abnormality_type = 1;
823 // The particular type of failure
824 optional FailureType failure_type = 2;
825 // How many times we have encountered this combination of AbnormalityType and FailureType
826 optional int32 failure_count = 3;
827}
828
829/**
830 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
831 *
832 * Logged from:
833 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
834 */
835message WifiConnectionResultReported {
836 enum FailureCode {
837 FAILURE_UNKNOWN = 0;
838 FAILURE_ASSOCIATION_TIMEOUT = 1;
839 FAILURE_ASSOCIATION_REJECTION = 2;
840 FAILURE_AUTHENTICATION_GENERAL = 3;
841 FAILURE_AUTHENTICATION_EAP = 4;
842 FAILURE_DHCP = 5;
843 FAILURE_NETWORK_DISCONNECTION = 6;
844 FAILURE_ROAM_TIMEOUT = 7;
845 }
846 // true represents a successful connection
847 optional bool connection_result = 1;
848 // reason for the connection failure
849 optional FailureCode failure_code = 2;
850 // scan rssi before the connection attempt
851 optional int32 rssi = 3;
852}
853
854/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700855 * Logs when memory stats of a process is reported.
856 *
857 * Logged from:
858 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
859 */
860message ProcessMemoryStatReported {
861 optional int32 uid = 1;
862 optional string process_name = 2;
863 optional string package_name = 3;
864 //TODO: remove this when validation is done
865 optional int64 version = 9;
866 optional int64 pss = 4;
867 optional int64 uss = 5;
868 optional int64 rss = 6;
869 enum Type {
870 ADD_PSS_INTERNAL_SINGLE = 0;
871 ADD_PSS_INTERNAL_ALL_MEM = 1;
872 ADD_PSS_INTERNAL_ALL_POLL = 2;
873 ADD_PSS_EXTERNAL = 3;
874 ADD_PSS_EXTERNAL_SLOW = 4;
875 }
876 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800877 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700878}
879
880/**
Bookatzc1a050a2017-10-10 15:49:28 -0700881 * Logs that a process started, finished, crashed, or ANRed.
882 *
883 * Logged from:
884 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
885 */
886message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700887 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700888
David Chen0b5c90c2018-01-25 16:51:49 -0800889 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800890 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700891
Bookatzddccf0a2017-11-28 16:48:14 -0800892 // What lifecycle state the process changed to.
893 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800894 enum State {
895 FINISHED = 0;
896 STARTED = 1;
897 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800898 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800899 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700900}
901
Bookatzc1a050a2017-10-10 15:49:28 -0700902/**
903 * Logs when the ble scan state changes.
904 *
905 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700906 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700907 */
908message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800909 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700910 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700911
912 enum State {
913 OFF = 0;
914 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700915 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
916 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700917 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800918 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700919 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800920 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700921 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800922 (state_field_option).nested = true
923 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700924
Bookatze5ec0b42018-03-26 13:34:56 -0700925 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700926 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700927 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700928 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700929 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700930 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700931}
932
933/**
934 * Logs reporting of a ble scan finding results.
935 *
936 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700937 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700938 */
Bookatzae6738e2018-09-13 11:38:56 -0700939// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700940message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800941 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700942
943 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800944 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700945}
946
947/**
948 * Logs when a sensor state changes.
949 *
950 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700951 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700952 */
953message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800954 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700955
Bookatzc1a050a2017-10-10 15:49:28 -0700956 // The id (int) of the sensor.
957 optional int32 sensor_id = 2;
958
959 enum State {
960 OFF = 0;
961 ON = 1;
962 }
963 optional State state = 3;
964}
965
Bookatzc1a050a2017-10-10 15:49:28 -0700966/**
967 * Logs when GPS state changes.
968 *
969 * Logged from:
970 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
971 */
972message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800973 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700974
975 enum State {
976 OFF = 0;
977 ON = 1;
978 }
979 optional State state = 2;
980}
981
Bookatz48d362e2018-11-06 15:49:08 -0800982/**
983 * Logs when GPS signal quality.
984 *
985 * Logged from:
986 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
987 */
988message GpsSignalQualityChanged {
989 optional android.server.location.GpsSignalQualityEnum level = 1;
990}
991
Bookatzc1a050a2017-10-10 15:49:28 -0700992
993/**
994 * Logs when a sync manager sync state changes.
995 *
996 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700997 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700998 */
999message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001000 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001001
David Chen0b5c90c2018-01-25 16:51:49 -08001002 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001003 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001004
1005 enum State {
1006 OFF = 0;
1007 ON = 1;
1008 }
1009 optional State state = 3;
1010}
1011
Yangster-mac96353002018-09-05 11:18:55 -07001012/*
1013 * Deferred job stats.
1014 *
1015 * Logged from:
1016 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
1017*/
1018message DeferredJobStatsReported {
1019 repeated AttributionNode attribution_node = 1;
1020
1021 // Number of jobs deferred.
1022 optional int32 num_jobs_deferred = 2;
1023
1024 // Time since the last job runs.
1025 optional int64 time_since_last_job_millis = 3;
1026}
1027
Bookatzc1a050a2017-10-10 15:49:28 -07001028/**
1029 * Logs when a job scheduler job state changes.
1030 *
1031 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001032 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001033 */
1034message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001035 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001036
1037 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001038 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001039
1040 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001041 FINISHED = 0;
1042 STARTED = 1;
1043 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001044 }
1045 optional State state = 3;
1046
Tej Singh33a412b2018-03-16 18:43:59 -07001047 // The reason a job has stopped.
1048 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001049 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001050 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001051
1052 // The standby bucket of the app that scheduled the job. These match the framework constants
1053 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1054 // already assigned 0.
1055 enum Bucket {
1056 UNKNOWN = -1;
1057 ACTIVE = 0;
1058 WORKING_SET = 1;
1059 FREQUENT = 2;
1060 RARE = 3;
1061 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001062 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001063 }
1064 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1065
1066 // The job id (as assigned by the app).
1067 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001068
1069 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1070 // constraints as they are always assumed to be set.
1071 optional bool has_charging_constraint = 7;
1072 optional bool has_battery_not_low_constraint = 8;
1073 optional bool has_storage_not_low_constraint = 9;
1074 optional bool has_timing_delay_constraint = 10;
1075 optional bool has_deadline_constraint = 11;
1076 optional bool has_idle_constraint = 12;
1077 optional bool has_connectivity_constraint = 13;
1078 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001079}
1080
1081/**
1082 * Logs when the audio state changes.
1083 *
1084 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001085 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001086 */
1087message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001088 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001089
1090 enum State {
1091 OFF = 0;
1092 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001093 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1094 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001095 }
1096 optional State state = 2;
1097}
1098
1099/**
1100 * Logs when the video codec state changes.
1101 *
1102 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001103 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001104 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001105message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001106 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001107
1108 enum State {
1109 OFF = 0;
1110 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001111 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1112 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001113 }
1114 optional State state = 2;
1115}
1116
1117/**
1118 * Logs when the flashlight state changes.
1119 *
1120 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001121 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001122 */
1123message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001124 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001125
1126 enum State {
1127 OFF = 0;
1128 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001129 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1130 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001131 }
1132 optional State state = 2;
1133}
1134
1135/**
1136 * Logs when the camera state changes.
1137 *
1138 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001139 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001140 */
1141message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001142 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001143
1144 enum State {
1145 OFF = 0;
1146 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001147 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1148 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001149 }
1150 optional State state = 2;
1151}
1152
1153/**
1154 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001155 *
1156 * Logged from:
1157 * TODO
1158 */
Bookatzd6746242017-10-24 18:39:35 -07001159message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001160 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001161 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001162
Bookatz1a1b0462018-01-12 11:47:03 -08001163 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1164 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001165 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001166
1167 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001168 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001169
1170 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001171 RELEASE = 0;
1172 ACQUIRE = 1;
1173 CHANGE_RELEASE = 2;
1174 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001175 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001176 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001177 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001178 (state_field_option).default_state_value = 0,
1179 (state_field_option).nested = true
1180 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001181}
1182
1183/**
Bookatzc1a050a2017-10-10 15:49:28 -07001184 * Logs when a partial wakelock is considered 'long' (over 1 min).
1185 *
1186 * Logged from:
1187 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1188 */
1189message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001190 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001191
Yao Chend54f9dd2017-10-17 17:37:48 +00001192 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1193 optional string tag = 2;
1194
Bookatzc1a050a2017-10-10 15:49:28 -07001195 // TODO: I have no idea what this is.
1196 optional string history_tag = 3;
1197
1198 enum State {
1199 OFF = 0;
1200 ON = 1;
1201 }
1202 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001203}
1204
Bookatzc1a050a2017-10-10 15:49:28 -07001205/**
Bookatza66083f2018-09-20 17:24:00 -07001206 * Logs when the device is interactive, according to the PowerManager Notifier.
1207 *
1208 * Logged from:
1209 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1210 */
1211message InteractiveStateChanged {
1212 enum State {
1213 OFF = 0;
1214 ON = 1;
1215 }
1216 optional State state = 1;
1217}
1218
1219/**
Bookatzc1a050a2017-10-10 15:49:28 -07001220 * Logs Battery Saver state change.
1221 *
1222 * Logged from:
1223 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1224 */
1225message BatterySaverModeStateChanged {
1226 enum State {
1227 OFF = 0;
1228 ON = 1;
1229 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001230 optional State state = 1
1231 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001232}
1233
1234/**
1235 * Logs Doze mode state change.
1236 *
1237 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001238 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001239 */
1240message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001241 optional android.server.DeviceIdleModeEnum state = 1
1242 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001243}
1244
1245
1246/**
1247 * Logs state change of Doze mode including maintenance windows.
1248 *
1249 * Logged from:
1250 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1251 */
1252message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001253 optional android.server.DeviceIdleModeEnum state = 1
1254 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001255}
1256
1257/**
1258 * Logs screen brightness level.
1259 *
1260 * Logged from:
1261 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1262 */
1263message ScreenBrightnessChanged {
1264 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1265 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001266}
1267
1268/**
1269 * Logs battery level (percent full, from 0 to 100).
1270 *
1271 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001272 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001273 */
1274message BatteryLevelChanged {
1275 // Battery level. Should be in [0, 100].
1276 optional int32 battery_level = 1;
1277}
1278
1279/**
1280 * Logs change in charging status of the device.
1281 *
1282 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001283 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001284 */
1285message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001286 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001287 optional android.os.BatteryStatusEnum state = 1
1288 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001289}
1290
1291/**
1292 * Logs whether the device is plugged in, and what power source it is using.
1293 *
1294 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001295 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001296 */
1297message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001298 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001299 optional android.os.BatteryPluggedStateEnum state = 1
1300 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001301}
1302
Bookatz8c6571b2017-10-24 15:04:41 -07001303/**
1304 * Logs when an app's wakeup alarm fires.
1305 *
1306 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001307 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001308 */
1309message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001310 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001311
1312 // Name of the wakeup alarm.
1313 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001314
1315 // Name of source package (for historical reasons, since BatteryStats tracked it).
1316 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001317
Ben Murdoch3389f1522019-05-21 15:05:34 +01001318 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001319 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001320}
1321
1322/**
1323 * Logs when an an app causes the mobile radio to change state.
1324 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1325 *
1326 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001327 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001328 */
1329message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001330 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001331
Bookatz1a1b0462018-01-12 11:47:03 -08001332 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1333 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001334}
1335
1336/**
1337 * Logs when an an app causes the wifi radio to change state.
1338 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1339 *
1340 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001341 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001342 */
1343message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001344 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001345
Bookatz1a1b0462018-01-12 11:47:03 -08001346 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1347 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001348}
1349
1350/**
1351 * Logs kernel wakeup reasons and aborts.
1352 *
1353 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001354 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001355 */
1356message KernelWakeupReported {
1357 // Name of the kernel wakeup reason (or abort).
1358 optional string wakeup_reason_name = 1;
1359
1360 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001361 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001362}
1363
1364/**
Bookatzda1798c2018-12-13 14:16:00 -08001365 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001366 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001367 *
1368 * Logged from:
1369 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1370 */
1371message WifiEnabledStateChanged {
1372 enum State {
1373 OFF = 0;
1374 ON = 1;
1375 }
1376 optional State state = 1;
1377}
1378
1379/**
tsaichristinececebdc2020-02-04 14:05:56 -08001380 * This atom is deprecated starting in R.
1381 *
Bookatzda1798c2018-12-13 14:16:00 -08001382 * 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 -08001383 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1384 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001385 *
1386 * Logged from:
1387 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1388 */
1389message WifiRunningStateChanged {
1390 repeated AttributionNode attribution_node = 1;
1391
1392 enum State {
1393 OFF = 0;
1394 ON = 1;
1395 }
1396 optional State state = 2;
1397}
1398
1399/**
Bookatze5885242017-10-24 20:10:31 -07001400 * Logs wifi locks held by an app.
1401 *
1402 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001403 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001404 */
1405message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001406 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001407
1408 enum State {
1409 OFF = 0;
1410 ON = 1;
1411 }
1412 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001413
1414 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1415 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001416}
1417
1418/**
1419 * Logs wifi signal strength changes.
1420 *
1421 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001422 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001423 */
1424message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001425 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1426 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001427}
1428
1429/**
1430 * Logs wifi scans performed by an app.
1431 *
1432 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001433 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001434 */
1435message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001436 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001437
1438 enum State {
1439 OFF = 0;
1440 ON = 1;
1441 }
1442 optional State state = 2;
1443}
1444
1445/**
Tej Singh4503e102018-01-04 14:35:01 -08001446 * Logs wifi multicast locks held by an app
1447 *
1448 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001449 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001450 */
1451message WifiMulticastLockStateChanged {
1452 repeated AttributionNode attribution_node = 1;
1453
1454 enum State {
1455 OFF = 0;
1456 ON = 1;
1457 }
1458 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001459
1460 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001461}
1462
1463/**
Tej Singh1ea42892018-01-19 09:27:00 -08001464 * Logs shutdown reason and duration on next boot.
1465 *
1466 * Logged from:
1467 * frameworks/base/core/java/com/android/server/BootReceiver.java
1468 */
1469message ShutdownSequenceReported {
1470 // True if shutdown is for a reboot. Default: false if we do not know.
1471 optional bool reboot = 1;
1472
1473 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1474 optional string reason = 2;
1475
1476 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1477 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001478 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001479
1480 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001481 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001482}
1483
Tej Singh6483ea42018-01-25 17:45:49 -08001484
1485/**
1486 * Logs boot reason and duration.
1487 *
1488 * Logged from:
1489 * system/core/bootstat/bootstat.cpp
1490 */
1491message BootSequenceReported {
1492 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1493 // Default: "<EMPTY>" if not available.
1494 optional string bootloader_reason = 1;
1495
1496 // Reason for system boot. Eg. bootloader, reboot,userrequested
1497 // Default: "<EMPTY>" if not available.
1498 optional string system_reason = 2;
1499
1500 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001501 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001502
1503 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001504 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001505
1506 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001507 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001508
1509 // Time since last boot in ms. Default: 0 if not available.
1510 optional int64 time_since_last_boot = 6;
1511}
1512
Tej Singhc477d9c2018-02-05 18:31:39 -08001513
1514/**
1515 * Logs call state and disconnect cause (if applicable).
1516 *
1517 * Logged from:
1518 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1519 */
1520message CallStateChanged {
1521 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1522 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1523 optional android.telecom.CallStateEnum call_state = 1;
1524
1525 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1526 // This value is only applicable when the call_state is DISCONNECTED, and
1527 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1528 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1529 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1530
1531 // True if the call is self-managed, which are apps that use the
1532 // telecom infrastructure to make their own calls.
1533 optional bool self_managed = 3;
1534
1535 // True if call is external. External calls are calls on connected Wear
1536 // devices but show up in Telecom so the user can pull them onto the device.
1537 optional bool external_call = 4;
1538}
1539
Tej Singh1ea42892018-01-19 09:27:00 -08001540/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001541 * Logs keyguard state. The keyguard is the lock screen.
1542 *
1543 * Logged from:
1544 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1545 */
1546message KeyguardStateChanged {
1547 enum State {
1548 UNKNOWN = 0;
1549 // The keyguard is hidden when the phone is unlocked.
1550 HIDDEN = 1;
1551 // The keyguard is shown when the phone is locked (screen turns off).
1552 SHOWN= 2;
1553 // The keyguard is occluded when something is overlaying the keyguard.
1554 // Eg. Opening the camera while on the lock screen.
1555 OCCLUDED = 3;
1556 }
1557 optional State state = 1;
1558}
1559
1560/**
1561 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1562 * prompts the user to enter a password (pattern, pin, etc).
1563 *
1564 * Logged from:
1565 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1566 */
1567
1568message KeyguardBouncerStateChanged {
1569 enum State {
1570 UNKNOWN = 0;
1571 // Bouncer is hidden, either as a result of successfully entering the
1572 // password, screen timing out, or user going back to lock screen.
1573 HIDDEN = 1;
1574 // This is when the user is being prompted to enter the password.
1575 SHOWN = 2;
1576 }
1577 optional State state = 1;
1578}
1579
1580/**
1581 * Logs the result of entering a password into the keyguard bouncer.
1582 *
1583 * Logged from:
1584 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1585 */
1586message KeyguardBouncerPasswordEntered {
1587 enum BouncerResult {
1588 UNKNOWN = 0;
1589 // The password entered was incorrect.
1590 FAILURE = 1;
1591 // The password entered was correct.
1592 SUCCESS = 2;
1593 }
1594 optional BouncerResult result = 1;
1595}
1596
Tej Singha883b372018-02-15 11:30:01 -08001597/*
1598 * Logs changes to the configuration of the device. The configuration is defined
1599 * in frameworks/base/core/java/android/content/res/Configuration.java
1600 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1601 * Please go there to interpret the possible values each field can be.
1602 *
1603 * Logged from:
1604 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1605 */
1606message ResourceConfigurationChanged {
1607 // Bit mask of color capabilities of the screen.
1608 // Contains information about the color gamut and hdr mode of the screen.
1609 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001610 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001611
1612 // The target screen density being rendered to.
1613 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001614 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001615
1616 // Current user preference for the scaling factor for fonts,
1617 // relative to the base density scaling.
1618 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001619 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001620
1621 // Flag indicating whether the hard keyboard is hidden.
1622 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001623 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001624
1625 // The type of keyboard attached to the device.
1626 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1627 optional int32 keyboard = 5;
1628
1629 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1630 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001631 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001632
1633 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1634 // 0 if undefined.
1635 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1636 optional int32 mcc = 7;
1637
1638 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1639 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1640 // MNC_ZERO symbol defined in Configuration.java.
1641 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1642 optional int32 mnc = 8;
1643
1644 // The kind of navigation available on the device.
1645 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1646 optional int32 navigation = 9;
1647
1648 // Flag indicating whether the navigation is available.
1649 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001650 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001651
1652 // Overall orientation of the screen.
1653 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1654 optional int32 orientation = 11;
1655
1656 // The current height of the available screen space, in dp units.
1657 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001658 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001659
1660 // Bit mask of overall layout of the screen.
1661 // Contains information about screen size, whether the screen is wider/taller
1662 // than normal, whether the screen layout is right-tl-left or left-to-right,
1663 // and whether the screen has a rounded shape.
1664 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001665 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001666
1667 // Current width of the available screen space, in dp units.
1668 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001669 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001670
1671 // The smallest screen size an application will see in normal operation.
1672 // This is the smallest value of both screenWidthDp and screenHeightDp
1673 // in portrait and landscape.
1674 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001675 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001676
1677 // The type of touch screen attached to the device.
1678 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1679 optional int32 touchscreen = 16;
1680
1681 // Bit mask of the ui mode.
1682 // Contains information about the overall ui mode of the device.
1683 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1684 // Also contains information about whether the device is in night mode.
1685 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001686 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001687}
1688
Tej Singheee317b2018-03-07 19:28:05 -08001689
1690/**
1691 * Logs changes in the connection state of the mobile radio.
1692 *
1693 * Logged from:
1694 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1695 */
1696message MobileConnectionStateChanged {
1697 // States are from the state machine DataConnection.java.
1698 enum State {
1699 UNKNOWN = 0;
1700 // The connection is inactive, or disconnected.
1701 INACTIVE = 1;
1702 // The connection is being activated, or connecting.
1703 ACTIVATING = 2;
1704 // The connection is active, or connected.
1705 ACTIVE = 3;
1706 // The connection is disconnecting.
1707 DISCONNECTING = 4;
1708 // The connection is disconnecting after creating a connection.
1709 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1710 }
1711 optional State state = 1;
1712 // For multi-sim phones, this distinguishes between the sim cards.
1713 optional int32 sim_slot_index = 2;
1714 // Used to identify the connection. Starts at 0 and increments by 1 for
1715 // every new network created. Resets whenever the device reboots.
1716 optional int32 data_connection_id = 3;
1717 // A bitmask for the capabilities of this connection.
1718 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1719 // Default value (if we have no information): 0
1720 optional int64 capabilities = 4;
1721 // If this connection has internet.
1722 // This just checks if the DEFAULT bit of capabilities is set.
1723 optional bool has_internet = 5;
1724}
1725
1726/**
1727 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1728 *
1729 * Logged from:
1730 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1731 */
1732message MobileRadioTechnologyChanged {
1733 optional android.telephony.NetworkTypeEnum state = 1;
1734 // For multi-sim phones, this distinguishes between the sim cards.
1735 optional int32 sim_slot_index = 2;
1736}
1737
Andrew Chantb56388b2018-03-22 21:07:33 -07001738/**
1739 * Logs the VID and PID of any connected USB devices.
1740 *
1741 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1742 *
1743 * Logged by Vendor.
1744 */
1745message UsbDeviceAttached {
1746 optional int32 vid = 1;
1747 optional int32 pid = 2;
1748 optional bool has_audio = 3;
1749 optional bool has_hid = 4;
1750 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001751 enum State {
1752 STATE_DISCONNECTED = 0;
1753 STATE_CONNECTED = 1;
1754 }
1755 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001756 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001757}
1758
Tej Singheee317b2018-03-07 19:28:05 -08001759
Tej Singhdd7bd352018-02-09 19:33:15 -08001760/**
Tej Singh5d991e12018-03-09 19:48:11 -08001761 * Logs when Bluetooth is enabled and disabled.
1762 *
1763 * Logged from:
1764 * services/core/java/com/android/server/BluetoothManagerService.java
1765 */
1766message BluetoothEnabledStateChanged {
1767 repeated AttributionNode attribution_node = 1;
1768 // Whether or not bluetooth is enabled on the device.
1769 enum State {
1770 UNKNOWN = 0;
1771 ENABLED = 1;
1772 DISABLED = 2;
1773 }
1774 optional State state = 2;
1775 // The reason for being enabled/disabled.
1776 // Eg. Airplane mode, crash, application request.
1777 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1778 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001779 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001780}
1781
1782/**
Jack Hed9837c82019-01-09 01:19:13 -08001783 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001784 *
1785 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001786 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1787 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001788 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001789 */
1790message BluetoothConnectionStateChanged {
1791 // The state of the connection.
1792 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1793 optional android.bluetooth.ConnectionStateEnum state = 1;
1794 // An identifier that can be used to match connect and disconnect events.
1795 // Currently is last two bytes of a hash of a device level ID and
1796 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001797 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001798 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001799 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1800 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001801 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001802 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001803 // An identifier that can be used to match events for this device.
1804 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1805 // Salt: Randomly generated 256 bit value
1806 // Hash algorithm: HMAC-SHA256
1807 // Size: 32 byte
1808 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001809 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001810 // An identifier that can be used to match events for this device.
1811 // The incremental identifier is locally generated and guaranteed not derived
1812 // from any globally unique hardware id.
1813 // For paired devices, it stays consistent between Bluetooth toggling for the
1814 // same remote device.
1815 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1816 // session for the same remote device.
1817 // Default: 0 if the device's metric id is unknown.
1818 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001819}
1820
1821/**
1822 * Logs when a Bluetooth device connects and disconnects over ACL
1823 *
1824 * Logged from:
1825 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1826 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001827 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001828 */
1829message BluetoothAclConnectionStateChanged {
1830 // An identifier that can be used to match events for this device.
1831 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1832 // Salt: Randomly generated 256 bit value
1833 // Hash algorithm: HMAC-SHA256
1834 // Size: 32 byte
1835 // Default: null or empty if the device identifier is not known
1836 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1837 // The state of the connection.
1838 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1839 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001840 // An identifier that can be used to match events for this device.
1841 // The incremental identifier is locally generated and guaranteed not derived
1842 // from any globally unique hardware id.
1843 // For paired devices, it stays consistent between Bluetooth toggling for the
1844 // same remote device.
1845 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1846 // session for the same remote device.
1847 // Default: 0 if the device's metric id is unknown.
1848 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001849}
1850
1851/**
1852 * Logs when a Bluetooth device connects and disconnects over SCO
1853 *
1854 * Logged from:
1855 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1856 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1857 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001858 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001859 */
1860message BluetoothScoConnectionStateChanged {
1861 // An identifier that can be used to match events for this device.
1862 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1863 // Salt: Randomly generated 256 bit value
1864 // Hash algorithm: HMAC-SHA256
1865 // Size: 32 byte
1866 // Default: null or empty if the device identifier is not known
1867 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1868 // The state of the connection.
1869 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1870 optional android.bluetooth.ConnectionStateEnum state = 2;
1871 // Codec used for this SCO connection
1872 // Default: UNKNOWN
1873 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001874 // An identifier that can be used to match events for this device.
1875 // The incremental identifier is locally generated and guaranteed not derived
1876 // from any globally unique hardware id.
1877 // For paired devices, it stays consistent between Bluetooth toggling for the
1878 // same remote device.
1879 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1880 // session for the same remote device.
1881 // Default: 0 if the device's metric id is unknown.
1882 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001883}
1884
Jack Hec27040a2019-01-09 20:54:41 -08001885/**
1886 * Logged when active device of a profile changes
1887 *
1888 * Logged from:
1889 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1890 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1891 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1892 */
1893message BluetoothActiveDeviceChanged {
1894 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1895 // From android.bluetooth.BluetoothProfile
1896 optional int32 bt_profile = 1;
1897 // An identifier that can be used to match events for this new active device.
1898 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1899 // Salt: Randomly generated 256 bit value
1900 // Hash algorithm: HMAC-SHA256
1901 // Size: 32 byte
1902 // Default: null or empty if there is no active device for this profile
1903 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001904 // An identifier that can be used to match events for this device.
1905 // The incremental identifier is locally generated and guaranteed not derived
1906 // from any globally unique hardware id.
1907 // For paired devices, it stays consistent between Bluetooth toggling for the
1908 // same remote device.
1909 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1910 // session for the same remote device.
1911 // Default: 0 if the device's metric id is unknown.
1912 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001913}
1914
Jack Heab86dbd22018-12-18 15:43:27 -08001915// Logs when there is an event affecting Bluetooth device's link layer connection.
1916// - This event is triggered when there is a related HCI command or event
1917// - Users of this metrics can deduce Bluetooth device's connection state from these events
1918// - HCI commands are logged before the command is sent, after receiving command status, and after
1919// receiving command complete
1920// - HCI events are logged when they arrive
1921//
1922// Low level log from system/bt
1923//
1924// Bluetooth classic commands:
1925// - CMD_CREATE_CONNECTION
1926// - CMD_DISCONNECT
1927// - CMD_CREATE_CONNECTION_CANCEL
1928// - CMD_ACCEPT_CONNECTION_REQUEST
1929// - CMD_REJECT_CONNECTION_REQUEST
1930// - CMD_SETUP_ESCO_CONNECTION
1931// - CMD_ACCEPT_ESCO_CONNECTION
1932// - CMD_REJECT_ESCO_CONNECTION
1933// - CMD_ENH_SETUP_ESCO_CONNECTION
1934// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1935//
1936// Bluetooth low energy commands:
1937// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1938// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1939// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1940// - CMD_BLE_CLEAR_WHITE_LIST
1941// - CMD_BLE_ADD_WHITE_LIST
1942// - CMD_BLE_REMOVE_WHITE_LIST
1943//
1944// Bluetooth classic events:
1945// - EVT_CONNECTION_COMP
1946// - EVT_CONNECTION_REQUEST
1947// - EVT_DISCONNECTION_COMP
1948// - EVT_ESCO_CONNECTION_COMP
1949// - EVT_ESCO_CONNECTION_CHANGED
1950//
1951// Bluetooth low energy meta events:
1952// - BLE_EVT_CONN_COMPLETE_EVT
1953// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1954//
1955// Next tag: 10
1956message BluetoothLinkLayerConnectionEvent {
1957 // An identifier that can be used to match events for this device.
1958 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1959 // Salt: Randomly generated 256 bit value
1960 // Hash algorithm: HMAC-SHA256
1961 // Size: 32 byte
1962 // Default: null or empty if the device identifier is not known
1963 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1964 // Connection handle of this connection if available
1965 // Range: 0x0000 - 0x0EFF (12 bits)
1966 // Default: 0xFFFF if the handle is unknown
1967 optional int32 connection_handle = 2;
1968 // Direction of the link
1969 // Default: DIRECTION_UNKNOWN
1970 optional android.bluetooth.DirectionEnum direction = 3;
1971 // Type of this link
1972 // Default: LINK_TYPE_UNKNOWN
1973 optional android.bluetooth.LinkTypeEnum type = 4;
1974
1975 // Reason metadata for this link layer connection event, rules for interpretation:
1976 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1977 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1978 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1979 // set and valid, ignore hci_ble_event
1980
1981 // HCI command associated with this event
1982 // Default: CMD_UNKNOWN
1983 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1984 // HCI event associated with this event
1985 // Default: EVT_UNKNOWN
1986 optional android.bluetooth.hci.EventEnum hci_event = 6;
1987 // HCI BLE meta event associated with this event
1988 // Default: BLE_EVT_UNKNOWN
1989 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1990 // HCI command status code if this is triggerred by hci_cmd
1991 // Default: STATUS_UNKNOWN
1992 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1993 // HCI reason code associated with this event
1994 // Default: STATUS_UNKNOWN
1995 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001996 // An identifier that can be used to match events for this device.
1997 // The incremental identifier is locally generated and guaranteed not derived
1998 // from any globally unique hardware id.
1999 // For paired devices, it stays consistent between Bluetooth toggling for the
2000 // same remote device.
2001 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2002 // session for the same remote device.
2003 // Default: 0 if the device's metric id is unknown.
2004 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08002005}
2006
Howard Roe103fe22019-01-17 16:52:16 -08002007/**
2008 * Logs when a module is rolled back by Watchdog.
2009 *
2010 * Logged from: Rollback Manager
2011 */
2012message WatchdogRollbackOccurred {
2013 enum RollbackType {
2014 UNKNOWN = 0;
2015 ROLLBACK_INITIATE = 1;
2016 ROLLBACK_SUCCESS = 2;
2017 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08002018 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08002019 }
2020 optional RollbackType rollback_type = 1;
2021
2022 optional string package_name = 2;
2023
2024 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002025
2026 enum RollbackReasonType {
2027 REASON_UNKNOWN = 0;
2028 REASON_NATIVE_CRASH = 1;
2029 REASON_EXPLICIT_HEALTH_CHECK = 2;
2030 REASON_APP_CRASH = 3;
2031 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002032 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002033 }
2034 optional RollbackReasonType rollback_reason = 4;
2035
2036 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2037 // is initiated. Empty if the package is unknown.
2038 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002039
2040 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002041}
2042
Jack Hec27040a2019-01-09 20:54:41 -08002043/**
2044 * Logs when there is a change in Bluetooth A2DP playback state
2045 *
2046 * Logged from:
2047 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2048 */
2049message BluetoothA2dpPlaybackStateChanged {
2050 // An identifier that can be used to match events for this device.
2051 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2052 // Salt: Randomly generated 256 bit value
2053 // Hash algorithm: HMAC-SHA256
2054 // Size: 32 byte
2055 // Default: null or empty if the device identifier is not known
2056 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2057 // Current playback state
2058 // Default: PLAYBACK_STATE_UNKNOWN
2059 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2060 // Current audio coding mode
2061 // Default: AUDIO_CODING_MODE_UNKNOWN
2062 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002063 // An identifier that can be used to match events for this device.
2064 // The incremental identifier is locally generated and guaranteed not derived
2065 // from any globally unique hardware id.
2066 // For paired devices, it stays consistent between Bluetooth toggling for the
2067 // same remote device.
2068 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2069 // session for the same remote device.
2070 // Default: 0 if the device's metric id is unknown.
2071 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002072}
2073
2074/**
2075 * Logs when there is a change in A2DP codec config for a particular remote device
2076 *
2077 * Logged from:
2078 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2079 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2080 */
2081message BluetoothA2dpCodecConfigChanged {
2082 // An identifier that can be used to match events for this device.
2083 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2084 // Salt: Randomly generated 256 bit value
2085 // Hash algorithm: HMAC-SHA256
2086 // Size: 32 byte
2087 // Default: null or empty if the device identifier is not known
2088 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2089 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2090 // Default SOURCE_CODEC_TYPE_INVALID
2091 optional int32 codec_type = 2;
2092 // Codec priroity, the higher the more preferred, -1 for disabled
2093 // Default: CODEC_PRIORITY_DEFAULT
2094 optional int32 codec_priority = 3;
2095 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2096 // Default: SAMPLE_RATE_NONE
2097 optional int32 sample_rate = 4;
2098 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2099 // Default: BITS_PER_SAMPLE_NONE
2100 optional int32 bits_per_sample = 5;
2101 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2102 // Default: CHANNEL_MODE_NONE
2103 optional int32 channel_mode = 6;
2104 // Codec specific values
2105 // Default 0
2106 optional int64 codec_specific_1 = 7;
2107 optional int64 codec_specific_2 = 8;
2108 optional int64 codec_specific_3 = 9;
2109 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002110 // An identifier that can be used to match events for this device.
2111 // The incremental identifier is locally generated and guaranteed not derived
2112 // from any globally unique hardware id.
2113 // For paired devices, it stays consistent between Bluetooth toggling for the
2114 // same remote device.
2115 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2116 // session for the same remote device.
2117 // Default: 0 if the device's metric id is unknown.
2118 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002119}
2120
2121/**
2122 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2123 * Each codec's capability is logged separately due to statsd restriction
2124 *
2125 * Logged from:
2126 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2127 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2128 */
2129message BluetoothA2dpCodecCapabilityChanged {
2130 // An identifier that can be used to match events for this device.
2131 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2132 // Salt: Randomly generated 256 bit value
2133 // Hash algorithm: HMAC-SHA256
2134 // Size: 32 byte
2135 // Default: null or empty if the device identifier is not known
2136 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2137 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2138 // Default SOURCE_CODEC_TYPE_INVALID
2139 optional int32 codec_type = 2;
2140 // Codec priroity, the higher the more preferred, -1 for disabled
2141 // Default: CODEC_PRIORITY_DEFAULT
2142 optional int32 codec_priority = 3;
2143 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2144 // in BluetoothCodecConfig
2145 // Default: empty and SAMPLE_RATE_NONE for individual item
2146 optional int32 sample_rate = 4;
2147 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2148 // in BluetoothCodecConfig
2149 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2150 optional int32 bits_per_sample = 5;
2151 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2152 // BluetoothCodecConfig
2153 // Default: empty and CHANNEL_MODE_NONE for individual item
2154 optional int32 channel_mode = 6;
2155 // Codec specific values
2156 // Default 0
2157 optional int64 codec_specific_1 = 7;
2158 optional int64 codec_specific_2 = 8;
2159 optional int64 codec_specific_3 = 9;
2160 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002161 // An identifier that can be used to match events for this device.
2162 // The incremental identifier is locally generated and guaranteed not derived
2163 // from any globally unique hardware id.
2164 // For paired devices, it stays consistent between Bluetooth toggling for the
2165 // same remote device.
2166 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2167 // session for the same remote device.
2168 // Default: 0 if the device's metric id is unknown.
2169 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002170}
2171
2172/**
2173 * Logs when A2DP failed to read from PCM source.
2174 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2175 *
2176 * Logged from:
2177 * system/bt
2178 */
2179message BluetoothA2dpAudioUnderrunReported {
2180 // An identifier that can be used to match events for this device.
2181 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2182 // Salt: Randomly generated 256 bit value
2183 // Hash algorithm: HMAC-SHA256
2184 // Size: 32 byte
2185 // Default: null or empty if the device identifier is not known
2186 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2187 // Encoding interval in nanoseconds
2188 // Default: 0
2189 optional int64 encoding_interval_nanos = 2;
2190 // Number of bytes of PCM data that could not be read from the source
2191 // Default: 0
2192 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002193 // An identifier that can be used to match events for this device.
2194 // The incremental identifier is locally generated and guaranteed not derived
2195 // from any globally unique hardware id.
2196 // For paired devices, it stays consistent between Bluetooth toggling for the
2197 // same remote device.
2198 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2199 // session for the same remote device.
2200 // Default: 0 if the device's metric id is unknown.
2201 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002202}
2203
2204/**
2205 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2206 * buffer queue is full and we have to drop data
2207 *
2208 * Logged from:
2209 * system/bt
2210 */
2211message BluetoothA2dpAudioOverrunReported {
2212 // An identifier that can be used to match events for this device.
2213 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2214 // Salt: Randomly generated 256 bit value
2215 // Hash algorithm: HMAC-SHA256
2216 // Size: 32 byte
2217 // Default: null or empty if the device identifier is not known
2218 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2219 // Encoding interval in nanoseconds
2220 // Default: 0
2221 optional int64 encoding_interval_nanos = 2;
2222 // Number of buffers dropped in this event
2223 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2224 // Default: 0
2225 optional int32 num_dropped_buffers = 3;
2226 // Number of encoded buffers dropped in this event
2227 // Default 0
2228 optional int32 num_dropped_encoded_frames = 4;
2229 // Number of encoded bytes dropped in this event
2230 // Default: 0
2231 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002232 // An identifier that can be used to match events for this device.
2233 // The incremental identifier is locally generated and guaranteed not derived
2234 // from any globally unique hardware id.
2235 // For paired devices, it stays consistent between Bluetooth toggling for the
2236 // same remote device.
2237 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2238 // session for the same remote device.
2239 // Default: 0 if the device's metric id is unknown.
2240 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002241}
2242
2243/**
2244 * Logs when we receive reports regarding a device's RSSI value
2245 *
2246 * Logged from:
2247 * system/bt
2248 */
2249message BluetoothDeviceRssiReported {
2250 // An identifier that can be used to match events for this device.
2251 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2252 // Salt: Randomly generated 256 bit value
2253 // Hash algorithm: HMAC-SHA256
2254 // Size: 32 byte
2255 // Default: null or empty if the device identifier is not known
2256 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2257 // Connection handle of this connection if available
2258 // Range: 0x0000 - 0x0EFF (12 bits)
2259 // Default: 0xFFFF if the handle is unknown
2260 optional int32 connection_handle = 2;
2261 // HCI command status code if this is triggerred by hci_cmd
2262 // Default: STATUS_UNKNOWN
2263 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2264 // BR/EDR
2265 // Range: -128 ≤ N ≤ 127 (signed integer)
2266 // Units: dB
2267 // LE:
2268 // Range: -127 to 20, 127 (signed integer)
2269 // Units: dBm
2270 // Invalid when an out of range value is reported
2271 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002272 // An identifier that can be used to match events for this device.
2273 // The incremental identifier is locally generated and guaranteed not derived
2274 // from any globally unique hardware id.
2275 // For paired devices, it stays consistent between Bluetooth toggling for the
2276 // same remote device.
2277 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2278 // session for the same remote device.
2279 // Default: 0 if the device's metric id is unknown.
2280 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002281}
2282
2283/**
2284 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2285 *
2286 * Logged from:
2287 * system/bt
2288 */
2289message BluetoothDeviceFailedContactCounterReported {
2290 // An identifier that can be used to match events for this device.
2291 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2292 // Salt: Randomly generated 256 bit value
2293 // Hash algorithm: HMAC-SHA256
2294 // Size: 32 byte
2295 // Default: null or empty if the device identifier is not known
2296 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2297 // Connection handle of this connection if available
2298 // Range: 0x0000 - 0x0EFF (12 bits)
2299 // Default: 0xFFFF if the handle is unknown
2300 optional int32 connection_handle = 2;
2301 // HCI command status code if this is triggerred by hci_cmd
2302 // Default: STATUS_UNKNOWN
2303 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2304 // Number of consecutive failed contacts for a connection corresponding to the Handle
2305 // Range: uint16_t, 0-0xFFFF
2306 // Default: 0xFFFFF
2307 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002308 // An identifier that can be used to match events for this device.
2309 // The incremental identifier is locally generated and guaranteed not derived
2310 // from any globally unique hardware id.
2311 // For paired devices, it stays consistent between Bluetooth toggling for the
2312 // same remote device.
2313 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2314 // session for the same remote device.
2315 // Default: 0 if the device's metric id is unknown.
2316 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002317}
2318
2319/**
2320 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2321 *
2322 * Logged from:
2323 * system/bt
2324 */
2325message BluetoothDeviceTxPowerLevelReported {
2326 // An identifier that can be used to match events for this device.
2327 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2328 // Salt: Randomly generated 256 bit value
2329 // Hash algorithm: HMAC-SHA256
2330 // Size: 32 byte
2331 // Default: null or empty if the device identifier is not known
2332 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2333 // Connection handle of this connection if available
2334 // Range: 0x0000 - 0x0EFF (12 bits)
2335 // Default: 0xFFFF if the handle is unknown
2336 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002337 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002338 // Default: STATUS_UNKNOWN
2339 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2340 // Range: -30 ≤ N ≤ 20
2341 // Units: dBm
2342 // Invalid when an out of range value is reported
2343 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002344 // An identifier that can be used to match events for this device.
2345 // The incremental identifier is locally generated and guaranteed not derived
2346 // from any globally unique hardware id.
2347 // For paired devices, it stays consistent between Bluetooth toggling for the
2348 // same remote device.
2349 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2350 // session for the same remote device.
2351 // Default: 0 if the device's metric id is unknown.
2352 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002353}
Jack Heab86dbd22018-12-18 15:43:27 -08002354
Tej Singh5d991e12018-03-09 19:48:11 -08002355/**
Jack He1021a612019-01-20 21:22:46 -08002356 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2357 * receiving an HCI command from the host
2358 *
2359 * Logged from: system/bt
2360 */
2361message BluetoothHciTimeoutReported {
2362 // HCI command associated with this event
2363 // Default: CMD_UNKNOWN
2364 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2365}
2366
2367/**
2368 * Logs when we receive Bluetooth Link Quality Report event from the controller
2369 * See Android Bluetooth HCI specification for more details
2370 *
2371 * Note: all count and bytes field are counted since last event
2372 *
2373 * Logged from: system/bt
2374 */
2375message BluetoothQualityReportReported {
2376 // Quality report ID
2377 // Original type: uint8_t
2378 // Default: BQR_ID_UNKNOWN
2379 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2380 // Packet type of the connection
2381 // Original type: uint8_t
2382 // Default: BQR_PACKET_TYPE_UNKNOWN
2383 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2384 // Connection handle of the connection
2385 // Original type: uint16_t
2386 optional int32 connection_handle = 3;
2387 // Performing Role for the connection
2388 // Original type: uint8_t
2389 optional int32 connection_role = 4;
2390 // Current Transmit Power Level for the connection. This value is the same as the controller's
2391 // response to the HCI_Read_Transmit_Power_Level HCI command
2392 // Original type: uint8_t
2393 optional int32 tx_power_level = 5;
2394 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2395 // absolute receiver signal strength value
2396 // Original type: int8_t
2397 optional int32 rssi = 6;
2398 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2399 // channels used by the link currently
2400 // Original type: uint8_t
2401 optional int32 snr = 7;
2402 // Indicates the number of unused channels in AFH_channel_map
2403 // Original type: uint8_t
2404 optional int32 unused_afh_channel_count = 8;
2405 // Indicates the number of the channels which are interfered and quality is bad but are still
2406 // selected for AFH
2407 // Original type: uint8_t
2408 optional int32 afh_select_unideal_channel_count = 9;
2409 // Current Link Supervision Timeout Setting
2410 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2411 // Original type: uint16_t
2412 optional int32 lsto = 10;
2413 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2414 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2415 // 0x01 (Piconet Clock)
2416 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2417 // Original type: uint32_t
2418 optional int64 connection_piconet_clock = 11;
2419 // The count of retransmission
2420 // Original type: uint32_t
2421 optional int64 retransmission_count = 12;
2422 // The count of no RX
2423 // Original type: uint32_t
2424 optional int64 no_rx_count = 13;
2425 // The count of NAK (Negative Acknowledge)
2426 // Original type: uint32_t
2427 optional int64 nak_count = 14;
2428 // Controller timestamp of last TX ACK
2429 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2430 // Original type: uint32_t
2431 optional int64 last_tx_ack_timestamp = 15;
2432 // The count of Flow-off (STOP)
2433 // Original type: uint32_t
2434 optional int64 flow_off_count = 16;
2435 // Controller timestamp of last Flow-on (GO)
2436 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2437 // Original type: uint32_t
2438 optional int64 last_flow_on_timestamp = 17;
2439 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2440 // Original type: uint32_t
2441 optional int64 buffer_overflow_bytes = 18;
2442 // Buffer underflow count (in byte) since last event
2443 // Original type: uint32_t
2444 optional int64 buffer_underflow_bytes = 19;
2445}
2446
2447/**
2448 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2449 *
2450 * Notes:
2451 * - Each event can be partially filled as we might learn different pieces of device
2452 * information at different time
2453 * - Multiple device info events can be combined to give more complete picture
2454 * - When multiple device info events tries to describe the same information, the
2455 * later one wins
2456 *
2457 * Logged from:
2458 * packages/apps/Bluetooth
2459 */
Jack Heaea26982019-04-04 11:19:48 -07002460message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002461 // An identifier that can be used to match events for this device.
2462 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2463 // Salt: Randomly generated 256 bit value
2464 // Hash algorithm: HMAC-SHA256
2465 // Size: 32 byte
2466 // Default: null or empty if the device identifier is not known
2467 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2468 // Where is this device info obtained from
2469 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2470 // Name of the data source
2471 // For EXTERNAL: package name of the data source
2472 // For INTERNAL: null for general case, component name otherwise
2473 optional string source_name = 3;
2474 // Name of the manufacturer of this device
2475 optional string manufacturer = 4;
2476 // Model of this device
2477 optional string model = 5;
2478 // Hardware version of this device
2479 optional string hardware_version = 6;
2480 // Software version of this device
2481 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002482 // An identifier that can be used to match events for this device.
2483 // The incremental identifier is locally generated and guaranteed not derived
2484 // from any globally unique hardware id.
2485 // For paired devices, it stays consistent between Bluetooth toggling for the
2486 // same remote device.
2487 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2488 // session for the same remote device.
2489 // Default: 0 if the device's metric id is unknown.
2490 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002491}
2492
2493/**
2494 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2495 * device, as documented by the Bluetooth Core HCI specification
2496 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2497 * Vol 2, Part E, Page 1118
2498 *
2499 * Logged from:
2500 * system/bt
2501 */
2502message BluetoothRemoteVersionInfoReported {
2503 // Connection handle of the connection
2504 // Original type: uint16_t
2505 optional int32 connection_handle = 1;
2506 // HCI command status code
2507 // Default: STATUS_UNKNOWN
2508 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2509 // 1 byte Version of current LMP in the remote controller
2510 optional int32 lmp_version = 3;
2511 // 2 bytes LMP manufacturer code of the remote controller
2512 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2513 optional int32 lmp_manufacturer_code = 4;
2514 // 4 bytes subversion of the LMP in the remote controller
2515 optional int32 lmp_subversion = 5;
2516}
2517
2518/**
2519 * Logs when certain Bluetooth SDP attributes are discovered
2520 * Constant definitions are from:
2521 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2522 *
2523 * Current logged attributes:
2524 * - BluetoothProfileDescriptorList
2525 * - Supported Features Bitmask
2526 *
2527 * Logged from:
2528 * system/bt
2529 */
2530message BluetoothSdpAttributeReported {
2531 // An identifier that can be used to match events for this device.
2532 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2533 // Salt: Randomly generated 256 bit value
2534 // Hash algorithm: HMAC-SHA256
2535 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2536 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2537 // Original type: uint16_t
2538 optional int32 protocol_uuid = 2;
2539 // Short form UUIDs used to identify Bluetooth SDP attribute types
2540 // Original type: uint16_t
2541 optional int32 attribute_id = 3;
2542 // Attribute value for the particular attribute
2543 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002544 // An identifier that can be used to match events for this device.
2545 // The incremental identifier is locally generated and guaranteed not derived
2546 // from any globally unique hardware id.
2547 // For paired devices, it stays consistent between Bluetooth toggling for the
2548 // same remote device.
2549 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2550 // session for the same remote device.
2551 // Default: 0 if the device's metric id is unknown.
2552 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002553}
2554
2555/**
2556 * Logs when bond state of a Bluetooth device changes
2557 *
2558 * Logged from:
2559 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2560 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2561 */
2562message BluetoothBondStateChanged {
2563 // An identifier that can be used to match events for this device.
2564 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2565 // Salt: Randomly generated 256 bit value
2566 // Hash algorithm: HMAC-SHA256
2567 // Size: 32 byte
2568 // Default: null or empty if the device identifier is not known
2569 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2570 // Preferred transport type to remote dual mode device
2571 // Default: TRANSPORT_AUTO means no preference
2572 optional android.bluetooth.TransportTypeEnum transport = 2;
2573 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2574 // Default: UNKNOWN
2575 optional android.bluetooth.DeviceTypeEnum type = 3;
2576 // Current bond state (NONE, BONDING, BONDED)
2577 // Default: BOND_STATE_UNKNOWN
2578 optional android.bluetooth.BondStateEnum bond_state = 4;
2579 // Bonding sub state
2580 // Default: BOND_SUB_STATE_UNKNOWN
2581 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2582 // Unbond Reason
2583 // Default: UNBOND_REASON_UNKNOWN
2584 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002585 // An identifier that can be used to match events for this device.
2586 // The incremental identifier is locally generated and guaranteed not derived
2587 // from any globally unique hardware id.
2588 // For paired devices, it stays consistent between Bluetooth toggling for the
2589 // same remote device.
2590 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2591 // session for the same remote device.
2592 // Default: 0 if the device's metric id is unknown.
2593 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002594}
2595
2596/**
2597 * Logs there is an event related Bluetooth classic pairing
2598 *
2599 * Logged from:
2600 * system/bt
2601 */
2602message BluetoothClassicPairingEventReported {
2603 // An identifier that can be used to match events for this device.
2604 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2605 // Salt: Randomly generated 256 bit value
2606 // Hash algorithm: HMAC-SHA256
2607 // Size: 32 byte
2608 // Default: null or empty if the device identifier is not known
2609 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2610 // Connection handle of this connection if available
2611 // Range: 0x0000 - 0x0EFF (12 bits)
2612 // Default: 0xFFFF if the handle is unknown
2613 optional int32 connection_handle = 2;
2614 // HCI command associated with this event
2615 // Default: CMD_UNKNOWN
2616 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2617 // HCI event associated with this event
2618 // Default: EVT_UNKNOWN
2619 optional android.bluetooth.hci.EventEnum hci_event = 4;
2620 // HCI command status code if this is triggerred by hci_cmd
2621 // Default: STATUS_UNKNOWN
2622 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2623 // HCI reason code associated with this event
2624 // Default: STATUS_UNKNOWN
2625 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002626 // A status value related to this specific event
2627 // Default: 0
2628 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002629 // An identifier that can be used to match events for this device.
2630 // The incremental identifier is locally generated and guaranteed not derived
2631 // from any globally unique hardware id.
2632 // For paired devices, it stays consistent between Bluetooth toggling for the
2633 // same remote device.
2634 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2635 // session for the same remote device.
2636 // Default: 0 if the device's metric id is unknown.
2637 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002638}
2639
2640/**
2641 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2642 *
2643 * Logged from:
2644 * system/bt
2645 */
2646message BluetoothSmpPairingEventReported {
2647 // An identifier that can be used to match events for this device.
2648 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2649 // Salt: Randomly generated 256 bit value
2650 // Hash algorithm: HMAC-SHA256
2651 // Size: 32 byte
2652 // Default: null or empty if the device identifier is not known
2653 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2654 // SMP command sent or received over L2CAP
2655 // Default: CMD_UNKNOWN
2656 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2657 // Whether this command is sent or received
2658 // Default: DIRECTION_UNKNOWN
2659 optional android.bluetooth.DirectionEnum direction = 3;
2660 // SMP failure reason code
2661 // Default: PAIRING_FAIL_REASON_DEFAULT
2662 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002663 // An identifier that can be used to match events for this device.
2664 // The incremental identifier is locally generated and guaranteed not derived
2665 // from any globally unique hardware id.
2666 // For paired devices, it stays consistent between Bluetooth toggling for the
2667 // same remote device.
2668 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2669 // session for the same remote device.
2670 // Default: 0 if the device's metric id is unknown.
2671 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002672}
2673
2674/**
Jack He815cdba2019-01-30 17:24:55 -08002675 * Logs when a Bluetooth socket’s connection state changed
2676 *
2677 * Logged from:
2678 * system/bt
2679 */
2680message BluetoothSocketConnectionStateChanged {
2681 // An identifier that can be used to match events for this device.
2682 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2683 // Salt: Randomly generated 256 bit value
2684 // Hash algorithm: HMAC-SHA256
2685 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002686 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002687 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002688 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002689 // Default 0 when unknown or don't care
2690 optional int32 port = 2;
2691 // Socket type as mentioned in
2692 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2693 // Default: SOCKET_TYPE_UNKNOWN
2694 optional android.bluetooth.SocketTypeEnum type = 3;
2695 // Socket connection state
2696 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2697 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2698 // Number of bytes sent to remote device during this connection
2699 optional int64 tx_bytes = 5;
2700 // Number of bytes received from remote device during this connection
2701 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002702 // Socket owner's UID
2703 optional int32 uid = 7 [(is_uid) = true];
2704 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2705 // |port| must be spawned by |server_port|
2706 // Default 0 when unknown or don't care
2707 optional int32 server_port = 8;
2708 // Whether this is a server listener socket
2709 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002710 // An identifier that can be used to match events for this device.
2711 // The incremental identifier is locally generated and guaranteed not derived
2712 // from any globally unique hardware id.
2713 // For paired devices, it stays consistent between Bluetooth toggling for the
2714 // same remote device.
2715 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2716 // session for the same remote device.
2717 // Default: 0 if the device's metric id is unknown.
2718 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002719}
2720
2721/**
Jack He71426802019-04-02 13:32:52 -07002722 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2723 *
2724 * Logged from:
2725 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2726 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2727 *
2728 */
2729message BluetoothClassOfDeviceReported {
2730 // An identifier that can be used to match events for this device.
2731 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2732 // Salt: Randomly generated 256 bit value
2733 // Hash algorithm: HMAC-SHA256
2734 // Size: 32 byte
2735 // Default: null or empty if this is a server listener socket
2736 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2737 // Class of Device (CoD) value including both Major, Minor device class and service class
2738 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2739 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2740 // Default: 0
2741 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002742 // An identifier that can be used to match events for this device.
2743 // The incremental identifier is locally generated and guaranteed not derived
2744 // from any globally unique hardware id.
2745 // For paired devices, it stays consistent between Bluetooth toggling for the
2746 // same remote device.
2747 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2748 // session for the same remote device.
2749 // Default: 0 if the device's metric id is unknown.
2750 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002751}
2752
2753/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002754 * Logs when something is plugged into or removed from the USB-C connector.
2755 *
2756 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002757 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002758 */
2759message UsbConnectorStateChanged {
2760 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002761 STATE_DISCONNECTED = 0;
2762 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002763 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002764 optional State state = 1
2765 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2766 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002767 // Last active session in ms.
2768 // 0 when the port is in connected state.
2769 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002770}
2771
2772/**
2773 * Logs the reported speaker impedance.
2774 *
2775 * Logged from:
2776 * Vendor audio implementation.
2777 */
2778message SpeakerImpedanceReported {
2779 optional int32 speaker_location = 1;
2780 optional int32 impedance = 2;
2781}
2782
2783/**
2784 * Logs the report of a failed hardware.
2785 *
2786 * Logged from:
2787 * Vendor HALs.
2788 *
2789 */
2790message HardwareFailed {
2791 enum HardwareType {
2792 HARDWARE_FAILED_UNKNOWN = 0;
2793 HARDWARE_FAILED_MICROPHONE = 1;
2794 HARDWARE_FAILED_CODEC = 2;
2795 HARDWARE_FAILED_SPEAKER = 3;
2796 HARDWARE_FAILED_FINGERPRINT = 4;
2797 }
2798 optional HardwareType hardware_type = 1;
2799
Maggie White6dcd8572019-01-31 14:11:50 -08002800 /**
2801 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002802 * the same hardware_type. The specific locations are vendor defined integers,
2803 * referring to board-specific numbering schemes.
2804 */
2805 optional int32 hardware_location = 2;
2806
Maggie White6dcd8572019-01-31 14:11:50 -08002807 /**
2808 * failure_code is specific to the HardwareType of the failed hardware.
2809 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002810 */
Maggie White6dcd8572019-01-31 14:11:50 -08002811 enum HardwareErrorCode {
2812 UNKNOWN = 0;
2813 COMPLETE = 1;
2814 SPEAKER_HIGH_Z = 2;
2815 SPEAKER_SHORT = 3;
2816 FINGERPRINT_SENSOR_BROKEN = 4;
2817 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002818 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002819 }
2820 optional int32 failure_code = 3;
2821}
2822
2823/**
2824 * Log an event when the device has been physically dropped.
2825 * Reported from the /vendor partition.
2826 */
2827message PhysicalDropDetected {
2828 // Confidence that the event was actually a drop, 0 -> 100
2829 optional int32 confidence_pctg = 1;
2830 // Peak acceleration of the drop, in 1/1000s of a g.
2831 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002832 // Duration of freefall in ms
2833 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002834}
2835
2836/**
2837 * Log bucketed battery charge cycles.
2838 *
2839 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002840 * a given charge point. For example, if 10 cycle buckets are
2841 * initialized, bucket 1 is the lowest 1/10th of the battery,
2842 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002843 *
2844 * Logged from:
2845 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2846 */
2847message ChargeCyclesReported {
2848 optional int32 cycle_bucket_1 = 1;
2849 optional int32 cycle_bucket_2 = 2;
2850 optional int32 cycle_bucket_3 = 3;
2851 optional int32 cycle_bucket_4 = 4;
2852 optional int32 cycle_bucket_5 = 5;
2853 optional int32 cycle_bucket_6 = 6;
2854 optional int32 cycle_bucket_7 = 7;
2855 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002856 optional int32 cycle_bucket_9 = 9;
2857 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002858}
2859
2860/**
Howard Roa46b6582018-09-18 16:45:02 -07002861 * Log battery health snapshot.
2862 *
2863 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2864 * are snapshotted periodically over 24hrs.
2865 */
2866message BatteryHealthSnapshot {
2867 enum BatterySnapshotType {
2868 UNKNOWN = 0;
2869 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2870 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2871 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2872 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2873 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2874 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2875 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2876 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2877 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2878 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2879 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2880 }
2881 optional BatterySnapshotType type = 1;
2882 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002883 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002884 // Voltage Battery Voltage, in microVolts.
2885 optional int32 voltage_micro_volt = 3;
2886 // Current Battery current, in microAmps.
2887 optional int32 current_micro_amps = 4;
2888 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2889 optional int32 open_circuit_micro_volt = 5;
2890 // Resistance Battery Resistance, in microOhms.
2891 optional int32 resistance_micro_ohm = 6;
2892 // Level Battery Level, as % of full.
2893 optional int32 level_percent = 7;
2894}
2895
2896/**
2897 * Log slow I/O operations on the primary storage.
2898 */
2899message SlowIo {
2900 // Classifications of IO Operations.
2901 enum IoOperation {
2902 UNKNOWN = 0;
2903 READ = 1;
2904 WRITE = 2;
2905 UNMAP = 3;
2906 SYNC = 4;
2907 }
2908 optional IoOperation operation = 1;
2909
2910 // The number of slow IO operations of this type over 24 hours.
2911 optional int32 count = 2;
2912}
2913
2914/**
2915 * Log battery caused shutdown with the last recorded voltage.
2916 */
2917message BatteryCausedShutdown {
2918 // The last recorded battery voltage prior to shutdown.
2919 optional int32 last_recorded_micro_volt = 1;
2920}
2921
2922/**
Tej Singha72344992019-04-17 18:55:08 -07002923 * Logs when ThermalService receives throttling events.
2924 *
2925 * Logged from:
2926 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2927 */
2928message ThermalThrottlingSeverityStateChanged {
2929 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2930 optional android.os.TemperatureTypeEnum sensor_type = 1;
2931
2932 // The name of the temperature source. Eg. CPU0
2933 optional string sensor_name = 2;
2934
2935 // Temperature in tenths of a degree C.
2936 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2937 optional int32 temperature_deci_celsius = 3;
2938
2939 // Relative severity of the throttling, see enum definition.
2940 optional android.os.ThrottlingSeverityEnum severity = 4;
2941}
2942
2943/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002944 * Logs the duration of a davey (jank of >=700ms) when it occurs
2945 *
2946 * Logged from:
2947 * frameworks/base/libs/hwui/JankTracker.cpp
2948 */
2949message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002950 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002951 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002952
Tej Singhbb8554a2018-01-26 11:59:14 -08002953 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002954 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002955}
2956
2957/**
Bookatze5885242017-10-24 20:10:31 -07002958 * Logs phone signal strength changes.
2959 *
2960 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002961 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002962 */
2963message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002964 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2965 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002966}
2967
Yangster4ccebea2018-10-09 17:09:02 -07002968
2969/**
2970 * Logs when the phone state, sim state or signal strength changes
2971 *
2972 * Logged from:
2973 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2974 */
2975message PhoneServiceStateChanged {
2976 optional android.telephony.ServiceStateEnum state = 1;
2977 optional android.telephony.SimStateEnum sim_state = 2;
2978 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2979}
2980
2981/**
2982 * Logs when the phone becomes on or off.
2983 *
2984 * Logged from:
2985 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2986 */
2987message PhoneStateChanged {
2988 enum State {
2989 OFF = 0;
2990 ON = 1;
2991 }
2992 optional State state = 1;
2993}
2994
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002995message BackGesture {
2996 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002997 DEFAULT_BACK_TYPE = 0;
2998 COMPLETED = 1;
2999 COMPLETED_REJECTED = 2; // successful because coming from rejected area
3000 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
3001 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
3002 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
3003 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
3004 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
3005 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003006 }
3007 optional BackType type = 1;
3008
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003009 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
3010 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
3011 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
3012 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
3013 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
3014 optional int32 left_boundary = 8; // left edge width + left inset
3015 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
3016
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003017 enum WindowHorizontalLocation {
3018 DEFAULT_LOCATION = 0;
3019 LEFT = 1;
3020 RIGHT = 2;
3021 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003022 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003023}
3024
3025message ExclusionRectStateChanged {
3026 optional string component_name = 1; // if not available, simply packageName
3027 optional int32 requested_height = 2; // px
3028 optional int32 rejected_height = 3; // px
3029
3030 enum WindowHorizontalLocation {
3031 DEFAULT_LOCATION = 0;
3032 LEFT = 1;
3033 RIGHT = 2;
3034 }
3035 optional WindowHorizontalLocation x_location = 4;
3036 optional bool landscape = 5;
3037 optional bool splitscreen = 6;
3038 optional int32 duration_millis = 7;
3039}
3040
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003041/**
3042 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3043 *
3044 * Logged from:
3045 * packages/apps/Launcher3
3046 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003047message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003048 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003049 optional android.stats.launcher.LauncherState src_state = 2;
3050 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003051 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3052 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3053
3054 // The event id (e.g., app launch, drag and drop, long press)
3055 optional int32 event_id = 6;
3056 // The event's source or target id (e.g., icon, task, button)
3057 optional int32 target_id = 7;
3058 // If the target needs to be tracked, use this id field
3059 optional int32 instance_id = 8;
3060 optional int32 uid = 9 [(is_uid) = true];
3061 optional string package_name = 10;
3062 optional string component_name = 11;
3063
3064 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003065 optional int32 grid_x = 12 [default = -1];
3066 optional int32 grid_y = 13 [default = -1];
3067 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003068
3069 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003070 optional int32 grid_x_parent = 15 [default = -1];
3071 optional int32 grid_y_parent = 16 [default = -1];
3072 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003073
3074 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3075 optional int32 hierarchy = 18;
3076
3077 optional bool is_work_profile = 19;
3078
3079 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003080 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003081
3082 // e.g., folderLabelState can be captured in the following two fields
3083 optional int32 from_state = 21;
3084 optional int32 to_state = 22;
3085
3086 // e.g., autofilled or suggested texts that are not user entered
3087 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003088
3089 // e.g., number of contents inside a container (e.g., icons inside a folder)
3090 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003091}
3092
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003093/**
3094 * Used for snapshot of the HomeScreen UI elements
3095 *
3096 * Logged from:
3097 * packages/apps/Launcher3
3098 */
3099message LauncherStaticLayout {
3100 // The event id (e.g., snapshot, drag and drop)
3101 optional int32 event_id = 1;
3102 // The event's source or target id (e.g., icon, shortcut, widget)
3103 optional int32 target_id = 2;
3104 // If the target needs to be tracked, use this id field
3105 optional int32 instance_id = 3;
3106 optional int32 uid = 4 [(is_uid) = true];
3107 optional string package_name = 5;
3108 optional string component_name = 6;
3109
3110 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003111 optional int32 grid_x = 7 [default = -1];
3112 optional int32 grid_y = 8 [default = -1];
3113 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003114
3115 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003116 // e.g., when used with widgets target, use these values for (span_x, span_y)
3117 optional int32 grid_x_parent = 10 [default = -1];
3118 optional int32 grid_y_parent = 11 [default = -1];
3119 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003120
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003121 // UNKNOWN = 0
3122 // HOTSEAT = 1
3123 // WORKSPACE = 2
3124 // FOLDER_HOTSEAT = 3
3125 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003126 optional int32 hierarchy = 13;
3127
3128 optional bool is_work_profile = 14;
3129
3130 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3131 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003132
3133 // e.g., number of icons inside a folder
3134 optional int32 cardinality = 16;
3135
3136 // e.g., (x, y) span of the widget inside homescreen grid system
3137 optional int32 span_x = 17 [default = 1];
3138 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003139}
3140
3141/**
3142 * Logs when Wallpaper or ThemePicker UI has changed.
3143 *
3144 * Logged from:
3145 * packages/apps/ThemePicker
3146 * packages/apps/WallpaperPicker2
3147 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003148message StyleUIChanged {
3149 optional android.stats.style.Action action = 1;
3150 optional int32 color_package_hash = 2;
3151 optional int32 font_package_hash = 3;
3152 optional int32 shape_package_hash = 4;
3153 optional int32 clock_package_hash = 5;
3154 optional int32 launcher_grid = 6;
3155 optional int32 wallpaper_category_hash = 7;
3156 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003157 optional int32 color_preference = 9;
3158 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003159}
3160
David Chenc28b2bb2017-10-24 12:52:52 -07003161/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003162 * Logs when Settings UI has changed.
3163 *
3164 * Logged from:
3165 * packages/apps/Settings
3166 */
3167message SettingsUIChanged {
3168 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003169 * Where this SettingsUIChange event comes from. For example, if
3170 * it's a PAGE_VISIBLE event, where the page is opened from.
3171 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003172 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003173
3174 /**
3175 * What the UI action is.
3176 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003177 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003178
3179 /**
3180 * Where the action is happening
3181 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003182 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003183
3184 /**
3185 * What preference changed in this event.
3186 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003187 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003188
3189 /**
3190 * The new value of the changed preference.
3191 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003192 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003193}
3194
3195/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003196 * Logs basic timing information about touch events.
3197 * Reported at most every 5 minutes while device is being interacted with.
3198 *
3199 * Logged from:
3200 * frameworks/native/services/inputflinger
3201 */
3202message TouchEventReported {
3203 /**
3204 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003205 * and the standard deviation of the time spent processing touchscreen events
3206 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003207 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003208 * On supported devices, the starting point is taken during the hard interrupt inside the
3209 * kernel touch driver. On all other devices, the starting point is taken inside
3210 * the kernel's input event subsystem upon receipt of the input event.
3211 * The ending point is taken inside InputDispatcher, just after the input event
3212 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003213 */
3214 // Minimum value
3215 optional float latency_min_micros = 1;
3216 // Maximum value
3217 optional float latency_max_micros = 2;
3218 // Average value
3219 optional float latency_mean_micros = 3;
3220 // Standard deviation
3221 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003222 // Number of touch events (input_event) in this report
3223 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003224}
3225
3226/**
Philip Quinn0eded622019-01-29 12:46:28 -08003227 * Logs gesture classification and timing information for touch events.
3228 *
3229 * Logged from:
3230 * frameworks/base/core/java/android/view/GestureDetector.java
3231 * frameworks/base/core/java/android/view/View.java
3232 */
3233message TouchGestureClassified {
3234 // The source of the classification (e.g. Java class name).
3235 optional string source = 1;
3236
3237 enum Classification {
3238 UNKNOWN_CLASSIFICATION = 0;
3239 SINGLE_TAP = 1;
3240 DOUBLE_TAP = 2;
3241 LONG_PRESS = 3;
3242 DEEP_PRESS = 4;
3243 SCROLL = 5;
3244 }
3245 // The classification of the gesture.
3246 optional Classification classification = 2;
3247
3248 // The interval from the start of a touch event stream until the
3249 // classification was made.
3250 optional int32 latency_millis = 3;
3251
3252 // The distance from the location of the first touch event to the
3253 // location of the touch event when the classification was made.
3254 optional float displacement_px = 4;
3255}
3256
3257/**
David Chenc28b2bb2017-10-24 12:52:52 -07003258 * Logs that a setting was updated.
3259 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003260 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003261 * The tag and is_default allow resetting of settings to default values based on the specified
3262 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3263 */
3264message SettingChanged {
3265 // The name of the setting.
3266 optional string setting = 1;
3267
3268 // The change being imposed on this setting. May represent a number, eg "3".
3269 optional string value = 2;
3270
3271 // The new value of this setting. For most settings, this is same as value. For some settings,
3272 // value is +X or -X where X represents an element in a set. For example, if the previous value
3273 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3274 // The +/- feature is currently only used for location_providers_allowed.
3275 optional string new_value = 3;
3276
3277 // The previous value of this setting.
3278 optional string prev_value = 4;
3279
3280 // The tag used with the is_default for resetting sets of settings. This is generally null.
3281 optional string tag = 5;
3282
Bookatz90867622018-01-31 15:05:57 -08003283 // True if this setting with tag should be resettable.
3284 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003285
David Chenbd789912018-03-16 17:19:55 -07003286 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003287 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003288
3289 enum ChangeReason {
3290 UPDATED = 1; // Updated can be an insertion or an update.
3291 DELETED = 2;
3292 }
3293 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003294}
Chenjie Yub3dda412017-10-24 13:41:59 -07003295
Chenjie Yu05013b32017-11-21 10:21:41 -08003296/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003297 * Logs activity going to foreground or background
3298 *
3299 * Logged from:
3300 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3301 */
3302message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003303 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003304 optional string pkg_name = 2;
3305 optional string class_name = 3;
3306
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003307 enum State {
3308 BACKGROUND = 0;
3309 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003310 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003311 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003312}
David Chenc8a43242017-10-17 16:23:28 -07003313
3314/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003315 * Logs when a volume entered low Storage state.
3316 * Logged from:
3317 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3318 */
3319message LowStorageStateChanged {
3320 // Volume that ran out of storage.
3321 optional string volume_description = 1;
3322
3323 enum State {
3324 UNKNOWN = 0;
3325 OFF = 1;
3326 ON = 2;
3327 }
3328 optional State state = 2;
3329}
3330
3331/**
3332 * Logs when an app is downgraded.
3333 * Logged from:
3334 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3335 */
3336message AppDowngraded {
3337 optional string package_name = 1;
3338 // Size of the package (all data) before being downgraded.
3339 optional int64 size_in_bytes_before = 2;
3340 // Size of the package (all data) after being downgraded.
3341 optional int64 size_in_bytes_after = 3;
3342
3343 optional bool aggressive = 4;
3344}
3345
3346/**
3347 * Logs when an app is optimized after being downgraded.
3348 * Logged from:
3349 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3350 */
3351message AppOptimizedAfterDowngraded {
3352 optional string package_name = 1;
3353}
3354
3355/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003356 * Logs whenever an app is installed on external storage.
3357 * Logged from:
3358 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3359 */
3360message AppInstallOnExternalStorageReported {
3361 // The type of external storage.
3362 optional android.stats.storage.ExternalStorageType storage_type = 1;
3363 // The name of the package that is installed on the sd card.
3364 optional string package_name = 2;
3365}
3366
3367/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003368 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003369 * Logged from:
3370 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3371 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003372message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003373 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003374
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003375 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003376
3377 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003378 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003379 optional string process_name = 3;
3380
3381 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003382 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003383
3384 optional string package_name = 5;
3385
3386 enum InstantApp {
3387 UNAVAILABLE = 0;
3388 FALSE = 1;
3389 TRUE = 2;
3390 }
3391 optional InstantApp is_instant_app = 6;
3392
3393 enum ForegroundState {
3394 UNKNOWN = 0;
3395 BACKGROUND = 1;
3396 FOREGROUND = 2;
3397 }
3398 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003399
3400 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003401}
David Chen9e3808c2017-11-20 17:25:34 -08003402
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003403/**
3404 * Logs when a WTF (What a Terrible Failure) happened.
3405 * Logged from:
3406 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3407 */
3408message WTFOccurred {
3409 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003410
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003411 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003412
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003413 // The name of the process.
3414 // system_server if it is not by an app
3415 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003416
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003417 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003418 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003419
3420 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003421}
3422
3423/**
3424 * Logs when system server reports low memory.
3425 * Logged from:
3426 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3427 */
3428message LowMemReported {
3429}
3430
3431/**
3432 * Logs when an app ANR (App Not Responding) occurs.
3433 * Logged from:
3434 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3435 */
3436message ANROccurred {
3437 optional int32 uid = 1 [(is_uid) = true];
3438
3439 optional string process_name = 2;
3440
3441 optional string short_component_name = 3;
3442
3443 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003444
3445 enum InstantApp {
3446 UNAVAILABLE = 0;
3447 FALSE = 1;
3448 TRUE = 2;
3449 }
3450 optional InstantApp is_instant_app = 5;
3451
3452 enum ForegroundState {
3453 UNKNOWN = 0;
3454 BACKGROUND = 1;
3455 FOREGROUND = 2;
3456 }
3457 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003458
3459 optional android.server.ErrorSource error_source = 7;
3460
3461 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003462}
3463
Bookatza7020bd2018-08-28 16:29:35 -07003464/**
3465 * Logs when the vibrator state changes.
3466 * Logged from:
3467 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3468 */
3469message VibratorStateChanged {
3470 repeated AttributionNode attribution_node = 1;
3471
3472 enum State {
3473 OFF = 0;
3474 ON = 1;
3475 }
3476 optional State state = 2;
3477
3478 // Duration (in milliseconds) requested to keep the vibrator on.
3479 // Only applicable for State == ON.
3480 optional int64 duration_millis = 3;
3481}
3482
David Chen0a368b22017-12-06 16:28:16 -08003483/*
3484 * Allows other apps to push events into statsd.
3485 * Logged from:
3486 * frameworks/base/core/java/android/util/StatsLog.java
3487 */
David Chen0b5c90c2018-01-25 16:51:49 -08003488message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003489 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003490 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003491
3492 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3493 optional int32 label = 2;
3494
3495 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3496 // predicates for the metrics).
3497 enum State {
3498 UNKNOWN = 0;
3499 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3500 STOP = 2;
3501 START = 3;
3502 }
3503 optional State state = 3;
3504}
3505
David Chen9e3808c2017-11-20 17:25:34 -08003506/**
Bookatz7948c872018-09-04 12:58:33 -07003507 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3508 * For example, this could be due to the user manually changing the time.
3509 *
3510 * Logged from:
3511 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3512 */
3513message WallClockTimeShifted {
3514 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3515 optional int64 wall_clock_timestamp_millis = 1;
3516}
3517
3518/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003519 * Logs when statsd detects an anomaly.
3520 *
3521 * Logged from:
3522 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3523 */
3524message AnomalyDetected {
3525 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003526 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003527
Yangster-mac94e197c2018-01-02 16:03:03 -08003528 // Id of the config whose anomaly detection alert fired.
3529 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003530
Yangster-mac94e197c2018-01-02 16:03:03 -08003531 // Id of the alert (i.e. name of the anomaly that was detected).
3532 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003533}
3534
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003535message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003536 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003537 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003538
3539 // The app package name.
3540 optional string pkg_name = 2;
3541
3542 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003543 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003544 WARM = 1;
3545 HOT = 2;
3546 COLD = 3;
3547 }
3548 // The transition type.
3549 optional TransitionType type = 3;
3550
3551 // The activity name.
3552 optional string activity_name = 4;
3553
3554 // The name of the calling app. Empty if not set.
3555 optional string calling_pkg_name = 5;
3556
3557 // Whether the app is an instant app.
3558 optional bool is_instant_app = 6;
3559
3560 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003561 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003562
Bookatz80d11a02018-01-16 10:46:35 -08003563 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003564
David Chen0b5c90c2018-01-25 16:51:49 -08003565 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003566 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003567 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003568 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003569 optional int32 bind_application_delay_millis = 11;
3570 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003571
3572 // Empty if not set.
3573 optional string launch_token = 13;
3574
Calin Juravle759fbda2018-02-20 19:52:30 +00003575 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003576 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003577
3578 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003579 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003580}
3581
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003582message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003583 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003584 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003585
3586 // The app package name.
3587 optional string pkg_name = 2;
3588
3589 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003590 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003591 WARM = 1;
3592 HOT = 2;
3593 COLD = 3;
3594 }
3595 // The transition type.
3596 optional TransitionType type = 3;
3597
3598 // The activity name.
3599 optional string activity_name = 4;
3600}
3601
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003602message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003603 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003604 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003605
3606 // The app package name.
3607 optional string pkg_name = 2;
3608
3609 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003610 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003611 WITH_BUNDLE = 1;
3612 WITHOUT_BUNDLE = 2;
3613 }
3614 // The transition type.
3615 optional TransitionType type = 3;
3616
3617 // The activity name.
3618 optional string activity_name = 4;
3619
3620 optional bool transition_process_running = 5;
3621
3622 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003623 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003624}
3625
Bookatz8fcd09a2017-12-18 13:01:10 -08003626/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003627 * Logs a picture-in-picture action
3628 * Logged from:
3629 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3630 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3631 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3632 */
3633message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003634 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003635 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003636
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003637 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003638
Chenjie Yu52cacc62017-12-08 18:11:45 -08003639 enum State {
3640 ENTERED = 1;
3641 EXPANDED_TO_FULL_SCREEN = 2;
3642 MINIMIZED = 3;
3643 DISMISSED = 4;
3644 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003645 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003646}
3647
3648/**
Chenjie Yue8904192017-12-08 19:12:57 -08003649 * Logs overlay action
3650 * Logged from:
3651 * services/core/java/com/android/server/wm/Session.java
3652 */
3653message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003654 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003655
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003656 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003657
3658 optional bool using_alert_window = 3;
3659
3660 enum State {
3661 ENTERED = 1;
3662 EXITED = 2;
3663 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003664 optional State state = 4
3665 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003666}
3667
Adam Bookatz38767932020-02-05 12:13:40 -08003668/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003669 * Logs foreground service starts and stops.
3670 * Note that this is not when a service starts or stops, but when it is
3671 * considered foreground.
3672 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003673 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003674 */
3675message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003676 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003677 // package_name + "/" + class_name
3678 optional string short_name = 2;
3679
3680 enum State {
3681 ENTER = 1;
3682 EXIT = 2;
3683 }
3684 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003685
3686 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3687 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3688 optional bool allow_while_in_use_permission = 4;
3689}
3690
3691/**
3692 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3693 * A foreground service session is any continuous period during which the uid holds at least one
3694 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3695 * Accesses initiated while the uid is in the TOP state are ignored.
3696 * Sessions with no attempted accesses are not logged.
3697 * Logged from
3698 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3699 */
3700message ForegroundServiceAppOpSessionEnded {
3701 optional int32 uid = 1 [(is_uid) = true];
3702
3703 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003704 // Only following four ops are logged
3705 // COARSE_LOCATION = 0
3706 // FINE_LOCATION = 1
3707 // CAMERA = 26
3708 // RECORD_AUDIO = 27
3709 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003710
3711 // The uid's permission mode for accessing the AppOp during this fgs session.
3712 enum Mode {
3713 MODE_UNKNOWN = 0;
3714 MODE_ALLOWED = 1; // Always allowed
3715 MODE_IGNORED = 2; // Denied
3716 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3717 }
3718 optional Mode app_op_mode = 3;
3719
3720 // Number of times this AppOp was requested and allowed.
3721 optional int32 count_ops_accepted = 4;
3722 // Number of times this AppOp was requested but denied.
3723 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003724}
3725
Chenjie Yue8904192017-12-08 19:12:57 -08003726/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003727 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3728 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3729 * attributed back to the parent (host) uid. One example is Chrome.
3730 *
3731 * Logged from:
3732 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3733 */
3734message IsolatedUidChanged {
3735 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003736 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003737 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003738 optional int32 parent_uid = 1;
3739
3740 optional int32 isolated_uid = 2;
3741
3742 // We expect an isolated uid to be removed before if it's used for another parent uid.
3743 enum Event {
3744 REMOVED = 0;
3745 CREATED = 1;
3746 }
3747 optional Event event = 3;
3748}
3749
3750/*
3751 * Logs the reception of an incoming network packet causing the main system to wake up for
3752 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3753 * and processed by WakeupController.cpp.
3754 */
3755message PacketWakeupOccurred {
3756 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3757 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003758 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003759 // The interface name on which the packet was received.
3760 optional string iface = 2;
3761 // The ethertype value of the packet.
3762 optional int32 ethertype = 3;
3763 // String representation of the destination MAC address of the packet.
3764 optional string destination_hardware_address = 4;
3765 // String representation of the source address of the packet if this was an IP packet.
3766 optional string source_ip = 5;
3767 // String representation of the destination address of the packet if this was an IP packet.
3768 optional string destination_ip = 6;
3769 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3770 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3771 // families.
3772 optional int32 ip_next_header = 7;
3773 // The source port if this was a TCP or UDP packet.
3774 optional int32 source_port = 8;
3775 // The destination port if this was a TCP or UDP packet.
3776 optional int32 destination_port = 9;
3777}
3778
3779/*
3780 * Logs the memory stats for an app on startup.
3781 * Logged from:
3782 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3783 */
3784message AppStartMemoryStateCaptured {
3785 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003786 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003787
3788 // The process name.
3789 optional string process_name = 2;
3790
3791 // The activity name.
3792 optional string activity_name = 3;
3793
3794 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003795 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003796
3797 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003798 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003799
3800 // RSS
3801 optional int64 rss_in_bytes = 6;
3802
3803 // CACHE
3804 optional int64 cache_in_bytes = 7;
3805
3806 // SWAP
3807 optional int64 swap_in_bytes = 8;
3808}
3809
3810/*
3811 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3812 * for LMK event.
3813 * Logged from:
3814 * system/core/lmkd/lmkd.c
3815 */
3816message LmkStateChanged {
3817 enum State {
3818 UNKNOWN = 0;
3819 START = 1;
3820 STOP = 2;
3821 }
3822 optional State state = 1;
3823}
3824
3825/*
3826 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3827 * Logged from:
3828 * system/core/lmkd/lmkd.c
3829 */
3830message LmkKillOccurred {
3831 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003832 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003833
3834 // The process name.
3835 optional string process_name = 2;
3836
3837 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003838 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003839
3840 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003841 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003842
3843 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003844 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003845
3846 // RSS
3847 optional int64 rss_in_bytes = 6;
3848
3849 // CACHE
3850 optional int64 cache_in_bytes = 7;
3851
3852 // SWAP
3853 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003854
3855 // The elapsed real time of start of the process.
3856 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003857
3858 // Min oom adj score considered by lmkd.
3859 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003860}
3861
Rajeev Kumar51b54602018-03-01 12:18:26 -08003862/*
3863 * Logs when the ActivityManagerService detects that an app died.
3864 *
3865 * Logged from:
3866 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3867 */
3868message AppDied {
3869 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003870 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003871}
3872
Howard Ro21a039c2018-08-06 14:55:47 -07003873/**
3874 * An atom for generic metrics logging. Available from Android Q.
3875 */
3876message GenericAtom {
3877 // The uid of the application that sent this custom atom.
3878 optional int32 uid = 1 [(is_uid) = true];
3879
3880 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003881 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003882}
3883
Tej Singhd6d6d772018-09-05 17:41:25 -07003884/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003885 * Atom for simple logging of user interaction and impression events, such as "the user touched
3886 * this button" or "this dialog was displayed".
3887 * Keep the UI event stream clean: don't use for system or background events.
3888 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003889 *
3890 * Logged from:
3891 * frameworks/base/services/core/java/com/android/server/
3892 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003893 */
3894message UiEventReported {
3895 // The event_id.
3896 optional int32 event_id = 1;
3897 // The event's source or target uid and package, if applicable.
3898 // For example, the package posting a notification, or the destination package of a share.
3899 optional int32 uid = 2 [(is_uid) = true];
3900 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003901 // An identifier used to disambiguate which logs refer to a particular instance of some
3902 // UI element. Useful when there might be multiple instances simultaneously active.
3903 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003904}
3905
3906/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003907 * Reports a notification was created or updated.
3908 *
3909 * Logged from:
3910 * frameworks/base/services/core/java/com/android/server/notification/
3911 */
3912message NotificationReported {
3913 // The event_id (as for UiEventReported).
3914 optional int32 event_id = 1;
3915 // The notifying app's uid and package.
3916 optional int32 uid = 2 [(is_uid) = true];
3917 optional string package_name = 3;
3918 // A small system-assigned identifier for the notification.
3919 // Locally probably-unique, but expect collisions across users and/or days.
3920 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003921 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3922 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003923
3924 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003925 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3926 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3927 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003928
3929 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003930 optional string category = 10; // App-assigned notification category (API-defined strings)
3931 optional int32 style = 11; // App-assigned notification style
3932 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003933
3934 // Ordering, importance and interruptiveness
3935
Will Brockman7614f6962020-02-10 19:43:03 -05003936 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003937
Will Brockman7614f6962020-02-10 19:43:03 -05003938 optional android.stats.sysui.NotificationImportance importance = 14;
3939 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003940
3941 enum NotificationImportanceExplanation {
3942 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3943 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3944 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3945 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3946 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3947 // Like _APP, but based on pre-channels priority signal.
3948 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3949 }
3950
Will Brockman7614f6962020-02-10 19:43:03 -05003951 optional NotificationImportanceExplanation importance_source = 16;
3952 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3953 optional NotificationImportanceExplanation importance_initial_source = 18;
3954 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3955 optional int32 assistant_hash = 20;
3956 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003957}
3958
3959message Notification {
3960 // The notifying app's uid and package.
3961 optional int32 uid = 1 [(is_uid) = true];
3962 optional string package_name = 2;
3963 // A small system-assigned identifier for the notification.
3964 optional int32 instance_id = 3;
3965
3966 // Grouping information.
3967 optional int32 group_instance_id = 4;
3968 optional bool is_group_summary = 5;
3969
3970 // The section of the shade that the notification is in.
3971 // See NotificationSectionsManager.PriorityBucket.
3972 enum NotificationSection {
3973 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003974 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003975 SECTION_MEDIA_CONTROLS = 2;
3976 SECTION_PEOPLE = 3;
3977 SECTION_ALERTING = 4;
3978 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003979 }
3980 optional NotificationSection section = 6;
3981}
3982
3983message NotificationList {
3984 repeated Notification notifications = 1; // An ordered sequence of notifications.
3985}
3986
3987/**
3988 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3989 *
3990 * Logged from:
3991 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3992 */
3993message NotificationPanelReported {
3994 // The event_id (as for UiEventReported).
3995 optional int32 event_id = 1;
3996 optional int32 num_notifications = 2;
3997 // The notifications in the panel, in the order that they appear there.
3998 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3999}
4000
4001/**
4002 * Reports a notification channel, or channel group, was created, updated, or deleted.
4003 *
4004 * Logged from:
4005 * frameworks/base/services/core/java/com/android/server/notification/
4006 */
4007message NotificationChannelModified {
4008 // The event_id (as for UiEventReported).
4009 optional int32 event_id = 1;
4010 // The notifying app's uid and package.
4011 optional int32 uid = 2 [(is_uid) = true];
4012 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05004013 // Hash of app-assigned notification channel ID or channel-group ID
4014 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05004015 // Previous importance setting, if applicable
4016 optional android.stats.sysui.NotificationImportance old_importance = 5;
4017 // New importance setting
4018 optional android.stats.sysui.NotificationImportance importance = 6;
4019}
4020
4021
4022/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004023 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004024 *
4025 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004026 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004027 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004028message BiometricAcquired {
4029 // Biometric modality that was acquired.
4030 optional android.hardware.biometrics.ModalityEnum modality = 1;
4031 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4032 optional int32 user = 2;
4033 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4034 optional bool is_crypto = 3;
4035 // Action that the device is performing. Acquired messages are only expected for enroll and
4036 // authenticate. Other actions may indicate an error.
4037 optional android.hardware.biometrics.ActionEnum action = 4;
4038 // The client that this acquisition was received for.
4039 optional android.hardware.biometrics.ClientEnum client = 5;
4040 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4041 optional int32 acquire_info = 6;
4042 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4043 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004044 // Dictates if this message should trigger additional debugging.
4045 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004046}
4047
4048/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004049 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004050 *
4051 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004052 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004053 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004054message BiometricAuthenticated {
4055 // Biometric modality that was used.
4056 optional android.hardware.biometrics.ModalityEnum modality = 1;
4057 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4058 optional int32 user = 2;
4059 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4060 // storage.
4061 optional bool is_crypto = 3;
4062 // The client that this acquisition was received for.
4063 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004064 // If authentication requires user confirmation. See BiometricPrompt's
4065 // setRequireConfirmation(bool) method.
4066 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004067
Kevin Chyn1741a072019-01-17 11:54:40 -08004068 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004069 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004070 REJECTED = 1;
4071 PENDING_CONFIRMATION = 2;
4072 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004073 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004074
4075 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004076 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004077 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4078 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4079 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4080 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004081 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004082 // Dictates if this message should trigger additional debugging.
4083 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004084}
4085
4086/**
4087 * Logs when a biometric error occurs.
4088 *
4089 * Logged from:
4090 * frameworks/base/services/core/java/com/android/server/biometrics
4091 */
4092message BiometricErrorOccurred {
4093 // Biometric modality that was used.
4094 optional android.hardware.biometrics.ModalityEnum modality = 1;
4095 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4096 optional int32 user = 2;
4097 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4098 optional bool is_crypto = 3;
4099 // Action that the device is performing.
4100 optional android.hardware.biometrics.ActionEnum action = 4;
4101 // The client that this acquisition was received for.
4102 optional android.hardware.biometrics.ClientEnum client = 5;
4103 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4104 // are unique to modality.
4105 optional int32 error_info = 6;
4106 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4107 // by the vendor and not specified by the HIDL interface.
4108 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004109 // Dictates if this message should trigger additional debugging.
4110 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004111 // Time spent during the authentication attempt.
4112 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004113}
4114
4115/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004116 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004117 * Logged from:
4118 * frameworks/base/services/core/java/com/android/server/biometrics
4119 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004120message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004121 // Biometric modality.
4122 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004123 // Type of issue detected.
4124 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004125 // Dictates if this message should trigger additional debugging.
4126 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004127}
Howard Ro688ae182018-09-25 00:09:36 -07004128
joshmccloskey6f952b22019-03-25 20:59:35 -07004129/**
4130 * Logs when a biometric enrollment occurs.
4131 *
4132 * Logged from:
4133 * frameworks/base/services/core/java/com/android/server/biometrics
4134 */
4135message BiometricEnrolled {
4136 // Biometric modality that was used.
4137 optional android.hardware.biometrics.ModalityEnum modality = 1;
4138 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4139 optional int32 user = 2;
4140 // The amount of time the enrollment took in milliseconds.
4141 optional int64 latency_millis = 3;
4142 // Whether or not the enrollment was successful.
4143 optional bool success = 4;
4144}
4145
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004146/*
Tej Singh0d176952019-01-16 19:10:54 -08004147 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004148 */
Tej Singh0d176952019-01-16 19:10:54 -08004149message FlagFlipUpdateOccurred {
4150 // If the event is from a flag config package, specify the package name.
4151 optional string flag_flip_package_name = 1;
4152
4153 // The order id of the package
4154 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004155}
4156
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004157/**
4158 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004159 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004160 */
4161message TrainExperimentIds {
4162 repeated int64 experiment_id = 1;
4163}
4164
Yangster-macb89807e2018-11-15 21:10:57 -08004165/*
4166 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004167 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004168 */
4169message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004170 // Name of the train.
4171 optional string train_name = 1;
4172 // Version code for a "train" of packages that need to be installed atomically
4173 optional int64 train_version_code = 2;
4174 // After installation of this package, device requires a restart.
4175 optional bool requires_staging = 3;
4176 // Rollback should be enabled for this install.
4177 optional bool rollback_enabled = 4;
4178 // Requires low latency monitoring if possible.
4179 optional bool requires_low_latency_monitor = 5;
4180
Yangster-macb89807e2018-11-15 21:10:57 -08004181 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004182 UNKNOWN = 0;
4183 INSTALL_REQUESTED = 1;
4184 INSTALL_STARTED = 2;
4185 INSTALL_STAGED_NOT_READY = 3;
4186 INSTALL_STAGED_READY = 4;
4187 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004188 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4189 // and INSTALL_FAILURE_COMMIT.
4190 INSTALL_FAILURE = 6 [deprecated = true];
4191 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004192 INSTALL_CANCELLED = 7;
4193 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004194 INSTALLER_ROLLBACK_INITIATED = 9;
4195 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4196 INSTALLER_ROLLBACK_STAGED = 11;
4197 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4198 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4199 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4200 INSTALLER_ROLLBACK_SUCCESS = 15;
4201 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004202 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4203 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4204 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4205 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4206 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4207 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004208 INSTALL_FAILURE_DOWNLOAD = 23;
4209 INSTALL_FAILURE_STATE_MISMATCH = 24;
4210 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004211 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004212 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004213 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004214 // Possible experiment ids for monitoring this push.
4215 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4216 // user id
4217 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004218 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004219 // Whether or not this is a rollback event
4220 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004221}
4222
Tej Singhc9203082019-05-03 13:42:23 -07004223/* Test atom, is not logged anywhere */
4224message TestAtomReported {
4225 repeated AttributionNode attribution_node = 1;
4226 optional int32 int_field = 2;
4227 optional int64 long_field = 3;
4228 optional float float_field = 4;
4229 optional string string_field = 5;
4230 optional bool boolean_field = 6;
4231 enum State {
4232 UNKNOWN = 0;
4233 OFF = 1;
4234 ON = 2;
4235 }
4236 optional State state = 7;
4237 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4238}
4239
Maggie Whitefc1aa592018-11-28 21:55:23 -08004240/** Represents USB port overheat event. */
4241message UsbPortOverheatEvent {
4242 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4243 optional int32 plug_temperature_deci_c = 1;
4244
4245 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4246 optional int32 max_temperature_deci_c = 2;
4247
4248 /* Time between USB plug event and overheat threshold trip, in seconds. */
4249 optional int32 time_to_overheat_secs = 3;
4250
4251 /* Time between overheat threshold trip and hysteresis, in seconds. */
4252 optional int32 time_to_hysteresis_secs = 4;
4253
4254 /* Time between hysteresis and active mitigation ending, in seconds. */
4255 optional int32 time_to_inactive_secs = 5;
4256};
4257
Maggie White8735b852019-01-18 11:40:49 -08004258/**
4259 * Logs total effective full charge and discharge cycles on a battery.
4260 * Here are some examples of one effective cycle:
4261 * 1) the battery charges from 0% to 100% and drains back to 0%,
4262 * 2) charging from 50% to 100% and draining back to 50% twice.
4263 * Pulled from:
4264 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4265 */
4266message BatteryCycleCount {
4267 /* Number of total charge and discharge cycles on the system battery. */
4268 optional int32 cycle_count = 1;
4269}
4270
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004271/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004272 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4273 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004274 * Pulled from:
4275 * StatsCompanionService
4276 */
4277
Carmen Agimof12dec122019-03-06 16:14:38 +00004278message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004279
Carmen Agimof12dec122019-03-06 16:14:38 +00004280 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004281 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004282 PUBLIC = 1;
4283 PRIVATE = 2;
4284 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004285 }
4286
Carmen Agimof12dec122019-03-06 16:14:38 +00004287 // The type of external storage.
4288 optional android.stats.storage.ExternalStorageType storage_type = 1;
4289 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4290 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004291 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004292 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004293}
4294
Yangster-macb89807e2018-11-15 21:10:57 -08004295/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004296 * Logs when a connection becomes available and lost.
4297 * Logged in StatsCompanionService.java
4298 */
4299message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004300 // Id of the network.
4301 optional int32 net_id = 1;
4302
4303 enum State {
4304 UNKNOWN = 0;
4305 CONNECTED = 1;
4306 DISCONNECTED = 2;
4307 }
4308 // Connected state of a network.
4309 optional State state = 2;
4310}
4311
4312/**
4313 * Logs when a service starts and stops.
4314 * Logged from:
4315 * services/core/java/com/android/server/am/ActiveServices.java
4316 */
4317message ServiceStateChanged {
4318
4319 optional int32 uid = 1 [(is_uid) = true];
4320
4321 optional string package_name = 2;
4322
4323 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004324
4325 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004326 START = 1;
4327 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004328 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004329
4330 optional State state = 4;
4331}
4332
4333/**
4334 * Logs when a service is launched.
4335 * Logged from:
4336 * services/core/java/com/android/server/am/ActiveServices.java
4337 */
4338message ServiceLaunchReported {
4339
4340 optional int32 uid = 1 [(is_uid) = true];
4341
4342 optional string package_name = 2;
4343
4344 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004345}
Howard Ro688ae182018-09-25 00:09:36 -07004346
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004347/**
4348 * Logs when a hidden API is used.
4349 *
4350 * Logged from:
4351 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4352 */
4353message HiddenApiUsed {
4354 // The uid of the app making the hidden access.
4355 optional int32 uid = 1 [(is_uid) = true];
4356
4357 // Signature of the method or field accessed.
4358 optional string signature = 2;
4359
4360 enum AccessMethod {
4361 NONE = 0;
4362 REFLECTION = 1;
4363 JNI = 2;
4364 LINKING = 3;
4365 }
4366
4367 // Type of access.
4368 optional AccessMethod access_method = 3;
4369
4370 // Whether the access was prevented or not.
4371 optional bool access_denied = 4;
4372}
4373
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004374/**
4375 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4376 * - When user sees privacy chip
4377 * - When user clicks privacy chip
4378 * - How does the user exit the Privacy Dialog
4379 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004380 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4381 */
4382message PrivacyIndicatorsInteracted {
4383
4384 enum Type {
4385 UNKNOWN = 0;
4386 CHIP_VIEWED = 1;
4387 CHIP_CLICKED = 2;
4388 DIALOG_PRIVACY_SETTINGS = 3;
4389 DIALOG_DISMISS = 4;
4390 DIALOG_LINE_ITEM = 5;
4391 }
4392
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004393 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004394
4395 // Used if the type is LINE_ITEM
4396 optional string package_name = 2;
4397}
4398
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004399/**
4400 * Logs information about a package that is moved from the internal to external storage and vice
4401 * versa.
4402 * It logs the package name, the type of the external storage where the package is installed
4403 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4404 * and the move type: if it's from internal to external or the other way around.
4405 *
4406 * Logged from:
4407 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4408 */
4409message AppMovedStorageReported {
4410 enum MoveType {
4411 UNKNOWN = 0;
4412 TO_EXTERNAL = 1;
4413 TO_INTERNAL = 2;
4414 }
4415 // The type of the external storage.
4416 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4417 // The type of move.
4418 optional MoveType move_type = 2;
4419 // The name of the package that was moved.
4420 optional string package_name = 3;
4421}
4422
jianjin8f2dee02019-03-29 14:03:08 -07004423/**
4424 * Logs when system server watchdog occurs.
4425 * Logged from:
4426 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4427 */
4428message SystemServerWatchdogOccurred {
4429 optional string subject = 1;
4430}
4431
4432/**
4433 * Logs when new file added to tombstones.
4434 * Logged from:
4435 * frameworks/base/core/java/com/android/server/BootReceiver.java
4436 */
4437message TombStoneOccurred {
4438}
4439
Hai Zhang5d3328d2019-04-13 21:25:06 +08004440/*
4441 * Information about a role request
4442 *
4443 * Logged from:
4444 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4445 */
4446message RoleRequestResultReported {
4447 // UID of application requesting the role
4448 optional int32 requesting_uid = 1;
4449
4450 // Package name of application requesting the role
4451 optional string requesting_package_name = 2;
4452
4453 // The role to be granted
4454 optional string role_name = 3;
4455
4456 // The count of applications qualifying for the role
4457 optional int32 qualifying_count = 4;
4458
4459 // UID of application current granted the role
4460 optional int32 current_uid = 5;
4461
4462 // Package name of application current granted the role
4463 optional string current_package_name = 6;
4464
4465 // UID of another application that user chose to grant the role to, instead of the requesting
4466 // application
4467 optional int32 granted_another_uid = 7;
4468
4469 // Package name of another application that user chose to grant the role to, instead of the
4470 // requesting application
4471 optional string granted_another_package_name = 8;
4472
4473 enum Result {
4474 UNDEFINED = 0;
4475 // role request was ignored
4476 IGNORED = 1;
4477 // role request was ignored because it's already granted
4478 IGNORED_ALREADY_GRANTED = 2;
4479 // role request was ignored because the application isn't qualified
4480 IGNORED_NOT_QUALIFIED = 3;
4481 // role request was ignored because user said it should be always denied
4482 IGNORED_USER_ALWAYS_DENIED = 4;
4483 // role was granted by user action
4484 USER_GRANTED = 5;
4485 // role was denied by user action
4486 USER_DENIED = 6;
4487 // role was denied by user granting another application the role
4488 USER_DENIED_GRANTED_ANOTHER = 7;
4489 // role was denied and set to be always denied by the user
4490 USER_DENIED_WITH_ALWAYS = 8;
4491 }
4492 // The result of the role request
4493 optional Result result = 9;
4494}
4495
Mark Tabrya824a642019-11-05 12:26:12 -08004496/**
4497 * Logs when a Vehicle Maps Service client's connection state has changed
4498 *
4499 * Logged from:
4500 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4501 */
4502message VmsClientConnectionStateChanged {
4503 // The UID of the VMS client app
4504 optional int32 uid = 1 [(is_uid) = true];
4505
4506 enum State {
4507 UNKNOWN = 0;
4508 // Attempting to connect to the client
4509 CONNECTING = 1;
4510 // Client connection established
4511 CONNECTED = 2;
4512 // Client connection closed unexpectedly
4513 DISCONNECTED = 3;
4514 // Client connection closed by VMS
4515 TERMINATED = 4;
4516 // Error establishing the client connection
4517 CONNECTION_ERROR = 5;
4518 }
4519
4520 optional State state = 2;
4521}
4522
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004523/**
4524 * Logs when MediaProvider has successfully finished scanning a storage volume.
4525 *
4526 * Logged from:
4527 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4528 */
shafik43825842020-04-02 17:30:24 +01004529message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004530 enum Reason {
4531 // Scan triggered due to unknown reason
4532 UNKNOWN = 0;
4533 // Scan triggered due to storage volume being mounted
4534 MOUNTED = 1;
4535 // Scan triggered due to explicit user action or app request
4536 DEMAND = 2;
4537 // Scan triggered due to idle maintenance
4538 IDLE = 3;
4539 }
4540
4541 // Volume type that this event pertains to
4542 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4543 // Reason why this scan was triggered
4544 optional Reason reason = 2;
4545 // Total number of files scanned
4546 optional int64 item_count = 3;
4547 // Duration of scan, normalized per file
4548 optional float normalized_duration_millis = 4;
4549 // Number of database inserts, normalized per file
4550 optional float normalized_insert_count = 5;
4551 // Number of database updates, normalized per file
4552 optional float normalized_update_count = 6;
4553 // Number of database deletes, normalized per file
4554 optional float normalized_delete_count = 7;
4555}
4556
4557/**
4558 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4559 *
4560 * Logged from:
4561 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4562 */
shafik43825842020-04-02 17:30:24 +01004563message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004564 // Volume type that this event pertains to
4565 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004566 // UID of app that requested deletion
4567 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004568 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004569 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004570}
4571
4572/**
4573 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4574 *
4575 * Logged from:
4576 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4577 */
shafik43825842020-04-02 17:30:24 +01004578message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004579 enum Result {
4580 UNKNOWN = 0;
4581 USER_GRANTED = 1;
4582 AUTO_GRANTED = 2;
4583 USER_DENIED = 3;
4584 USER_DENIED_WITH_PREJUDICE = 4;
4585 AUTO_DENIED = 5;
4586 }
4587
4588 // Volume type that this event pertains to
4589 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004590 // UID of app that requested permission
4591 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004592 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004593 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004594 // Result of this request
shafik43825842020-04-02 17:30:24 +01004595 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004596}
4597
4598/**
4599 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4600 *
4601 * Logged from:
4602 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4603 */
shafik43825842020-04-02 17:30:24 +01004604message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004605 // Volume type that this event pertains to
4606 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4607 // Old database version code
4608 optional int32 version_from = 2;
4609 // New database version code
4610 optional int32 version_to = 3;
4611 // Total number of files in database
4612 optional int64 item_count = 4;
4613 // Duration of schema change, normalized per file
4614 optional float normalized_duration_millis = 5;
4615}
4616
4617/**
4618 * Logs when MediaProvider has finished an idle maintenance job.
4619 *
4620 * Logged from:
4621 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4622 */
shafik43825842020-04-02 17:30:24 +01004623message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004624 // Volume type that this event pertains to
4625 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4626
4627 // Total number of files in database
4628 optional int64 item_count = 2;
4629 // Duration of idle maintenance, normalized per file
4630 optional float normalized_duration_millis = 3;
4631 // Number of thumbnails found to be stale, normalized per file
4632 optional float normalized_stale_thumbnails = 4;
4633 // Number of items found to be expired, normalized per file
4634 optional float normalized_expired_media = 5;
4635}
4636
Keun young Park3e033cb2019-12-18 11:27:35 -08004637/**
4638 * Represents boot time event with duration in ms.
4639 *
4640 * Logged from: bootstat and various system server components. Check each enums for details.
4641 */
4642message BootTimeEventDuration {
4643 enum DurationEvent {
4644 UNKNOWN = 0;
4645 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4646 ABSOLUTE_BOOT_TIME = 1;
4647 // Bootloader's 1st stage execution time.
4648 // Logged from bootstat.
4649 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4650 // Bootloader's 1st stage loading time.
4651 // Logged from bootstat.
4652 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4653 // Bootloader's kernel loading time.
4654 // Logged from bootstat.
4655 BOOTLOADER_KERNEL_LOAD = 4;
4656 // Bootloader's 2nd stage execution time.
4657 // Logged from bootstat.
4658 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4659 // Bootloader's 2nd stage loading time.
4660 // Logged from bootstat.
4661 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4662 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4663 // for locked device.
4664 // Logged from bootstat.
4665 BOOTLOADER_UI_WAIT = 7;
4666 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4667 // Logged from bootstat.
4668 BOOTLOADER_TOTAL = 8;
4669 // Shutdown duration inside init for the reboot before the current boot up.
4670 // Logged from f/b/services/.../BootReceiver.java.
4671 SHUTDOWN_DURATION = 9;
4672 // Total time for mounting of disk devices during bootup.
4673 // Logged from f/b/services/.../BootReceiver.java.
4674 MOUNT_DEFAULT_DURATION = 10;
4675 // Total time for early stage mounting of disk devices during bootup.
4676 // Logged from f/b/services/.../BootReceiver.java.
4677 MOUNT_EARLY_DURATION = 11;
4678 // Total time for late stage mounting of disk devices during bootup.
4679 // Logged from f/b/services/.../BootReceiver.java.
4680 MOUNT_LATE_DURATION = 12;
4681 // Average time to scan non-system app after OTA
4682 // Logged from f/b/services/.../PackageManagerService.java
4683 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4684 // Time to initialize Package manager after OTA
4685 // Logged from f/b/services/.../PackageManagerService.java
4686 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4687 // Time to scan all system app from Package manager after OTA
4688 // Logged from f/b/services/.../PackageManagerService.java
4689 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4690 // Init's total time for cold boot stage.
4691 // Logged from bootstat.
4692 COLDBOOT_WAIT = 16;
4693 // Init's total time for initializing selinux.
4694 // Logged from bootstat.
4695 SELINUX_INIT = 17;
4696 // Time since last factory reset.
4697 // Logged from bootstat.
4698 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004699 // Init's total time spent for completing the 1st stage.
4700 // Logged from bootstat.
4701 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004702 }
4703
4704 // Type of the event.
4705 optional DurationEvent event = 1;
4706 // Duration of the event in ms.
4707 optional int64 duration_millis = 2;
4708}
4709
4710/**
4711 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4712 * since boot-up.
4713 *
4714 * Logged from: bootstat and various system server components. Check each enums for details.
4715 */
4716message BootTimeEventElapsedTime {
4717 enum ElapsedTimeEvent {
4718 UNKNOWN = 0;
4719 // Time when init starts 1st stage. Logged from bootstat.
4720 ANDROID_INIT_STAGE_1 = 1;
4721 // Time when sys.boot_completed prop is set.
4722 // Logged from bootstat.
4723 BOOT_COMPLETE = 2;
4724 // BOOT_COMPLETE for encrypted device.
4725 BOOT_COMPLETE_ENCRYPTION = 3;
4726 // BOOT_COMPLETE for device with no encryption.
4727 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4728 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004729 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004730 // BOOT_COMPLETE after factory reset.
4731 FACTORY_RESET_BOOT_COMPLETE = 6;
4732 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4733 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004734 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4735 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004736 // BOOT_COMPLETE after OTA.
4737 OTA_BOOT_COMPLETE = 9;
4738 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4739 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004740 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4741 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004742 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4743 // Logged from f/b/services/.../UserController.java
4744 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4745 // Time when the system starts sending BOOT_COMPLETED broadcast.
4746 // Logged from f/b/services/.../UserController.java
4747 FRAMEWORK_BOOT_COMPLETED = 13;
4748 // Time when the package manager starts init.
4749 // Logged from f/b/services/.../SystemServer.java
4750 PACKAGE_MANAGER_INIT_START = 14;
4751 // Time when package manager is ready
4752 // Logged from f/b/services/.../SystemServer.java
4753 PACKAGE_MANAGER_INIT_READY = 15;
4754 // Represents the time when user has entered unlock credential for system with user pin.
4755 // Logged from bootstat.
4756 POST_DECRYPT = 16;
4757 // Represents the start of zygote's init.
4758 // Logged from zygote itself.
4759 ZYGOTE_INIT_START = 17;
4760 // Represents the start of secondary zygote's init.
4761 // TODO: add logging to zygote
4762 SECONDARY_ZYGOTE_INIT_START = 18;
4763 // Represents the start of system server's init.
4764 // Logged from f/b/services/.../SystemServer.java
4765 SYSTEM_SERVER_INIT_START = 19;
4766 // Represents the completion of system server's init.
4767 // Logged from f/b/services/.../SystemServer.java
4768 SYSTEM_SERVER_READY = 20;
4769 // Represents the start of launcher during boot-up.
4770 // TODO: add logging
4771 LAUNCHER_START = 21;
4772 // Represents the completion of launcher's initial rendering. User can use other apps from
4773 // launcher from this point.
4774 // TODO: add logging
4775 LAUNCHER_SHOWN = 22;
4776 }
4777
4778 // Type of the event.
4779 optional ElapsedTimeEvent event = 1;
4780 // Time since bootup for the event.
4781 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4782 optional int64 time_millis = 2;
4783}
4784
4785/**
4786 * Boot time events with UTC time.
4787 *
4788 * Logged from: bootstat and various system server components. Check each enums for details.
4789 */
4790message BootTimeEventUtcTime {
4791 enum UtcTimeEvent {
4792 UNKNOWN = 0;
4793 // Time of the bootstat's marking of 1st boot after the last factory reset.
4794 // Logged from bootstat.
4795 FACTORY_RESET_RESET_TIME = 1;
4796 // The time when bootstat records FACTORY_RESET_* events. This is close to
4797 // BOOT_COMPLETE time for the current bootup.
4798 // Logged from bootstat.
4799 FACTORY_RESET_CURRENT_TIME = 2;
4800 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4801 // Logged from bootstat.
4802 FACTORY_RESET_RECORD_VALUE = 3;
4803 }
4804
4805 // Type of the event.
4806 optional UtcTimeEvent event = 1;
4807 // UTC time for the event.
4808 optional int64 utc_time_secs = 2;
4809}
4810
4811/**
4812 * Boot time events representing specific error code during bootup.
4813 * Meaning of error code can be different per each event type.
4814 *
4815 * Logged from: bootstat and various system server components. Check each enums for details.
4816 */
4817message BootTimeEventErrorCode {
4818 enum ErrorCodeEvent {
4819 UNKNOWN = 0;
4820 // Linux error code for time() call to get the current UTC time.
4821 // Logged from bootstat.
4822 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4823 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4824 // as UMOUNT_STAT_* from init/reboot.cpp.
4825 // Logged from f/b/services/.../BootReceiver.java.
4826 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004827 // Reprepsents fie system mounting error code of /data partition for the current boot.
4828 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004829 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004830 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004831 }
4832
4833 // Type of the event.
4834 optional ErrorCodeEvent event = 1;
4835 // error code defined per each event type.
4836 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4837 // FS_MGR_FS_STAT.
4838 optional int32 error_code = 2;
4839}
4840
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004841/**
4842 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4843 * after an OTA.
4844 *
4845 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004846 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004847 */
4848message SnapshotMergeReported {
4849 // Keep in sync with
4850 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4851 enum UpdateState {
4852 // No update or merge is in progress.
4853 NONE = 0;
4854 // An update is applying; snapshots may already exist.
4855 INITIATED = 1;
4856 // An update is pending, but has not been successfully booted yet.
4857 UNVERIFIED = 2;
4858 // The kernel is merging in the background.
4859 MERGING = 3;
4860 // Post-merge cleanup steps could not be completed due to a transient
4861 // error, but the next reboot will finish any pending operations.
4862 MERGE_NEEDS_REBOOT = 4;
4863 // Merging is complete, and needs to be acknowledged.
4864 MERGE_COMPLETED = 5;
4865 // Merging failed due to an unrecoverable error.
4866 MERGE_FAILED = 6;
4867 // The update was implicitly cancelled, either by a rollback or a flash
4868 // operation via fastboot. This state can only be returned by WaitForMerge.
4869 CANCELLED = 7;
4870 };
4871
4872 // Status of the update after the merge attempts.
4873 optional UpdateState final_state = 1;
4874
4875 // Time to complete a merge operation in milliseconds.
4876 // A negative value corresponds to the case in which the merge operation
4877 // was interrupted and resumed (e.g. in case of a system reboot during the
4878 // merge).
4879 optional int64 duration_millis = 2;
4880
4881 // Number of reboots that occurred after issuing and before completing the
4882 // merge of all the snapshot devices.
4883 optional int32 intermediate_reboots = 3;
Alessio Balsini2294f392020-05-26 11:11:20 +01004884
4885 // The device has been upgraded to Virtual A/B.
4886 optional bool is_vab_retrofit = 4;
4887
4888 // Space that has been temporarily allocated in the /data partition
4889 // containing the dm-snapshot's copy-on-write data generated during a
4890 // Virtual A/B update.
4891 optional int64 cow_file_size_bytes = 5;
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004892}
4893
Chenjie Yubbcbc602018-02-05 16:51:52 -08004894//////////////////////////////////////////////////////////////////////
4895// Pulled atoms below this line //
4896//////////////////////////////////////////////////////////////////////
4897
4898/**
David Chenc8a43242017-10-17 16:23:28 -07004899 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4900 *
4901 * Pulled from:
4902 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4903 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004904message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004905 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004906
4907 optional int64 rx_bytes = 2;
4908
4909 optional int64 rx_packets = 3;
4910
4911 optional int64 tx_bytes = 4;
4912
4913 optional int64 tx_packets = 5;
4914}
4915
4916/**
4917 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4918 *
4919 * Pulled from:
4920 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4921 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004922message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004923 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004924
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004925 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4926 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004927
4928 optional int64 rx_bytes = 3;
4929
4930 optional int64 rx_packets = 4;
4931
4932 optional int64 tx_bytes = 5;
4933
4934 optional int64 tx_packets = 6;
4935}
4936
4937/**
4938 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4939 *
4940 * Pulled from:
4941 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4942 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004943message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004944 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004945
4946 optional int64 rx_bytes = 2;
4947
4948 optional int64 rx_packets = 3;
4949
4950 optional int64 tx_bytes = 4;
4951
4952 optional int64 tx_packets = 5;
4953}
4954
4955/**
4956 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4957 *
4958 * Pulled from:
4959 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4960 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004961message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004962 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004963
Yao Chenc40a19d2018-03-15 16:48:25 -07004964 // 1 denotes foreground and 0 denotes background. This is called Set in
4965 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004966 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004967
4968 optional int64 rx_bytes = 3;
4969
4970 optional int64 rx_packets = 4;
4971
4972 optional int64 tx_bytes = 5;
4973
4974 optional int64 tx_packets = 6;
4975}
4976
4977/**
junyulai8d1a6092020-05-07 13:38:15 +08004978 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08004979 * Note that the data is expected to be sliced into more dimensions in future. In other words,
4980 * the caller must not assume any row of data is one full report when filtering with a set of
4981 * matching conditions, because future data may represent with multiple rows what is currently
4982 * represented by one.
4983 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
4984 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08004985 *
4986 * Pulled from:
4987 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
4988 */
4989message DataUsageBytesTransfer {
4990 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
4991 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
4992 // states combined, not including debug states. See NetworkStats#SET_*.
4993 optional int32 state = 1;
4994
4995 optional int64 rx_bytes = 2;
4996
4997 optional int64 rx_packets = 3;
4998
4999 optional int64 tx_bytes = 4;
5000
5001 optional int64 tx_packets = 5;
5002
5003 // Radio Access Technology (RAT) type of this record, should be one of
5004 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
5005 // the record is for all rat types combined.
5006 optional int32 rat_type = 6;
5007
5008 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08005009 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005010 optional string sim_mcc = 7;
5011 optional string sim_mnc = 8;
5012
junyulai8b794b72020-05-19 17:36:13 +08005013 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
5014 // See TelephonyManager#getSimCarrierId.
5015 optional int32 carrier_id = 9;
5016
junyulai8d1a6092020-05-07 13:38:15 +08005017 // Enumeration of opportunistic states with an additional ALL state indicates the record is
5018 // combined regardless of the boolean value in its field.
5019 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08005020 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08005021 ALL = 1;
5022 OPPORTUNISTIC = 2;
5023 NOT_OPPORTUNISTIC = 3;
5024 }
5025 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08005026 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005027 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005028 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005029}
5030
5031/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005032 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5033 *
5034 * Pulled from:
5035 * StatsCompanionService
5036 */
5037message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005038 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005039
5040 optional int64 rx_bytes = 2;
5041
5042 optional int64 tx_bytes = 3;
5043}
5044
5045/**
David Chenc8a43242017-10-17 16:23:28 -07005046 * Pulls the kernel wakelock durations. This atom is adapted from
5047 * android/internal/os/KernelWakelockStats.java
5048 *
5049 * Pulled from:
5050 * StatsCompanionService using KernelWakelockReader.
5051 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005052message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005053 optional string name = 1;
5054
5055 optional int32 count = 2;
5056
5057 optional int32 version = 3;
5058
Yangster-maca8a30442018-10-13 23:46:34 -07005059 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005060}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005061
Chenjie Yu05013b32017-11-21 10:21:41 -08005062/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005063 * Pulls low power state information. If power.stats HAL is not available, this
5064 * includes platform and subsystem sleep state information,
5065 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5066 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005067 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005068 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005069 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5070 * as defined in:
5071 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005072 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005073message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005074 // Subsystem name
5075 optional string subsystem_name = 1;
5076 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5077 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005078 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5079 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005080 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005081 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005082 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005083 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005084 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005085}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005086
Chenjie Yu05013b32017-11-21 10:21:41 -08005087/**
Bookatz92da2832018-11-01 18:10:03 -07005088 * Pulls on-device power measurement information.
5089 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5090 * Pulled from:
5091 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5092 */
5093message OnDevicePowerMeasurement {
5094 // Name of the subsystem (to which the rail belongs).
5095 optional string subsystem_name = 1;
5096
5097 // Rail name. The rail lies within the subsystem.
5098 optional string rail_name = 2;
5099
5100 // Time (in ms since boot) at which the rail energy value was measured.
5101 // This may differ slightly from the time that statsd logs this information.
5102 optional uint64 measurement_timestamp_millis = 3;
5103
5104 // Accumulated energy used via the rail since device boot in uWs.
5105 optional uint64 energy_microwatt_secs = 4;
5106}
5107
5108/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005109 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005110 * Pulls the time the cpu spend on the frequency index. Frequency index
5111 * starts from highest to lowest. The value should be monotonically
5112 * increasing since boot. However, if there is a cpu
5113 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005114 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005115message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005116 optional uint32 cluster = 1;
5117 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005118 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005119}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005120
Chenjie Yu05013b32017-11-21 10:21:41 -08005121/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005122 * Pulls Cpu Time Per Uid.
5123 * Note that isolated process uid time should be attributed to host uids.
5124 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005125message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005126 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005127 optional uint64 user_time_micros = 2;
5128 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005129}
5130
5131/**
5132 * Pulls Cpu Time Per Uid per frequency.
5133 * Note that isolated process uid time should be attributed to host uids.
5134 * For each uid, we order the time by descending frequencies.
5135 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005136message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005137 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005138 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005139 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005140}
Hugo Benichi884970e2017-11-14 22:42:46 +09005141
Chenjie Yu05013b32017-11-21 10:21:41 -08005142/**
5143 * Pulls Wifi Controller Activity Energy Info
5144 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005145message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005146 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005147 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005148 // stack reported state
5149 // TODO: replace this with proto enum
5150 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005151 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005152 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005153 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005154 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005155 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005156 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005157 // product of current(mA), voltage(V) and time(ms)
5158 optional uint64 controller_energy_used = 6;
5159}
5160
5161/**
5162 * Pulls Modem Activity Energy Info
5163 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005164message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005165 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005166 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005167 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005168 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005169 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005170 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005171 /**
5172 * Tx power index
5173 * index 0 = tx_power < 0dBm
5174 * index 1 = 0dBm < tx_power < 5dBm
5175 * index 2 = 5dBm < tx_power < 15dBm
5176 * index 3 = 15dBm < tx_power < 20dBm
5177 * index 4 = tx_power > 20dBm
5178 */
5179 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005180 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005181 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005182 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005183 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005184 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005185 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005186 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005187 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005188 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005189 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005190 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005191 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005192 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005193}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005194
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005195/**
5196 * Pulls Bluetooth Activity Energy Info
5197 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5198 */
5199message BluetoothActivityInfo {
5200 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005201 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005202 // bluetooth stack state
5203 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005204 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005205 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005206 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005207 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005208 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005209 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005210 // product of current(mA), voltage(V) and time(ms)
5211 optional uint64 energy_used = 6;
5212}
5213
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005214/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005215 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005216 *
5217 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005218 */
5219message ProcessMemoryState {
5220 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005221 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005222
5223 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005224 // Usually package name, "system" for system server.
5225 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005226 optional string process_name = 2;
5227
Rafal Slawikda51b932018-12-13 16:31:33 +00005228 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005229 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005230
5231 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005232 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005233
5234 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005235 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005236
Rajeev Kumar90235992018-01-29 11:06:48 -08005237 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005238 // Value is read from memory.stat, field total_rss if per-app memory
5239 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005240 optional int64 rss_in_bytes = 6;
5241
5242 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005243 // Value is read from memory.stat, field total_cache if per-app memory
5244 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005245 optional int64 cache_in_bytes = 7;
5246
5247 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005248 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005249 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005250 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005251
Rafal Slawik203c3db2019-09-25 19:53:01 +01005252 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005253 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005254
Rafal Slawik203c3db2019-09-25 19:53:01 +01005255 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5256 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005257
Rafal Slawik203c3db2019-09-25 19:53:01 +01005258 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5259 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005260}
5261
5262/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005263 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005264 *
5265 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5266 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005267 *
5268 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005269 */
5270message ProcessMemoryHighWaterMark {
5271 // The uid if available. -1 means not available.
5272 optional int32 uid = 1 [(is_uid) = true];
5273
Rafal Slawikda51b932018-12-13 16:31:33 +00005274 // The process name.
5275 // Usually package name or process cmdline.
5276 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005277 optional string process_name = 2;
5278
Rafal Slawik239b6802019-09-09 18:46:01 +01005279 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5280 // computed by converting kilobytes to bytes.
5281 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5282
Rafal Slawik3bea8952018-11-15 12:39:33 +00005283 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5284 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005285 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005286}
5287
5288/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005289 * Logs the memory stats for a process.
5290 *
5291 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5292 * and for selected native processes.
5293 */
5294message ProcessMemorySnapshot {
5295 // The uid if available. -1 means not available.
5296 optional int32 uid = 1 [(is_uid) = true];
5297
5298 // The process name.
5299 // Usually package name or process cmdline.
5300 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5301 optional string process_name = 2;
5302
5303 // The pid of the process.
5304 // Allows to disambiguate instances of the process.
5305 optional int32 pid = 3;
5306
5307 // The current OOM score adjustment value.
5308 // Read from ProcessRecord for managed processes.
5309 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5310 optional int32 oom_score_adj = 4;
5311
5312 // The current RSS of the process.
5313 // VmRSS from /proc/pid/status.
5314 optional int32 rss_in_kilobytes = 5;
5315
5316 // The current anon RSS of the process.
5317 // RssAnon from /proc/pid/status.
5318 optional int32 anon_rss_in_kilobytes = 6;
5319
5320 // The current swap size of the process.
5321 // VmSwap from /proc/pid/status.
5322 optional int32 swap_in_kilobytes = 7;
5323
5324 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5325 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5326}
5327
5328/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005329 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005330 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005331message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005332 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005333}
5334
5335/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005336 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005337 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005338message SystemUptime {
5339 // Milliseconds since the system was booted.
5340 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5341 // for external input).
5342 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005343 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005344}
5345
5346/*
5347 * Reads from /proc/uid_concurrent_active_time which has the format:
5348 * active: X (X is # cores)
5349 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5350 * [uid1]: [time-0] [time-1] [time-2] ... ...
5351 * ...
5352 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5353 * The file contains a monotonically increasing count of time for a single boot.
5354 */
5355message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005356 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005357 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005358}
5359
5360/**
5361 * Reads from /proc/uid_concurrent_policy_time which has the format:
5362 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5363 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5364 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5365 * ...
5366 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5367 * The file contains a monotonically increasing count of time for a single boot.
5368 */
5369message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005370 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005371 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005372 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005373}
5374
5375/*
5376 * Pulls free disk space, for data, system partition and temporary directory.
5377 */
5378message DiskSpace {
5379 // available bytes in data partition
5380 optional uint64 data_available_bytes = 1;
5381 // available bytes in system partition
5382 optional uint64 system_available_bytes = 2;
5383 // available bytes in download cache or temp directories
5384 optional uint64 temp_available_bytes = 3;
5385}
Tej Singhbf972d92018-01-10 20:51:13 -08005386
5387/**
5388 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005389 *
5390 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005391 */
5392message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005393 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005394}
5395
5396/**
5397 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005398 * Pulled from:
5399 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005400 */
5401message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005402 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005403}
5404
5405/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005406 * Pulls battery voltage.
5407 * Pulled from:
5408 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5409 */
5410message BatteryVoltage {
5411 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005412 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005413}
5414
5415/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005416 * Pulls battery level (percent full, from 0 to 100).
5417 *
5418 * Pulled from:
5419 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5420 */
5421message BatteryLevel {
5422 // Battery level. Should be in [0, 100].
5423 optional int32 battery_level = 1;
5424}
5425
5426/**
Tej Singhd89137e2018-03-26 14:51:40 -07005427 * Pulls the temperature of various parts of the device.
5428 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005429 *
Maggie White442b6312019-04-05 16:26:44 -07005430 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005431 */
5432message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005433 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005434 optional android.os.TemperatureTypeEnum sensor_location = 1;
5435
5436 // The name of the temperature source. Eg. CPU0
5437 optional string sensor_name = 2;
5438
Tej Singhd89137e2018-03-26 14:51:40 -07005439 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005440 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005441 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005442
5443 // Relative severity of the throttling, see enum definition.
5444 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005445}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005446
5447/**
5448 * Pulls the statistics of calls to Binder.
5449 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005450 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5451 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005452 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005453 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005454 */
5455message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005456 // UID of the process responsible for the binder transaction. It will be set if the process
5457 // executing the binder transaction attribute the transaction to another uid using
5458 // Binder.setThreadWorkSource().
5459 //
5460 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005461 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005462 // UID of the process executing the binder transaction.
5463 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005464 // Fully qualified class name of the API call.
5465 //
5466 // This is a system server class name.
5467 //
5468 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5469 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5470 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5471 // commonly used APIs.
5472 optional string service_class_name = 2;
5473 // Method name of the API call. It can also be a transaction code if we cannot
5474 // resolve it to a name. See Binder#getTransactionName.
5475 //
5476 // This is a system server method name.
5477 optional string service_method_name = 3;
5478 // Total number of API calls.
5479 optional int64 call_count = 4;
5480 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5481 optional bool screen_interactive = 13;
5482 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5483 // call_count will be equal to recorded_call_count.
5484 //
5485 // If recorded_call_count is different than call_count, it means data collection has been
5486 // sampled. All the fields below will be sampled in this case.
5487 optional int64 recorded_call_count = 12;
5488 // Number of exceptions thrown by the API.
5489 optional int64 recorded_exception_count = 5;
5490 // Total latency of all API calls.
5491 // Average can be computed using total_latency_micros / recorded_call_count.
5492 optional int64 recorded_total_latency_micros = 6;
5493 // Maximum latency of one API call.
5494 optional int64 recorded_max_latency_micros = 7;
5495 // Total CPU usage of all API calls.
5496 // Average can be computed using total_cpu_micros / recorded_call_count.
5497 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5498 optional int64 recorded_total_cpu_micros = 8;
5499 // Maximum CPU usage of one API call.
5500 optional int64 recorded_max_cpu_micros = 9;
5501 // Maximum parcel reply size of one API call.
5502 optional int64 recorded_max_reply_size_bytes = 10;
5503 // Maximum parcel request size of one API call.
5504 optional int64 recorded_max_request_size_bytes = 11;
5505}
5506
5507/**
5508 * Pulls the statistics of exceptions during calls to Binder.
5509 *
5510 * Binder stats are cumulative from boot unless somebody reset the data using
5511 * > adb shell dumpsys binder_calls_stats --reset
5512 */
5513message BinderCallsExceptions {
5514 // Exception class name, e.g. java.lang.IllegalArgumentException.
5515 //
5516 // This is an exception class name thrown by the system server.
5517 optional string exception_class_name = 1;
5518 // Total number of exceptions.
5519 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005520}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005521
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005522/**
5523 * Pulls the statistics of message dispatching on HandlerThreads.
5524 *
5525 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5526 * config on the device.
5527 *
5528 * Next tag: 11
5529 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005530message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005531 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005532 optional int32 uid = 1 [(is_uid) = true];
5533
5534 // Fully qualified class name of the handler target class.
5535 //
5536 // This field does not contain PII. This is a system server class name.
5537 optional string handler_class_name = 2;
5538
5539 // The name of the thread that runs the Looper.
5540 //
5541 // This field does not contain PII. This is a system server thread name.
5542 optional string looper_thread_name = 3;
5543
5544 // The name of the dispatched message.
5545 //
5546 // This field does not contain PII. This is a system server constant or class
5547 // name.
5548 optional string message_name = 4;
5549
5550 // Total number of successfully dispatched messages.
5551 optional int64 message_count = 5;
5552
5553 // Total number of messages that failed dispatching.
5554 optional int64 exception_count = 6;
5555
5556 // Total number of processed messages we have data recorded for. If we
5557 // collected data for all the messages, message_count will be equal to
5558 // recorded_message_count.
5559 //
5560 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005561 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005562 optional int64 recorded_message_count = 7;
5563
5564 // Total latency of all processed messages.
5565 // Average can be computed using recorded_total_latency_micros /
5566 // recorded_message_count.
5567 optional int64 recorded_total_latency_micros = 8;
5568
5569 // Total CPU usage of all processed message.
5570 // Average can be computed using recorded_total_cpu_micros /
5571 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005572 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005573 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005574
5575 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5576 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005577
5578 // Max recorded CPU usage of all processed messages.
5579 optional int64 recorded_max_cpu_micros = 11;
5580
5581 // Max recorded latency of all processed messages.
5582 optional int64 recorded_max_latency_micros = 12;
5583
5584 // Total number of messages we tracked the dispatching delay for. If we
5585 // collected data for all the messages, message_count will be equal to
5586 // recorded_delay_message_count.
5587 //
5588 // If recorded_delay_message_count is different than message_count, it means data
5589 // collection has been sampled or/and not all messages specified the target dispatch time.
5590 // The fields below will be sampled in this case.
5591 optional int64 recorded_delay_message_count = 13;
5592
5593 // Total dispatching delay of all processed messages.
5594 // Calculated as a difference between the target dispatching time (Message.when)
5595 // and the actual dispatching time.
5596 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5597 optional int64 recorded_total_delay_millis = 14;
5598
5599 // Max dispatching delay of all processed messages.
5600 // Calculated as a difference between the target dispatching time (Message.when)
5601 // and the actual dispatching time.
5602 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005603}
Tej Singh86dc9db2018-09-06 00:39:57 +00005604
5605/**
5606 * Pulls disk information, such as write speed and latency.
5607 */
5608message DiskStats {
5609 // Time taken to open, write 512B to, and close a file.
5610 // -1 if error performing the check.
5611 optional int64 data_write_latency_millis = 1;
5612
5613 optional bool file_based_encryption = 2;
5614
5615 // Recent disk write speed in kB/s.
5616 // -1 if error querying storageed.
5617 // 0 if data is unavailable.
5618 optional int32 recent_disk_write_speed = 3;
5619}
5620
5621
5622/**
5623 * Free and total bytes of the Data, Cache, and System partition.
5624 */
5625message DirectoryUsage {
5626 enum Directory {
5627 UNKNOWN = 0;
5628 DATA = 1;
5629 CACHE = 2;
5630 SYSTEM = 3;
5631 }
5632 optional Directory directory = 1;
5633 optional int64 free_bytes = 2;
5634 optional int64 total_bytes = 3;
5635}
5636
5637
5638/**
5639 * Size of an application: apk size, data size, and cache size.
5640 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5641 * Information is only reported for apps with the primary user (user 0).
5642 * Sizes are aggregated by package name.
5643 */
5644message AppSize {
5645 // Including uids will involve modifying diskstats logic.
5646 optional string package_name = 1;
5647 // App size in bytes. -1 if unavailable.
5648 optional int64 app_size_bytes = 2;
5649 // App data size in bytes. -1 if unavailable.
5650 optional int64 app_data_size_bytes = 3;
5651 // App cache size in bytes. -1 if unavailable.
5652 optional int64 app_cache_size_bytes = 4;
5653 // Time that the cache file was produced.
5654 // Uses System.currentTimeMillis(), which is wall clock time.
5655 optional int64 cache_time_millis = 5;
5656}
5657
5658
5659/**
5660 * Size of a particular category. Eg: photos, videos.
5661 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5662 */
5663message CategorySize {
5664 enum Category {
5665 UNKNOWN = 0;
5666 APP_SIZE = 1;
5667 APP_DATA_SIZE = 2;
5668 APP_CACHE_SIZE = 3;
5669 PHOTOS = 4;
5670 VIDEOS = 5;
5671 AUDIO = 6;
5672 DOWNLOADS = 7;
5673 SYSTEM = 8;
5674 OTHER = 9;
5675 }
5676 optional Category category = 1;
5677 // Category size in bytes.
5678 optional int64 size_bytes = 2;
5679 // Time that the cache file was produced.
5680 // Uses System.currentTimeMillis(), which is wall clock time.
5681 optional int64 cache_time_millis = 3;
5682}
Tej Singhd6d6d772018-09-05 17:41:25 -07005683
5684/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005685 * Pulls per uid I/O stats. The stats are cumulative since boot.
5686 *
5687 * Read/write bytes are I/O events from a storage device
5688 * Read/write chars are data requested by read/write syscalls, and can be
5689 * satisfied by caching.
5690 *
5691 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5692 */
5693message DiskIo {
5694 optional int32 uid = 1 [(is_uid) = true];
5695 optional int64 fg_chars_read = 2;
5696 optional int64 fg_chars_write = 3;
5697 optional int64 fg_bytes_read = 4;
5698 optional int64 fg_bytes_write = 5;
5699 optional int64 bg_chars_read = 6;
5700 optional int64 bg_chars_write = 7;
5701 optional int64 bg_bytes_read = 8;
5702 optional int64 bg_bytes_write = 9;
5703 optional int64 fg_fsync = 10;
5704 optional int64 bg_fsync= 11;
5705}
5706
5707
5708/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005709 * Pulls the number of fingerprints for each user.
5710 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005711 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005712 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005713message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005714 // The associated user. Eg: 0 for owners, 10+ for others.
5715 // Defined in android/os/UserHandle.java
5716 optional int32 user = 1;
5717 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005718 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005719}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005720
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005721/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005722 * Pulls the number of faces for each user.
5723 *
5724 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5725 */
5726message NumFacesEnrolled {
5727 // The associated user. Eg: 0 for owners, 10+ for others.
5728 // Defined in android/os/UserHandle.java
5729 optional int32 user = 1;
5730 // Number of faces registered to that user.
5731 optional int32 num_faces_enrolled = 2;
5732}
5733/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005734 * A mapping of role holder -> role
5735 */
5736message RoleHolder {
5737 // uid of the role holder
5738 optional int32 uid = 1 [(is_uid) = true];
5739
5740 // package name of the role holder
5741 optional string package_name = 2;
5742
5743 // the role held
5744 optional string role = 3;
5745}
5746
Yangsteraf9aee72018-10-12 09:26:16 -07005747message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005748 // These are all in byte resolution.
5749 optional int64 min = 1 [deprecated = true];
5750 optional int64 average = 2 [deprecated = true];
5751 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005752
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005753 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5754 // int64 fields.
5755 optional int32 mean_kb = 4;
5756 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005757}
5758
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005759// A reduced subset of process states; reducing the number of possible states allows more
5760// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5761enum ProcessStateAggregated {
5762 PROCESS_STATE_UNKNOWN = 0;
5763 // Persistent system process.
5764 PROCESS_STATE_PERSISTENT = 1;
5765 // Top activity; actually any visible activity.
5766 PROCESS_STATE_TOP = 2;
5767 // Process binding to top or a foreground service.
5768 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5769 // Processing running a foreground service.
5770 PROCESS_STATE_FGS = 4;
5771 // Important foreground process (ime, wallpaper, etc).
5772 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5773 // Important background process.
5774 PROCESS_STATE_BACKGROUND = 6;
5775 // Process running a receiver.
5776 PROCESS_STATE_RECEIVER = 7;
5777 // All kinds of cached processes.
5778 PROCESS_STATE_CACHED = 8;
5779}
5780
5781// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005782message ProcessStatsStateProto {
5783 optional android.service.procstats.ScreenState screen_state = 1;
5784
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005785 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005786
5787 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5788 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005789 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5790
5791 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005792
5793 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005794 optional int64 duration_millis = 4 [deprecated = true];
5795 // Same as above, but with minute resolution so it fits into an int32.
5796 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005797
5798 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005799 optional int64 realtime_duration_millis = 9 [deprecated = true];
5800 // Same as above, but with minute resolution so it fits into an int32.
5801 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005802
5803 // # of samples taken
5804 optional int32 sample_size = 5;
5805
5806 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005807 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005808
5809 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005810 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005811
5812 // RSS is memory resident for this process
5813 optional AggStats rss = 8;
5814}
5815
Jing Ji060d6862020-04-13 19:36:31 -07005816// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005817message ProcessStatsProto {
5818 // Name of process.
5819 optional string process = 1;
5820
5821 // Uid of the process.
Jing Ji1cd1f602020-06-03 13:45:36 -07005822 optional int32 uid = 2 [(is_uid) = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005823
5824 // Information about how often kills occurred
5825 message Kill {
5826 // Count of excessive CPU kills
5827 optional int32 cpu = 1;
5828
5829 // Count of kills when cached
5830 optional int32 cached = 2;
5831
5832 // PSS stats during cached kill
5833 optional AggStats cached_pss = 3;
5834 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005835 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005836
5837 // Time and memory spent in various states.
5838 repeated ProcessStatsStateProto states = 5;
5839
5840 // Total time process has been running... screen_state, memory_state, and process_state
5841 // will not be set.
5842 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005843
5844 // Association data for this process in this state;
5845 // each entry here is one association.
5846 repeated ProcessStatsAssociationProto assocs = 7;
5847}
5848
Jing Ji1cd1f602020-06-03 13:45:36 -07005849// Next Tag: 6
Jing Ji060d6862020-04-13 19:36:31 -07005850message ProcessStatsAssociationProto {
5851 // Procss Name of the associated process (client process of service binding)
5852 optional string assoc_process_name = 1;
5853
5854 // Package Name of the associated package (client package of service binding)
Jing Ji1cd1f602020-06-03 13:45:36 -07005855 optional string assoc_package_name = 2 [deprecated = true];
5856
5857 // UID of the associated process/package (client package of service binding)
5858 optional int32 assoc_uid = 5 [(is_uid) = true];
Jing Ji060d6862020-04-13 19:36:31 -07005859
5860 // Total count of the times this association (service binding) appeared.
5861 optional int32 total_count = 3;
5862
5863 // Uptime total duration in seconds this association (service binding) was around.
5864 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005865}
5866
5867message PackageServiceOperationStatsProto {
5868 // Operate enum: Started, Foreground, Bound, Executing
5869 optional android.service.procstats.ServiceOperationState operation = 1;
5870
5871 // Number of times the service was in this operation.
5872 optional int32 count = 2;
5873
5874 // Information about a state the service can be in.
5875 message StateStats {
5876 // Screen state enum.
5877 optional android.service.procstats.ScreenState screen_state = 1;
5878 // Memory state enum.
5879 optional android.service.procstats.MemoryState memory_state = 2;
5880
5881 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005882 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005883 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005884 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005885 }
5886 repeated StateStats state_stats = 3;
5887}
5888
5889message PackageServiceStatsProto {
5890 // Name of service component.
5891 optional string service_name = 1;
5892
5893 // The operation stats.
5894 // The package_name, package_uid, package_version, service_name will not be set to save space.
5895 repeated PackageServiceOperationStatsProto operation_stats = 2;
5896}
5897
5898message PackageAssociationSourceProcessStatsProto {
5899 // Uid of the process.
5900 optional int32 process_uid = 1;
5901 // Process name.
5902 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005903 // Package name.
5904 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005905 // Total count of the times this association appeared.
5906 optional int32 total_count = 3;
5907
5908 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005909 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005910
5911 // Total count of the times this association became actively impacting its target process.
5912 optional int32 active_count = 5;
5913
5914 // Information on one source in this association.
5915 message StateStats {
5916 // Process state enum.
5917 optional android.service.procstats.ProcessState process_state = 1;
5918 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005919 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005920 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005921 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005922 }
5923 repeated StateStats active_state_stats = 6;
5924}
5925
5926message PackageAssociationProcessStatsProto {
5927 // Name of the target component.
5928 optional string component_name = 1;
5929 // Information on one source in this association.
5930 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5931}
5932
5933
5934message ProcessStatsPackageProto {
5935 // Name of package.
5936 optional string package = 1;
5937
5938 // Uid of the package.
5939 optional int32 uid = 2;
5940
5941 // Version of the package.
5942 optional int64 version = 3;
5943
5944 // Stats for each process running with the package loaded in to it.
5945 repeated ProcessStatsProto process_stats = 4;
5946
5947 // Stats for each of the package's services.
5948 repeated PackageServiceStatsProto service_stats = 5;
5949
5950 // Stats for each association with the package.
5951 repeated PackageAssociationProcessStatsProto association_stats = 6;
5952}
5953
5954message ProcessStatsSectionProto {
5955 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005956 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005957
5958 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005959 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005960
5961 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005962 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005963
5964 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005965 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005966
5967 // System runtime library. e.g. "libdvm.so", "libart.so".
5968 optional string runtime = 5;
5969
5970 // whether kernel reports swapped pss.
5971 optional bool has_swapped_pss = 6;
5972
5973 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5974 enum Status {
5975 STATUS_UNKNOWN = 0;
5976 STATUS_COMPLETE = 1;
5977 STATUS_PARTIAL = 2;
5978 STATUS_SHUTDOWN = 3;
5979 STATUS_SYSPROPS = 4;
5980 }
5981 repeated Status status = 7;
5982
Chenjie Yub2ecc792019-01-17 10:27:26 -08005983 // Number of pages available of various types and sizes, representation fragmentation.
5984 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5985
Yangsteraf9aee72018-10-12 09:26:16 -07005986 // Stats for each process.
5987 repeated ProcessStatsProto process_stats = 8;
5988
5989 // Stats for each package.
5990 repeated ProcessStatsPackageProto package_stats = 9;
5991}
5992
Chenjie Yub2ecc792019-01-17 10:27:26 -08005993message ProcessStatsAvailablePagesProto {
5994 // Node these pages are in (as per /proc/pagetypeinfo)
5995 optional int32 node = 1;
5996
5997 // Zone these pages are in (as per /proc/pagetypeinfo)
5998 optional string zone = 2;
5999
6000 // Label for the type of these pages (as per /proc/pagetypeinfo)
6001 optional string label = 3;
6002
6003 // Distribution of number of pages available by order size. First entry in array is
6004 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
6005 repeated int32 pages_per_order = 4;
6006}
6007
Chenjie Yu12e5e672018-09-14 15:54:59 -07006008/**
6009 * Pulled from ProcessStatsService.java
6010 */
6011message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07006012 optional ProcessStatsSectionProto proc_stats_section = 1;
6013}
6014
Chenjie Yuf910b7802019-01-11 16:08:20 -08006015/**
6016 * Pulled from ProcessStatsService.java
6017 */
6018message ProcStatsPkgProc {
6019 optional ProcessStatsSectionProto proc_stats_section = 1;
6020}
6021
Chris Wrencdea3b72019-11-22 16:58:17 -05006022// Next Tag: 2
6023message PackageRemoteViewInfoProto {
6024 optional string package_name = 1;
6025 // add per-package additional info here (like channels)
6026}
6027
6028// Next Tag: 2
6029message NotificationRemoteViewsProto {
6030 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6031}
6032
6033/**
6034 * Pulled from NotificationManagerService.java
6035 */
6036message NotificationRemoteViews {
6037 optional NotificationRemoteViewsProto notification_remote_views = 1;
6038}
6039
Yotam Aron74299972020-01-16 16:20:58 +02006040/**
6041 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6042 */
6043message PackageNotificationPreferences {
6044 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006045 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006046 // Notification importance, which specifies when and how a notification is displayed.
6047 // Specified under core/java/android/app/NotificationManager.java.
6048 optional int32 importance = 2;
6049 // Lockscreen visibility as set by the user.
6050 optional int32 visibility = 3;
6051 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6052 // PreferencesHelper.java)
6053 optional int32 user_locked_fields = 4;
6054}
6055
6056/**
6057 * Atom that contains a list of a package's channel preferences, pulled from
6058 * NotificationManagerService.java.
6059 */
6060message PackageNotificationChannelPreferences {
6061 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006062 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006063 // Channel's ID. Should always be available.
6064 optional string channel_id = 2;
6065 // Channel's name. Should always be available.
6066 optional string channel_name = 3;
6067 // Channel's description. Optionally set by the channel creator.
6068 optional string description = 4;
6069 // Notification importance, which specifies when and how a notification is displayed. Specified
6070 // under core/java/android/app/NotificationManager.java.
6071 optional int32 importance = 5;
6072 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6073 // at core/java/android/app/NotificationChannel.java
6074 optional int32 user_locked_fields = 6;
6075 // Indicates if the channel was deleted by the app.
6076 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006077 // Indicates if the channel was marked as a conversation by the app.
6078 optional bool is_conversation = 8;
6079 // Indicates if the channel is a conversation that was demoted by the user.
6080 optional bool is_demoted_conversation = 9;
6081 // Indicates if the channel is a conversation that was marked as important by the user.
6082 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006083}
6084
6085/**
6086 * Atom that contains a list of a package's channel group preferences, pulled from
6087 * NotificationManagerService.java.
6088 */
6089message PackageNotificationChannelGroupPreferences {
6090 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006091 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006092 // Channel Group's ID. Should always be available.
6093 optional string group_id = 2;
6094 // Channel Group's name. Should always be available.
6095 optional string group_name = 3;
6096 // Channel Group's description. Optionally set by group creator.
6097 optional string description = 4;
6098 // Indicates if notifications from this channel group are blocked.
6099 optional bool is_blocked = 5;
6100 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6101 // at core/java/android/app/NotificationChannelGroup.java
6102 optional int32 user_locked_fields = 6;
6103}
6104
Yangsteraf9aee72018-10-12 09:26:16 -07006105message PowerProfileProto {
6106 optional double cpu_suspend = 1;
6107
6108 optional double cpu_idle = 2;
6109
6110 optional double cpu_active = 3;
6111
6112 message CpuCluster {
6113 optional int32 id = 1;
6114 optional double cluster_power = 2;
6115 optional int32 cores = 3;
6116 repeated int64 speed = 4;
6117 repeated double core_power = 5;
6118 }
6119
6120 repeated CpuCluster cpu_cluster = 40;
6121
6122 optional double wifi_scan = 4;
6123
6124 optional double wifi_on = 5;
6125
6126 optional double wifi_active = 6;
6127
6128 optional double wifi_controller_idle = 7;
6129
6130 optional double wifi_controller_rx = 8;
6131
6132 optional double wifi_controller_tx = 9;
6133
6134 repeated double wifi_controller_tx_levels = 10;
6135
6136 optional double wifi_controller_operating_voltage = 11;
6137
6138 optional double bluetooth_controller_idle = 12;
6139
6140 optional double bluetooth_controller_rx = 13;
6141
6142 optional double bluetooth_controller_tx = 14;
6143
6144 optional double bluetooth_controller_operating_voltage = 15;
6145
6146 optional double modem_controller_sleep = 16;
6147
6148 optional double modem_controller_idle = 17;
6149
6150 optional double modem_controller_rx = 18;
6151
6152 repeated double modem_controller_tx = 19;
6153
6154 optional double modem_controller_operating_voltage = 20;
6155
6156 optional double gps_on = 21;
6157
6158 repeated double gps_signal_quality_based = 22;
6159
6160 optional double gps_operating_voltage = 23;
6161
6162 optional double bluetooth_on = 24;
6163
6164 optional double bluetooth_active = 25;
6165
6166 optional double bluetooth_at_cmd = 26;
6167
6168 optional double ambient_display = 27;
6169
6170 optional double screen_on = 28;
6171
6172 optional double radio_on = 29;
6173
6174 optional double radio_scanning = 30;
6175
6176 optional double radio_active = 31;
6177
6178 optional double screen_full = 32;
6179
6180 optional double audio = 33;
6181
6182 optional double video = 34;
6183
6184 optional double flashlight = 35;
6185
6186 optional double memory = 36;
6187
6188 optional double camera = 37;
6189
6190 optional double wifi_batched_scan = 38;
6191
6192 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006193}
Chenjie Yuab530202018-09-26 12:39:20 -07006194
6195/**
6196 * power_profile.xml and other constants for power model calculations.
6197 * Pulled from PowerProfile.java
6198 */
6199message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006200 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006201}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006202
6203/**
arangelovd5db50e2018-10-12 20:24:39 +01006204 * Logs when a user restriction was added or removed.
6205 *
6206 * Logged from:
6207 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6208 */
6209message UserRestrictionChanged {
6210 // The raw string of the user restriction as defined in UserManager.
6211 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6212 optional string restriction = 1;
6213 // Whether the restriction is enabled or disabled.
6214 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006215}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006216
6217/**
6218 * Pulls process user time and system time. Puller takes a snapshot of all pids
6219 * in the system and returns cpu stats for those that are working at the time.
6220 * Dead pids will be dropped. Kernel processes are excluded.
6221 * Min cool-down is 5 sec.
6222 */
6223message ProcessCpuTime {
6224 optional int32 uid = 1 [(is_uid) = true];
6225
6226 optional string process_name = 2;
6227 // Process cpu time in user space, cumulative from boot/process start
6228 optional int64 user_time_millis = 3;
6229 // Process cpu time in system space, cumulative from boot/process start
6230 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006231}
Misha Wagner5a51e002018-10-03 15:04:09 +01006232
6233/**
6234 * Pulls the CPU usage for each thread.
6235 *
6236 * Read from /proc/$PID/task/$TID/time_in_state files.
6237 *
6238 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6239 * time_in_state files not being present on some phones, have not been addressed. These should be
6240 * considered before a public release.
6241 */
6242message CpuTimePerThreadFreq {
6243 // UID that owns the process.
6244 optional int32 uid = 1 [(is_uid) = true];
6245 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006246 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006247 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006248 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006249 // Name of the process taken from `/proc/$PID/cmdline`.
6250 optional string process_name = 4;
6251 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6252 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006253
6254 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6255 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6256 // frequencies are given here as the alternative is sending eight separate atoms. This method
6257 // significantly reduces the amount of data created
6258 optional int32 frequency1_khz = 6;
6259 optional int32 time1_millis = 7;
6260 optional int32 frequency2_khz = 8;
6261 optional int32 time2_millis = 9;
6262 optional int32 frequency3_khz = 10;
6263 optional int32 time3_millis = 11;
6264 optional int32 frequency4_khz = 12;
6265 optional int32 time4_millis = 13;
6266 optional int32 frequency5_khz = 14;
6267 optional int32 time5_millis = 15;
6268 optional int32 frequency6_khz = 16;
6269 optional int32 time6_millis = 17;
6270 optional int32 frequency7_khz = 18;
6271 optional int32 time7_millis = 19;
6272 optional int32 frequency8_khz = 20;
6273 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006274}
Bookatz75ee60422018-11-09 12:27:37 -08006275
6276/**
Bookatz366a4432018-11-20 09:42:33 -08006277 * Pulls information about the device's build.
6278 */
6279message BuildInformation {
6280 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6281 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6282 optional string fingerprint = 1;
6283
6284 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6285 optional string brand = 2;
6286
6287 // Build.PRODUCT. The name of the overall product.
6288 optional string product = 3;
6289
6290 // Build.DEVICE. The name of the industrial design.
6291 optional string device = 4;
6292
6293 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6294 optional string version_release = 5;
6295
6296 // Build.ID. E.g. a label like "M4-rc20".
6297 optional string id = 6;
6298
6299 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6300 // represent this build.
6301 optional string version_incremental = 7;
6302
6303 // Build.TYPE. The type of build, like "user" or "eng".
6304 optional string type = 8;
6305
6306 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6307 optional string tags = 9;
6308}
6309
6310/**
Adam He420947c2019-01-23 15:59:09 -08006311 * Logs information about mismatched caller for content capture.
6312 *
6313 * Logged from:
6314 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6315 */
6316message ContentCaptureCallerMismatchReported {
6317 optional string intended_package = 1;
6318 optional string calling_package = 2;
6319}
6320
6321/**
6322 * Logs information about content capture service events.
6323 *
6324 * Logged from:
6325 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6326 */
6327message ContentCaptureServiceEvents {
6328 // The type of event.
6329 enum Event {
6330 UNKNOWN = 0;
6331 ON_CONNECTED = 1;
6332 ON_DISCONNECTED = 2;
6333 SET_WHITELIST = 3;
6334 SET_DISABLED = 4;
6335 ON_USER_DATA_REMOVED = 5;
6336 }
6337 optional Event event = 1;
6338 // component/package of content capture service.
6339 optional string service_info = 2;
6340 // component/package of target.
6341 // it's a concatenated list of component/package for SET_WHITELIST event
6342 // separated by " ".
6343 optional string target_info = 3;
6344}
6345
6346/**
6347 * Logs information about content capture session events.
6348 *
6349 * Logged from:
6350 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6351 */
6352message ContentCaptureSessionEvents {
6353 // The type of event.
6354 enum Event {
6355 UNKNOWN = 0;
6356 ON_SESSION_STARTED = 1;
6357 ON_SESSION_FINISHED = 2;
6358 SESSION_NOT_CREATED = 3;
6359 }
6360 optional int32 session_id = 1;
6361 optional Event event = 2;
6362 // (n/a on session finished)
6363 optional int32 state_flags = 3;
6364 // component/package of content capture service.
6365 optional string service_info = 4;
6366 // component/package of app.
6367 // (n/a on session finished)
6368 optional string app_info = 5;
6369 optional bool is_child_session = 6;
6370}
6371
6372/**
6373 * Logs information about session being flushed.
6374 *
6375 * Logged from:
6376 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6377 */
6378message ContentCaptureFlushed {
6379 optional int32 session_id = 1;
6380 // component/package of content capture service.
6381 optional string service_info = 2;
6382 // component/package of app.
6383 optional string app_info = 3;
6384 // session start/finish events
6385 optional int32 child_session_started = 4;
6386 optional int32 child_session_finished = 5;
6387 // count of view events.
6388 optional int32 view_appeared_count = 6;
6389 optional int32 view_disappeared_count = 7;
6390 optional int32 view_text_changed_count = 8;
6391
6392 // Flush stats.
6393 optional int32 max_events = 9;
6394 optional int32 idle_flush_freq = 10;
6395 optional int32 text_flush_freq = 11;
6396 optional int32 flush_reason = 12;
6397}
6398
6399/**
Bookatz75ee60422018-11-09 12:27:37 -08006400 * Pulls on-device BatteryStats power use calculations for the overall device.
6401 */
6402message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006403 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6404 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6405 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6406 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006407}
6408
6409/**
6410 * Pulls on-device BatteryStats power use calculations broken down by uid.
6411 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6412 * that is attributed to non-uid items. They must all be included to get the total power use.
6413 */
6414message DeviceCalculatedPowerBlameUid {
6415 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6416 optional int32 uid = 1 [(is_uid) = true];
6417
Bookatz3dbc13a2018-12-21 12:16:51 -08006418 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6419 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6420 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006421}
6422
6423/**
6424 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6425 * drain type.
6426 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6427 * is attributed uids. They must all be included to get the total power use.
6428 */
6429message DeviceCalculatedPowerBlameOther {
6430 // The type of item whose power use is being reported.
6431 enum DrainType {
6432 AMBIENT_DISPLAY = 0;
6433 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6434 BLUETOOTH = 2;
6435 CAMERA = 3;
6436 // Cell-standby
6437 CELL = 4;
6438 FLASHLIGHT = 5;
6439 IDLE = 6;
6440 MEMORY = 7;
6441 // Amount that total computed drain exceeded the drain estimated using the
6442 // battery level changes and capacity.
6443 OVERCOUNTED = 8;
6444 PHONE = 9;
6445 SCREEN = 10;
6446 // Amount that total computed drain was below the drain estimated using the
6447 // battery level changes and capacity.
6448 UNACCOUNTED = 11;
6449 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6450 WIFI = 13;
6451 }
6452 optional DrainType drain_type = 1;
6453
Bookatz3dbc13a2018-12-21 12:16:51 -08006454 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6455 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6456 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006457}
arangelov4e994062018-11-13 16:12:38 +00006458
6459/**
6460 * Logs device policy features.
6461 *
6462 * Logged from:
6463 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6464 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6465 */
6466message DevicePolicyEvent {
6467 // The event id - unique for each event.
6468 optional android.stats.devicepolicy.EventId event_id = 1;
6469 // The admin package name.
6470 optional string admin_package_name = 2;
6471 // A generic integer parameter.
6472 optional int32 integer_value = 3;
6473 // A generic boolean parameter.
6474 optional bool boolean_value = 4;
6475 // A parameter specifying a time period in milliseconds.
6476 optional uint64 time_period_millis = 5;
6477 // A parameter specifying a list of package names, bundle extras or string parameters.
6478 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6479}
shawnlinea5b66b2018-11-13 15:05:29 +08006480
6481/**
6482 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6483 *
6484 * Logged from:
6485 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6486 */
6487message DocsUILaunchReported {
6488 optional android.stats.docsui.LaunchAction launch_action = 1;
6489 optional bool has_initial_uri = 2;
6490 optional android.stats.docsui.MimeType mime_type = 3;
6491 optional android.stats.docsui.Root initial_root = 4;
6492}
6493
6494/**
6495 * Logs root/app visited event in file managers/picker. Call this when the user
6496 * taps on root/app in hamburger menu.
6497 *
6498 * Logged from:
6499 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6500 */
6501message DocsUIRootVisitedReported {
6502 optional android.stats.docsui.ContextScope scope = 1;
6503 optional android.stats.docsui.Root root = 2;
6504}
6505
6506/**
6507 * Logs file operation stats. Call this when a file operation has completed.
6508 *
6509 * Logged from:
6510 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6511 */
6512message DocsUIFileOperationReported {
6513 optional android.stats.docsui.Provider provider = 1;
6514 optional android.stats.docsui.FileOperation file_op = 2;
6515}
6516
6517/**
6518 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6519 * mode.
6520 *
6521 * Logged from:
6522 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6523 */
6524message DocsUIFileOperationCopyMoveModeReported {
6525 optional android.stats.docsui.FileOperation file_op = 1;
6526 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6527}
6528
6529
6530/**
6531 * Logs file sub operation stats. Call this when a file operation has failed.
6532 *
6533 * Logged from:
6534 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6535 */
6536message DocsUIFileOperationFailureReported {
6537 optional android.stats.docsui.Authority authority = 1;
6538 optional android.stats.docsui.SubFileOperation sub_op = 2;
6539}
6540
6541/**
6542* Logs the cancellation of a file operation. Call this when a job is canceled
6543*
6544* Logged from:
6545* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6546*/
6547message DocsUIFileOperationCanceledReported {
6548 optional android.stats.docsui.FileOperation file_op = 1;
6549}
6550
6551/**
6552 * Logs startup time in milliseconds.
6553 *
6554 * Logged from:
6555 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6556 */
6557message DocsUIStartupMsReported {
6558 optional int32 startup_millis = 1;
6559}
6560
6561/**
6562 * Logs the action that was started by user.
6563 *
6564 * Logged from:
6565 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6566 */
6567message DocsUIUserActionReported {
6568 optional android.stats.docsui.UserAction action = 1;
6569}
6570
6571/**
6572 * Logs the invalid type when invalid scoped access is requested.
6573 *
6574 * Logged from:
6575 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6576 */
6577message DocsUIInvalidScopedAccessRequestReported {
6578 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006579}
Ben Murdochbab399f2018-12-06 11:01:38 +00006580
6581/**
shawnlina75e82d2019-01-07 10:31:12 +08006582 * Logs the package name that launches docsui picker mode.
6583 *
6584 * Logged from:
6585 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6586 */
6587message DocsUIPickerLaunchedFromReported {
6588 optional string package_name = 1;
6589}
6590
6591/**
6592 * Logs the search type.
6593 *
6594 * Logged from:
6595 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6596 */
6597message DocsUISearchTypeReported {
6598 optional android.stats.docsui.SearchType search_type = 1;
6599}
6600
6601/**
6602 * Logs the search mode.
6603 *
6604 * Logged from:
6605 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6606 */
6607message DocsUISearchModeReported {
6608 optional android.stats.docsui.SearchMode search_mode = 1;
6609}
6610
6611/**
6612 * Logs the pick result information.
6613 *
6614 * Logged from:
6615 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6616 */
6617message DocsUIPickResultReported {
6618 optional int32 total_action_count = 1;
6619 optional int64 duration_millis = 2;
6620 optional int32 file_count= 3;
6621 optional bool is_searching = 4;
6622 optional android.stats.docsui.Root picked_from = 5;
6623 optional android.stats.docsui.MimeType mime_type = 6;
6624 optional int32 repeatedly_pick_times = 7;
6625}
6626
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006627/** Logs the drag and drop of files.
6628
6629 * Logged from:
6630 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6631 */
6632message DocsUIDragAndDropReported {
6633 optional bool drag_initiated_from_docsui = 1;
6634}
6635
shawnlina75e82d2019-01-07 10:31:12 +08006636/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006637 * Logs when an app's memory is compacted.
6638 *
6639 * Logged from:
6640 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6641 */
6642message AppCompacted {
6643 // The pid of the process being compacted.
6644 optional int32 pid = 1;
6645
6646 // The name of the process being compacted.
6647 optional string process_name = 2;
6648
6649 // The type of compaction.
6650 enum Action {
6651 UNKNOWN = 0;
6652 SOME = 1;
6653 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006654 PERSISTENT = 3;
6655 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006656 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006657 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006658
6659 // Total RSS in kilobytes consumed by the process prior to compaction.
6660 optional int64 before_rss_total_kilobytes = 4;
6661
6662 // File RSS in kilobytes consumed by the process prior to compaction.
6663 optional int64 before_rss_file_kilobytes = 5;
6664
6665 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6666 optional int64 before_rss_anon_kilobytes = 6;
6667
6668 // Swap in kilobytes consumed by the process prior to compaction.
6669 optional int64 before_swap_kilobytes = 7;
6670
6671 // Total RSS in kilobytes consumed by the process after compaction.
6672 optional int64 after_rss_total_kilobytes = 8;
6673
6674 // File RSS in kilobytes consumed by the process after compaction.
6675 optional int64 after_rss_file_kilobytes = 9;
6676
6677 // Anonymous RSS in kilobytes consumed by the process after compaction.
6678 optional int64 after_rss_anon_kilobytes = 10;
6679
6680 // Swap in kilobytes consumed by the process after compaction.
6681 optional int64 after_swap_kilobytes = 11;
6682
6683 // The time taken to perform compaction in milliseconds.
6684 optional int64 time_to_compact_millis = 12;
6685
6686 // The last compaction action performed for this app.
6687 optional Action last_action = 13;
6688
Ben Murdoch01720b82018-12-19 18:03:44 +00006689 // The last time that compaction was attempted on this process in milliseconds
6690 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6691 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006692
Ben Murdoch885c21b2019-03-15 18:02:04 +00006693 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006694 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006695
6696 // The process state at the time of compaction.
6697 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006698
6699 // Free ZRAM in kilobytes before compaction.
6700 optional int64 before_zram_free_kilobytes = 17;
6701
6702 // Free ZRAM in kilobytes after compaction.
6703 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006704}
lifr157fc552018-12-12 16:38:04 +08006705
6706/**
lifrb6b90b62019-03-29 00:40:17 +08006707 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6708 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6709 *
lifr1f74b052019-04-16 22:16:30 +08006710 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6711 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6712 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6713 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006714 */
6715message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006716 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006717
lifr1f74b052019-04-16 22:16:30 +08006718 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006719
6720 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006721 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006722
lifr1f74b052019-04-16 22:16:30 +08006723 // Only valid for event_type = EVENT_GETADDRINFO.
6724 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006725
lifr1f74b052019-04-16 22:16:30 +08006726 // Flags passed to android_res_nsend() defined in multinetwork.h
6727 // Only valid for event_type = EVENT_RESNSEND.
6728 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006729
lifrad9becc2019-05-20 11:04:41 +08006730 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006731
6732 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006733 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006734
6735 // Additional pass-through fields opaque to statsd.
6736 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006737 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006738
6739 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6740 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006741}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006742
6743/**
6744 * Logs when a data stall event occurs.
6745 *
6746 * Log from:
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006747 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006748 */
6749message DataStallEvent {
6750 // Data stall evaluation type.
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006751 // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006752 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6753 optional int32 evaluation_type = 1;
6754 // See definition in data_stall_event.proto.
6755 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6756 // See definition in data_stall_event.proto.
6757 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6758 // See definition in data_stall_event.proto.
6759 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6760 // See definition in data_stall_event.proto.
6761 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6762 // See definition in data_stall_event.proto.
6763 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006764 // The tcp packets fail rate from the latest tcp polling.
6765 optional int32 tcp_fail_rate = 7;
6766 // Number of packets sent since the last received packet.
6767 optional int32 tcp_sent_since_last_recv = 8;
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006768}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006769
6770/*
6771 * Logs when RescueParty resets some set of experiment flags.
6772 *
6773 * Logged from:
6774 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6775 */
6776message RescuePartyResetReported {
6777 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6778 optional int32 rescue_level = 1;
6779}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006780
6781/**
6782 * Logs when signed config is received from an APK, and if that config was applied successfully.
6783 * Logged from:
6784 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6785 */
6786message SignedConfigReported {
6787 enum Type {
6788 UNKNOWN_TYPE = 0;
6789 GLOBAL_SETTINGS = 1;
6790 }
6791 optional Type type = 1;
6792
6793 // The final status of the signed config received.
6794 enum Status {
6795 UNKNOWN_STATUS = 0;
6796 APPLIED = 1;
6797 BASE64_FAILURE_CONFIG = 2;
6798 BASE64_FAILURE_SIGNATURE = 3;
6799 SECURITY_EXCEPTION = 4;
6800 INVALID_CONFIG = 5;
6801 OLD_CONFIG = 6;
6802 SIGNATURE_CHECK_FAILED = 7;
6803 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006804 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006805 }
6806 optional Status status = 2;
6807
6808 // The version of the signed config processed.
6809 optional int32 version = 3;
6810
6811 // The package name that the config was extracted from.
6812 optional string from_package = 4;
6813
6814 enum Key {
6815 NO_KEY = 0;
6816 DEBUG = 1;
6817 PRODUCTION = 2;
6818 }
6819 // Which key was used to verify the config.
6820 optional Key verified_with = 5;
6821}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006822
6823/*
6824 * Logs GNSS Network-Initiated (NI) location events.
6825 *
6826 * Logged from:
6827 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6828 */
6829message GnssNiEventReported {
6830 // The type of GnssNiEvent.
6831 enum EventType {
6832 UNKNOWN = 0;
6833 NI_REQUEST = 1;
6834 NI_RESPONSE = 2;
6835 }
6836 optional EventType event_type = 1;
6837
6838 // An ID generated by HAL to associate NI notifications and UI responses.
6839 optional int32 notification_id = 2;
6840
6841 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006842 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006843
6844 // NI requires notification.
6845 optional bool need_notify = 4;
6846
6847 // NI requires verification.
6848 optional bool need_verify = 5;
6849
6850 // NI requires privacy override, no notification/minimal trace.
6851 optional bool privacy_override = 6;
6852
6853 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6854 // seconds.
6855 optional int32 timeout = 7;
6856
6857 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006858 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006859
6860 // String representing the requester of the network inititated location request.
6861 optional string requestor_id = 9;
6862
6863 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6864 // network initiated location request.
6865 optional string text = 10;
6866
6867 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006868 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006869
6870 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006871 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006872
6873 // True if SUPL ES is enabled.
6874 optional bool is_supl_es_enabled = 13;
6875
6876 // True if GNSS location is enabled.
6877 optional bool is_location_enabled = 14;
6878
6879 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006880 optional android.server.location.GnssUserResponseType user_response = 15;
6881}
6882
6883/**
6884 * Logs GNSS non-framework (NFW) location notification.
6885 *
6886 * Logged from:
6887 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6888 */
6889message GnssNfwNotificationReported {
6890 // Package name of the Android proxy application representing the non-framework entity that
6891 // requested location. Set to empty string if unknown.
6892 optional string proxy_app_package_name = 1;
6893
6894 // Protocol stack that initiated the non-framework location request.
6895 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6896
6897 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6898 // set to empty string. This field is opaque to the framework and used for logging purposes.
6899 optional string other_protocol_stack_name = 3;
6900
6901 // Source initiating/receiving the location information.
6902 optional android.server.location.NfwRequestor requestor = 4;
6903
6904 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6905 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6906 // and used for logging purposes.
6907 optional string requestor_id = 5;
6908
6909 // Indicates whether location information was provided for this request.
6910 optional android.server.location.NfwResponseType response_type = 6;
6911
6912 // True if the device is in user initiated emergency session.
6913 optional bool in_emergency_mode = 7;
6914
6915 // True if cached location is provided.
6916 optional bool is_cached_location = 8;
6917
6918 // True if proxy app permission mismatch between framework and GNSS HAL.
6919 optional bool is_permission_mismatched = 9;
6920}
6921
6922/**
6923 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6924 *
6925 * Logged from:
6926 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6927 */
6928message GnssConfigurationReported {
6929 // SUPL host name.
6930 optional string supl_host = 1;
6931
6932 // SUPL port number.
6933 optional int32 supl_port = 2;
6934
6935 // C2K host name.
6936 optional string c2k_host = 3;
6937
6938 // C2K port number.
6939 optional int32 c2k_port = 4;
6940
6941 // The SUPL version requested by Carrier.
6942 optional int32 supl_ver = 5;
6943
6944 // The SUPL mode.
6945 optional android.server.location.SuplMode supl_mode = 6;
6946
6947 // True if NI emergency SUPL restrictions is enabled.
6948 optional bool supl_es = 7;
6949
6950 // LTE Positioning Profile settings
6951 optional android.server.location.LppProfile lpp_profile = 8;
6952
6953 // Positioning protocol on A-Glonass system.
6954 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6955
6956 // True if emergency PDN is used. Otherwise, regular PDN is used.
6957 optional bool use_emergency_pdn_for_emergency_supl= 10;
6958
6959 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6960 optional android.server.location.GpsLock gps_lock = 11;
6961
6962 // Number of seconds to extend the emergency session duration post emergency call.
6963 optional int32 es_extension_sec = 12;
6964
6965 // The full list of package names of proxy Android applications representing the non-framework
6966 // location access entities (on/off the device) for which the framework user has granted
6967 // non-framework location access permission. The package names are concatenated in one string
6968 // with spaces as separators.
6969 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006970}
Jack Yu95b64f32018-12-13 18:26:11 +08006971
6972/**
6973 * Logs when a NFC device's error occurred.
6974 * Logged from:
6975 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6976 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6977 */
6978message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006979 enum Type {
6980 UNKNOWN = 0;
6981 CMD_TIMEOUT = 1;
6982 ERROR_NOTIFICATION = 2;
6983 AID_OVERFLOW = 3;
6984 }
6985 optional Type type = 1;
6986 // If it's nci cmd timeout, log the timeout command.
6987 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006988
Alex Salod7c3eef2019-01-25 14:43:27 -08006989 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006990}
6991
6992/**
6993 * Logs when a NFC device's state changed event
6994 * Logged from:
6995 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6996 */
6997message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006998 enum State {
6999 UNKNOWN = 0;
7000 OFF = 1;
7001 ON = 2;
7002 ON_LOCKED = 3; // Secure Nfc enabled.
7003 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
7004 }
7005 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007006}
7007
7008/**
7009 * Logs when a NFC Beam Transaction occurred.
7010 * Logged from:
7011 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
7012 */
7013message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007014 enum Operation {
7015 UNKNOWN = 0;
7016 SEND = 1;
7017 RECEIVE = 2;
7018 }
7019 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007020}
7021
7022/**
7023 * Logs when a NFC Card Emulation Transaction occurred.
7024 * Logged from:
7025 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
7026 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
7027 */
7028message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007029 enum Category {
7030 UNKNOWN = 0;
7031 HCE_PAYMENT = 1;
7032 HCE_OTHER = 2;
7033 OFFHOST = 3;
7034 }
7035 // Transaction belongs to HCE payment or HCE other category, or offhost.
7036 optional Category category = 1;
7037 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7038 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007039}
7040
7041/**
7042 * Logs when a NFC Tag event occurred.
7043 * Logged from:
7044 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7045 */
7046message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007047 enum Type {
7048 UNKNOWN = 0;
7049 URL = 1;
7050 BT_PAIRING = 2;
7051 PROVISION = 3;
7052 WIFI_CONNECT = 4;
7053 APP_LAUNCH = 5;
7054 OTHERS = 6;
7055 }
7056 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007057}
7058
7059/**
7060 * Logs when Hce transaction triggered
7061 * Logged from:
7062 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7063 */
7064message NfcHceTransactionOccurred {
7065 // The latency period(in microseconds) it took for the first HCE data
7066 // exchange.
7067 optional uint32 latency_micros = 1;
7068}
7069
7070/**
7071 * Logs when SecureElement state event changed
7072 * Logged from:
7073 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7074 */
7075message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007076 enum State {
7077 UNKNOWN = 0;
7078 INITIALIZED = 1;
7079 DISCONNECTED = 2;
7080 CONNECTED = 3;
7081 HALCRASH = 4;
7082 }
7083 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007084
Alex Salod7c3eef2019-01-25 14:43:27 -08007085 optional string state_change_reason = 2;
7086 // SIMx or eSEx.
7087 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007088}
7089
7090/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007091 * Information about a permission grant request
7092 */
7093message PermissionGrantRequestResultReported {
7094 // unique value identifying an API call. A API call might result in multiple of these atoms
7095 optional int64 request_id = 1;
7096
7097 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007098 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007099
7100 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007101 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007102
7103 // The permission to be granted
7104 optional string permission_name = 4;
7105
7106 // If the permission was explicitly requested via the API or added by the system
7107 optional bool is_implicit = 5;
7108
7109 enum Result {
7110 UNDEFINED = 0;
7111 // permission request was ignored
7112 IGNORED = 1;
7113 // permission request was ignored because it was user fixed
7114 IGNORED_USER_FIXED = 2;
7115 // permission request was ignored because it was policy fixed
7116 IGNORED_POLICY_FIXED = 3;
7117 // permission was granted by user action
7118 USER_GRANTED = 4;
7119 // permission was automatically granted
7120 AUTO_GRANTED = 5;
7121 // permission was denied by user action
7122 USER_DENIED = 6;
7123 // permission was denied with prejudice by the user
7124 USER_DENIED_WITH_PREJUDICE = 7;
7125 // permission was automatically denied
7126 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007127 // permission request was ignored because permission is restricted
7128 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007129 // one time permission was granted by user action
7130 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007131 // user ignored request by leaving the request screen without choosing any option
7132 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007133 // user granted the permission after being linked to settings
7134 USER_GRANTED_IN_SETTINGS = 12;
7135 // user denied the permission after being linked to settings
7136 USER_DENIED_IN_SETTINGS = 13;
7137 // user denied the permission with prejudice after being linked to settings
7138 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7139 // permission was automatically revoked after one-time permission expired
7140 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007141 // permission was automatically revoked for unused app
7142 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007143 }
7144 // The result of the permission grant
7145 optional Result result = 6;
7146}
7147
7148/**
Jack Yu95b64f32018-12-13 18:26:11 +08007149 * Logs when Omapi API used
7150 * Logged from:
7151 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7152 */
7153message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007154 enum Operation {
7155 UNKNOWN = 0;
7156 OPEN_CHANNEL = 1;
7157 }
7158 optional Operation operation = 1;
7159 // SIMx or eSEx.
7160 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007161
Alex Salod7c3eef2019-01-25 14:43:27 -08007162 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007163}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007164
7165/**
Alex Saloa060aee2019-01-21 14:36:41 -08007166 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7167 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007168 * Logged from:
7169 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7170 */
7171message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007172 optional int64 dispatch_latency_millis = 1;
7173}
7174
7175/**
7176 * Logs AttentionManagerService attention check result.
7177 *
7178 * Logged from:
7179 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7180 */
7181message AttentionManagerServiceResultReported {
7182 // See core/java/android/service/attention/AttentionService.java
7183 enum AttentionCheckResult {
7184 UNKNOWN = 20;
7185 ATTENTION_SUCCESS_ABSENT = 0;
7186 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007187 ATTENTION_FAILURE_UNKNOWN = 2;
7188 ATTENTION_FAILURE_CANCELLED = 3;
7189 ATTENTION_FAILURE_PREEMPTED = 4;
7190 ATTENTION_FAILURE_TIMED_OUT = 5;
7191 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007192 }
7193 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007194}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007195
7196/**
7197 * Logs when an adb connection changes state.
7198 *
7199 * Logged from:
7200 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7201 */
7202message AdbConnectionChanged {
7203 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7204 // previously selected for this system.
7205 optional int64 last_connection_time_millis = 1;
7206
7207 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7208 // to reconnect via adb without user interaction.
7209 optional int64 auth_window_millis = 2;
7210
7211 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7212 optional android.debug.AdbConnectionStateEnum state = 3;
7213
7214 // True if the 'always allow' option was selected for this system.
7215 optional bool always_allow = 4;
7216}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007217
7218/*
7219 * Logs the reported speech DSP status.
7220 *
7221 * Logged from:
7222 * Vendor audio implementation.
7223 */
7224message SpeechDspStatReported {
7225 // The total Speech DSP uptime in milliseconds.
7226 optional int32 total_uptime_millis = 1;
7227 // The total Speech DSP downtime in milliseconds.
7228 optional int32 total_downtime_millis = 2;
7229 optional int32 total_crash_count = 3;
7230 optional int32 total_recover_count = 4;
7231}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007232
7233/**
7234 * Logs USB connector contaminant status.
7235 *
7236 * Logged from: USB Service.
7237 */
7238message UsbContaminantReported {
7239 optional string id = 1;
7240 optional android.service.usb.ContaminantPresenceStatus status = 2;
7241}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007242
7243/**
7244 * This atom is for debugging purpose.
7245 */
7246message DebugElapsedClock {
7247 // Monotically increasing value for each pull.
7248 optional int64 pull_count = 1;
7249 // Time from System.elapsedRealtime.
7250 optional int64 elapsed_clock_millis = 2;
7251 // Time from System.elapsedRealtime.
7252 optional int64 same_elapsed_clock_millis = 3;
7253 // Diff between current elapsed time and elapsed time from previous pull.
7254 optional int64 elapsed_clock_diff_millis = 4;
7255
7256 enum Type {
7257 TYPE_UNKNOWN = 0;
7258 ALWAYS_PRESENT = 1;
7259 PRESENT_ON_ODD_PULLS = 2;
7260 }
7261 // Type of behavior for the pulled data.
7262 optional Type type = 5;
7263}
7264
7265/**
7266 * This atom is for debugging purpose.
7267 */
7268message DebugFailingElapsedClock {
7269 // Monotically increasing value for each pull.
7270 optional int64 pull_count = 1;
7271 // Time from System.elapsedRealtime.
7272 optional int64 elapsed_clock_millis = 2;
7273 // Time from System.elapsedRealtime.
7274 optional int64 same_elapsed_clock_millis = 3;
7275 // Diff between current elapsed time and elapsed time from previous pull.
7276 optional int64 elapsed_clock_diff_millis = 4;
7277}
Steven Wuacef6bb2019-01-23 14:21:17 -05007278
7279/** Logs System UI bubbles event changed.
7280 *
7281 * Logged from:
7282 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7283 */
7284message BubbleUIChanged {
7285
7286 // The app package that is posting the bubble.
7287 optional string package_name = 1;
7288
7289 // The notification channel that is posting the bubble.
7290 optional string notification_channel = 2;
7291
7292 // The notification id associated with the posted bubble.
7293 optional int32 notification_id = 3;
7294
7295 // The position of the bubble within the bubble stack.
7296 optional int32 position = 4;
7297
7298 // The total number of bubbles within the bubble stack.
7299 optional int32 total_number = 5;
7300
7301 // User interactions with the bubble.
7302 enum Action {
7303 UNKNOWN = 0;
7304 POSTED = 1;
7305 UPDATED = 2;
7306 EXPANDED = 3;
7307 COLLAPSED = 4;
7308 DISMISSED = 5;
7309 STACK_DISMISSED = 6;
7310 STACK_MOVED = 7;
7311 HEADER_GO_TO_APP = 8;
7312 HEADER_GO_TO_SETTINGS = 9;
7313 PERMISSION_OPT_IN = 10;
7314 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007315 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007316 SWIPE_LEFT = 13;
7317 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007318 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007319 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007320 }
7321 optional Action action = 6;
7322
7323 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7324 optional float normalized_x_position = 7;
7325 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007326
7327 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7328 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007329
7330 // Whether the bubble is an on-going one.
7331 optional bool is_ongoing = 10;
7332
7333 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007334 // This is deprecated and the value should be ignored.
7335 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007336}
Kweku Adams8845d012018-12-11 20:06:45 -08007337
7338/**
Steven Wu552f63f2019-02-05 13:41:36 -05007339 * Logs System UI bubbles developer errors.
7340 *
7341 * Logged from:
7342 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7343 */
7344message BubbleDeveloperErrorReported {
7345
7346 // The app package that is posting the bubble.
7347 optional string package_name = 1;
7348
7349 // Bubble developer error type enums.
7350 enum Error {
7351 UNKNOWN = 0;
7352 ACTIVITY_INFO_MISSING = 1;
7353 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7354 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7355 }
7356 optional Error error = 2 [default = UNKNOWN];
7357}
7358
7359/**
Kweku Adams8845d012018-12-11 20:06:45 -08007360 * Logs that a constraint for a scheduled job has changed.
7361 *
7362 * Logged from:
7363 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7364 */
7365message ScheduledJobConstraintChanged {
7366 repeated AttributionNode attribution_node = 1;
7367
7368 // Name of the job.
7369 optional string job_name = 2;
7370
7371 optional com.android.server.job.ConstraintEnum constraint = 3;
7372
7373 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007374 UNKNOWN = 0;
7375 UNSATISFIED = 1;
7376 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007377 }
7378 optional State state = 4;
7379}
Alex Salod7c3eef2019-01-25 14:43:27 -08007380
7381/**
7382 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7383 * returns true.
7384 *
7385 * Logged from:
7386 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7387 */
7388message ScreenTimeoutExtensionReported {
7389 // Describes how many times in a row did the power manager reset the screen off timeout.
7390 optional uint32 consecutive_timeout_extended_count = 1;
7391}
Hui Yu885aca12019-01-10 17:11:34 -08007392
7393/*
7394* Logs number of milliseconds it takes to start a process.
7395* The definition of app process start time is from the app launch time to
7396* the time that Zygote finished forking the app process and loaded the
7397* application package's java classes.
7398
7399* This metric is different from AppStartOccurred which is for foreground
7400* activity only.
7401
7402* ProcessStartTime can report all processes (both foreground and background)
7403* start time.
7404*
7405* Logged from:
7406* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7407*/
7408message ProcessStartTime {
7409 // The uid of the ProcessRecord.
7410 optional int32 uid = 1 [(is_uid) = true];
7411
7412 // The process pid.
7413 optional int32 pid = 2;
7414
7415 // The process name.
7416 // Usually package name, "system" for system server.
7417 // Provided by ActivityManagerService.
7418 optional string process_name = 3;
7419
7420 enum StartType {
7421 UNKNOWN = 0;
7422 WARM = 1;
7423 HOT = 2;
7424 COLD = 3;
7425 }
7426
7427 // The start type.
7428 optional StartType type = 4;
7429
7430 // The elapsed realtime at the start of the process.
7431 optional int64 process_start_time_millis = 5;
7432
7433 // Number of milliseconds it takes to reach bind application.
7434 optional int32 bind_application_delay_millis = 6;
7435
7436 // Number of milliseconds it takes to finish start of the process.
7437 optional int32 process_start_delay_millis = 7;
7438
7439 // hostingType field in ProcessRecord, the component type such as "activity",
7440 // "service", "content provider", "broadcast" or other strings.
7441 optional string hosting_type = 8;
7442
7443 // hostingNameStr field in ProcessRecord. The component class name that runs
7444 // in this process.
7445 optional string hosting_name = 9;
7446}
7447
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007448/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007449 * Track Media Codec usage
7450 * Logged from:
7451 * frameworks/av/media/libstagefright/MediaCodec.cpp
7452 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7453 */
7454message MediametricsCodecReported {
7455 optional int64 timestamp_nanos = 1;
7456 optional string package_name = 2;
7457 optional int64 package_version_code = 3;
7458 optional int64 media_apex_version = 4;
7459
7460 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7461}
7462
7463/**
7464 * Track Media Extractor (pulling video/audio streams out of containers) usage
7465 * Logged from:
7466 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7467 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7468 */
7469message MediametricsExtractorReported {
7470 optional int64 timestamp_nanos = 1;
7471 optional string package_name = 2;
7472 optional int64 package_version_code = 3;
7473 optional int64 media_apex_version = 4;
7474
7475 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7476}
7477
7478/**
7479 * Track how we arbitrate between microphone/input requests.
7480 * Logged from
7481 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7482 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7483 */
7484message MediametricsAudiopolicyReported {
7485 optional int64 timestamp_nanos = 1;
7486 optional string package_name = 2;
7487 optional int64 package_version_code = 3;
7488 optional int64 media_apex_version = 4;
7489
7490 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7491}
7492
7493/**
7494 * Track how we arbitrate between microphone requests.
7495 * Logged from
7496 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7497 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7498 */
7499message MediametricsAudiorecordReported {
7500 optional int64 timestamp_nanos = 1;
7501 optional string package_name = 2;
7502 optional int64 package_version_code = 3;
7503 optional int64 media_apex_version = 4;
7504
7505 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7506}
7507
7508/**
7509 * Track how we arbitrate between microphone/input requests.
7510 * Logged from
7511 * frameworks/av/media/libnblog/ReportPerformance.cpp
7512 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7513 */
7514message MediametricsAudiothreadReported {
7515 optional int64 timestamp_nanos = 1;
7516 optional string package_name = 2;
7517 optional int64 package_version_code = 3;
7518 optional int64 media_apex_version = 4;
7519
7520 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7521}
7522
7523/**
7524 * Track how we arbitrate between microphone/input requests.
7525 * Logged from
7526 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7527 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7528 */
7529message MediametricsAudiotrackReported {
7530 optional int64 timestamp_nanos = 1;
7531 optional string package_name = 2;
7532 optional int64 package_version_code = 3;
7533 optional int64 media_apex_version = 4;
7534
7535 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7536}
7537
7538/**
7539 * Track information about DRM framework performance
7540 * Logged from
7541 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7542 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7543 */
7544message MediametricsMediadrmReported {
7545 optional int64 timestamp_nanos = 1;
7546 optional string package_name = 2;
7547 optional int64 package_version_code = 3;
7548 optional int64 media_apex_version = 4;
7549
7550 // vendor+description tell about which DRM plugin is in use on this device
7551 optional string vendor = 5;
7552 optional string description = 6;
7553 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7554 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7555}
7556
7557/**
7558 * Track information about the widevine DRM plugin performance
7559 * Logged from
7560 * vendor/widevine/libwvdrmengine/cdm/metrics
7561 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7562 */
7563message MediametricsDrmWidevineReported {
7564 optional int64 timestamp_nanos = 1;
7565 optional string package_name = 2;
7566 optional int64 package_version_code = 3;
7567 optional int64 media_apex_version = 4;
7568
7569 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7570}
7571
7572/**
7573 * Track information about recordings (e.g. camcorder)
7574 * Logged from
7575 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7576 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7577 */
7578message MediametricsRecorderReported {
7579 optional int64 timestamp_nanos = 1;
7580 optional string package_name = 2;
7581 optional int64 package_version_code = 3;
7582 optional int64 media_apex_version = 4;
7583
7584 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7585}
7586
7587/**
7588 * Track Media Player usage
7589 * Logged from:
7590 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7591 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7592 */
7593message MediametricsNuPlayerReported {
7594 optional int64 timestamp_nanos = 1;
7595 optional string package_name = 2;
7596 optional int64 package_version_code = 3;
7597 optional int64 media_apex_version = 4;
7598
7599 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7600}
7601
7602/**
Robert Shiha4beed32019-08-19 14:15:23 -07007603 * Track Legacy DRM usage
7604 * Logged from
7605 * frameworks/av/drm/drmserver/DrmManager.cpp
7606 */
7607message MediametricsDrmManagerReported {
7608 optional int64 timestamp_nanos = 1;
7609 optional string package_name = 2;
7610 optional int64 package_version_code = 3;
7611 optional int64 media_apex_version = 4;
7612
7613 enum Method {
7614 METHOD_NOT_FOUND = -1;
7615 GET_CONSTRAINTS = 0;
7616 GET_METADATA = 1;
7617 CAN_HANDLE = 2;
7618 PROCESS_DRM_INFO = 3;
7619 ACQUIRE_DRM_INFO = 4;
7620 SAVE_RIGHTS = 5;
7621 GET_ORIGINAL_MIME_TYPE = 6;
7622 GET_DRM_OBJECT_TYPE = 7;
7623 CHECK_RIGHTS_STATUS = 8;
7624 REMOVE_RIGHTS = 9;
7625 REMOVE_ALL_RIGHTS = 10;
7626 OPEN_CONVERT_SESSION = 11;
7627 OPEN_DECRYPT_SESSION = 12;
7628 }
7629
7630 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7631 optional string plugin_id = 5;
7632 optional string description = 6;
7633 optional Method method = 7;
7634 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007635
7636 optional int64 get_constraints_count = 9;
7637 optional int64 get_metadata_count = 10;
7638 optional int64 can_handle_count = 11;
7639 optional int64 process_drm_info_count = 12;
7640 optional int64 acquire_drm_info_count = 13;
7641 optional int64 save_rights_count = 14;
7642 optional int64 get_original_mime_type_count = 15;
7643 optional int64 get_drm_object_type_count = 16;
7644 optional int64 check_rights_status_count = 17;
7645 optional int64 remove_rights_count = 18;
7646 optional int64 remove_all_rights_count = 19;
7647 optional int64 open_convert_session_count = 20;
7648 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007649}
7650
7651/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007652 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007653 * Pulled from: StatsCompanionService
7654*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007655message DangerousPermissionState {
7656 // Name of the permission
7657 optional string permission_name = 1;
7658
7659 // Uid of the package
7660 optional int32 uid = 2 [(is_uid) = true];
7661
7662 // Package requesting the permission
7663 optional string package_name = 3;
7664
7665 // If the permission is granted to the uid
7666 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007667
7668 // Permission flags as per android.content.pm.PermissionFlags
7669 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007670}
7671
Michael Groover4a0ca942019-01-24 17:41:25 -08007672/**
7673 * Logs when a package is denied access to a device identifier based on the new access requirements.
7674 *
7675 * Logged from:
7676 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7677 */
7678message DeviceIdentifierAccessDenied {
7679 // The name of the package denied access to the requested device identifier.
7680 optional string package_name = 1;
7681
7682 // The name of the device identifier method the package attempted to invoke.
7683 optional string method_name = 2;
7684
7685 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007686 // Starting from Android 11, this boolean is not set and will always be false.
7687 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007688
7689 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007690 // Starting from Android 11, this boolean is not set and will always be false.
7691 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007692}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007693
7694/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007695 * Pulls the ongoing mainline install train version code.
7696 * Pulled from StatsCompanionService
7697 */
7698message TrainInfo {
7699 optional int64 train_version_code = 1;
7700
7701 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007702
7703 optional string train_name = 3;
7704
7705 enum Status {
7706 UNKNOWN = 0;
7707 INSTALL_REQUESTED = 1;
7708 INSTALL_STARTED = 2;
7709 INSTALL_STAGED_NOT_READY = 3;
7710 INSTALL_STAGED_READY = 4;
7711 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007712 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7713 // and INSTALL_FAILURE_COMMIT.
7714 INSTALL_FAILURE = 6 [deprecated = true];
7715 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007716 INSTALL_CANCELLED = 7;
7717 INSTALLER_ROLLBACK_REQUESTED = 8;
7718 INSTALLER_ROLLBACK_INITIATED = 9;
7719 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7720 INSTALLER_ROLLBACK_STAGED = 11;
7721 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7722 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7723 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7724 INSTALLER_ROLLBACK_SUCCESS = 15;
7725 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007726 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7727 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7728 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7729 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7730 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7731 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007732 INSTALL_FAILURE_DOWNLOAD = 23;
7733 INSTALL_FAILURE_STATE_MISMATCH = 24;
7734 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007735 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007736 }
7737 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007738}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007739
7740/**
7741 * Logs the gesture stage changed event.
7742 *
7743 * Logged from:
7744 * frameworks/base/packages/SystemUI/
7745 */
7746message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007747 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007748}
7749
7750/**
7751 * Logs the feedback type.
7752 *
7753 * Logged from:
7754 * frameworks/base/packages/SystemUI/
7755 */
7756message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007757 // Whether or not the gesture was used.
7758 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007759}
7760
7761/**
7762 * Logs the progress.
7763 *
7764 * Logged from:
7765 * frameworks/base/packages/SystemUI/
7766 */
7767message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007768 // [0,100] progress for the assist gesture.
7769 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007770}
Neil Fullerdb14b482019-02-05 19:44:44 +00007771
7772/*
7773 * Information about the time zone data on a device.
7774 */
7775message TimeZoneDataInfo {
7776 // A version identifier for the data set on device. e.g. "2018i"
7777 optional string tzdb_version = 1;
7778}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007779
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007780/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007781 * Logs the GPU stats global health information.
7782 *
7783 * Logged from:
7784 * frameworks/native/services/gpuservice/gpustats/
7785 */
7786message GpuStatsGlobalInfo {
7787 // Package name of the gpu driver.
7788 optional string driver_package_name = 1;
7789
7790 // Version name of the gpu driver.
7791 optional string driver_version_name = 2;
7792
7793 // Version code of the gpu driver.
7794 optional int64 driver_version_code = 3;
7795
7796 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7797 optional int64 driver_build_time = 4;
7798
7799 // Total count of the gl driver gets loaded.
7800 optional int64 gl_loading_count = 5;
7801
7802 // Total count of the gl driver fails to be loaded.
7803 optional int64 gl_loading_failure_count = 6;
7804
7805 // Total count of the Vulkan driver gets loaded.
7806 optional int64 vk_loading_count = 7;
7807
7808 // Total count of the Vulkan driver fails to be loaded.
7809 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007810
7811 // Api version of the system Vulkan driver.
7812 optional int32 vulkan_version = 9;
7813
7814 // Api version of the system CPU Vulkan driver.
7815 optional int32 cpu_vulkan_version = 10;
7816
7817 // Api version of the system GLES driver.
7818 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007819
7820 // Total count of the angle driver gets loaded.
7821 optional int64 angle_loading_count = 12;
7822
7823 // Total count of the angle driver fails to be loaded.
7824 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007825}
7826
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007827/**
7828 * GPU driver loading time info.
7829 */
7830message GpuDriverLoadingTime {
7831 // List of all the driver loading times for this app. The list size is
7832 // capped at 50.
7833 repeated int64 driver_loading_time = 1;
7834}
7835
7836/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007837 * Logs the GPU stats per app health information.
7838 *
7839 * Logged from:
7840 * frameworks/native/services/gpuservice/gpustats/
7841 */
7842message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007843 // Package name of the application that loads the gpu driver. Total number
7844 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007845 optional string app_package_name = 1;
7846
7847 // Version code of the gpu driver this app loads.
7848 optional int64 driver_version_code = 2;
7849
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007850 // gl driver loading time info.
7851 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7852 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007853
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007854 // Vulkan driver loading time info.
7855 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7856 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007857
7858 // Angle driver loading time info.
7859 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7860 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007861
7862 // CPU Vulkan implementation is in use.
7863 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007864
7865 // App is not doing pre-rotation correctly.
7866 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007867
7868 // App creates GLESv1 context.
7869 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007870}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007871
7872/*
7873 * Logs the size of the system ion heap.
7874 *
7875 * Pulled from StatsCompanionService.
7876 */
7877message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007878 // Deprecated due to limited support of ion stats in debugfs.
7879 // Use `IonHeapSize` instead.
7880 option deprecated = true;
7881
Rafal Slawikd4e87572019-03-12 13:08:38 +00007882 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007883 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007884 optional int64 size_in_bytes = 1;
7885}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007886
Rafal Slawik77987ed2019-06-17 12:28:23 +01007887/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007888 * Logs the total size of the ion heap.
7889 *
7890 * Pulled from StatsCompanionService.
7891 */
7892message IonHeapSize {
7893 // Total size of all ion heaps in kilobytes.
7894 // Read from: /sys/kernel/ion/total_heaps_kb.
7895 optional int32 total_size_kb = 1;
7896}
7897
7898/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007899 * Logs the per-process size of the system ion heap.
7900 *
7901 * Pulled from StatsCompanionService.
7902 */
7903message ProcessSystemIonHeapSize {
7904 // The uid if available. -1 means not available.
7905 optional int32 uid = 1 [(is_uid) = true];
7906
7907 // The process name (from /proc/PID/cmdline).
7908 optional string process_name = 2;
7909
7910 // Sum of sizes of all allocations.
7911 optional int32 total_size_in_kilobytes = 3;
7912
7913 // Number of allocations.
7914 optional int32 allocation_count = 4;
7915
7916 // Size of the largest allocation.
7917 optional int32 max_size_in_kilobytes = 5;
7918}
7919
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007920/**
7921 * Push network stack events.
7922 *
7923 * Log from:
7924 * frameworks/base/packages/NetworkStack/
7925 */
7926message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007927 // The id that indicates the event reported from NetworkStack.
7928 optional int32 event_id = 1;
7929 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007930 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7931}
Carmen Agimofa769c152019-03-04 14:39:14 +00007932
7933/**
7934 * Logs the apps that are installed on the external storage.
7935 * Pulled from:
7936 * StatsCompanionService
7937 */
7938message AppsOnExternalStorageInfo {
7939 // The type of the external storage.
7940 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7941 // The name of the package that is installed on the external storage.
7942 optional string package_name = 2;
7943}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007944
7945/**
7946 * Logs the settings related to Face.
7947 * Logged from:
7948 * frameworks/base/services/core/java/com/android/server/stats
7949 */
7950message FaceSettings {
7951 // Whether or not face unlock is allowed on Keyguard.
7952 optional bool unlock_keyguard_enabled = 1;
7953 // Whether or not face unlock dismisses the Keyguard.
7954 optional bool unlock_dismisses_keyguard = 2;
7955 // Whether or not face unlock requires attention.
7956 optional bool unlock_attention_required = 3;
7957 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7958 optional bool unlock_app_enabled = 4;
7959 // Whether or not face unlock always requires user confirmation.
7960 optional bool unlock_always_require_confirmation = 5;
7961 // Whether or not a diverse set of poses are required during enrollment.
7962 optional bool unlock_diversity_required = 6;
7963}
Maggie White442b6312019-04-05 16:26:44 -07007964
7965/**
7966 * Logs cooling devices maintained by the kernel.
7967 *
7968 * Pulled from StatsCompanionService.java
7969 */
7970message CoolingDevice {
7971 // The type of cooling device being reported. Eg. CPU, GPU...
7972 optional android.os.CoolingTypeEnum device_location = 1;
7973 // The name of the cooling device source. Eg. CPU0
7974 optional string device_name = 2;
7975 // Current throttle state of the cooling device. The value can any unsigned
7976 // integer between 0 and max_state defined in its driver. 0 means device is
7977 // not in throttling, higher value means deeper throttling.
7978 optional int32 state = 3;
7979}
Ben Blount763a5d52019-04-10 11:48:58 -07007980
7981/**
7982 * Intelligence has several counter-type events that don't warrant a
7983 * full separate atom. These are primarily API call counters but also include
7984 * counters for feature usage and specific failure modes.
7985 *
7986 * Logged from the Intelligence mainline module.
7987 */
7988message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007989 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007990 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007991 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007992 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007993 // How many times the event occured (to report a batch of high frequency events).
7994 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007995 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007996 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007997}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007998
7999/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008000 * Logs when Car Power state changed.
8001 *
8002 * Logged from:
8003 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8004 */
8005message CarPowerStateChanged {
8006 // States come from CpmsState in CarPowerManagementService.java.
8007 enum State {
8008 WAIT_FOR_VHAL = 0;
8009 ON = 1;
8010 SHUTDOWN_PREPARE = 2;
8011 WAIT_FOR_FINISH = 3;
8012 SUSPEND = 4;
8013 SIMULATE_SLEEP = 5;
8014 }
8015 optional State state = 1;
8016}
8017
8018/**
Mayank Gargda5ca012020-05-14 00:23:53 -07008019 * Logs when Car User Hal is requested to switch/create/remove user.
8020 *
8021 * Logged from:
8022 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8023 */
8024message CarUserHalModifyUserRequestReported {
8025 // Request id for the request.
8026 optional int32 request_id = 1;
8027 // Request type.
8028 enum RequestType {
8029 UNKNOWN = 0;
8030 // Car user manager requested user switch.
8031 SWITCH_REQUEST_ANDROID = 1;
8032 // OEM requested User switch.
8033 SWITCH_REQUEST_OEM = 2;
8034 // Hal switch requested after android switch using activity manager.
8035 SWITCH_REQUEST_LEGACY = 3;
8036 // Create User
8037 CREATE_REQUEST = 4;
8038 // Remove User
8039 REMOVE_REQUEST = 5;
8040 }
8041 optional RequestType request_type = 2;
8042 // Android User id of the current user which can only be 0, 10, 11 and so on.
8043 // -1 if not available.
8044 optional int32 user_id = 3;
8045 // VHAL flags of the current user. (-1 if not available)
8046 optional int32 user_flags = 4;
8047 // Android User id of the target user for switch/create/remove. It can only
8048 // be 0, 10, 11 and so on. -1 if not available.
8049 optional int32 target_user_id = 5;
8050 // VHAL flags of the target user for switch/create/remove. (-1 if not available)
8051 optional int32 target_user_flags = 6;
8052 // Request timeout Milliseconds (-1 if not available)
8053 optional int32 timeout_millis = 7;
8054}
8055
8056/**
8057 * Logs when Car User Hal responds to switch/create user request.
8058 *
8059 * Logged from:
8060 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8061 */
8062message CarUserHalModifyUserResponseReported {
8063 // Request id of the request associated with the response.
8064 optional int32 request_id = 1;
8065 // Car user hal callback status.
8066 enum CallbackStatus {
8067 UNKNOWN = 0;
8068 // Hal response was invalid.
8069 INVALID = 1;
8070 // Hal response was ok.
8071 OK = 2;
8072 // Hal timeout during set call.
8073 HAL_SET_TIMEOUT = 3;
8074 // Hal response timeout.
8075 HAL_RESPONSE_TIMEOUT = 4;
8076 // Hal responded with wrong info.
8077 WRONG_HAL_RESPONSE = 5;
8078 // Hal is processing multiple requests simultaneously.
8079 CONCURRENT_OPERATION = 6;
8080 }
8081 optional CallbackStatus callback_status = 2;
8082
8083 // Hal request status for user switch/create/remove.
8084 enum HalRequestStatus {
8085 UNSPECIFIED = 0;
8086 // Hal request for user switch/create is successful.
8087 SUCCESS = 1;
8088 // Hal request for user switch/create failed.
8089 FAILURE = 2;
8090 }
8091 optional HalRequestStatus request_status = 3;
8092}
8093
8094/**
8095 * Logs when post switch response is posted to Car User Hal.
8096 *
8097 * Logged from:
8098 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8099 */
8100message CarUserHalPostSwitchResponseReported {
8101 // Request id.
8102 optional int32 request_id = 1;
8103
8104 // Android user switch status.
8105 enum UserSwitchStatus {
8106 UNKNOWN = 0;
8107 // Android user switch is successful.
8108 SUCCESS = 1;
8109 // Android user switch failed.
8110 FAILURE = 2;
8111 }
8112 optional UserSwitchStatus switch_status = 2;
8113}
8114
8115/**
8116 * Logs when initial user information is requested from Car User Hal.
8117 *
8118 * Logged from:
8119 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8120 */
8121message CarUserHalInitialUserInfoRequestReported {
8122 // Request id for the request.
8123 optional int32 request_id = 1;
8124
8125 // Request type for initial user information.
8126 enum InitialUserInfoRequestType {
8127 UNKNOWN = 0;
8128 // At the first time Android was booted (or after a factory reset).
8129 FIRST_BOOT = 1;
8130 // At the first time Android was booted after the system was updated.
8131 FIRST_BOOT_AFTER_OTA = 2;
8132 // When Android was booted "from scratch".
8133 COLD_BOOT = 3;
8134 // When Android was resumed after the system was suspended to memory.
8135 RESUME = 4;
8136 }
8137 optional InitialUserInfoRequestType request_type = 2;
8138 // Request timeout Milliseconds (-1 if not available)
8139 optional int32 timeout_millis = 3;
8140}
8141
8142/**
8143 * Logs when Car User Hal responds to initial user information requests.
8144 *
8145 * Logged from:
8146 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8147 */
8148message CarUserHalInitialUserInfoResponseReported {
8149 // Request id of the request associated with the response.
8150 optional int32 request_id = 1;
8151 // Car user hal callback status.
8152 enum CallbackStatus {
8153 UNKNOWN = 0;
8154 // Hal response was invalid.
8155 INVALID = 1;
8156 // Hal response was ok.
8157 OK = 2;
8158 // Hal timeout during set call.
8159 HAL_SET_TIMEOUT = 3;
8160 // Hal response timeout.
8161 HAL_RESPONSE_TIMEOUT = 4;
8162 // Hal responded with wrong info.
8163 WRONG_HAL_RESPONSE = 5;
8164 // Hal is processing multiple requests simultaneously.
8165 CONCURRENT_OPERATION = 6;
8166 }
8167 optional CallbackStatus callback_status = 2;
8168 // Response for initial user information request.
8169 enum InitialUserInfoResponseAction {
8170 UNSPECIFIED = 0;
8171 // Let the Android System decide what to do.
8172 DEFAULT = 1;
8173 // Switch to an existing Android user.
8174 SWITCH = 2;
8175 // Create a new Android user (and switch to it).
8176 CREATE = 3;
8177 }
8178 optional InitialUserInfoResponseAction response_action = 3;
8179 // Android User id of the target user which can only be 0, 10, 11 and so on.
8180 // -1 if not available.
8181 optional int32 target_user = 4;
8182 // VHAL flags of the current user. (-1 if not available)
8183 optional int32 target_user_flags = 5;
8184 // User locales
8185 optional string user_locales = 6;
8186}
8187
8188/**
8189 * Logs when set user association is requested from Car User Hal.
8190 *
8191 * Logged from:
8192 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8193 */
8194message CarUserHalUserAssociationRequestReported {
8195 // Request id for the request.
8196 optional int32 request_id = 1;
8197 // Request type.
8198 enum RequestType {
8199 UNKNOWN = 0;
8200 // For setting user association information.
8201 SET = 1;
8202 // For getting user association information.
8203 GET = 2;
8204 }
8205 optional RequestType request_type = 2;
8206 // Android User id of the current user which can only be 0, 10, 11 and so on.
8207 // -1 if not available.
8208 optional int32 current_user_id = 3;
8209 // VHAL flags of the current user. (-1 if not available)
8210 optional int32 current_user_flags = 4;
8211 // Number of the set associations requested.
8212 optional int32 number_associations = 5;
8213 // Concatenated string for the types from set associations request.
8214 // This is a string converted from an array of integers.
8215 optional string user_identification_association_types = 6;
8216 // Concatenated string for the values from set associations request.
8217 // This is a string converted from an array of integers.
8218 optional string user_identification_association_values = 7;
8219}
8220
8221/**
8222 * Logs when Car User Hal responds to set user association requests.
8223 *
8224 * Logged from:
8225 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8226 */
8227message CarUserHalSetUserAssociationResponseReported {
8228 // Request id of the request associated with the response.
8229 optional int32 request_id = 1;
8230 // Car user hal callback status.
8231 enum CallbackStatus {
8232 UNKNOWN = 0;
8233 // Hal response was invalid.
8234 INVALID = 1;
8235 // Hal response was ok.
8236 OK = 2;
8237 // Hal timeout during set call.
8238 HAL_SET_TIMEOUT = 3;
8239 // Hal response timeout.
8240 HAL_RESPONSE_TIMEOUT = 4;
8241 // Hal responded with wrong info.
8242 WRONG_HAL_RESPONSE = 5;
8243 // Hal is processing multiple requests simultaneously.
8244 CONCURRENT_OPERATION = 6;
8245 }
8246 optional CallbackStatus callback_status = 2;
8247 // Number of the set associations in the response.
8248 optional int32 number_associations = 3;
8249 // Concatenated string for the types from set associations request.
8250 // This is a string converted from an array of integers.
8251 optional string user_identification_association_types = 4;
8252 // Concatenated string for the values from set associations request.
8253 // This is a string converted from an array of integers.
8254 optional string user_identification_association_values = 5;
8255}
8256
8257/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008258 * Logs whether GarageMode is entered.
8259 *
8260 * Logged from:
8261 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8262 */
8263message GarageModeInfo {
8264 // Whether GarageMode is entered.
8265 optional bool is_garage_mode = 1;
8266}
Martijn Coenencd95d462019-04-25 17:09:45 +02008267
8268/**
8269 * Historical app ops data per package.
8270 */
8271message AppOps {
8272 // Uid of the package requesting the op
8273 optional int32 uid = 1 [(is_uid) = true];
8274
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008275 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008276 optional string package_name = 2;
8277
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008278 // operation id
8279 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008280
8281 // The number of times the op was granted while the app was in the
8282 // foreground (only for trusted requests)
8283 optional int64 trusted_foreground_granted_count = 4;
8284
8285 // The number of times the op was granted while the app was in the
8286 // background (only for trusted requests)
8287 optional int64 trusted_background_granted_count = 5;
8288
8289 // The number of times the op was rejected while the app was in the
8290 // foreground (only for trusted requests)
8291 optional int64 trusted_foreground_rejected_count = 6;
8292
8293 // The number of times the op was rejected while the app was in the
8294 // background (only for trusted requests)
8295 optional int64 trusted_background_rejected_count = 7;
8296
8297 // For long-running operations, total duration of the operation
8298 // while the app was in the foreground (only for trusted requests)
8299 optional int64 trusted_foreground_duration_millis = 8;
8300
8301 // For long-running operations, total duration of the operation
8302 // while the app was in the background (only for trusted requests)
8303 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008304
8305 // Whether AppOps is guarded by Runtime permission
8306 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008307}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008308
8309/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008310 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008311 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008312message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008313 // Uid of the package requesting the op
8314 optional int32 uid = 1 [(is_uid) = true];
8315
8316 // Name of the package performing the op
8317 optional string package_name = 2;
8318
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008319 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8320 // Attributions must be provided through manifest using <attribution> tag available in R and
8321 // above.
8322 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008323
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008324 // operation id
8325 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008326
8327 // The number of times the op was granted while the app was in the
8328 // foreground (only for trusted requests)
8329 optional int64 trusted_foreground_granted_count = 5;
8330
8331 // The number of times the op was granted while the app was in the
8332 // background (only for trusted requests)
8333 optional int64 trusted_background_granted_count = 6;
8334
8335 // The number of times the op was rejected while the app was in the
8336 // foreground (only for trusted requests)
8337 optional int64 trusted_foreground_rejected_count = 7;
8338
8339 // The number of times the op was rejected while the app was in the
8340 // background (only for trusted requests)
8341 optional int64 trusted_background_rejected_count = 8;
8342
8343 // For long-running operations, total duration of the operation
8344 // while the app was in the foreground (only for trusted requests)
8345 optional int64 trusted_foreground_duration_millis = 9;
8346
8347 // For long-running operations, total duration of the operation
8348 // while the app was in the background (only for trusted requests)
8349 optional int64 trusted_background_duration_millis = 10;
8350
8351 // Whether AppOps is guarded by Runtime permission
8352 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008353
8354 // Sampling rate used on device, from 0 to 100
8355 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008356}
8357
8358/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008359 * Location Manager API Usage information(e.g. API under usage,
8360 * API call's parameters).
8361 * Logged from:
8362 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8363 */
8364message LocationManagerApiUsageReported {
8365
8366 // Indicating if usage starts or usage ends.
8367 optional android.stats.location.UsageState state = 1;
8368
8369 // LocationManagerService's API in use.
8370 // We can identify which API from LocationManager is
8371 // invoking current LMS API by the combination of
8372 // API parameter(e.g. is_listener_null, is_intent_null,
8373 // is_location_request_null)
8374 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8375
8376 // Name of the package calling the API.
8377 optional string calling_package_name = 3;
8378
8379 // Type of the location provider.
8380 optional android.stats.location.ProviderType provider = 4;
8381
8382 // Quality of the location request
8383 optional android.stats.location.LocationRequestQuality quality = 5;
8384
8385 // The desired interval for active location updates, in milliseconds.
8386 // Bucketized to reduce cardinality.
8387 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8388
8389 // Minimum distance between location updates, in meters.
8390 // Bucketized to reduce cardinality.
8391 optional android.stats.location.SmallestDisplacementBucket
8392 bucketized_smallest_displacement = 7;
8393
8394 // The number of location updates.
8395 optional int64 num_updates = 8;
8396
8397 // The request expiration time, in millisecond since boot.
8398 // Bucketized to reduce cardinality.
8399 optional android.stats.location.ExpirationBucket
8400 bucketized_expire_in = 9;
8401
8402 // Type of Callback passed in for this API.
8403 optional android.stats.location.CallbackType callback_type = 10;
8404
8405 // The radius of the central point of the alert
8406 // region, in meters. Only for API REQUEST_GEOFENCE.
8407 // Bucketized to reduce cardinality.
8408 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8409
8410 // Activity Importance of API caller.
8411 // Categorized to 3 types that are interesting from location's perspective.
8412 optional android.stats.location.ActivityImportance activiy_importance = 12;
8413}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008414
8415/**
8416 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8417 */
8418message ReviewPermissionsFragmentResultReported {
8419 // unique value identifying a permission group change. A permission group change might result
8420 // in multiple of these atoms
8421 optional int64 change_id = 1;
8422
8423 // UID of package the permission belongs to
8424 optional int32 uid = 2 [(is_uid) = true];
8425
8426 // Name of package the permission belongs to
8427 optional string package_name = 3;
8428
8429 // The permission to be granted
8430 optional string permission_name = 4;
8431
8432 // The result of the permission grant
8433 optional bool permission_granted = 5;
8434}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008435
8436/**
8437* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8438* Logged from: RuntimePermissionUpdgradeController
8439*/
8440message RuntimePermissionsUpgradeResult {
8441 // Permission granted as result of upgrade
8442 optional string permission_name = 1;
8443
8444 // UID of package granted permission
8445 optional int32 uid = 2 [(is_uid) = true];
8446
8447 // Name of package granted permission
8448 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008449}
8450
8451/**
8452* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8453*/
8454message GrantPermissionsActivityButtonActions {
8455 // Permission granted as result of upgrade
8456 optional string permission_group_name = 1;
8457
8458 // UID of package granted permission
8459 optional int32 uid = 2 [(is_uid) = true];
8460
8461 // Name of package requesting permission
8462 optional string package_name = 3;
8463
8464 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8465 // LABEL_ constants in GrantPermissionActivity.java
8466 optional int32 buttons_presented = 4;
8467
8468 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8469 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008470
8471 // id which identifies single session of user interacting with permission controller
8472 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008473}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008474
8475/**
8476 * Information about LocationAccessCheck notification presented to user
8477 */
8478message LocationAccessCheckNotificationAction {
8479
8480 // id which identifies single session of user interacting with permission controller
8481 optional int64 session_id = 1;
8482
8483 // Uid of package for which location access check is presented
8484 optional int32 package_uid = 2;
8485
8486 // Name of package for which location access check is presented
8487 optional string package_name = 3;
8488
8489 enum Result {
8490 UNDEFINED = 0;
8491 // notification was presented to the user
8492 NOTIFICATION_PRESENTED = 1;
8493 // notification was declined by the user
8494 NOTIFICATION_DECLINED = 2;
8495 // notification was clicked by the user
8496 NOTIFICATION_CLICKED = 3;
8497 }
8498
8499 // View / interaction recorded
8500 optional Result result = 4;
8501}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008502
8503/**
8504 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8505 */
8506message AppPermissionFragmentActionReported {
8507 // id which identifies single session of user interacting with permission controller
8508 optional int64 session_id = 1;
8509
8510 // unique value identifying a permission group change. A permission group change might result
8511 // in multiple of these atoms
8512 optional int64 change_id = 2;
8513
8514 // UID of package the permission belongs to
8515 optional int32 uid = 3 [(is_uid) = true];
8516
8517 // Name of package the permission belongs to
8518 optional string package_name = 4;
8519
8520 // The permission to be granted
8521 optional string permission_name = 5;
8522
8523 // The result of the permission grant
8524 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008525
8526 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8527 optional int32 permission_flags = 7;
8528
8529 enum Button {
8530 UNDEFINED = 0;
8531 // Allow button
8532 ALLOW = 1;
8533 // Deny button
8534 DENY = 2;
8535 // Ask every time button
8536 ASK_EVERY_TIME = 3;
8537 // Allow all the time button
8538 ALLOW_ALWAYS = 4;
8539 // Allow only while using the app button
8540 ALLOW_FOREGROUND = 5;
8541 // Same is Deny button but shown in while in use dialog
8542 DENY_FOREGROUND = 6;
8543 }
8544
8545 // Button pressed in the dialog
8546 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008547}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008548
8549/**
8550* Information about a AppPermissionFragment viewed by user
8551*/
8552message AppPermissionFragmentViewed {
8553 // id which identifies single session of user interacting with permission controller
8554 optional int64 session_id = 1;
8555
8556 // UID of package for which permissions are viewed
8557 optional int32 uid = 2 [(is_uid) = true];
8558
8559 // Name of package for which permissions are viewed
8560 optional string package_name = 3;
8561
8562 // Permission group viewed
8563 optional string permission_group_name = 4;
8564}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008565
8566/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008567* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8568* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008569*/
8570message AppPermissionsFragmentViewed {
8571 // id which identifies single session of user interacting with permission controller
8572 optional int64 session_id = 1;
8573
8574 // id which identifies single view as every view might have several logging records
8575 // with different package information attached
8576 optional int64 view_id = 2;
8577
8578 // Permission group viewed
8579 optional string permission_group_name = 3;
8580
8581 // UID of package for which permissions are viewed
8582 optional int32 uid = 4 [(is_uid) = true];
8583
8584 // Name of package for which permissions are viewed
8585 optional string package_name = 5;
8586
8587 // Category in which permission is included
8588 enum Category {
8589 UNDEFINED = 0;
8590 ALLOWED = 1;
8591 ALLOWED_FOREGROUND = 2;
8592 DENIED = 3;
8593 }
8594 optional Category category = 6;
8595}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008596/**
8597* Information about a PermissionAppsFragment viewed by user.
8598* Logged from ui/handheld/PermissionAppsFragment.java
8599*/
8600message PermissionAppsFragmentViewed {
8601 // id which identifies single session of user interacting with permission controller
8602 optional int64 session_id = 1;
8603
8604 // id which identifies single view as every view might have several logging records
8605 // with different package information attached
8606 optional int64 view_id = 2;
8607
8608 // Permission group viewed
8609 optional string permission_group_name = 3;
8610
8611 // UID of package for which permissions are viewed
8612 optional int32 uid = 4 [(is_uid) = true];
8613
8614 // Name of package for which permissions are viewed
8615 optional string package_name = 5;
8616
8617 // Category in which app is included
8618 enum Category {
8619 UNDEFINED = 0;
8620 ALLOWED = 1;
8621 ALLOWED_FOREGROUND = 2;
8622 DENIED = 3;
8623 }
8624 optional Category category = 6;
8625}
Tony Make2b1b672019-07-29 16:59:47 +01008626
8627/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008628* Log that the Auto Revoke notification has been clicked
8629* Logged from ui/ManagePermissionsActivity
8630*/
8631message AutoRevokeNotificationClicked {
8632 // id which identifies single session of user interacting with permission controller
8633 optional int64 session_id = 1;
8634}
8635
8636/**
8637* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8638* auto revoked for it.
8639* Logged from ui/handheld/AutoRevokeFragment
8640*/
8641message AutoRevokeFragmentAppViewed {
8642 // id which identifies single session of user interacting with permission controller
8643 optional int64 session_id = 1;
8644
8645 // UID of package for which permissions are viewed
8646 optional int32 uid = 2 [(is_uid) = true];
8647
8648 // Name of package for which permissions are viewed
8649 optional string package_name = 3;
8650
8651 // The name of a permission group that has been revoked
8652 optional string permission_group_name = 4;
8653
8654 // The age of the app- more than three months old, or more than six months
8655 enum Age {
8656 UNDEFINED = 0;
8657 NEWER_BUCKET = 1;
8658 OLDER_BUCKET = 2;
8659 }
8660
8661 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8662 optional Age age = 5;
8663}
8664
8665/**
8666* Log that the user has interacted with an app on the auto revoke fragment
8667* Logged from ui/handheld/AutoRevokeFragment
8668*/
8669message AutoRevokedAppInteraction {
8670 // id which identifies single session of user interacting with permission controller
8671 optional int64 session_id = 1;
8672
8673 // UID of package for which permissions are viewed
8674 optional int32 uid = 2 [(is_uid) = true];
8675
8676 // Name of package for which permissions are viewed
8677 optional string package_name = 3;
8678
8679 enum Action {
8680 UNDEFINED = 0;
8681 REMOVE = 1;
8682 OPEN = 2;
8683 APP_INFO = 3;
8684 PERMISSIONS = 4;
8685 REMOVE_IN_SETTINGS = 5;
8686 OPEN_IN_SETTINGS = 6;
8687 }
8688
8689 // The action the user took to interact with the app
8690 optional Action action = 4;
8691}
8692
8693/**
8694* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8695* auto revoke, or that the auto revoke switch has been changed
8696* Logged from ui/handheld/AppPermissionGroupsFragment
8697 */
8698message AppPermissionGroupsFragmentAutoRevokeAction {
8699 // id which identifies single session of user interacting with permission controller
8700 optional int64 session_id = 1;
8701
8702 // UID of package for which permissions are viewed
8703 optional int32 uid = 2 [(is_uid) = true];
8704
8705 // Name of package for which permissions are viewed
8706 optional string package_name = 3;
8707
8708 enum Action {
8709 UNDEFINED = 0;
8710 OPENED_FOR_AUTO_REVOKE = 1;
8711 OPENED_FROM_INTENT = 2;
8712 SWITCH_ENABLED = 3;
8713 SWITCH_DISABLED = 4;
8714 }
8715
8716 // The action the user took to interact with the fragment
8717 optional Action action = 4;
8718}
8719
8720/**
Tony Make2b1b672019-07-29 16:59:47 +01008721 * Logs when there is a smart selection related event.
8722 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8723 * Logged from: TextClassifierEventLogger.java
8724 */
8725message TextSelectionEvent {
8726 // A session ID.
8727 optional string session_id = 1;
8728
8729 // Event type of this event.
8730 optional android.stats.textclassifier.EventType event_type = 2;
8731
Tony Mak9c84bd22019-12-09 07:27:25 +00008732 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008733 optional string model_name = 3;
8734
8735 // Type of widget that was involved in triggering this event.
8736 optional android.stats.textclassifier.WidgetType widget_type = 4;
8737
8738 // Index of this event in a session.
8739 optional int32 event_index = 5;
8740
8741 // Entity type that is involved.
8742 optional string entity_type = 6;
8743
8744 // Relative word index of the start of the selection.
8745 optional int32 relative_word_start_index = 7;
8746
8747 // Relative word (exclusive) index of the end of the selection.
8748 optional int32 relative_word_end_index = 8;
8749
8750 // Relative word index of the start of the smart selection.
8751 optional int32 relative_suggested_word_start_index = 9;
8752
8753 // Relative word (exclusive) index of the end of the smart selection.
8754 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008755
8756 // Name of source package.
8757 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008758
8759 // Name of the LangID model that is involved in this event.
8760 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008761}
8762
8763/**
8764 * Logs when there is a smart linkify related event.
8765 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8766 * Logged from: TextClassifierEventLogger.java
8767 */
8768message TextLinkifyEvent {
8769 // A session ID.
8770 optional string session_id = 1;
8771
8772 // Event type of this event.
8773 optional android.stats.textclassifier.EventType event_type = 2;
8774
Tony Mak9c84bd22019-12-09 07:27:25 +00008775 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008776 optional string model_name = 3;
8777
8778 // Type of widget that was involved in triggering this event.
8779 optional android.stats.textclassifier.WidgetType widget_type = 4;
8780
8781 // Index of this event in a session.
8782 optional int32 event_index = 5;
8783
8784 // Entity type that is involved.
8785 optional string entity_type = 6;
8786
8787 // Number of links detected.
8788 optional int32 num_links = 7;
8789
8790 // The total length of all links.
8791 optional int32 linked_text_length = 8;
8792
8793 // Length of input text.
8794 optional int32 text_length = 9;
8795
8796 // Time spent on generating links in ms.
8797 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008798
8799 // Name of source package.
8800 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008801
8802 // Name of the LangID model that is involved in this event.
8803 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008804}
8805
8806/**
8807 * Logs when there is a conversation actions related event.
8808 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8809 * Logged from: TextClassifierEventLogger.java
8810 */
8811message ConversationActionsEvent {
8812 // A session ID.
8813 optional string session_id = 1;
8814
8815 // Event type of this event.
8816 optional android.stats.textclassifier.EventType event_type = 2;
8817
Tony Mak9c84bd22019-12-09 07:27:25 +00008818 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008819 optional string model_name = 3;
8820
8821 // Type of widget that was involved in triggering this event.
8822 optional android.stats.textclassifier.WidgetType widget_type = 4;
8823
8824 // The first entity type that is involved.
8825 optional string first_entity_type = 5;
8826
8827 // The second entity type that is involved.
8828 optional string second_entity_type = 6;
8829
8830 // The third entity type that is involved.
8831 optional string third_entity_type = 7;
8832
8833 // The score of the first entity type.
8834 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008835
8836 // Name of source package.
8837 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008838
8839 // Name of the annotator model that is involved in this event.
8840 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008841
8842 // Name of the LangID model that is involved in this event.
8843 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008844}
8845
8846/**
8847 * Logs when there is a language detection related event.
8848 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8849 * Logged from: TextClassifierEventLogger.java
8850 */
8851message LanguageDetectionEvent {
8852 // A session ID.
8853 optional string session_id = 1;
8854
8855 // Event type of this event.
8856 optional android.stats.textclassifier.EventType event_type = 2;
8857
Tony Mak9c84bd22019-12-09 07:27:25 +00008858 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008859 optional string model_name = 3;
8860
8861 // Type of widget that was involved in triggering this event.
8862 optional android.stats.textclassifier.WidgetType widget_type = 4;
8863
8864 // Detected language.
8865 optional string language_tag = 5;
8866
8867 // Score of the detected language.
8868 optional float score = 6;
8869
8870 // Position of this action.
8871 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008872
8873 // Name of source package.
8874 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008875}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008876
8877/**
8878 * Information about an OTA update attempt by update_engine.
8879 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8880 */
8881message UpdateEngineUpdateAttemptReported {
8882 // The number of attempts for the update engine to apply a given payload.
8883 optional int32 attempt_number = 1;
8884
8885 optional android.stats.otaupdate.PayloadType payload_type = 2;
8886
8887 // The total time in minutes for the update engine to apply a given payload.
8888 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8889 // it's increased when the system is sleeping.
8890 optional int32 duration_boottime_in_minutes = 3;
8891
8892 // The total time in minutes for the update engine to apply a given payload.
8893 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8894 // and it's not increased when the system is sleeping.
8895 optional int32 duration_monotonic_in_minutes = 4;
8896
8897 // The size of the payload in MiBs.
8898 optional int32 payload_size_mib = 5;
8899
8900 // The attempt result reported by the update engine for an OTA update.
8901 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8902
8903 // The error code reported by the update engine after an OTA update attempt
8904 // on A/B devices.
8905 optional android.stats.otaupdate.ErrorCode error_code = 7;
8906
8907 // The build fingerprint of the source system. The value is read from a
8908 // system property when the device takes the update. e.g.
8909 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8910 optional string source_fingerprint = 8;
Alessio Balsinid8698fa2020-05-26 22:26:56 +01008911
8912 // Size of super partition.
8913 optional int64 super_partition_size_bytes = 9;
8914
8915 // Size of current slot within the super partition.
8916 optional int64 slot_size_bytes = 10;
8917
8918 // Free space available in the super partition.
8919 optional int64 super_free_space_bytes = 11;
Tianjie Xu167c3db2019-07-22 14:25:14 -07008920}
8921
8922/**
8923 * Information about all the attempts the device make before finishing the
8924 * successful update.
8925 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8926 */
8927message UpdateEngineSuccessfulUpdateReported {
8928 // The number of attempts for the update engine to apply the payload for a
8929 // successful update.
8930 optional int32 attempt_count = 1;
8931
8932 optional android.stats.otaupdate.PayloadType payload_type = 2;
8933
8934 optional int32 payload_size_mib = 3;
8935
8936 // The total number of bytes downloaded by update_engine since the last
8937 // successful update.
8938 optional int32 total_bytes_downloaded_mib = 4;
8939
8940 // The ratio in percentage of the over-downloaded bytes compared to the
8941 // total bytes needed to successfully install the update. e.g. 200 if we
8942 // download 200MiB in total for a 100MiB package.
8943 optional int32 download_overhead_percentage = 5;
8944
8945 // The total time in minutes for the update engine to apply the payload for a
8946 // successful update.
8947 optional int32 total_duration_minutes = 6;
8948
8949 // The number of reboot of the device during a successful update.
8950 optional int32 reboot_count = 7;
8951}
Alec Mourie088e762019-07-02 13:10:55 -07008952
8953/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008954 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8955 * key to indicate whether it was successful or not.
8956 *
8957 * Logged from:
8958 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8959 */
8960message RebootEscrowRecoveryReported {
8961 optional bool successful = 1;
8962}
8963
8964/**
Alec Mourie088e762019-07-02 13:10:55 -07008965 * Global display pipeline metrics reported by SurfaceFlinger.
8966 * Pulled from:
8967 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8968 */
8969message SurfaceflingerStatsGlobalInfo {
8970 // Total number of frames presented during the tracing period
8971 optional int64 total_frames = 1;
8972 // Total number of frames missed
8973 optional int64 missed_frames = 2;
8974 // Total number of frames that fell back to client composition
8975 optional int64 client_composition_frames = 3;
8976 // Total time the display was turned on
8977 optional int64 display_on_millis = 4;
8978 // Total time that was spent performing animations.
8979 // This is derived from the present-to-present layer histogram
8980 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008981 // Total number of event connections tracked by SurfaceFlinger at the time
8982 // of this pull. If this number grows prohibitively large, then this can
8983 // cause jank due to resource contention.
8984 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008985 // Set of timings measured from when SurfaceFlinger began compositing a
8986 // frame, until the frame was requested to be presented to the display. This
8987 // measures SurfaceFlinger's total CPU walltime on the critical path per
8988 // frame.
8989 optional FrameTimingHistogram frame_duration = 7
8990 [(android.os.statsd.log_mode) = MODE_BYTES];
8991 // Set of timings measured from when SurfaceFlinger first began using the
8992 // GPU to composite a frame, until the GPU has finished compositing that
8993 // frame. This measures the total additional time SurfaceFlinger needed to
8994 // perform due to falling back into GPU composition.
8995 optional FrameTimingHistogram render_engine_timing = 8
8996 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008997}
8998
8999/**
9000 * Per-layer display pipeline metrics reported by SurfaceFlinger.
9001 * The number of layers uploaded will be restricted due to size limitations.
9002 * Pulled from:
9003 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9004 */
9005message SurfaceflingerStatsLayerInfo {
9006 // The layer for this set of metrics
9007 // For now we can infer that the package name is included in the layer
9008 // name.
9009 optional string layer_name = 1;
9010 // Total number of frames presented
9011 optional int64 total_frames = 2;
9012 // Total number of dropped frames while latching a buffer for this layer.
9013 optional int64 dropped_frames = 3;
9014 // Set of timings measured between successive presentation timestamps.
9015 optional FrameTimingHistogram present_to_present = 4
9016 [(android.os.statsd.log_mode) = MODE_BYTES];
9017 // Set of timings measured from when an app queued a buffer for
9018 // presentation, until the buffer was actually presented to the
9019 // display.
9020 optional FrameTimingHistogram post_to_present = 5
9021 [(android.os.statsd.log_mode) = MODE_BYTES];
9022 // Set of timings measured from when a buffer is ready to be presented,
9023 // until the buffer was actually presented to the display.
9024 optional FrameTimingHistogram acquire_to_present = 6
9025 [(android.os.statsd.log_mode) = MODE_BYTES];
9026 // Set of timings measured from when a buffer was latched by
9027 // SurfaceFlinger, until the buffer was presented to the display
9028 optional FrameTimingHistogram latch_to_present = 7
9029 [(android.os.statsd.log_mode) = MODE_BYTES];
9030 // Set of timings measured from the desired presentation to the actual
9031 // presentation time
9032 optional FrameTimingHistogram desired_to_present = 8
9033 [(android.os.statsd.log_mode) = MODE_BYTES];
9034 // Set of timings measured from when an app queued a buffer for
9035 // presentation, until the buffer was ready to be presented.
9036 optional FrameTimingHistogram post_to_acquire = 9
9037 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08009038 // Frames missed latch because the acquire fence didn't fire
9039 optional int64 late_acquire_frames = 10;
9040 // Frames latched early because the desired present time was bad
9041 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07009042}
9043
9044/**
9045 * Histogram of frame counts bucketed by time in milliseconds.
9046 * Because of size limitations, we hard-cap the number of buckets, with
9047 * buckets for corresponding to larger milliseconds being less precise.
9048 */
9049message FrameTimingHistogram {
9050 // Timings in milliseconds that describes a set of histogram buckets
9051 repeated int32 time_millis_buckets = 1;
9052 // Number of frames that match to each time_millis, i.e. the bucket
9053 // contents
9054 // It's required that len(time_millis) == len(frame_count)
9055 repeated int64 frame_counts = 2;
9056}
Emilian Peev6729f372019-08-29 09:14:09 -07009057
Emilian Peev6729f372019-08-29 09:14:09 -07009058/**
Alec Mouri5ac32622020-02-06 08:44:25 -08009059 * Janky event as reported by SurfaceFlinger.
9060 * This event is intended to be consumed by a Perfetto subscriber for
9061 * automated trace collection.
9062 *
9063 * Logged from:
9064 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
9065 */
9066message DisplayJankReported {
9067 // Informational field for how long the janky event lasted in milliseconds
9068 optional int64 event_duration_millis = 1;
9069 // Number of frame deadlines missed, where SurfaceFlinger failed to update
9070 // the display on time.
9071 optional int32 present_deadlines_missed = 2;
9072}
9073
9074/**
Emilian Peev6729f372019-08-29 09:14:09 -07009075 * Information about camera facing and API level usage.
9076 * Logged from:
9077 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
9078 */
9079message CameraActionEvent {
9080 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08009081 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07009082
9083 // Camera API level used
9084 optional int32 api_level = 2;
9085
9086 // Name of client package
9087 optional string package_name = 3;
9088
9089 // Camera facing
9090 enum Facing {
9091 UNKNOWN = 0;
9092 BACK = 1;
9093 FRONT = 2;
9094 EXTERNAL = 3;
9095 }
9096 optional Facing facing = 4;
9097}
atrost01a20932019-08-28 15:40:37 +01009098
9099/**
9100 * Logs when a compatibility change is affecting an app.
9101 *
9102 * Logged from:
9103 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
9104 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
9105 */
9106message AppCompatibilityChangeReported {
9107 // The UID of the app being affected by the compatibilty change.
9108 optional int32 uid = 1 [(is_uid) = true];
9109
9110 // The ID of the change affecting the app.
9111 optional int64 change_id = 2;
9112
9113 enum State {
9114 UNKNOWN_STATE = 0;
9115 ENABLED = 1;
9116 DISABLED = 2;
9117 LOGGED = 3;
9118 }
9119
9120 // The state of the change - if logged from gating whether it was enabled or disabled, or just
9121 // logged otherwise.
9122 optional State state = 3;
9123
9124 enum Source {
9125 UNKNOWN_SOURCE = 0;
9126 APP_PROCESS = 1;
9127 SYSTEM_SERVER = 2;
9128 }
9129
9130 // Where it was logged from.
9131 optional Source source = 4;
9132
9133}
Hector Dearman40579f62019-11-01 13:19:30 +00009134
9135/**
9136 * Logged from
9137 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
9138 */
9139message PerfettoUploaded {
9140 enum Event {
9141 PERFETTO_UNDEFINED = 0;
9142 PERFETTO_TRACE_BEGIN = 1;
9143 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
9144 PERFETTO_ON_CONNECT = 3;
9145 PERFETTO_ON_TRACING_DISABLED = 4;
9146 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
9147 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
9148 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
9149 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
9150 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
9151 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
9152 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
9153 PERFETTO_TRIGGER_BEGIN = 12;
9154 PERFETTO_TRIGGER_SUCCESS = 13;
9155 PERFETTO_TRIGGER_FAILURE = 14;
9156 PERFETTO_HIT_GUARDRAILS = 15;
9157 PERFETTO_ON_TIMEOUT = 16;
9158 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
9159 }
9160
9161 // Which stage of the pipeline we are reporting from.
9162 optional Event event = 1;
9163
9164 // UUID matching the one set inside the SystemInfo trace packet.
9165 optional int64 trace_uuid_lsb = 2;
9166 optional int64 trace_uuid_msb = 3;
9167}
Mark Tabrya824a642019-11-05 12:26:12 -08009168
9169/**
9170 * Pulls client metrics on data transferred via Vehicle Maps Service.
9171 * Metrics are keyed by uid + layer.
9172 *
9173 * Pulled from:
9174 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
9175 */
9176message VmsClientStats {
9177 // UID of the VMS client app
9178 optional int32 uid = 1 [(is_uid) = true];
9179
9180 // VMS layer definition
9181 optional int32 layer_type = 2;
9182 optional int32 layer_channel = 3;
9183 optional int32 layer_version = 4;
9184
9185 // Bytes and packets sent by the client for the layer
9186 optional int64 tx_bytes = 5;
9187 optional int64 tx_packets = 6;
9188
9189 // Bytes and packets received by the client for the layer
9190 optional int64 rx_bytes = 7;
9191 optional int64 rx_packets = 8;
9192
9193 // Bytes and packets dropped due to client error
9194 optional int64 dropped_bytes = 9;
9195 optional int64 dropped_packets = 10;
9196}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00009197
9198/**
9199 * State of a dangerous permission requested by a package - sampled
9200 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
9201*/
9202message DangerousPermissionStateSampled {
9203 // Name of the permission
9204 optional string permission_name = 1;
9205
9206 // Uid of the package
9207 optional int32 uid = 2 [(is_uid) = true];
9208
9209 // If the permission is granted to the uid
9210 optional bool is_granted = 3;
9211
9212 // Permission flags as per android.content.pm.PermissionFlags
9213 optional int32 permission_flags = 4;
9214}
9215
Stan Iliev637ba5e2019-08-16 13:43:08 -04009216/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04009217 * HWUI stats for a given app.
9218 */
9219message GraphicsStats {
9220 // The package name of the app
9221 optional string package_name = 1;
9222
9223 // The version code of the app
9224 optional int64 version_code = 2;
9225
9226 // The start & end timestamps in UTC as
9227 // milliseconds since January 1, 1970
9228 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05009229 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04009230
Stan Ilievb6517192020-02-18 10:12:42 -05009231 optional int64 end_millis = 4;
9232
9233 // HWUI renders pipeline type: GL (1) or Vulkan (2).
9234 enum PipelineType {
9235 UNKNOWN = 0;
9236 GL = 1;
9237 VULKAN = 2;
9238 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04009239
9240 // HWUI renders pipeline type: GL or Vulkan.
9241 optional PipelineType pipeline = 5;
9242
9243 // Distinct frame count.
9244 optional int32 total_frames = 6;
9245
9246 // Number of "missed vsync" events.
9247 optional int32 missed_vsync_count = 7;
9248
9249 // Number of frames in triple-buffering scenario (high input latency)
9250 optional int32 high_input_latency_count = 8;
9251
9252 // Number of "slow UI thread" events.
9253 optional int32 slow_ui_thread_count = 9;
9254
9255 // Number of "slow bitmap upload" events.
9256 optional int32 slow_bitmap_upload_count = 10;
9257
9258 // Number of "slow draw" events.
9259 optional int32 slow_draw_count = 11;
9260
9261 // Number of frames that missed their deadline (aka, visibly janked)
9262 optional int32 missed_deadline_count = 12;
9263
9264 // The frame time histogram for the package
9265 optional FrameTimingHistogram cpu_histogram = 13
9266 [(android.os.statsd.log_mode) = MODE_BYTES];
9267
9268 // The gpu frame time histogram for the package
9269 optional FrameTimingHistogram gpu_histogram = 14
9270 [(android.os.statsd.log_mode) = MODE_BYTES];
9271
9272 // UI mainline module version.
9273 optional int64 version_ui_module = 15;
9274
9275 // If true, these are HWUI stats for up to a 24h period for a given app from today.
9276 // If false, these are HWUI stats for a 24h period for a given app from the last complete
9277 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
9278 // more apps are running / rendering.
9279 optional bool is_today = 16;
9280}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009281
9282/**
9283 * Message related to dangerous (runtime) app ops access
9284 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009285message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009286 // Uid of the package accessing app op
9287 optional int32 uid = 1 [(is_uid) = true];
9288
9289 // Name of the package accessing app op
9290 optional string package_name = 2;
9291
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009292 // deprecated - set to empty string
9293 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009294
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009295 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009296 // API. Attributions must be provided through manifest using <attribution> tag available in R
9297 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009298 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009299
9300 // message related to app op access, limited to 600 chars by API
9301 optional string message = 5;
9302
9303 enum SamplingStrategy {
9304 DEFAULT = 0;
9305 UNIFORM = 1;
9306 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009307 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009308 }
9309
9310 // sampling strategy used to collect this message
9311 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009312
9313 // operation id
9314 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009315}
9316
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009317/*
9318 * Logs userspace reboot outcome and duration.
9319 *
9320 * Logged from:
9321 * frameworks/base/core/java/com/android/server/BootReceiver.java
9322 */
9323message UserspaceRebootReported {
9324 // Possible outcomes of userspace reboot.
9325 enum Outcome {
9326 // Default value in case platform failed to determine the outcome.
9327 OUTCOME_UNKNOWN = 0;
9328 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9329 SUCCESS = 1;
9330 // Userspace reboot shutdown sequence was aborted.
9331 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9332 // Remounting userdata into checkpointing mode failed.
9333 FAILED_USERDATA_REMOUNT = 3;
9334 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9335 // reboot.
9336 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9337 }
9338 // Outcome of userspace reboot. Always set.
9339 optional Outcome outcome = 1;
9340 // Duration of userspace reboot in case it has a successful outcome.
9341 // Duration is measured as time between userspace reboot was initiated and until boot completed
9342 // (e.g. sys.boot_completed=1).
9343 optional int64 duration_millis = 2;
9344 // State of primary user's (user0) credential encryption storage.
9345 enum UserEncryptionState {
9346 // Default value.
9347 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9348 // Credential encrypted storage is unlocked.
9349 UNLOCKED = 1;
9350 // Credential encrypted storage is locked.
9351 LOCKED = 2;
9352 }
9353 // State of primary user's encryption storage at the moment boot completed. Always set.
9354 optional UserEncryptionState user_encryption_state = 3;
9355}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009356
9357/*
9358 * Logs integrity check information during each install.
9359 *
9360 * Logged from:
9361 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9362 */
9363message IntegrityCheckResultReported {
9364 optional string package_name = 1;
9365 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009366 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009367 optional string installer_package_name = 4;
9368 enum Response {
9369 UNKNOWN = 0;
9370 ALLOWED = 1;
9371 REJECTED = 2;
9372 FORCE_ALLOWED = 3;
9373 }
9374 optional Response response = 5;
9375 // An estimate on the cause of the response. This will only be populated for
9376 // REJECTED and FORCE_ALLOWED
9377 optional bool caused_by_app_cert_rule = 6;
9378 optional bool caused_by_installer_rule = 7;
9379}
9380
9381/**
9382 * Logs the information about the rules and the provider whenever rules are
9383 * pushed into AppIntegrityManager.
9384 *
9385 * Logged from:
9386 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9387 */
9388message IntegrityRulesPushed {
9389 optional bool success = 1;
9390 // Package name of the app that pushed the rules.
9391 optional string rule_provider = 2;
9392 // Version string of arbitrary format provided by the rule provider to
9393 // identify the rules.
9394 optional string rule_version = 3;
9395}
Jordan Liubedfa702019-12-20 15:08:45 -08009396
9397/**
9398 * Logs when a cell broadcast message is received on the device.
9399 *
Jordan Liu900e5cb2020-05-29 09:44:59 -07009400 * Logged from Cell Broadcast module and platform:
Jordan Liubedfa702019-12-20 15:08:45 -08009401 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
Jordan Liu900e5cb2020-05-29 09:44:59 -07009402 * packages/apps/CellBroadcastReceiver/
9403 * frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
Jordan Liubedfa702019-12-20 15:08:45 -08009404 */
9405message CellBroadcastMessageReported {
9406 // The type of Cell Broadcast message
9407 enum CbType {
9408 UNKNOWN_TYPE = 0;
9409 GSM = 1;
9410 CDMA = 2;
9411 CDMA_SPC = 3;
9412 }
9413
Jordan Liu900e5cb2020-05-29 09:44:59 -07009414 // The parts of the cell broadcast message pipeline
9415 enum ReportSource {
9416 UNKNOWN_SOURCE = 0;
9417 FRAMEWORK = 1;
9418 CB_SERVICE = 2;
9419 CB_RECEIVER_APP = 3;
9420 }
9421
Jordan Liubedfa702019-12-20 15:08:45 -08009422 // GSM, CDMA, CDMA-SCP
9423 optional CbType type = 1;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009424
9425 // The source of the report
9426 optional ReportSource source = 2;
9427}
9428
9429/**
9430 * Logs when a cell broadcast message is filtered out, or otherwise intentionally not sent to CBR.
9431 *
9432 * Logged from CellBroadcastService module:
9433 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9434 */
9435message CellBroadcastMessageFiltered {
9436 enum FilterReason {
9437 NOT_FILTERED = 0;
9438 DUPLICATE_MESSAGE = 1;
9439 GEOFENCED_MESSAGE = 2;
9440 AREA_INFO_MESSAGE = 3;
9441 }
9442
9443 // GSM, CDMA, CDMA-SCP
9444 optional CellBroadcastMessageReported.CbType type = 1;
9445
9446 // The source of the report
9447 optional FilterReason filter = 2;
Jordan Liubedfa702019-12-20 15:08:45 -08009448}
9449
9450/**
9451 * Logs when an error occurs while handling a cell broadcast message;
9452 *
9453 * Logged from CellBroadcastService module:
9454 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9455 */
9456message CellBroadcastMessageError {
9457 // The type of error raised when trying to handle a cell broadcast message
9458 enum ErrorType {
9459 UNKNOWN_TYPE = 0;
9460 CDMA_DECODING_ERROR = 1;
9461 CDMA_SCP_EMPTY = 2;
9462 CDMA_SCP_HANDLING_ERROR = 3;
9463 GSM_INVALID_HEADER_LENGTH = 4;
9464 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9465 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9466 GSM_INVALID_PDU = 7;
9467 GSM_INVALID_GEO_FENCING_DATA = 8;
9468 GSM_UMTS_INVALID_WAC = 9;
9469 FAILED_TO_INSERT_TO_DB = 10;
9470 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9471 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9472 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9473 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009474 NO_CONNECTION_TO_CB_SERVICE = 15;
Jordan Liubedfa702019-12-20 15:08:45 -08009475 }
9476
9477 // What kind of error occurred
9478 optional ErrorType type = 1;
9479
9480 // Exception message (or log message) associated with the error (max 1000 chars)
9481 optional string exception_message = 2;
9482}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009483
9484/**
Henry Fange316ab62020-04-21 18:43:14 -07009485 * Logs when a tune occurs through device's Frontend.
9486 * This is atom ID 276.
9487 *
9488 * Logged from:
9489 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9490 */
9491message TvTunerStateChanged {
9492 enum State {
9493 UNKNOWN = 0;
9494 TUNING = 1; // Signal is tuned
9495 LOCKED = 2; // the signal is locked
9496 NOT_LOCKED = 3; // the signal isn’t locked.
9497 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9498 SCANNING = 5; // the signal is scanned
9499 SCAN_STOPPED = 6; // the scan is stopped.
9500 }
9501 // The uid of the application that sent this custom atom.
9502 optional int32 uid = 1 [(is_uid) = true];
9503 // new state
9504 optional State state = 2;
9505}
Henry Fang1ae85bb2020-05-28 18:07:03 -07009506
9507/**
9508 * Logs the status of a dvr playback or record.
9509 * This is atom ID 279.
9510 *
9511 * Logged from:
9512 * frameworks/base/media/java/android/media/tv/tuner/dvr
9513 */
9514message TvTunerDvrStatus {
9515 enum Type {
9516 UNKNOWN_TYPE = 0;
9517 PLAYBACK = 1; // is a playback
9518 RECORD = 2; // is a record
9519 }
9520 enum State {
9521 UNKNOWN_STATE = 0;
9522 STARTED = 1; // DVR is started
9523 STOPPED = 2; // DVR is stopped
9524 }
9525 // The uid of the application that sent this custom atom.
9526 optional int32 uid = 1 [(is_uid) = true];
9527 // DVR type
9528 optional Type type = 2;
9529 // DVR state
9530 optional State state = 3;
9531 // Identify the segment of a record or playback
9532 optional int32 segment_id = 4;
9533 // indicate how many overflow or underflow happened between started to stopped
9534 optional int32 overflow_underflow_count = 5;
9535}
Henry Fangfd40c072020-06-01 14:59:17 -07009536
9537/**
9538 * Logs when a cas session opened through MediaCas.
9539 * This is atom ID 280.
9540 *
9541 * Logged from:
9542 * frameworks/base/media/java/android/media/MediaCas.java
9543 */
9544message TvCasSessionOpenStatus {
9545 enum State {
9546 UNKNOWN = 0;
9547 SUCCEEDED = 1; // indicate that the session is opened successfully.
9548 FAILED = 2; // indicate that the session isn’t opened successfully.
9549 }
9550 // The uid of the application that sent this custom atom.
9551 optional int32 uid = 1 [(is_uid) = true];
9552 // Cas system Id
9553 optional int32 cas_system_id = 2;
9554 // State of the session
9555 optional State state = 3;
9556}
9557
Henry Fange316ab62020-04-21 18:43:14 -07009558/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009559 * Logs when an app is frozen or unfrozen.
9560 *
9561 * Logged from:
9562 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9563 */
9564message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009565 // The type of event.
9566 enum Action {
9567 UNKNOWN = 0;
9568 FREEZE_APP = 1;
9569 UNFREEZE_APP = 2;
9570 }
9571 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009572
Blake Kragten6ce382a2020-01-16 20:20:46 -08009573 // Pid of the process being frozen.
9574 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009575
Blake Kragten6ce382a2020-01-16 20:20:46 -08009576 // Name of the process being frozen.
9577 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009578
Blake Kragten6ce382a2020-01-16 20:20:46 -08009579 // Time since last unfrozen.
9580 optional int64 time_unfrozen_millis = 4;
9581}
9582
9583/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009584 * Pulls information for a single voice call.
9585 *
9586 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9587 *
9588 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009589 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009590 */
9591message VoiceCallSession {
9592 // Bearer (IMS or CS) when the call started.
9593 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9594
9595 // Bearer (IMS or CS) when the call ended.
9596 // The bearer may change during the call, e.g. due to SRVCC.
9597 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9598
9599 // Direction of the call (incoming or outgoing).
9600 optional android.telephony.CallDirectionEnum direction = 3;
9601
9602 // Time spent setting up the call.
9603 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9604
9605 // Whether the call ended before the setup was completed.
9606 optional bool setup_failed = 5;
9607
9608 // IMS reason code or CS disconnect cause.
9609 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9610 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9611 optional int32 disconnect_reason_code = 6;
9612
9613 // IMS extra code or CS precise disconnect cause.
9614 // For IMS, this code is vendor-specific
9615 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9616 optional int32 disconnect_extra_code = 7;
9617
9618 // IMS extra message or CS vendor cause.
9619 optional string disconnect_extra_message = 8;
9620
9621 // Radio access technology (RAT) used when call started.
9622 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9623
9624 // Radio access technology (RAT) used when call terminated.
9625 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9626
9627 // Number of times RAT changed during the call.
9628 optional int64 rat_switch_count = 11;
9629
9630 // A bitmask of all codecs used during the call.
9631 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9632 optional int64 codec_bitmask = 12;
9633
9634 // Number of other calls going on during call setup, for the same SIM slot.
9635 optional int32 concurrent_call_count_at_start = 13;
9636
9637 // Number of other calls going on during call termination, for the same SIM slot.
9638 optional int32 concurrent_call_count_at_end = 14;
9639
9640 // Index of the SIM is used, 0 for single-SIM devices.
9641 optional int32 sim_slot_index = 15;
9642
9643 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9644 optional bool is_multi_sim = 16;
9645
9646 // Whether the call was made with an eSIM profile.
9647 optional bool is_esim = 17;
9648
9649 // Carrier ID of the SIM card.
9650 // See https://source.android.com/devices/tech/config/carrierid.
9651 optional int32 carrier_id = 18;
9652
Chi Zhangba1b03a2020-04-21 17:17:56 -07009653 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009654 optional bool srvcc_completed = 19;
9655
9656 // Number of SRVCC failures.
9657 optional int64 srvcc_failure_count = 20;
9658
9659 // Number of SRVCC cancellations.
9660 optional int64 srvcc_cancellation_count = 21;
9661
Chi Zhangba1b03a2020-04-21 17:17:56 -07009662 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9663 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009664 optional bool rtt_enabled = 22;
9665
9666 // Whether this was an emergency call.
9667 optional bool is_emergency = 23;
9668
9669 // Whether the call was performed while roaming.
9670 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009671
9672 // A random number used as the dimension field to pull multiple atoms.
9673 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009674}
9675
9676/**
9677 * Pulls voice call radio access technology (RAT) usage.
9678 *
9679 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9680 * time. The atom will be skipped if not enough data is available.
9681 *
9682 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009683 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009684 */
9685message VoiceCallRatUsage {
9686 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9687 optional int32 carrier_id = 1;
9688
9689 // Radio access technology.
9690 optional android.telephony.NetworkTypeEnum rat = 2;
9691
9692 // Total duration that voice calls spent on this carrier and RAT.
9693 optional int64 total_duration_seconds = 3;
9694
9695 // Total number of calls using this carrier and RAT.
9696 // A call is counted once even if it used the RAT multiple times.
9697 optional int64 call_count = 4;
9698}
9699
9700/**
9701 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9702 *
9703 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009704 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009705 */
9706message SimSlotState {
9707 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9708 optional int32 active_slot_count = 1;
9709
9710 // Number of SIM cards (both physical and active eSIM profiles).
9711 // This number is always equal to or less than the number of active SIM slots.
9712 optional int32 sim_count = 2;
9713
9714 // Number of active eSIM profiles.
9715 // This number is always equal to or less than the number of SIMs.
9716 optional int32 esim_count = 3;
9717}
9718
9719/**
9720 * Pulls supported cellular radio access technologies.
9721 *
9722 * This atom reports the capabilities of the device, rather than the network it has access to.
9723 *
9724 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009725 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009726 */
9727message SupportedRadioAccessFamily {
9728 // A bitmask of supported radio technologies.
9729 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9730 optional int64 network_type_bitmask = 1;
9731}
9732
9733/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009734 * Logs gnss stats from location service provider
9735 *
9736 * Pulled from:
9737 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9738 */
9739
9740message GnssStats {
9741 // Number of location reports since boot
9742 optional int64 location_reports = 1;
9743
9744 // Total pulled reports of Location failures since boot
9745 optional int64 location_failure_reports = 2;
9746
9747 // Number of time to first fix reports since boot
9748 optional int64 time_to_first_fix_reports = 3;
9749
9750 // Total pulled reported time to first fix (in milli-seconds) since boot
9751 optional int64 time_to_first_fix_milli_s = 4;
9752
9753 // Number of position accuracy reports since boot
9754 optional int64 position_accuracy_reports = 5;
9755
9756 // Total pulled reported position accuracy (in meters) since boot
9757 optional int64 position_accuracy_meters = 6;
9758
9759 // Number of top 4 average CN0 reports since boot
9760 optional int64 top_four_average_cn0_reports = 7;
9761
9762 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9763 optional int64 top_four_average_cn0_db_mhz = 8;
9764
9765 // Number of l5 top 4 average CN0 reports since boot
9766 optional int64 l5_top_four_average_cn0_reports = 9;
9767
9768 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9769 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9770
9771 // Total number of sv status messages reports since boot
9772 optional int64 sv_status_reports = 11;
9773
9774 // Total number of sv status messages reports, where sv is used in fix since boot
9775 optional int64 sv_status_reports_used_in_fix = 12;
9776
9777 // Total number of L5 sv status messages reports since boot
9778 optional int64 l5_sv_status_reports = 13;
9779
9780 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9781 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009782}
Kweku Adams12752132020-02-18 15:36:48 -08009783
9784/**
9785 * Logs when an app is moved to a different standby bucket.
9786 *
9787 * Logged from:
9788 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9789 */
9790message AppStandbyBucketChanged {
9791 optional string package_name = 1;
9792
9793 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9794 optional int32 user_id = 2;
9795
9796 // These enum values match the constants defined in UsageStatsManager.java.
9797 enum Bucket {
9798 BUCKET_UNKNOWN = 0;
9799 BUCKET_EXEMPTED = 5;
9800 BUCKET_ACTIVE = 10;
9801 BUCKET_WORKING_SET = 20;
9802 BUCKET_FREQUENT = 30;
9803 BUCKET_RARE = 40;
9804 BUCKET_RESTRICTED = 45;
9805 BUCKET_NEVER = 50;
9806 }
9807 optional Bucket bucket = 3;
9808
9809 enum MainReason {
9810 MAIN_UNKNOWN = 0;
9811 MAIN_DEFAULT = 0x0100;
9812 MAIN_TIMEOUT = 0x0200;
9813 MAIN_USAGE = 0x0300;
9814 MAIN_FORCED_BY_USER = 0x0400;
9815 MAIN_PREDICTED = 0x0500;
9816 MAIN_FORCED_BY_SYSTEM = 0x0600;
9817 }
9818 optional MainReason main_reason = 4;
9819
9820 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9821 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9822 // UsageStatsManager.java.
9823 optional int32 sub_reason = 5;
9824}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009825
9826/**
9827* Reports a started sharesheet transaction.
9828*
9829* Logged from:
9830* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9831*/
9832message SharesheetStarted {
9833 // The event_id (as for UiEventReported).
9834 optional int32 event_id = 1;
9835 // The calling app's package name.
9836 optional string package_name = 2;
9837 // An identifier to tie together multiple logs relating to the same share event
9838 optional int32 instance_id = 3;
9839 // The mime type of the share
9840 optional string mime_type = 4;
9841 // The number of direct targets the calling app is providing that will be shown.
9842 optional int32 num_app_provided_direct_targets = 5;
9843 // The number of app targets the calling app is providing that will be shown.
9844 optional int32 num_app_provided_app_targets = 6;
9845 // True if the share originates from the workprofile
9846 optional bool is_workprofile = 7;
9847
9848 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009849 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009850 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9851 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9852 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9853 }
9854 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009855 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009856
9857 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9858 INTENT_DEFAULT = 0;
9859 INTENT_ACTION_VIEW = 1;
9860 INTENT_ACTION_EDIT = 2;
9861 INTENT_ACTION_SEND = 3;
9862 INTENT_ACTION_SENDTO = 4;
9863 INTENT_ACTION_SEND_MULTIPLE = 5;
9864 INTENT_ACTION_IMAGE_CAPTURE = 6;
9865 INTENT_ACTION_MAIN = 7;
9866 }
9867 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009868 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009869}
9870
9871/**
9872 * Reports a ranking selection event.
9873 *
9874 * Logged from:
9875 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9876 */
9877message RankingSelected {
9878 // The event_id (as for UiEventReported).
9879 optional int32 event_id = 1;
9880 // The relevant app's package name (can be source or picked package).
9881 optional string package_name = 2;
9882 // An identifier to tie together multiple logs relating to the same share event.
9883 optional int32 instance_id = 3;
9884 // Which of the ranked targets got picked, default starting position 0.
9885 optional int32 position_picked = 4;
9886}
Raff Tsaiea4db182020-03-06 07:45:43 +08009887
9888/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009889 * Logs when TvSettings UI is interacted at.
9890 *
9891 * Logged from: packages/apps/TvSettings
9892 */
9893message TvSettingsUIInteracted {
9894
9895 /** The UI action category */
9896 optional android.app.tvsettings.Action action = 1;
9897
9898 /** The ID of the entry that the users actioned on */
9899 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -07009900}
9901
9902/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009903 * Logs information about a package installation using package installer V2 APIs.
9904 *
9905 * Logged from:
9906 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9907 */
9908message PackageInstallerV2Reported {
9909 // Whether this installation uses Incremental File System
9910 optional bool is_incremental = 1;
9911 // Name of the package that is intended to be installed
9912 optional string package_name = 2;
9913 // The duration between when the install was requested to when the install has completed
9914 optional int64 duration_millis = 3;
9915 // Installation result in final integer, which are SystemApi's.
9916 // Return_code 1 indicates success.
9917 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9918 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009919 // Total size of the APKs installed for this package
9920 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009921}
9922
9923/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009924 * Logs settings provider values.
9925 *
9926 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9927 * then write the value to proto.
9928 *
9929 */
9930message SettingSnapshot {
9931
9932 // Setting key
9933 optional string name = 1;
9934
9935 enum SettingsValueType {
9936 NOTASSIGNED = 0;
9937 ASSIGNED_BOOL_TYPE = 1;
9938 ASSIGNED_INT_TYPE = 2;
9939 ASSIGNED_FLOAT_TYPE = 3;
9940 ASSIGNED_STRING_TYPE = 4;
9941 };
9942 // Setting value type
9943 optional SettingsValueType type = 2;
9944
9945 optional bool bool_value = 3;
9946
9947 optional int32 int_value = 4;
9948
9949 optional float float_value = 5;
9950
9951 optional string str_value = 6;
9952
9953 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9954 optional int32 user_id = 7;
9955}
Varun Shahacb56342019-12-18 11:45:38 -08009956
9957/**
9958 * An event logged to indicate that a user journey is about to be performed. This atom includes
9959 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9960 * will immediately follow this atom which will describe the event(s) and its state.
9961 *
9962 * Logged from:
9963 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9964 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9965 */
9966message UserLifecycleJourneyReported {
9967 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9968 // UserLifecycleEventOccurred atom)
9969 optional int64 session_id = 1;
9970
9971 // Indicates what type of user journey this session is related to
9972 enum Journey {
9973 UNKNOWN = 0; // Undefined user lifecycle journey
9974 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9975 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9976 USER_START = 3; // A user start journey
9977 USER_CREATE = 4; // A user creation journey
9978 }
9979 optional Journey journey = 2;
9980 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9981 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9982 optional int32 origin_user = 3;
9983 // Which user the journey is targeting
9984 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9985 optional int32 target_user = 4;
9986
9987 // What is the user type of the target user
9988 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9989 enum UserType {
9990 TYPE_UNKNOWN = 0;
9991 FULL_SYSTEM = 1;
9992 FULL_SECONDARY = 2;
9993 FULL_GUEST = 3;
9994 FULL_DEMO = 4;
9995 FULL_RESTRICTED = 5;
9996 PROFILE_MANAGED = 6;
9997 SYSTEM_HEADLESS = 7;
9998 }
9999 optional UserType user_type = 5;
10000 // What are the flags attached to the target user
10001 optional int32 user_flags = 6;
10002}
10003
10004/**
10005 * An event logged when a specific user lifecycle event is performed. These events should be
10006 * correlated with a UserLifecycleJourneyReported atom via the session_id.
10007 * Note: journeys can span over multiple events, hence some events may share a single session id.
10008 *
10009 * Logged from:
10010 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10011 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10012 */
10013message UserLifecycleEventOccurred {
10014 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
10015 optional int64 session_id = 1;
10016 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
10017 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10018 optional int32 user_id = 2;
10019
10020 enum Event {
10021 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
10022 SWITCH_USER = 1; // Indicates that this is a user switch event
10023 START_USER = 2; // Indicates that this is a user start event
10024 CREATE_USER = 3; // Indicates that this is a user create event
Mayank Garg4f93a042020-05-12 23:05:21 -070010025 USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
10026 UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
10027 UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
Varun Shahacb56342019-12-18 11:45:38 -080010028 }
10029 optional Event event = 3;
10030
10031 enum State {
10032 NONE = 0; // Indicates the associated event has no start/end defined
10033 BEGIN = 1;
10034 FINISH = 2;
10035 }
10036 optional State state = 4; // Represents the state of an event (beginning/ending)
10037}
jasonwshsu81173e32020-03-27 15:22:03 +080010038
10039/**
10040 * Logs when accessibility shortcut clicked.
10041 *
10042 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010043 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010044 */
10045message AccessibilityShortcutReported {
10046 // The accessibility feature(including installed a11y service, framework a11y feature,
10047 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
10048 optional string package_name = 1;
10049
10050 // The definition of the accessibility shortcut.
10051 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10052 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
10053
10054 // The definition of the service status.
10055 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10056 optional android.stats.accessibility.ServiceStatus service_status = 3;
10057}
10058
10059/**
10060 * Logs when accessibility service status changed.
10061 *
10062 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010063 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010064 */
10065message AccessibilityServiceReported {
10066 // The accessibility service package name.
10067 optional string package_name = 1;
10068
10069 // The definition of the service status.
10070 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10071 optional android.stats.accessibility.ServiceStatus service_status = 2;
10072}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010073
Denny cy Leeca62fc42020-05-28 18:13:07 +080010074/**
10075 * Logs when display wake up.
10076 *
10077 * Logged from:
10078 * services/core/java/com/android/server/power/Notifier.java
10079 */
10080
10081message DisplayWakeReported {
Denny cy Lee57b31282020-04-17 10:08:52 +080010082 // Wake_up_reason code
10083 // If LOWORD(wake_up_reason) = 0
10084 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
10085 // else reference wake_up_reason to
Denny cy Leeca62fc42020-05-28 18:13:07 +080010086 // services/core/java/com/android/server/power/Notifier.java#onWakeUp
Denny cy Lee57b31282020-04-17 10:08:52 +080010087 optional int32 wake_up_reason = 1;
Denny cy Lee57b31282020-04-17 10:08:52 +080010088}
10089
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010090/**
10091 * Logs app usage events.
10092 */
10093message AppUsageEventOccurred {
10094 optional int32 uid = 1 [(is_uid) = true];
10095 optional string package_name = 2;
10096 optional string class_name = 3;
10097
10098 enum EventType {
10099 NONE = 0;
10100 MOVE_TO_FOREGROUND = 1;
10101 MOVE_TO_BACKGROUND = 2;
10102 }
10103 optional EventType event_type = 4;
10104}
Changyeon Jo51ae3582020-04-14 09:41:00 -070010105
10106/*
10107 * Quality metrics logged when EVS cameras are active.
10108 *
10109 * Logged from:
10110 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
10111 */
10112message EvsUsageStatsReported {
10113
10114 // Camera identifier to distinguish the source camera device. This is not
10115 // globally unique and therefore cannot be used to identify the user and/or
10116 // the device.
10117 optional int32 device_id = 1;
10118
10119 // Peak number of clients during the service
10120 optional int32 peak_num_clients = 2;
10121
10122 // Number of erroneous events during the service
10123 optional int32 num_errors = 3;
10124
10125 // Round trip latency of the very first frame
10126 optional int64 first_latency_millis = 4;
10127
10128 // Average frame round trip latency
10129 optional float avg_latency_millis = 5;
10130
10131 // Peak frame round trip latency
10132 optional int64 peak_latency_millis = 6;
10133
10134 // Total number of frames received
10135 optional int64 total_frames = 7;
10136
10137 // Number of frames ignored
10138 optional int64 ignored_frames = 8;
10139
10140 // Number of dropped frames to synchronize camera devices
10141 optional int64 dropped_frames_to_sync = 9;
10142
10143 // The duration of the service
10144 optional int64 duration_millis = 10;
10145}
Robert Leecccdc152020-04-23 13:22:46 +080010146
10147/**
10148 * Logs audio power usage stats.
10149 *
10150 * Pushed from:
10151 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
10152 */
10153message AudioPowerUsageDataReported {
10154 /**
10155 * Device used for input/output
10156 *
10157 * All audio devices please refer to below file:
10158 * system/media/audio/include/system/audio-base.h
10159 *
10160 * Define our own enum values because we don't report all audio devices.
10161 * Currently, we only report built-in audio devices such as handset, speaker,
10162 * built-in mics, common audio devices such as wired headset, usb headset
10163 * and bluetooth devices.
10164 */
10165 enum AudioDevice {
10166 OUTPUT_EARPIECE = 0x1; // handset
10167 OUTPUT_SPEAKER = 0x2; // dual speaker
10168 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
10169 OUTPUT_USB_HEADSET = 0x8; // usb headset
10170 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
10171 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
10172 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
10173
10174 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
10175 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
10176 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
10177 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
10178 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
10179 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
10180 }
10181 optional AudioDevice audio_device = 1;
10182
10183 // Duration of the audio in seconds
10184 optional int32 duration_secs = 2;
10185
10186 // Average volume (0 ... 1.0)
10187 optional float average_volume = 3;
10188
10189 enum AudioType {
10190 UNKNOWN_TYPE = 0;
10191 VOICE_CALL_TYPE = 1; // voice call
10192 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
10193 MEDIA_TYPE = 3; // music and system sound
10194 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
10195 ALARM_TYPE = 5; // alarm type
10196 // record type
10197 CAMCORDER_TYPE = 6; // camcorder
10198 RECORD_TYPE = 7; // other recording
10199 }
10200 optional AudioType type = 4;
10201}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -070010202
10203/**
10204 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
10205 *
10206 * Pulled from:
10207 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
10208 */
10209message BytesTransferByTagAndMetered {
10210 optional int32 uid = 1 [(is_uid) = true];
10211
10212 optional bool is_metered = 2;
10213
10214 optional int32 tag = 3;
10215
10216 optional int64 rx_bytes = 4;
10217
10218 optional int64 rx_packets = 5;
10219
10220 optional int64 tx_bytes = 6;
10221
10222 optional int64 tx_packets = 7;
10223}
Robert Luo2f52f042020-05-11 16:39:24 +080010224
10225/*
10226 * Logs when the Media Output Switcher finishes a media switch operation.
10227 *
10228 * Logged from:
10229 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
10230 */
10231message MediaOutputOpSwitchReported {
10232 // Source medium type before switching.
10233 optional android.app.settings.mediaoutput.MediumType source = 1;
10234
10235 // Target medium type after switching.
10236 optional android.app.settings.mediaoutput.MediumType target = 2;
10237
10238 // The result of switching.
10239 optional android.app.settings.mediaoutput.SwitchResult result = 3;
10240
10241 // The detail code of a switching result.
10242 optional android.app.settings.mediaoutput.SubResult subresult = 4;
10243
10244 /*
10245 * The package name of a pre-installed app, whose media session is being switched.
10246 */
10247 optional string media_session_package_name = 5;
10248
10249 // The amount of available wired devices when a switching is being performed.
10250 optional int32 available_wired_device_count = 6;
10251
10252 // The amount of available Bluetooth devices a switching is being performed.
10253 optional int32 available_bt_device_count = 7;
10254
10255 // The amount of available remote devices when a switching is being performed.
10256 optional int32 available_remote_device_count = 8;
10257
10258 // The amount of applied devices within a remote dynamic group after a switching is done.
10259 optional int32 applied_device_count_within_remote_group = 9;
10260}
Govinda Wassermane4640282020-04-30 09:30:56 -040010261
10262/**
10263 * Logs when the Assistant is invoked.
10264 *
10265 * Logged from:
10266 * frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
10267 */
10268message AssistantInvocationReported {
10269
10270 // The event_id (as for UiEventReported).
10271 optional int32 event_id = 1;
10272
10273 // The registered Assistant's uid and package (as for UiEventReported).
10274 optional int32 uid = 2 [(is_uid) = true];
10275 optional string package_name = 3;
10276
10277 // An identifier used to disambiguate which logs refer to a particular invocation of the
10278 // Assistant (as for UiEventReported).
10279 optional int32 instance_id = 4;
10280
10281 // The state of the device at the time of invocation.
10282 enum DeviceState {
10283 UNKNOWN_DEVICE_STATE = 0;
10284 AOD1 = 1;
10285 AOD2 = 2;
10286 BOUNCER = 3;
10287 UNLOCKED_LOCKSCREEN = 4;
10288 LAUNCHER_HOME = 5;
10289 LAUNCHER_OVERVIEW = 6;
10290 LAUNCHER_ALL_APPS = 7;
10291 APP_DEFAULT = 8;
10292 APP_IMMERSIVE = 9;
10293 APP_FULLSCREEN = 10;
10294 }
10295 optional DeviceState device_state = 5;
10296
10297 // Whether the Assistant handles were showing at the time of invocation.
10298 optional bool assistant_handles_showing = 6;
10299}