blob: a495764cf72951806eb6bb76ee71f44efa1061c6 [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"];
lifr1cc318d2020-03-19 21:58:30 +0800468 NetworkIpProvisioningReported network_ip_provisioning_reported =
469 290 [(module) = "network_stack"];
470 NetworkDhcpRenewReported network_dhcp_renew_reported = 291 [(module) = "network_stack"];
471 NetworkValidationReported network_validation_reported = 292 [(module) = "network_stack"];
472 NetworkStackQuirkReported network_stack_quirk_reported = 293 [(module) = "network_stack"];
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700473
474 // StatsdStats tracks platform atoms with ids upto 500.
475 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000476 }
David Chenc8a43242017-10-17 16:23:28 -0700477
David Chen6e3e6cb2018-01-03 16:14:06 -0800478 // Pulled events will start at field 10000.
Denny cy Leeca62fc42020-05-28 18:13:07 +0800479 // Next: 10081
David Chenc8a43242017-10-17 16:23:28 -0700480 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800481 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
482 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700483 MobileBytesTransfer mobile_bytes_transfer =
484 10002 [(module) = "framework", (truncate_timestamp) = true];
485 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
486 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800487 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
488 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700489 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800490 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700491 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800492 CpuTimePerUidFreq cpu_time_per_uid_freq =
493 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800494 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
495 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
496 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
497 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
498 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700499 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700500 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700501 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700502 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800503 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
504 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700505 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800506 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800507 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800508 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800509 DiskStats disk_stats = 10025 [(module) = "framework"];
510 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
511 AppSize app_size = 10027 [(module) = "framework"];
512 CategorySize category_size = 10028 [(module) = "framework"];
513 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800514 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800515 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
516 DiskIo disk_io = 10032 [(module) = "framework"];
517 PowerProfile power_profile = 10033 [(module) = "framework"];
518 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
519 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
520 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700521 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800522 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
523 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
524 10040 [(module) = "framework"];
525 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
526 10041 [(module) = "framework"];
527 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800528 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800529 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800530 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800531 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
532 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
533 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
534 RoleHolder role_holder = 10049 [(module) = "framework"];
535 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800536 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800537 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
538 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800539 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
540 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800541 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
542 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
543 FaceSettings face_settings = 10058 [(module) = "framework"];
544 CoolingDevice cooling_device = 10059 [(module) = "framework"];
545 AppOps app_ops = 10060 [(module) = "framework"];
546 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700547 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
548 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800549 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800550 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800551 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
552 DangerousPermissionStateSampled dangerous_permission_state_sampled =
553 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400554 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000555 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000556 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200557 PackageNotificationPreferences package_notification_preferences =
558 10071 [(module) = "framework"];
559 PackageNotificationChannelPreferences package_notification_channel_preferences =
560 10072 [(module) = "framework"];
561 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
562 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800563 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800564 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700565 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
566 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
567 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
568 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800569 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Denny cy Leeca62fc42020-05-28 18:13:07 +0800570 //10081 free for use
junyulai8d1a6092020-05-07 13:38:15 +0800571 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700572 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
573 10083 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700574 }
yroa1fe77c2018-02-26 14:22:54 -0800575
Bookatz76aafcf2018-09-17 16:17:10 -0700576 // DO NOT USE field numbers above 100,000 in AOSP.
577 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
578 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100579
580 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700581}
582
Yao Chend54f9dd2017-10-17 17:37:48 +0000583/**
Yangster-mac20877162017-12-22 17:19:39 -0800584 * This proto represents a node of an attribution chain.
585 * Note: All attribution chains are represented as a repeated field of type
586 * AttributionNode. It is understood that in such arrays, the order is that
587 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000588 */
Yangster-mac20877162017-12-22 17:19:39 -0800589message AttributionNode {
590 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800591 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800592
Yangster-mac20877162017-12-22 17:19:39 -0800593 // The (optional) string tag for an element in the attribution chain. If the
594 // element has no tag, it is encoded as an empty string.
595 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700596}
597
Yangster-mac48b3d622018-08-18 12:38:11 -0700598message KeyValuePair {
599 optional int32 key = 1;
600 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700601 int32 value_int = 2;
602 int64 value_long = 3;
603 string value_str = 4;
604 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700605 }
606}
607
608message KeyValuePairsAtom {
609 optional int32 uid = 1;
610 repeated KeyValuePair pairs = 2;
611}
612
Yao Chend54f9dd2017-10-17 17:37:48 +0000613/*
614 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800615 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000616 *
617 * RULES:
618 * - The field ids for each atom must start at 1, and count upwards by 1.
619 * Skipping field ids is not allowed.
620 * - These form an API, so renaming, renumbering or removing fields is
621 * not allowed between android releases. (This is not currently enforced,
622 * but there will be a tool to enforce this restriction).
623 * - The types must be built-in protocol buffer types, namely, no sub-messages
624 * are allowed (yet). The bytes type is also not allowed.
625 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800626 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000627 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800628 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000629 * - A field that is a uid should be a string field, tagged with the [xxx]
630 * annotation. The generated code on android will be represented by UIDs,
631 * and those UIDs will be translated in xxx to those strings.
632 *
633 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700634 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000635 * - If there is a UID, it goes first. Think in an object-oriented fashion.
636 * *****************************************************************************
637 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700638
Yao Chend54f9dd2017-10-17 17:37:48 +0000639/**
Tej Singha72344992019-04-17 18:55:08 -0700640 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700641 * Logs when the Thermal service HAL notifies the throttling start/stop events.
642 *
643 * Logged from:
644 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
645 */
646message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700647 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700648 optional android.os.TemperatureTypeEnum sensor_type = 1;
649
Maggie White442b6312019-04-05 16:26:44 -0700650 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700651 enum State {
652 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700653 START = 1; // START indicated that throttling was triggered.
654 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700655 }
Yangster-mace16189a2018-08-26 12:20:16 -0700656 optional State state = 2;
657
658 optional float temperature = 3;
659}
660
661/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000662 * Logs when the screen state changes.
663 *
664 * Logged from:
665 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
666 */
667message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800668 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800669 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700670 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700671}
Yao Chend54f9dd2017-10-17 17:37:48 +0000672
673/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700674 * Logs that the process state of the uid, as determined by ActivityManager
675 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000676 *
677 * Logged from:
678 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
679 */
Bookatzc1a050a2017-10-10 15:49:28 -0700680message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700681 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000682
Bookatzdb026a22018-01-10 19:01:56 -0800683 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800684 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700685 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000686}
687
688/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700689 * Logs process state change of a process, as per the activity manager.
690 *
691 * Logged from:
692 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
693 */
694message ProcessStateChanged {
695 optional int32 uid = 1;
696 optional string process_name = 2;
697 optional string package_name = 3;
698 // TODO: remove this when validation is done
699 optional int64 version = 5;
700 // The state, from frameworks/base/core/proto/android/app/enums.proto.
701 optional android.app.ProcessStateEnum state = 4;
702}
703
704/**
705 * Logs when ActivityManagerService sleep state is changed.
706 *
707 * Logged from:
708 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
709 */
710message ActivityManagerSleepStateChanged {
711 // TODO: import frameworks proto
712 enum State {
713 UNKNOWN = 0;
714 ASLEEP = 1;
715 AWAKE = 2;
716 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700717 optional State state = 1
718 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700719}
720
721/**
722 * Logs when system memory state changes.
723 *
724 * Logged from:
725 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
726 */
727message MemoryFactorStateChanged {
728 // TODO: import frameworks proto
729 enum State {
730 MEMORY_UNKNOWN = 0;
731 NORMAL = 1; // normal.
732 MODERATE = 2; // moderate memory pressure.
733 LOW = 3; // low memory.
734 CRITICAL = 4; // critical memory.
735
736 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700737 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700738}
739
740/**
741 * Logs when app is using too much cpu, according to ActivityManagerService.
742 *
743 * Logged from:
744 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
745 */
746message ExcessiveCpuUsageReported {
747 optional int32 uid = 1;
748 optional string process_name = 2;
749 optional string package_name = 3;
750 // package version. TODO: remove this when validation is done
751 optional int64 version = 4;
752}
753
754/**
755 * Logs when a cached process is killed, along with its pss.
756 *
757 * Logged from:
758 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
759 */
760message CachedKillReported {
761 optional int32 uid = 1;
762 optional string process_name = 2;
763 optional string package_name = 3;
764 // TODO: remove this when validation is done
765 optional int64 version = 5;
766 optional int64 pss = 4;
767}
768
769/**
xshu2c3d9e42019-09-26 17:54:02 -0700770 * Logs the change in wifi health.
771 *
772 * Logged from:
773 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
774 */
775message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800776 enum Band {
777 UNKNOWN = 0;
778 // All of 2.4GHz band
779 BAND_2G = 1;
780 // Frequencies in the range of [5150, 5250) GHz
781 BAND_5G_LOW = 2;
782 // Frequencies in the range of [5250, 5725) GHz
783 BAND_5G_MIDDLE = 3;
784 // Frequencies in the range of [5725, 5850) GHz
785 BAND_5G_HIGH = 4;
786 // Frequencies in the range of [5925, 6425) GHz
787 BAND_6G_LOW = 5;
788 // Frequencies in the range of [6425, 6875) GHz
789 BAND_6G_MIDDLE = 6;
790 // Frequencies in the range of [6875, 7125) GHz
791 BAND_6G_HIGH = 7;
792 }
xshu2c3d9e42019-09-26 17:54:02 -0700793 // duration this stat is obtained over in milliseconds
794 optional int32 duration_millis = 1;
795 // whether wifi is classified as sufficient for the user's data traffic, determined
796 // by whether the calculated throughput exceeds the average demand within |duration_millis|
797 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700798 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800799 optional bool is_cell_data_available = 3;
800 // the Band bucket the connected network is on
801 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700802}
803
804/**
805 * Logged when wifi detects a significant change in connection failure rate.
806 *
807 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
808 *
809 */
810message WifiFailureStatReported {
811 enum AbnormalityType {
812 UNKNOWN = 0;
813 SIGNIFICANT_INCREASE = 1;
814 SIGNIFICANT_DECREASE = 2;
815 SIMPLY_HIGH = 3;
816 }
817 enum FailureType {
818 FAILURE_UNKNOWN = 0;
819 FAILURE_CONNECTION = 1;
820 FAILURE_ASSOCIATION_REJECTION = 2;
821 FAILURE_ASSOCIATION_TIMEOUT = 3;
822 FAILURE_AUTHENTICATION = 4;
823 FAILURE_NON_LOCAL_DISCONNECTION = 5;
824 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
825 }
826 // Reason for uploading this stat
827 optional AbnormalityType abnormality_type = 1;
828 // The particular type of failure
829 optional FailureType failure_type = 2;
830 // How many times we have encountered this combination of AbnormalityType and FailureType
831 optional int32 failure_count = 3;
832}
833
834/**
835 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
836 *
837 * Logged from:
838 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
839 */
840message WifiConnectionResultReported {
841 enum FailureCode {
842 FAILURE_UNKNOWN = 0;
843 FAILURE_ASSOCIATION_TIMEOUT = 1;
844 FAILURE_ASSOCIATION_REJECTION = 2;
845 FAILURE_AUTHENTICATION_GENERAL = 3;
846 FAILURE_AUTHENTICATION_EAP = 4;
847 FAILURE_DHCP = 5;
848 FAILURE_NETWORK_DISCONNECTION = 6;
849 FAILURE_ROAM_TIMEOUT = 7;
850 }
851 // true represents a successful connection
852 optional bool connection_result = 1;
853 // reason for the connection failure
854 optional FailureCode failure_code = 2;
855 // scan rssi before the connection attempt
856 optional int32 rssi = 3;
857}
858
859/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700860 * Logs when memory stats of a process is reported.
861 *
862 * Logged from:
863 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
864 */
865message ProcessMemoryStatReported {
866 optional int32 uid = 1;
867 optional string process_name = 2;
868 optional string package_name = 3;
869 //TODO: remove this when validation is done
870 optional int64 version = 9;
871 optional int64 pss = 4;
872 optional int64 uss = 5;
873 optional int64 rss = 6;
874 enum Type {
875 ADD_PSS_INTERNAL_SINGLE = 0;
876 ADD_PSS_INTERNAL_ALL_MEM = 1;
877 ADD_PSS_INTERNAL_ALL_POLL = 2;
878 ADD_PSS_EXTERNAL = 3;
879 ADD_PSS_EXTERNAL_SLOW = 4;
880 }
881 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800882 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700883}
884
885/**
Bookatzc1a050a2017-10-10 15:49:28 -0700886 * Logs that a process started, finished, crashed, or ANRed.
887 *
888 * Logged from:
889 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
890 */
891message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700892 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700893
David Chen0b5c90c2018-01-25 16:51:49 -0800894 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800895 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700896
Bookatzddccf0a2017-11-28 16:48:14 -0800897 // What lifecycle state the process changed to.
898 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800899 enum State {
900 FINISHED = 0;
901 STARTED = 1;
902 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800903 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800904 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700905}
906
Bookatzc1a050a2017-10-10 15:49:28 -0700907/**
908 * Logs when the ble scan state changes.
909 *
910 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700911 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700912 */
913message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800914 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700915 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700916
917 enum State {
918 OFF = 0;
919 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700920 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
921 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700922 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800923 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700924 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800925 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700926 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800927 (state_field_option).nested = true
928 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700929
Bookatze5ec0b42018-03-26 13:34:56 -0700930 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700931 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700932 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700933 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700934 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700935 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700936}
937
938/**
939 * Logs reporting of a ble scan finding results.
940 *
941 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700942 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700943 */
Bookatzae6738e2018-09-13 11:38:56 -0700944// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700945message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800946 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700947
948 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800949 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700950}
951
952/**
953 * Logs when a sensor state changes.
954 *
955 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700956 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700957 */
958message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800959 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700960
Bookatzc1a050a2017-10-10 15:49:28 -0700961 // The id (int) of the sensor.
962 optional int32 sensor_id = 2;
963
964 enum State {
965 OFF = 0;
966 ON = 1;
967 }
968 optional State state = 3;
969}
970
Bookatzc1a050a2017-10-10 15:49:28 -0700971/**
972 * Logs when GPS state changes.
973 *
974 * Logged from:
975 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
976 */
977message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800978 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700979
980 enum State {
981 OFF = 0;
982 ON = 1;
983 }
984 optional State state = 2;
985}
986
Bookatz48d362e2018-11-06 15:49:08 -0800987/**
988 * Logs when GPS signal quality.
989 *
990 * Logged from:
991 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
992 */
993message GpsSignalQualityChanged {
994 optional android.server.location.GpsSignalQualityEnum level = 1;
995}
996
Bookatzc1a050a2017-10-10 15:49:28 -0700997
998/**
999 * Logs when a sync manager sync state changes.
1000 *
1001 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001002 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001003 */
1004message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001005 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001006
David Chen0b5c90c2018-01-25 16:51:49 -08001007 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001008 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001009
1010 enum State {
1011 OFF = 0;
1012 ON = 1;
1013 }
1014 optional State state = 3;
1015}
1016
Yangster-mac96353002018-09-05 11:18:55 -07001017/*
1018 * Deferred job stats.
1019 *
1020 * Logged from:
1021 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
1022*/
1023message DeferredJobStatsReported {
1024 repeated AttributionNode attribution_node = 1;
1025
1026 // Number of jobs deferred.
1027 optional int32 num_jobs_deferred = 2;
1028
1029 // Time since the last job runs.
1030 optional int64 time_since_last_job_millis = 3;
1031}
1032
Bookatzc1a050a2017-10-10 15:49:28 -07001033/**
1034 * Logs when a job scheduler job state changes.
1035 *
1036 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001037 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001038 */
1039message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001040 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001041
1042 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001043 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001044
1045 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001046 FINISHED = 0;
1047 STARTED = 1;
1048 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001049 }
1050 optional State state = 3;
1051
Tej Singh33a412b2018-03-16 18:43:59 -07001052 // The reason a job has stopped.
1053 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001054 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001055 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001056
1057 // The standby bucket of the app that scheduled the job. These match the framework constants
1058 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1059 // already assigned 0.
1060 enum Bucket {
1061 UNKNOWN = -1;
1062 ACTIVE = 0;
1063 WORKING_SET = 1;
1064 FREQUENT = 2;
1065 RARE = 3;
1066 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001067 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001068 }
1069 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1070
1071 // The job id (as assigned by the app).
1072 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001073
1074 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1075 // constraints as they are always assumed to be set.
1076 optional bool has_charging_constraint = 7;
1077 optional bool has_battery_not_low_constraint = 8;
1078 optional bool has_storage_not_low_constraint = 9;
1079 optional bool has_timing_delay_constraint = 10;
1080 optional bool has_deadline_constraint = 11;
1081 optional bool has_idle_constraint = 12;
1082 optional bool has_connectivity_constraint = 13;
1083 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001084}
1085
1086/**
1087 * Logs when the audio state changes.
1088 *
1089 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001090 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001091 */
1092message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001093 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001094
1095 enum State {
1096 OFF = 0;
1097 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001098 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1099 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001100 }
1101 optional State state = 2;
1102}
1103
1104/**
1105 * Logs when the video codec state changes.
1106 *
1107 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001108 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001109 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001110message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001111 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001112
1113 enum State {
1114 OFF = 0;
1115 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001116 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1117 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001118 }
1119 optional State state = 2;
1120}
1121
1122/**
1123 * Logs when the flashlight state changes.
1124 *
1125 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001126 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001127 */
1128message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001129 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001130
1131 enum State {
1132 OFF = 0;
1133 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001134 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1135 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001136 }
1137 optional State state = 2;
1138}
1139
1140/**
1141 * Logs when the camera state changes.
1142 *
1143 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001144 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001145 */
1146message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001147 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001148
1149 enum State {
1150 OFF = 0;
1151 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001152 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1153 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001154 }
1155 optional State state = 2;
1156}
1157
1158/**
1159 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001160 *
1161 * Logged from:
1162 * TODO
1163 */
Bookatzd6746242017-10-24 18:39:35 -07001164message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001165 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001166 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001167
Bookatz1a1b0462018-01-12 11:47:03 -08001168 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1169 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001170 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001171
1172 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001173 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001174
1175 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001176 RELEASE = 0;
1177 ACQUIRE = 1;
1178 CHANGE_RELEASE = 2;
1179 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001180 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001181 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001182 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001183 (state_field_option).default_state_value = 0,
1184 (state_field_option).nested = true
1185 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001186}
1187
1188/**
Bookatzc1a050a2017-10-10 15:49:28 -07001189 * Logs when a partial wakelock is considered 'long' (over 1 min).
1190 *
1191 * Logged from:
1192 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1193 */
1194message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001195 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001196
Yao Chend54f9dd2017-10-17 17:37:48 +00001197 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1198 optional string tag = 2;
1199
Bookatzc1a050a2017-10-10 15:49:28 -07001200 // TODO: I have no idea what this is.
1201 optional string history_tag = 3;
1202
1203 enum State {
1204 OFF = 0;
1205 ON = 1;
1206 }
1207 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001208}
1209
Bookatzc1a050a2017-10-10 15:49:28 -07001210/**
Bookatza66083f2018-09-20 17:24:00 -07001211 * Logs when the device is interactive, according to the PowerManager Notifier.
1212 *
1213 * Logged from:
1214 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1215 */
1216message InteractiveStateChanged {
1217 enum State {
1218 OFF = 0;
1219 ON = 1;
1220 }
1221 optional State state = 1;
1222}
1223
1224/**
Bookatzc1a050a2017-10-10 15:49:28 -07001225 * Logs Battery Saver state change.
1226 *
1227 * Logged from:
1228 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1229 */
1230message BatterySaverModeStateChanged {
1231 enum State {
1232 OFF = 0;
1233 ON = 1;
1234 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001235 optional State state = 1
1236 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001237}
1238
1239/**
1240 * Logs Doze mode state change.
1241 *
1242 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001243 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001244 */
1245message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001246 optional android.server.DeviceIdleModeEnum state = 1
1247 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001248}
1249
1250
1251/**
1252 * Logs state change of Doze mode including maintenance windows.
1253 *
1254 * Logged from:
1255 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1256 */
1257message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001258 optional android.server.DeviceIdleModeEnum state = 1
1259 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001260}
1261
1262/**
1263 * Logs screen brightness level.
1264 *
1265 * Logged from:
1266 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1267 */
1268message ScreenBrightnessChanged {
1269 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1270 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001271}
1272
1273/**
1274 * Logs battery level (percent full, from 0 to 100).
1275 *
1276 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001277 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001278 */
1279message BatteryLevelChanged {
1280 // Battery level. Should be in [0, 100].
1281 optional int32 battery_level = 1;
1282}
1283
1284/**
1285 * Logs change in charging status of the device.
1286 *
1287 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001288 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001289 */
1290message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001291 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001292 optional android.os.BatteryStatusEnum state = 1
1293 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001294}
1295
1296/**
1297 * Logs whether the device is plugged in, and what power source it is using.
1298 *
1299 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001300 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001301 */
1302message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001303 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001304 optional android.os.BatteryPluggedStateEnum state = 1
1305 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001306}
1307
Bookatz8c6571b2017-10-24 15:04:41 -07001308/**
1309 * Logs when an app's wakeup alarm fires.
1310 *
1311 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001312 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001313 */
1314message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001315 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001316
1317 // Name of the wakeup alarm.
1318 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001319
1320 // Name of source package (for historical reasons, since BatteryStats tracked it).
1321 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001322
Ben Murdoch3389f1522019-05-21 15:05:34 +01001323 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001324 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001325}
1326
1327/**
1328 * Logs when an an app causes the mobile radio to change state.
1329 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1330 *
1331 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001332 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001333 */
1334message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001335 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001336
Bookatz1a1b0462018-01-12 11:47:03 -08001337 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1338 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001339}
1340
1341/**
1342 * Logs when an an app causes the wifi radio to change state.
1343 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1344 *
1345 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001346 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001347 */
1348message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001349 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001350
Bookatz1a1b0462018-01-12 11:47:03 -08001351 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1352 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001353}
1354
1355/**
1356 * Logs kernel wakeup reasons and aborts.
1357 *
1358 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001359 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001360 */
1361message KernelWakeupReported {
1362 // Name of the kernel wakeup reason (or abort).
1363 optional string wakeup_reason_name = 1;
1364
1365 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001366 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001367}
1368
1369/**
Bookatzda1798c2018-12-13 14:16:00 -08001370 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001371 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001372 *
1373 * Logged from:
1374 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1375 */
1376message WifiEnabledStateChanged {
1377 enum State {
1378 OFF = 0;
1379 ON = 1;
1380 }
1381 optional State state = 1;
1382}
1383
1384/**
tsaichristinececebdc2020-02-04 14:05:56 -08001385 * This atom is deprecated starting in R.
1386 *
Bookatzda1798c2018-12-13 14:16:00 -08001387 * 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 -08001388 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1389 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001390 *
1391 * Logged from:
1392 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1393 */
1394message WifiRunningStateChanged {
1395 repeated AttributionNode attribution_node = 1;
1396
1397 enum State {
1398 OFF = 0;
1399 ON = 1;
1400 }
1401 optional State state = 2;
1402}
1403
1404/**
Bookatze5885242017-10-24 20:10:31 -07001405 * Logs wifi locks held by an app.
1406 *
1407 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001408 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001409 */
1410message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001411 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001412
1413 enum State {
1414 OFF = 0;
1415 ON = 1;
1416 }
1417 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001418
1419 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1420 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001421}
1422
1423/**
1424 * Logs wifi signal strength changes.
1425 *
1426 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001427 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001428 */
1429message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001430 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1431 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001432}
1433
1434/**
1435 * Logs wifi scans performed by an app.
1436 *
1437 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001438 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001439 */
1440message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001441 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001442
1443 enum State {
1444 OFF = 0;
1445 ON = 1;
1446 }
1447 optional State state = 2;
1448}
1449
1450/**
Tej Singh4503e102018-01-04 14:35:01 -08001451 * Logs wifi multicast locks held by an app
1452 *
1453 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001454 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001455 */
1456message WifiMulticastLockStateChanged {
1457 repeated AttributionNode attribution_node = 1;
1458
1459 enum State {
1460 OFF = 0;
1461 ON = 1;
1462 }
1463 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001464
1465 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001466}
1467
1468/**
Tej Singh1ea42892018-01-19 09:27:00 -08001469 * Logs shutdown reason and duration on next boot.
1470 *
1471 * Logged from:
1472 * frameworks/base/core/java/com/android/server/BootReceiver.java
1473 */
1474message ShutdownSequenceReported {
1475 // True if shutdown is for a reboot. Default: false if we do not know.
1476 optional bool reboot = 1;
1477
1478 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1479 optional string reason = 2;
1480
1481 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1482 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001483 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001484
1485 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001486 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001487}
1488
Tej Singh6483ea42018-01-25 17:45:49 -08001489
1490/**
1491 * Logs boot reason and duration.
1492 *
1493 * Logged from:
1494 * system/core/bootstat/bootstat.cpp
1495 */
1496message BootSequenceReported {
1497 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1498 // Default: "<EMPTY>" if not available.
1499 optional string bootloader_reason = 1;
1500
1501 // Reason for system boot. Eg. bootloader, reboot,userrequested
1502 // Default: "<EMPTY>" if not available.
1503 optional string system_reason = 2;
1504
1505 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001506 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001507
1508 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001509 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001510
1511 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001512 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001513
1514 // Time since last boot in ms. Default: 0 if not available.
1515 optional int64 time_since_last_boot = 6;
1516}
1517
Tej Singhc477d9c2018-02-05 18:31:39 -08001518
1519/**
1520 * Logs call state and disconnect cause (if applicable).
1521 *
1522 * Logged from:
1523 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1524 */
1525message CallStateChanged {
1526 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1527 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1528 optional android.telecom.CallStateEnum call_state = 1;
1529
1530 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1531 // This value is only applicable when the call_state is DISCONNECTED, and
1532 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1533 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1534 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1535
1536 // True if the call is self-managed, which are apps that use the
1537 // telecom infrastructure to make their own calls.
1538 optional bool self_managed = 3;
1539
1540 // True if call is external. External calls are calls on connected Wear
1541 // devices but show up in Telecom so the user can pull them onto the device.
1542 optional bool external_call = 4;
1543}
1544
Tej Singh1ea42892018-01-19 09:27:00 -08001545/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001546 * Logs keyguard state. The keyguard is the lock screen.
1547 *
1548 * Logged from:
1549 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1550 */
1551message KeyguardStateChanged {
1552 enum State {
1553 UNKNOWN = 0;
1554 // The keyguard is hidden when the phone is unlocked.
1555 HIDDEN = 1;
1556 // The keyguard is shown when the phone is locked (screen turns off).
1557 SHOWN= 2;
1558 // The keyguard is occluded when something is overlaying the keyguard.
1559 // Eg. Opening the camera while on the lock screen.
1560 OCCLUDED = 3;
1561 }
1562 optional State state = 1;
1563}
1564
1565/**
1566 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1567 * prompts the user to enter a password (pattern, pin, etc).
1568 *
1569 * Logged from:
1570 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1571 */
1572
1573message KeyguardBouncerStateChanged {
1574 enum State {
1575 UNKNOWN = 0;
1576 // Bouncer is hidden, either as a result of successfully entering the
1577 // password, screen timing out, or user going back to lock screen.
1578 HIDDEN = 1;
1579 // This is when the user is being prompted to enter the password.
1580 SHOWN = 2;
1581 }
1582 optional State state = 1;
1583}
1584
1585/**
1586 * Logs the result of entering a password into the keyguard bouncer.
1587 *
1588 * Logged from:
1589 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1590 */
1591message KeyguardBouncerPasswordEntered {
1592 enum BouncerResult {
1593 UNKNOWN = 0;
1594 // The password entered was incorrect.
1595 FAILURE = 1;
1596 // The password entered was correct.
1597 SUCCESS = 2;
1598 }
1599 optional BouncerResult result = 1;
1600}
1601
Tej Singha883b372018-02-15 11:30:01 -08001602/*
1603 * Logs changes to the configuration of the device. The configuration is defined
1604 * in frameworks/base/core/java/android/content/res/Configuration.java
1605 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1606 * Please go there to interpret the possible values each field can be.
1607 *
1608 * Logged from:
1609 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1610 */
1611message ResourceConfigurationChanged {
1612 // Bit mask of color capabilities of the screen.
1613 // Contains information about the color gamut and hdr mode of the screen.
1614 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001615 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001616
1617 // The target screen density being rendered to.
1618 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001619 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001620
1621 // Current user preference for the scaling factor for fonts,
1622 // relative to the base density scaling.
1623 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001624 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001625
1626 // Flag indicating whether the hard keyboard is hidden.
1627 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001628 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001629
1630 // The type of keyboard attached to the device.
1631 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1632 optional int32 keyboard = 5;
1633
1634 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1635 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001636 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001637
1638 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1639 // 0 if undefined.
1640 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1641 optional int32 mcc = 7;
1642
1643 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1644 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1645 // MNC_ZERO symbol defined in Configuration.java.
1646 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1647 optional int32 mnc = 8;
1648
1649 // The kind of navigation available on the device.
1650 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1651 optional int32 navigation = 9;
1652
1653 // Flag indicating whether the navigation is available.
1654 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001655 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001656
1657 // Overall orientation of the screen.
1658 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1659 optional int32 orientation = 11;
1660
1661 // The current height of the available screen space, in dp units.
1662 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001663 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001664
1665 // Bit mask of overall layout of the screen.
1666 // Contains information about screen size, whether the screen is wider/taller
1667 // than normal, whether the screen layout is right-tl-left or left-to-right,
1668 // and whether the screen has a rounded shape.
1669 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001670 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001671
1672 // Current width of the available screen space, in dp units.
1673 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001674 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001675
1676 // The smallest screen size an application will see in normal operation.
1677 // This is the smallest value of both screenWidthDp and screenHeightDp
1678 // in portrait and landscape.
1679 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001680 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001681
1682 // The type of touch screen attached to the device.
1683 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1684 optional int32 touchscreen = 16;
1685
1686 // Bit mask of the ui mode.
1687 // Contains information about the overall ui mode of the device.
1688 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1689 // Also contains information about whether the device is in night mode.
1690 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001691 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001692}
1693
Tej Singheee317b2018-03-07 19:28:05 -08001694
1695/**
1696 * Logs changes in the connection state of the mobile radio.
1697 *
1698 * Logged from:
1699 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1700 */
1701message MobileConnectionStateChanged {
1702 // States are from the state machine DataConnection.java.
1703 enum State {
1704 UNKNOWN = 0;
1705 // The connection is inactive, or disconnected.
1706 INACTIVE = 1;
1707 // The connection is being activated, or connecting.
1708 ACTIVATING = 2;
1709 // The connection is active, or connected.
1710 ACTIVE = 3;
1711 // The connection is disconnecting.
1712 DISCONNECTING = 4;
1713 // The connection is disconnecting after creating a connection.
1714 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1715 }
1716 optional State state = 1;
1717 // For multi-sim phones, this distinguishes between the sim cards.
1718 optional int32 sim_slot_index = 2;
1719 // Used to identify the connection. Starts at 0 and increments by 1 for
1720 // every new network created. Resets whenever the device reboots.
1721 optional int32 data_connection_id = 3;
1722 // A bitmask for the capabilities of this connection.
1723 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1724 // Default value (if we have no information): 0
1725 optional int64 capabilities = 4;
1726 // If this connection has internet.
1727 // This just checks if the DEFAULT bit of capabilities is set.
1728 optional bool has_internet = 5;
1729}
1730
1731/**
1732 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1733 *
1734 * Logged from:
1735 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1736 */
1737message MobileRadioTechnologyChanged {
1738 optional android.telephony.NetworkTypeEnum state = 1;
1739 // For multi-sim phones, this distinguishes between the sim cards.
1740 optional int32 sim_slot_index = 2;
1741}
1742
Andrew Chantb56388b2018-03-22 21:07:33 -07001743/**
1744 * Logs the VID and PID of any connected USB devices.
1745 *
1746 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1747 *
1748 * Logged by Vendor.
1749 */
1750message UsbDeviceAttached {
1751 optional int32 vid = 1;
1752 optional int32 pid = 2;
1753 optional bool has_audio = 3;
1754 optional bool has_hid = 4;
1755 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001756 enum State {
1757 STATE_DISCONNECTED = 0;
1758 STATE_CONNECTED = 1;
1759 }
1760 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001761 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001762}
1763
Tej Singheee317b2018-03-07 19:28:05 -08001764
Tej Singhdd7bd352018-02-09 19:33:15 -08001765/**
Tej Singh5d991e12018-03-09 19:48:11 -08001766 * Logs when Bluetooth is enabled and disabled.
1767 *
1768 * Logged from:
1769 * services/core/java/com/android/server/BluetoothManagerService.java
1770 */
1771message BluetoothEnabledStateChanged {
1772 repeated AttributionNode attribution_node = 1;
1773 // Whether or not bluetooth is enabled on the device.
1774 enum State {
1775 UNKNOWN = 0;
1776 ENABLED = 1;
1777 DISABLED = 2;
1778 }
1779 optional State state = 2;
1780 // The reason for being enabled/disabled.
1781 // Eg. Airplane mode, crash, application request.
1782 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1783 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001784 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001785}
1786
1787/**
Jack Hed9837c82019-01-09 01:19:13 -08001788 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001789 *
1790 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001791 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1792 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001793 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001794 */
1795message BluetoothConnectionStateChanged {
1796 // The state of the connection.
1797 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1798 optional android.bluetooth.ConnectionStateEnum state = 1;
1799 // An identifier that can be used to match connect and disconnect events.
1800 // Currently is last two bytes of a hash of a device level ID and
1801 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001802 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001803 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001804 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1805 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001806 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001807 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001808 // An identifier that can be used to match events for this device.
1809 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1810 // Salt: Randomly generated 256 bit value
1811 // Hash algorithm: HMAC-SHA256
1812 // Size: 32 byte
1813 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001814 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001815 // An identifier that can be used to match events for this device.
1816 // The incremental identifier is locally generated and guaranteed not derived
1817 // from any globally unique hardware id.
1818 // For paired devices, it stays consistent between Bluetooth toggling for the
1819 // same remote device.
1820 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1821 // session for the same remote device.
1822 // Default: 0 if the device's metric id is unknown.
1823 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001824}
1825
1826/**
1827 * Logs when a Bluetooth device connects and disconnects over ACL
1828 *
1829 * Logged from:
1830 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1831 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001832 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001833 */
1834message BluetoothAclConnectionStateChanged {
1835 // An identifier that can be used to match events for this device.
1836 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1837 // Salt: Randomly generated 256 bit value
1838 // Hash algorithm: HMAC-SHA256
1839 // Size: 32 byte
1840 // Default: null or empty if the device identifier is not known
1841 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1842 // The state of the connection.
1843 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1844 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001845 // An identifier that can be used to match events for this device.
1846 // The incremental identifier is locally generated and guaranteed not derived
1847 // from any globally unique hardware id.
1848 // For paired devices, it stays consistent between Bluetooth toggling for the
1849 // same remote device.
1850 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1851 // session for the same remote device.
1852 // Default: 0 if the device's metric id is unknown.
1853 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001854}
1855
1856/**
1857 * Logs when a Bluetooth device connects and disconnects over SCO
1858 *
1859 * Logged from:
1860 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1861 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1862 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001863 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001864 */
1865message BluetoothScoConnectionStateChanged {
1866 // An identifier that can be used to match events for this device.
1867 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1868 // Salt: Randomly generated 256 bit value
1869 // Hash algorithm: HMAC-SHA256
1870 // Size: 32 byte
1871 // Default: null or empty if the device identifier is not known
1872 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1873 // The state of the connection.
1874 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1875 optional android.bluetooth.ConnectionStateEnum state = 2;
1876 // Codec used for this SCO connection
1877 // Default: UNKNOWN
1878 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001879 // An identifier that can be used to match events for this device.
1880 // The incremental identifier is locally generated and guaranteed not derived
1881 // from any globally unique hardware id.
1882 // For paired devices, it stays consistent between Bluetooth toggling for the
1883 // same remote device.
1884 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1885 // session for the same remote device.
1886 // Default: 0 if the device's metric id is unknown.
1887 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001888}
1889
Jack Hec27040a2019-01-09 20:54:41 -08001890/**
1891 * Logged when active device of a profile changes
1892 *
1893 * Logged from:
1894 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1895 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1896 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1897 */
1898message BluetoothActiveDeviceChanged {
1899 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1900 // From android.bluetooth.BluetoothProfile
1901 optional int32 bt_profile = 1;
1902 // An identifier that can be used to match events for this new active device.
1903 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1904 // Salt: Randomly generated 256 bit value
1905 // Hash algorithm: HMAC-SHA256
1906 // Size: 32 byte
1907 // Default: null or empty if there is no active device for this profile
1908 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001909 // An identifier that can be used to match events for this device.
1910 // The incremental identifier is locally generated and guaranteed not derived
1911 // from any globally unique hardware id.
1912 // For paired devices, it stays consistent between Bluetooth toggling for the
1913 // same remote device.
1914 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1915 // session for the same remote device.
1916 // Default: 0 if the device's metric id is unknown.
1917 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001918}
1919
Jack Heab86dbd22018-12-18 15:43:27 -08001920// Logs when there is an event affecting Bluetooth device's link layer connection.
1921// - This event is triggered when there is a related HCI command or event
1922// - Users of this metrics can deduce Bluetooth device's connection state from these events
1923// - HCI commands are logged before the command is sent, after receiving command status, and after
1924// receiving command complete
1925// - HCI events are logged when they arrive
1926//
1927// Low level log from system/bt
1928//
1929// Bluetooth classic commands:
1930// - CMD_CREATE_CONNECTION
1931// - CMD_DISCONNECT
1932// - CMD_CREATE_CONNECTION_CANCEL
1933// - CMD_ACCEPT_CONNECTION_REQUEST
1934// - CMD_REJECT_CONNECTION_REQUEST
1935// - CMD_SETUP_ESCO_CONNECTION
1936// - CMD_ACCEPT_ESCO_CONNECTION
1937// - CMD_REJECT_ESCO_CONNECTION
1938// - CMD_ENH_SETUP_ESCO_CONNECTION
1939// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1940//
1941// Bluetooth low energy commands:
1942// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1943// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1944// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1945// - CMD_BLE_CLEAR_WHITE_LIST
1946// - CMD_BLE_ADD_WHITE_LIST
1947// - CMD_BLE_REMOVE_WHITE_LIST
1948//
1949// Bluetooth classic events:
1950// - EVT_CONNECTION_COMP
1951// - EVT_CONNECTION_REQUEST
1952// - EVT_DISCONNECTION_COMP
1953// - EVT_ESCO_CONNECTION_COMP
1954// - EVT_ESCO_CONNECTION_CHANGED
1955//
1956// Bluetooth low energy meta events:
1957// - BLE_EVT_CONN_COMPLETE_EVT
1958// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1959//
1960// Next tag: 10
1961message BluetoothLinkLayerConnectionEvent {
1962 // An identifier that can be used to match events for this device.
1963 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1964 // Salt: Randomly generated 256 bit value
1965 // Hash algorithm: HMAC-SHA256
1966 // Size: 32 byte
1967 // Default: null or empty if the device identifier is not known
1968 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1969 // Connection handle of this connection if available
1970 // Range: 0x0000 - 0x0EFF (12 bits)
1971 // Default: 0xFFFF if the handle is unknown
1972 optional int32 connection_handle = 2;
1973 // Direction of the link
1974 // Default: DIRECTION_UNKNOWN
1975 optional android.bluetooth.DirectionEnum direction = 3;
1976 // Type of this link
1977 // Default: LINK_TYPE_UNKNOWN
1978 optional android.bluetooth.LinkTypeEnum type = 4;
1979
1980 // Reason metadata for this link layer connection event, rules for interpretation:
1981 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1982 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1983 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1984 // set and valid, ignore hci_ble_event
1985
1986 // HCI command associated with this event
1987 // Default: CMD_UNKNOWN
1988 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1989 // HCI event associated with this event
1990 // Default: EVT_UNKNOWN
1991 optional android.bluetooth.hci.EventEnum hci_event = 6;
1992 // HCI BLE meta event associated with this event
1993 // Default: BLE_EVT_UNKNOWN
1994 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1995 // HCI command status code if this is triggerred by hci_cmd
1996 // Default: STATUS_UNKNOWN
1997 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1998 // HCI reason code associated with this event
1999 // Default: STATUS_UNKNOWN
2000 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002001 // An identifier that can be used to match events for this device.
2002 // The incremental identifier is locally generated and guaranteed not derived
2003 // from any globally unique hardware id.
2004 // For paired devices, it stays consistent between Bluetooth toggling for the
2005 // same remote device.
2006 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2007 // session for the same remote device.
2008 // Default: 0 if the device's metric id is unknown.
2009 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08002010}
2011
Howard Roe103fe22019-01-17 16:52:16 -08002012/**
2013 * Logs when a module is rolled back by Watchdog.
2014 *
2015 * Logged from: Rollback Manager
2016 */
2017message WatchdogRollbackOccurred {
2018 enum RollbackType {
2019 UNKNOWN = 0;
2020 ROLLBACK_INITIATE = 1;
2021 ROLLBACK_SUCCESS = 2;
2022 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08002023 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08002024 }
2025 optional RollbackType rollback_type = 1;
2026
2027 optional string package_name = 2;
2028
2029 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002030
2031 enum RollbackReasonType {
2032 REASON_UNKNOWN = 0;
2033 REASON_NATIVE_CRASH = 1;
2034 REASON_EXPLICIT_HEALTH_CHECK = 2;
2035 REASON_APP_CRASH = 3;
2036 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002037 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002038 }
2039 optional RollbackReasonType rollback_reason = 4;
2040
2041 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2042 // is initiated. Empty if the package is unknown.
2043 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002044
2045 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002046}
2047
Jack Hec27040a2019-01-09 20:54:41 -08002048/**
2049 * Logs when there is a change in Bluetooth A2DP playback state
2050 *
2051 * Logged from:
2052 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2053 */
2054message BluetoothA2dpPlaybackStateChanged {
2055 // An identifier that can be used to match events for this device.
2056 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2057 // Salt: Randomly generated 256 bit value
2058 // Hash algorithm: HMAC-SHA256
2059 // Size: 32 byte
2060 // Default: null or empty if the device identifier is not known
2061 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2062 // Current playback state
2063 // Default: PLAYBACK_STATE_UNKNOWN
2064 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2065 // Current audio coding mode
2066 // Default: AUDIO_CODING_MODE_UNKNOWN
2067 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002068 // An identifier that can be used to match events for this device.
2069 // The incremental identifier is locally generated and guaranteed not derived
2070 // from any globally unique hardware id.
2071 // For paired devices, it stays consistent between Bluetooth toggling for the
2072 // same remote device.
2073 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2074 // session for the same remote device.
2075 // Default: 0 if the device's metric id is unknown.
2076 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002077}
2078
2079/**
2080 * Logs when there is a change in A2DP codec config for a particular remote device
2081 *
2082 * Logged from:
2083 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2084 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2085 */
2086message BluetoothA2dpCodecConfigChanged {
2087 // An identifier that can be used to match events for this device.
2088 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2089 // Salt: Randomly generated 256 bit value
2090 // Hash algorithm: HMAC-SHA256
2091 // Size: 32 byte
2092 // Default: null or empty if the device identifier is not known
2093 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2094 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2095 // Default SOURCE_CODEC_TYPE_INVALID
2096 optional int32 codec_type = 2;
2097 // Codec priroity, the higher the more preferred, -1 for disabled
2098 // Default: CODEC_PRIORITY_DEFAULT
2099 optional int32 codec_priority = 3;
2100 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2101 // Default: SAMPLE_RATE_NONE
2102 optional int32 sample_rate = 4;
2103 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2104 // Default: BITS_PER_SAMPLE_NONE
2105 optional int32 bits_per_sample = 5;
2106 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2107 // Default: CHANNEL_MODE_NONE
2108 optional int32 channel_mode = 6;
2109 // Codec specific values
2110 // Default 0
2111 optional int64 codec_specific_1 = 7;
2112 optional int64 codec_specific_2 = 8;
2113 optional int64 codec_specific_3 = 9;
2114 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002115 // An identifier that can be used to match events for this device.
2116 // The incremental identifier is locally generated and guaranteed not derived
2117 // from any globally unique hardware id.
2118 // For paired devices, it stays consistent between Bluetooth toggling for the
2119 // same remote device.
2120 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2121 // session for the same remote device.
2122 // Default: 0 if the device's metric id is unknown.
2123 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002124}
2125
2126/**
2127 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2128 * Each codec's capability is logged separately due to statsd restriction
2129 *
2130 * Logged from:
2131 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2132 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2133 */
2134message BluetoothA2dpCodecCapabilityChanged {
2135 // An identifier that can be used to match events for this device.
2136 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2137 // Salt: Randomly generated 256 bit value
2138 // Hash algorithm: HMAC-SHA256
2139 // Size: 32 byte
2140 // Default: null or empty if the device identifier is not known
2141 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2142 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2143 // Default SOURCE_CODEC_TYPE_INVALID
2144 optional int32 codec_type = 2;
2145 // Codec priroity, the higher the more preferred, -1 for disabled
2146 // Default: CODEC_PRIORITY_DEFAULT
2147 optional int32 codec_priority = 3;
2148 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2149 // in BluetoothCodecConfig
2150 // Default: empty and SAMPLE_RATE_NONE for individual item
2151 optional int32 sample_rate = 4;
2152 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2153 // in BluetoothCodecConfig
2154 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2155 optional int32 bits_per_sample = 5;
2156 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2157 // BluetoothCodecConfig
2158 // Default: empty and CHANNEL_MODE_NONE for individual item
2159 optional int32 channel_mode = 6;
2160 // Codec specific values
2161 // Default 0
2162 optional int64 codec_specific_1 = 7;
2163 optional int64 codec_specific_2 = 8;
2164 optional int64 codec_specific_3 = 9;
2165 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002166 // An identifier that can be used to match events for this device.
2167 // The incremental identifier is locally generated and guaranteed not derived
2168 // from any globally unique hardware id.
2169 // For paired devices, it stays consistent between Bluetooth toggling for the
2170 // same remote device.
2171 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2172 // session for the same remote device.
2173 // Default: 0 if the device's metric id is unknown.
2174 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002175}
2176
2177/**
2178 * Logs when A2DP failed to read from PCM source.
2179 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2180 *
2181 * Logged from:
2182 * system/bt
2183 */
2184message BluetoothA2dpAudioUnderrunReported {
2185 // An identifier that can be used to match events for this device.
2186 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2187 // Salt: Randomly generated 256 bit value
2188 // Hash algorithm: HMAC-SHA256
2189 // Size: 32 byte
2190 // Default: null or empty if the device identifier is not known
2191 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2192 // Encoding interval in nanoseconds
2193 // Default: 0
2194 optional int64 encoding_interval_nanos = 2;
2195 // Number of bytes of PCM data that could not be read from the source
2196 // Default: 0
2197 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002198 // An identifier that can be used to match events for this device.
2199 // The incremental identifier is locally generated and guaranteed not derived
2200 // from any globally unique hardware id.
2201 // For paired devices, it stays consistent between Bluetooth toggling for the
2202 // same remote device.
2203 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2204 // session for the same remote device.
2205 // Default: 0 if the device's metric id is unknown.
2206 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002207}
2208
2209/**
2210 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2211 * buffer queue is full and we have to drop data
2212 *
2213 * Logged from:
2214 * system/bt
2215 */
2216message BluetoothA2dpAudioOverrunReported {
2217 // An identifier that can be used to match events for this device.
2218 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2219 // Salt: Randomly generated 256 bit value
2220 // Hash algorithm: HMAC-SHA256
2221 // Size: 32 byte
2222 // Default: null or empty if the device identifier is not known
2223 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2224 // Encoding interval in nanoseconds
2225 // Default: 0
2226 optional int64 encoding_interval_nanos = 2;
2227 // Number of buffers dropped in this event
2228 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2229 // Default: 0
2230 optional int32 num_dropped_buffers = 3;
2231 // Number of encoded buffers dropped in this event
2232 // Default 0
2233 optional int32 num_dropped_encoded_frames = 4;
2234 // Number of encoded bytes dropped in this event
2235 // Default: 0
2236 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002237 // An identifier that can be used to match events for this device.
2238 // The incremental identifier is locally generated and guaranteed not derived
2239 // from any globally unique hardware id.
2240 // For paired devices, it stays consistent between Bluetooth toggling for the
2241 // same remote device.
2242 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2243 // session for the same remote device.
2244 // Default: 0 if the device's metric id is unknown.
2245 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002246}
2247
2248/**
2249 * Logs when we receive reports regarding a device's RSSI value
2250 *
2251 * Logged from:
2252 * system/bt
2253 */
2254message BluetoothDeviceRssiReported {
2255 // An identifier that can be used to match events for this device.
2256 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2257 // Salt: Randomly generated 256 bit value
2258 // Hash algorithm: HMAC-SHA256
2259 // Size: 32 byte
2260 // Default: null or empty if the device identifier is not known
2261 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2262 // Connection handle of this connection if available
2263 // Range: 0x0000 - 0x0EFF (12 bits)
2264 // Default: 0xFFFF if the handle is unknown
2265 optional int32 connection_handle = 2;
2266 // HCI command status code if this is triggerred by hci_cmd
2267 // Default: STATUS_UNKNOWN
2268 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2269 // BR/EDR
2270 // Range: -128 ≤ N ≤ 127 (signed integer)
2271 // Units: dB
2272 // LE:
2273 // Range: -127 to 20, 127 (signed integer)
2274 // Units: dBm
2275 // Invalid when an out of range value is reported
2276 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002277 // An identifier that can be used to match events for this device.
2278 // The incremental identifier is locally generated and guaranteed not derived
2279 // from any globally unique hardware id.
2280 // For paired devices, it stays consistent between Bluetooth toggling for the
2281 // same remote device.
2282 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2283 // session for the same remote device.
2284 // Default: 0 if the device's metric id is unknown.
2285 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002286}
2287
2288/**
2289 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2290 *
2291 * Logged from:
2292 * system/bt
2293 */
2294message BluetoothDeviceFailedContactCounterReported {
2295 // An identifier that can be used to match events for this device.
2296 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2297 // Salt: Randomly generated 256 bit value
2298 // Hash algorithm: HMAC-SHA256
2299 // Size: 32 byte
2300 // Default: null or empty if the device identifier is not known
2301 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2302 // Connection handle of this connection if available
2303 // Range: 0x0000 - 0x0EFF (12 bits)
2304 // Default: 0xFFFF if the handle is unknown
2305 optional int32 connection_handle = 2;
2306 // HCI command status code if this is triggerred by hci_cmd
2307 // Default: STATUS_UNKNOWN
2308 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2309 // Number of consecutive failed contacts for a connection corresponding to the Handle
2310 // Range: uint16_t, 0-0xFFFF
2311 // Default: 0xFFFFF
2312 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002313 // An identifier that can be used to match events for this device.
2314 // The incremental identifier is locally generated and guaranteed not derived
2315 // from any globally unique hardware id.
2316 // For paired devices, it stays consistent between Bluetooth toggling for the
2317 // same remote device.
2318 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2319 // session for the same remote device.
2320 // Default: 0 if the device's metric id is unknown.
2321 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002322}
2323
2324/**
2325 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2326 *
2327 * Logged from:
2328 * system/bt
2329 */
2330message BluetoothDeviceTxPowerLevelReported {
2331 // An identifier that can be used to match events for this device.
2332 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2333 // Salt: Randomly generated 256 bit value
2334 // Hash algorithm: HMAC-SHA256
2335 // Size: 32 byte
2336 // Default: null or empty if the device identifier is not known
2337 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2338 // Connection handle of this connection if available
2339 // Range: 0x0000 - 0x0EFF (12 bits)
2340 // Default: 0xFFFF if the handle is unknown
2341 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002342 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002343 // Default: STATUS_UNKNOWN
2344 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2345 // Range: -30 ≤ N ≤ 20
2346 // Units: dBm
2347 // Invalid when an out of range value is reported
2348 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002349 // An identifier that can be used to match events for this device.
2350 // The incremental identifier is locally generated and guaranteed not derived
2351 // from any globally unique hardware id.
2352 // For paired devices, it stays consistent between Bluetooth toggling for the
2353 // same remote device.
2354 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2355 // session for the same remote device.
2356 // Default: 0 if the device's metric id is unknown.
2357 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002358}
Jack Heab86dbd22018-12-18 15:43:27 -08002359
Tej Singh5d991e12018-03-09 19:48:11 -08002360/**
Jack He1021a612019-01-20 21:22:46 -08002361 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2362 * receiving an HCI command from the host
2363 *
2364 * Logged from: system/bt
2365 */
2366message BluetoothHciTimeoutReported {
2367 // HCI command associated with this event
2368 // Default: CMD_UNKNOWN
2369 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2370}
2371
2372/**
2373 * Logs when we receive Bluetooth Link Quality Report event from the controller
2374 * See Android Bluetooth HCI specification for more details
2375 *
2376 * Note: all count and bytes field are counted since last event
2377 *
2378 * Logged from: system/bt
2379 */
2380message BluetoothQualityReportReported {
2381 // Quality report ID
2382 // Original type: uint8_t
2383 // Default: BQR_ID_UNKNOWN
2384 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2385 // Packet type of the connection
2386 // Original type: uint8_t
2387 // Default: BQR_PACKET_TYPE_UNKNOWN
2388 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2389 // Connection handle of the connection
2390 // Original type: uint16_t
2391 optional int32 connection_handle = 3;
2392 // Performing Role for the connection
2393 // Original type: uint8_t
2394 optional int32 connection_role = 4;
2395 // Current Transmit Power Level for the connection. This value is the same as the controller's
2396 // response to the HCI_Read_Transmit_Power_Level HCI command
2397 // Original type: uint8_t
2398 optional int32 tx_power_level = 5;
2399 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2400 // absolute receiver signal strength value
2401 // Original type: int8_t
2402 optional int32 rssi = 6;
2403 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2404 // channels used by the link currently
2405 // Original type: uint8_t
2406 optional int32 snr = 7;
2407 // Indicates the number of unused channels in AFH_channel_map
2408 // Original type: uint8_t
2409 optional int32 unused_afh_channel_count = 8;
2410 // Indicates the number of the channels which are interfered and quality is bad but are still
2411 // selected for AFH
2412 // Original type: uint8_t
2413 optional int32 afh_select_unideal_channel_count = 9;
2414 // Current Link Supervision Timeout Setting
2415 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2416 // Original type: uint16_t
2417 optional int32 lsto = 10;
2418 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2419 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2420 // 0x01 (Piconet Clock)
2421 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2422 // Original type: uint32_t
2423 optional int64 connection_piconet_clock = 11;
2424 // The count of retransmission
2425 // Original type: uint32_t
2426 optional int64 retransmission_count = 12;
2427 // The count of no RX
2428 // Original type: uint32_t
2429 optional int64 no_rx_count = 13;
2430 // The count of NAK (Negative Acknowledge)
2431 // Original type: uint32_t
2432 optional int64 nak_count = 14;
2433 // Controller timestamp of last TX ACK
2434 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2435 // Original type: uint32_t
2436 optional int64 last_tx_ack_timestamp = 15;
2437 // The count of Flow-off (STOP)
2438 // Original type: uint32_t
2439 optional int64 flow_off_count = 16;
2440 // Controller timestamp of last Flow-on (GO)
2441 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2442 // Original type: uint32_t
2443 optional int64 last_flow_on_timestamp = 17;
2444 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2445 // Original type: uint32_t
2446 optional int64 buffer_overflow_bytes = 18;
2447 // Buffer underflow count (in byte) since last event
2448 // Original type: uint32_t
2449 optional int64 buffer_underflow_bytes = 19;
2450}
2451
2452/**
2453 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2454 *
2455 * Notes:
2456 * - Each event can be partially filled as we might learn different pieces of device
2457 * information at different time
2458 * - Multiple device info events can be combined to give more complete picture
2459 * - When multiple device info events tries to describe the same information, the
2460 * later one wins
2461 *
2462 * Logged from:
2463 * packages/apps/Bluetooth
2464 */
Jack Heaea26982019-04-04 11:19:48 -07002465message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002466 // An identifier that can be used to match events for this device.
2467 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2468 // Salt: Randomly generated 256 bit value
2469 // Hash algorithm: HMAC-SHA256
2470 // Size: 32 byte
2471 // Default: null or empty if the device identifier is not known
2472 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2473 // Where is this device info obtained from
2474 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2475 // Name of the data source
2476 // For EXTERNAL: package name of the data source
2477 // For INTERNAL: null for general case, component name otherwise
2478 optional string source_name = 3;
2479 // Name of the manufacturer of this device
2480 optional string manufacturer = 4;
2481 // Model of this device
2482 optional string model = 5;
2483 // Hardware version of this device
2484 optional string hardware_version = 6;
2485 // Software version of this device
2486 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002487 // An identifier that can be used to match events for this device.
2488 // The incremental identifier is locally generated and guaranteed not derived
2489 // from any globally unique hardware id.
2490 // For paired devices, it stays consistent between Bluetooth toggling for the
2491 // same remote device.
2492 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2493 // session for the same remote device.
2494 // Default: 0 if the device's metric id is unknown.
2495 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002496}
2497
2498/**
2499 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2500 * device, as documented by the Bluetooth Core HCI specification
2501 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2502 * Vol 2, Part E, Page 1118
2503 *
2504 * Logged from:
2505 * system/bt
2506 */
2507message BluetoothRemoteVersionInfoReported {
2508 // Connection handle of the connection
2509 // Original type: uint16_t
2510 optional int32 connection_handle = 1;
2511 // HCI command status code
2512 // Default: STATUS_UNKNOWN
2513 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2514 // 1 byte Version of current LMP in the remote controller
2515 optional int32 lmp_version = 3;
2516 // 2 bytes LMP manufacturer code of the remote controller
2517 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2518 optional int32 lmp_manufacturer_code = 4;
2519 // 4 bytes subversion of the LMP in the remote controller
2520 optional int32 lmp_subversion = 5;
2521}
2522
2523/**
2524 * Logs when certain Bluetooth SDP attributes are discovered
2525 * Constant definitions are from:
2526 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2527 *
2528 * Current logged attributes:
2529 * - BluetoothProfileDescriptorList
2530 * - Supported Features Bitmask
2531 *
2532 * Logged from:
2533 * system/bt
2534 */
2535message BluetoothSdpAttributeReported {
2536 // An identifier that can be used to match events for this device.
2537 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2538 // Salt: Randomly generated 256 bit value
2539 // Hash algorithm: HMAC-SHA256
2540 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2541 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2542 // Original type: uint16_t
2543 optional int32 protocol_uuid = 2;
2544 // Short form UUIDs used to identify Bluetooth SDP attribute types
2545 // Original type: uint16_t
2546 optional int32 attribute_id = 3;
2547 // Attribute value for the particular attribute
2548 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002549 // An identifier that can be used to match events for this device.
2550 // The incremental identifier is locally generated and guaranteed not derived
2551 // from any globally unique hardware id.
2552 // For paired devices, it stays consistent between Bluetooth toggling for the
2553 // same remote device.
2554 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2555 // session for the same remote device.
2556 // Default: 0 if the device's metric id is unknown.
2557 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002558}
2559
2560/**
2561 * Logs when bond state of a Bluetooth device changes
2562 *
2563 * Logged from:
2564 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2565 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2566 */
2567message BluetoothBondStateChanged {
2568 // An identifier that can be used to match events for this device.
2569 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2570 // Salt: Randomly generated 256 bit value
2571 // Hash algorithm: HMAC-SHA256
2572 // Size: 32 byte
2573 // Default: null or empty if the device identifier is not known
2574 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2575 // Preferred transport type to remote dual mode device
2576 // Default: TRANSPORT_AUTO means no preference
2577 optional android.bluetooth.TransportTypeEnum transport = 2;
2578 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2579 // Default: UNKNOWN
2580 optional android.bluetooth.DeviceTypeEnum type = 3;
2581 // Current bond state (NONE, BONDING, BONDED)
2582 // Default: BOND_STATE_UNKNOWN
2583 optional android.bluetooth.BondStateEnum bond_state = 4;
2584 // Bonding sub state
2585 // Default: BOND_SUB_STATE_UNKNOWN
2586 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2587 // Unbond Reason
2588 // Default: UNBOND_REASON_UNKNOWN
2589 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002590 // An identifier that can be used to match events for this device.
2591 // The incremental identifier is locally generated and guaranteed not derived
2592 // from any globally unique hardware id.
2593 // For paired devices, it stays consistent between Bluetooth toggling for the
2594 // same remote device.
2595 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2596 // session for the same remote device.
2597 // Default: 0 if the device's metric id is unknown.
2598 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002599}
2600
2601/**
2602 * Logs there is an event related Bluetooth classic pairing
2603 *
2604 * Logged from:
2605 * system/bt
2606 */
2607message BluetoothClassicPairingEventReported {
2608 // An identifier that can be used to match events for this device.
2609 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2610 // Salt: Randomly generated 256 bit value
2611 // Hash algorithm: HMAC-SHA256
2612 // Size: 32 byte
2613 // Default: null or empty if the device identifier is not known
2614 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2615 // Connection handle of this connection if available
2616 // Range: 0x0000 - 0x0EFF (12 bits)
2617 // Default: 0xFFFF if the handle is unknown
2618 optional int32 connection_handle = 2;
2619 // HCI command associated with this event
2620 // Default: CMD_UNKNOWN
2621 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2622 // HCI event associated with this event
2623 // Default: EVT_UNKNOWN
2624 optional android.bluetooth.hci.EventEnum hci_event = 4;
2625 // HCI command status code if this is triggerred by hci_cmd
2626 // Default: STATUS_UNKNOWN
2627 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2628 // HCI reason code associated with this event
2629 // Default: STATUS_UNKNOWN
2630 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002631 // A status value related to this specific event
2632 // Default: 0
2633 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002634 // An identifier that can be used to match events for this device.
2635 // The incremental identifier is locally generated and guaranteed not derived
2636 // from any globally unique hardware id.
2637 // For paired devices, it stays consistent between Bluetooth toggling for the
2638 // same remote device.
2639 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2640 // session for the same remote device.
2641 // Default: 0 if the device's metric id is unknown.
2642 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002643}
2644
2645/**
2646 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2647 *
2648 * Logged from:
2649 * system/bt
2650 */
2651message BluetoothSmpPairingEventReported {
2652 // An identifier that can be used to match events for this device.
2653 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2654 // Salt: Randomly generated 256 bit value
2655 // Hash algorithm: HMAC-SHA256
2656 // Size: 32 byte
2657 // Default: null or empty if the device identifier is not known
2658 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2659 // SMP command sent or received over L2CAP
2660 // Default: CMD_UNKNOWN
2661 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2662 // Whether this command is sent or received
2663 // Default: DIRECTION_UNKNOWN
2664 optional android.bluetooth.DirectionEnum direction = 3;
2665 // SMP failure reason code
2666 // Default: PAIRING_FAIL_REASON_DEFAULT
2667 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002668 // An identifier that can be used to match events for this device.
2669 // The incremental identifier is locally generated and guaranteed not derived
2670 // from any globally unique hardware id.
2671 // For paired devices, it stays consistent between Bluetooth toggling for the
2672 // same remote device.
2673 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2674 // session for the same remote device.
2675 // Default: 0 if the device's metric id is unknown.
2676 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002677}
2678
2679/**
Jack He815cdba2019-01-30 17:24:55 -08002680 * Logs when a Bluetooth socket’s connection state changed
2681 *
2682 * Logged from:
2683 * system/bt
2684 */
2685message BluetoothSocketConnectionStateChanged {
2686 // An identifier that can be used to match events for this device.
2687 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2688 // Salt: Randomly generated 256 bit value
2689 // Hash algorithm: HMAC-SHA256
2690 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002691 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002692 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002693 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002694 // Default 0 when unknown or don't care
2695 optional int32 port = 2;
2696 // Socket type as mentioned in
2697 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2698 // Default: SOCKET_TYPE_UNKNOWN
2699 optional android.bluetooth.SocketTypeEnum type = 3;
2700 // Socket connection state
2701 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2702 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2703 // Number of bytes sent to remote device during this connection
2704 optional int64 tx_bytes = 5;
2705 // Number of bytes received from remote device during this connection
2706 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002707 // Socket owner's UID
2708 optional int32 uid = 7 [(is_uid) = true];
2709 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2710 // |port| must be spawned by |server_port|
2711 // Default 0 when unknown or don't care
2712 optional int32 server_port = 8;
2713 // Whether this is a server listener socket
2714 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002715 // An identifier that can be used to match events for this device.
2716 // The incremental identifier is locally generated and guaranteed not derived
2717 // from any globally unique hardware id.
2718 // For paired devices, it stays consistent between Bluetooth toggling for the
2719 // same remote device.
2720 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2721 // session for the same remote device.
2722 // Default: 0 if the device's metric id is unknown.
2723 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002724}
2725
2726/**
Jack He71426802019-04-02 13:32:52 -07002727 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2728 *
2729 * Logged from:
2730 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2731 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2732 *
2733 */
2734message BluetoothClassOfDeviceReported {
2735 // An identifier that can be used to match events for this device.
2736 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2737 // Salt: Randomly generated 256 bit value
2738 // Hash algorithm: HMAC-SHA256
2739 // Size: 32 byte
2740 // Default: null or empty if this is a server listener socket
2741 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2742 // Class of Device (CoD) value including both Major, Minor device class and service class
2743 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2744 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2745 // Default: 0
2746 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002747 // An identifier that can be used to match events for this device.
2748 // The incremental identifier is locally generated and guaranteed not derived
2749 // from any globally unique hardware id.
2750 // For paired devices, it stays consistent between Bluetooth toggling for the
2751 // same remote device.
2752 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2753 // session for the same remote device.
2754 // Default: 0 if the device's metric id is unknown.
2755 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002756}
2757
2758/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002759 * Logs when something is plugged into or removed from the USB-C connector.
2760 *
2761 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002762 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002763 */
2764message UsbConnectorStateChanged {
2765 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002766 STATE_DISCONNECTED = 0;
2767 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002768 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002769 optional State state = 1
2770 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2771 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002772 // Last active session in ms.
2773 // 0 when the port is in connected state.
2774 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002775}
2776
2777/**
2778 * Logs the reported speaker impedance.
2779 *
2780 * Logged from:
2781 * Vendor audio implementation.
2782 */
2783message SpeakerImpedanceReported {
2784 optional int32 speaker_location = 1;
2785 optional int32 impedance = 2;
2786}
2787
2788/**
2789 * Logs the report of a failed hardware.
2790 *
2791 * Logged from:
2792 * Vendor HALs.
2793 *
2794 */
2795message HardwareFailed {
2796 enum HardwareType {
2797 HARDWARE_FAILED_UNKNOWN = 0;
2798 HARDWARE_FAILED_MICROPHONE = 1;
2799 HARDWARE_FAILED_CODEC = 2;
2800 HARDWARE_FAILED_SPEAKER = 3;
2801 HARDWARE_FAILED_FINGERPRINT = 4;
2802 }
2803 optional HardwareType hardware_type = 1;
2804
Maggie White6dcd8572019-01-31 14:11:50 -08002805 /**
2806 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002807 * the same hardware_type. The specific locations are vendor defined integers,
2808 * referring to board-specific numbering schemes.
2809 */
2810 optional int32 hardware_location = 2;
2811
Maggie White6dcd8572019-01-31 14:11:50 -08002812 /**
2813 * failure_code is specific to the HardwareType of the failed hardware.
2814 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002815 */
Maggie White6dcd8572019-01-31 14:11:50 -08002816 enum HardwareErrorCode {
2817 UNKNOWN = 0;
2818 COMPLETE = 1;
2819 SPEAKER_HIGH_Z = 2;
2820 SPEAKER_SHORT = 3;
2821 FINGERPRINT_SENSOR_BROKEN = 4;
2822 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002823 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002824 }
2825 optional int32 failure_code = 3;
2826}
2827
2828/**
2829 * Log an event when the device has been physically dropped.
2830 * Reported from the /vendor partition.
2831 */
2832message PhysicalDropDetected {
2833 // Confidence that the event was actually a drop, 0 -> 100
2834 optional int32 confidence_pctg = 1;
2835 // Peak acceleration of the drop, in 1/1000s of a g.
2836 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002837 // Duration of freefall in ms
2838 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002839}
2840
2841/**
2842 * Log bucketed battery charge cycles.
2843 *
2844 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002845 * a given charge point. For example, if 10 cycle buckets are
2846 * initialized, bucket 1 is the lowest 1/10th of the battery,
2847 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002848 *
2849 * Logged from:
2850 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2851 */
2852message ChargeCyclesReported {
2853 optional int32 cycle_bucket_1 = 1;
2854 optional int32 cycle_bucket_2 = 2;
2855 optional int32 cycle_bucket_3 = 3;
2856 optional int32 cycle_bucket_4 = 4;
2857 optional int32 cycle_bucket_5 = 5;
2858 optional int32 cycle_bucket_6 = 6;
2859 optional int32 cycle_bucket_7 = 7;
2860 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002861 optional int32 cycle_bucket_9 = 9;
2862 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002863}
2864
2865/**
Howard Roa46b6582018-09-18 16:45:02 -07002866 * Log battery health snapshot.
2867 *
2868 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2869 * are snapshotted periodically over 24hrs.
2870 */
2871message BatteryHealthSnapshot {
2872 enum BatterySnapshotType {
2873 UNKNOWN = 0;
2874 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2875 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2876 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2877 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2878 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2879 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2880 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2881 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2882 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2883 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2884 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2885 }
2886 optional BatterySnapshotType type = 1;
2887 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002888 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002889 // Voltage Battery Voltage, in microVolts.
2890 optional int32 voltage_micro_volt = 3;
2891 // Current Battery current, in microAmps.
2892 optional int32 current_micro_amps = 4;
2893 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2894 optional int32 open_circuit_micro_volt = 5;
2895 // Resistance Battery Resistance, in microOhms.
2896 optional int32 resistance_micro_ohm = 6;
2897 // Level Battery Level, as % of full.
2898 optional int32 level_percent = 7;
2899}
2900
2901/**
2902 * Log slow I/O operations on the primary storage.
2903 */
2904message SlowIo {
2905 // Classifications of IO Operations.
2906 enum IoOperation {
2907 UNKNOWN = 0;
2908 READ = 1;
2909 WRITE = 2;
2910 UNMAP = 3;
2911 SYNC = 4;
2912 }
2913 optional IoOperation operation = 1;
2914
2915 // The number of slow IO operations of this type over 24 hours.
2916 optional int32 count = 2;
2917}
2918
2919/**
2920 * Log battery caused shutdown with the last recorded voltage.
2921 */
2922message BatteryCausedShutdown {
2923 // The last recorded battery voltage prior to shutdown.
2924 optional int32 last_recorded_micro_volt = 1;
2925}
2926
2927/**
Tej Singha72344992019-04-17 18:55:08 -07002928 * Logs when ThermalService receives throttling events.
2929 *
2930 * Logged from:
2931 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2932 */
2933message ThermalThrottlingSeverityStateChanged {
2934 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2935 optional android.os.TemperatureTypeEnum sensor_type = 1;
2936
2937 // The name of the temperature source. Eg. CPU0
2938 optional string sensor_name = 2;
2939
2940 // Temperature in tenths of a degree C.
2941 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2942 optional int32 temperature_deci_celsius = 3;
2943
2944 // Relative severity of the throttling, see enum definition.
2945 optional android.os.ThrottlingSeverityEnum severity = 4;
2946}
2947
2948/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002949 * Logs the duration of a davey (jank of >=700ms) when it occurs
2950 *
2951 * Logged from:
2952 * frameworks/base/libs/hwui/JankTracker.cpp
2953 */
2954message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002955 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002956 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002957
Tej Singhbb8554a2018-01-26 11:59:14 -08002958 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002959 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002960}
2961
2962/**
Bookatze5885242017-10-24 20:10:31 -07002963 * Logs phone signal strength changes.
2964 *
2965 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002966 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002967 */
2968message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002969 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2970 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002971}
2972
Yangster4ccebea2018-10-09 17:09:02 -07002973
2974/**
2975 * Logs when the phone state, sim state or signal strength changes
2976 *
2977 * Logged from:
2978 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2979 */
2980message PhoneServiceStateChanged {
2981 optional android.telephony.ServiceStateEnum state = 1;
2982 optional android.telephony.SimStateEnum sim_state = 2;
2983 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2984}
2985
2986/**
2987 * Logs when the phone becomes on or off.
2988 *
2989 * Logged from:
2990 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2991 */
2992message PhoneStateChanged {
2993 enum State {
2994 OFF = 0;
2995 ON = 1;
2996 }
2997 optional State state = 1;
2998}
2999
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003000message BackGesture {
3001 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003002 DEFAULT_BACK_TYPE = 0;
3003 COMPLETED = 1;
3004 COMPLETED_REJECTED = 2; // successful because coming from rejected area
3005 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
3006 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
3007 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
3008 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
3009 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
3010 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003011 }
3012 optional BackType type = 1;
3013
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003014 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
3015 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
3016 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
3017 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
3018 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
3019 optional int32 left_boundary = 8; // left edge width + left inset
3020 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
3021
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003022 enum WindowHorizontalLocation {
3023 DEFAULT_LOCATION = 0;
3024 LEFT = 1;
3025 RIGHT = 2;
3026 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003027 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003028}
3029
3030message ExclusionRectStateChanged {
3031 optional string component_name = 1; // if not available, simply packageName
3032 optional int32 requested_height = 2; // px
3033 optional int32 rejected_height = 3; // px
3034
3035 enum WindowHorizontalLocation {
3036 DEFAULT_LOCATION = 0;
3037 LEFT = 1;
3038 RIGHT = 2;
3039 }
3040 optional WindowHorizontalLocation x_location = 4;
3041 optional bool landscape = 5;
3042 optional bool splitscreen = 6;
3043 optional int32 duration_millis = 7;
3044}
3045
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003046/**
3047 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3048 *
3049 * Logged from:
3050 * packages/apps/Launcher3
3051 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003052message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003053 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003054 optional android.stats.launcher.LauncherState src_state = 2;
3055 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003056 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3057 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3058
3059 // The event id (e.g., app launch, drag and drop, long press)
3060 optional int32 event_id = 6;
3061 // The event's source or target id (e.g., icon, task, button)
3062 optional int32 target_id = 7;
3063 // If the target needs to be tracked, use this id field
3064 optional int32 instance_id = 8;
3065 optional int32 uid = 9 [(is_uid) = true];
3066 optional string package_name = 10;
3067 optional string component_name = 11;
3068
3069 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003070 optional int32 grid_x = 12 [default = -1];
3071 optional int32 grid_y = 13 [default = -1];
3072 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003073
3074 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003075 optional int32 grid_x_parent = 15 [default = -1];
3076 optional int32 grid_y_parent = 16 [default = -1];
3077 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003078
3079 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3080 optional int32 hierarchy = 18;
3081
3082 optional bool is_work_profile = 19;
3083
3084 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003085 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003086
3087 // e.g., folderLabelState can be captured in the following two fields
3088 optional int32 from_state = 21;
3089 optional int32 to_state = 22;
3090
3091 // e.g., autofilled or suggested texts that are not user entered
3092 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003093
3094 // e.g., number of contents inside a container (e.g., icons inside a folder)
3095 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003096}
3097
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003098/**
3099 * Used for snapshot of the HomeScreen UI elements
3100 *
3101 * Logged from:
3102 * packages/apps/Launcher3
3103 */
3104message LauncherStaticLayout {
3105 // The event id (e.g., snapshot, drag and drop)
3106 optional int32 event_id = 1;
3107 // The event's source or target id (e.g., icon, shortcut, widget)
3108 optional int32 target_id = 2;
3109 // If the target needs to be tracked, use this id field
3110 optional int32 instance_id = 3;
3111 optional int32 uid = 4 [(is_uid) = true];
3112 optional string package_name = 5;
3113 optional string component_name = 6;
3114
3115 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003116 optional int32 grid_x = 7 [default = -1];
3117 optional int32 grid_y = 8 [default = -1];
3118 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003119
3120 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003121 // e.g., when used with widgets target, use these values for (span_x, span_y)
3122 optional int32 grid_x_parent = 10 [default = -1];
3123 optional int32 grid_y_parent = 11 [default = -1];
3124 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003125
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003126 // UNKNOWN = 0
3127 // HOTSEAT = 1
3128 // WORKSPACE = 2
3129 // FOLDER_HOTSEAT = 3
3130 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003131 optional int32 hierarchy = 13;
3132
3133 optional bool is_work_profile = 14;
3134
3135 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3136 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003137
3138 // e.g., number of icons inside a folder
3139 optional int32 cardinality = 16;
3140
3141 // e.g., (x, y) span of the widget inside homescreen grid system
3142 optional int32 span_x = 17 [default = 1];
3143 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003144}
3145
3146/**
3147 * Logs when Wallpaper or ThemePicker UI has changed.
3148 *
3149 * Logged from:
3150 * packages/apps/ThemePicker
3151 * packages/apps/WallpaperPicker2
3152 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003153message StyleUIChanged {
3154 optional android.stats.style.Action action = 1;
3155 optional int32 color_package_hash = 2;
3156 optional int32 font_package_hash = 3;
3157 optional int32 shape_package_hash = 4;
3158 optional int32 clock_package_hash = 5;
3159 optional int32 launcher_grid = 6;
3160 optional int32 wallpaper_category_hash = 7;
3161 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003162 optional int32 color_preference = 9;
3163 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003164}
3165
David Chenc28b2bb2017-10-24 12:52:52 -07003166/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003167 * Logs when Settings UI has changed.
3168 *
3169 * Logged from:
3170 * packages/apps/Settings
3171 */
3172message SettingsUIChanged {
3173 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003174 * Where this SettingsUIChange event comes from. For example, if
3175 * it's a PAGE_VISIBLE event, where the page is opened from.
3176 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003177 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003178
3179 /**
3180 * What the UI action is.
3181 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003182 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003183
3184 /**
3185 * Where the action is happening
3186 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003187 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003188
3189 /**
3190 * What preference changed in this event.
3191 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003192 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003193
3194 /**
3195 * The new value of the changed preference.
3196 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003197 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003198}
3199
3200/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003201 * Logs basic timing information about touch events.
3202 * Reported at most every 5 minutes while device is being interacted with.
3203 *
3204 * Logged from:
3205 * frameworks/native/services/inputflinger
3206 */
3207message TouchEventReported {
3208 /**
3209 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003210 * and the standard deviation of the time spent processing touchscreen events
3211 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003212 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003213 * On supported devices, the starting point is taken during the hard interrupt inside the
3214 * kernel touch driver. On all other devices, the starting point is taken inside
3215 * the kernel's input event subsystem upon receipt of the input event.
3216 * The ending point is taken inside InputDispatcher, just after the input event
3217 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003218 */
3219 // Minimum value
3220 optional float latency_min_micros = 1;
3221 // Maximum value
3222 optional float latency_max_micros = 2;
3223 // Average value
3224 optional float latency_mean_micros = 3;
3225 // Standard deviation
3226 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003227 // Number of touch events (input_event) in this report
3228 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003229}
3230
3231/**
Philip Quinn0eded622019-01-29 12:46:28 -08003232 * Logs gesture classification and timing information for touch events.
3233 *
3234 * Logged from:
3235 * frameworks/base/core/java/android/view/GestureDetector.java
3236 * frameworks/base/core/java/android/view/View.java
3237 */
3238message TouchGestureClassified {
3239 // The source of the classification (e.g. Java class name).
3240 optional string source = 1;
3241
3242 enum Classification {
3243 UNKNOWN_CLASSIFICATION = 0;
3244 SINGLE_TAP = 1;
3245 DOUBLE_TAP = 2;
3246 LONG_PRESS = 3;
3247 DEEP_PRESS = 4;
3248 SCROLL = 5;
3249 }
3250 // The classification of the gesture.
3251 optional Classification classification = 2;
3252
3253 // The interval from the start of a touch event stream until the
3254 // classification was made.
3255 optional int32 latency_millis = 3;
3256
3257 // The distance from the location of the first touch event to the
3258 // location of the touch event when the classification was made.
3259 optional float displacement_px = 4;
3260}
3261
3262/**
David Chenc28b2bb2017-10-24 12:52:52 -07003263 * Logs that a setting was updated.
3264 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003265 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003266 * The tag and is_default allow resetting of settings to default values based on the specified
3267 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3268 */
3269message SettingChanged {
3270 // The name of the setting.
3271 optional string setting = 1;
3272
3273 // The change being imposed on this setting. May represent a number, eg "3".
3274 optional string value = 2;
3275
3276 // The new value of this setting. For most settings, this is same as value. For some settings,
3277 // value is +X or -X where X represents an element in a set. For example, if the previous value
3278 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3279 // The +/- feature is currently only used for location_providers_allowed.
3280 optional string new_value = 3;
3281
3282 // The previous value of this setting.
3283 optional string prev_value = 4;
3284
3285 // The tag used with the is_default for resetting sets of settings. This is generally null.
3286 optional string tag = 5;
3287
Bookatz90867622018-01-31 15:05:57 -08003288 // True if this setting with tag should be resettable.
3289 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003290
David Chenbd789912018-03-16 17:19:55 -07003291 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003292 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003293
3294 enum ChangeReason {
3295 UPDATED = 1; // Updated can be an insertion or an update.
3296 DELETED = 2;
3297 }
3298 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003299}
Chenjie Yub3dda412017-10-24 13:41:59 -07003300
Chenjie Yu05013b32017-11-21 10:21:41 -08003301/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003302 * Logs activity going to foreground or background
3303 *
3304 * Logged from:
3305 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3306 */
3307message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003308 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003309 optional string pkg_name = 2;
3310 optional string class_name = 3;
3311
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003312 enum State {
3313 BACKGROUND = 0;
3314 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003315 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003316 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003317}
David Chenc8a43242017-10-17 16:23:28 -07003318
3319/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003320 * Logs when a volume entered low Storage state.
3321 * Logged from:
3322 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3323 */
3324message LowStorageStateChanged {
3325 // Volume that ran out of storage.
3326 optional string volume_description = 1;
3327
3328 enum State {
3329 UNKNOWN = 0;
3330 OFF = 1;
3331 ON = 2;
3332 }
3333 optional State state = 2;
3334}
3335
3336/**
3337 * Logs when an app is downgraded.
3338 * Logged from:
3339 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3340 */
3341message AppDowngraded {
3342 optional string package_name = 1;
3343 // Size of the package (all data) before being downgraded.
3344 optional int64 size_in_bytes_before = 2;
3345 // Size of the package (all data) after being downgraded.
3346 optional int64 size_in_bytes_after = 3;
3347
3348 optional bool aggressive = 4;
3349}
3350
3351/**
3352 * Logs when an app is optimized after being downgraded.
3353 * Logged from:
3354 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3355 */
3356message AppOptimizedAfterDowngraded {
3357 optional string package_name = 1;
3358}
3359
3360/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003361 * Logs whenever an app is installed on external storage.
3362 * Logged from:
3363 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3364 */
3365message AppInstallOnExternalStorageReported {
3366 // The type of external storage.
3367 optional android.stats.storage.ExternalStorageType storage_type = 1;
3368 // The name of the package that is installed on the sd card.
3369 optional string package_name = 2;
3370}
3371
3372/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003373 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003374 * Logged from:
3375 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3376 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003377message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003378 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003379
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003380 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003381
3382 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003383 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003384 optional string process_name = 3;
3385
3386 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003387 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003388
3389 optional string package_name = 5;
3390
3391 enum InstantApp {
3392 UNAVAILABLE = 0;
3393 FALSE = 1;
3394 TRUE = 2;
3395 }
3396 optional InstantApp is_instant_app = 6;
3397
3398 enum ForegroundState {
3399 UNKNOWN = 0;
3400 BACKGROUND = 1;
3401 FOREGROUND = 2;
3402 }
3403 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003404
3405 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003406}
David Chen9e3808c2017-11-20 17:25:34 -08003407
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003408/**
3409 * Logs when a WTF (What a Terrible Failure) happened.
3410 * Logged from:
3411 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3412 */
3413message WTFOccurred {
3414 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003415
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003416 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003417
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003418 // The name of the process.
3419 // system_server if it is not by an app
3420 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003421
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003422 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003423 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003424
3425 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003426}
3427
3428/**
3429 * Logs when system server reports low memory.
3430 * Logged from:
3431 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3432 */
3433message LowMemReported {
3434}
3435
3436/**
3437 * Logs when an app ANR (App Not Responding) occurs.
3438 * Logged from:
3439 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3440 */
3441message ANROccurred {
3442 optional int32 uid = 1 [(is_uid) = true];
3443
3444 optional string process_name = 2;
3445
3446 optional string short_component_name = 3;
3447
3448 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003449
3450 enum InstantApp {
3451 UNAVAILABLE = 0;
3452 FALSE = 1;
3453 TRUE = 2;
3454 }
3455 optional InstantApp is_instant_app = 5;
3456
3457 enum ForegroundState {
3458 UNKNOWN = 0;
3459 BACKGROUND = 1;
3460 FOREGROUND = 2;
3461 }
3462 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003463
3464 optional android.server.ErrorSource error_source = 7;
3465
3466 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003467}
3468
Bookatza7020bd2018-08-28 16:29:35 -07003469/**
3470 * Logs when the vibrator state changes.
3471 * Logged from:
3472 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3473 */
3474message VibratorStateChanged {
3475 repeated AttributionNode attribution_node = 1;
3476
3477 enum State {
3478 OFF = 0;
3479 ON = 1;
3480 }
3481 optional State state = 2;
3482
3483 // Duration (in milliseconds) requested to keep the vibrator on.
3484 // Only applicable for State == ON.
3485 optional int64 duration_millis = 3;
3486}
3487
David Chen0a368b22017-12-06 16:28:16 -08003488/*
3489 * Allows other apps to push events into statsd.
3490 * Logged from:
3491 * frameworks/base/core/java/android/util/StatsLog.java
3492 */
David Chen0b5c90c2018-01-25 16:51:49 -08003493message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003494 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003495 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003496
3497 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3498 optional int32 label = 2;
3499
3500 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3501 // predicates for the metrics).
3502 enum State {
3503 UNKNOWN = 0;
3504 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3505 STOP = 2;
3506 START = 3;
3507 }
3508 optional State state = 3;
3509}
3510
David Chen9e3808c2017-11-20 17:25:34 -08003511/**
Bookatz7948c872018-09-04 12:58:33 -07003512 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3513 * For example, this could be due to the user manually changing the time.
3514 *
3515 * Logged from:
3516 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3517 */
3518message WallClockTimeShifted {
3519 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3520 optional int64 wall_clock_timestamp_millis = 1;
3521}
3522
3523/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003524 * Logs when statsd detects an anomaly.
3525 *
3526 * Logged from:
3527 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3528 */
3529message AnomalyDetected {
3530 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003531 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003532
Yangster-mac94e197c2018-01-02 16:03:03 -08003533 // Id of the config whose anomaly detection alert fired.
3534 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003535
Yangster-mac94e197c2018-01-02 16:03:03 -08003536 // Id of the alert (i.e. name of the anomaly that was detected).
3537 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003538}
3539
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003540message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003541 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003542 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003543
3544 // The app package name.
3545 optional string pkg_name = 2;
3546
3547 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003548 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003549 WARM = 1;
3550 HOT = 2;
3551 COLD = 3;
3552 }
3553 // The transition type.
3554 optional TransitionType type = 3;
3555
3556 // The activity name.
3557 optional string activity_name = 4;
3558
3559 // The name of the calling app. Empty if not set.
3560 optional string calling_pkg_name = 5;
3561
3562 // Whether the app is an instant app.
3563 optional bool is_instant_app = 6;
3564
3565 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003566 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003567
Bookatz80d11a02018-01-16 10:46:35 -08003568 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003569
David Chen0b5c90c2018-01-25 16:51:49 -08003570 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003571 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003572 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003573 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003574 optional int32 bind_application_delay_millis = 11;
3575 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003576
3577 // Empty if not set.
3578 optional string launch_token = 13;
3579
Calin Juravle759fbda2018-02-20 19:52:30 +00003580 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003581 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003582
3583 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003584 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003585}
3586
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003587message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003588 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003589 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003590
3591 // The app package name.
3592 optional string pkg_name = 2;
3593
3594 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003595 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003596 WARM = 1;
3597 HOT = 2;
3598 COLD = 3;
3599 }
3600 // The transition type.
3601 optional TransitionType type = 3;
3602
3603 // The activity name.
3604 optional string activity_name = 4;
3605}
3606
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003607message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003608 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003609 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003610
3611 // The app package name.
3612 optional string pkg_name = 2;
3613
3614 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003615 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003616 WITH_BUNDLE = 1;
3617 WITHOUT_BUNDLE = 2;
3618 }
3619 // The transition type.
3620 optional TransitionType type = 3;
3621
3622 // The activity name.
3623 optional string activity_name = 4;
3624
3625 optional bool transition_process_running = 5;
3626
3627 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003628 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003629}
3630
Bookatz8fcd09a2017-12-18 13:01:10 -08003631/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003632 * Logs a picture-in-picture action
3633 * Logged from:
3634 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3635 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3636 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3637 */
3638message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003639 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003640 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003641
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003642 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003643
Chenjie Yu52cacc62017-12-08 18:11:45 -08003644 enum State {
3645 ENTERED = 1;
3646 EXPANDED_TO_FULL_SCREEN = 2;
3647 MINIMIZED = 3;
3648 DISMISSED = 4;
3649 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003650 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003651}
3652
3653/**
Chenjie Yue8904192017-12-08 19:12:57 -08003654 * Logs overlay action
3655 * Logged from:
3656 * services/core/java/com/android/server/wm/Session.java
3657 */
3658message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003659 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003660
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003661 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003662
3663 optional bool using_alert_window = 3;
3664
3665 enum State {
3666 ENTERED = 1;
3667 EXITED = 2;
3668 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003669 optional State state = 4
3670 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003671}
3672
Adam Bookatz38767932020-02-05 12:13:40 -08003673/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003674 * Logs foreground service starts and stops.
3675 * Note that this is not when a service starts or stops, but when it is
3676 * considered foreground.
3677 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003678 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003679 */
3680message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003681 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003682 // package_name + "/" + class_name
3683 optional string short_name = 2;
3684
3685 enum State {
3686 ENTER = 1;
3687 EXIT = 2;
3688 }
3689 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003690
3691 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3692 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3693 optional bool allow_while_in_use_permission = 4;
3694}
3695
3696/**
3697 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3698 * A foreground service session is any continuous period during which the uid holds at least one
3699 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3700 * Accesses initiated while the uid is in the TOP state are ignored.
3701 * Sessions with no attempted accesses are not logged.
3702 * Logged from
3703 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3704 */
3705message ForegroundServiceAppOpSessionEnded {
3706 optional int32 uid = 1 [(is_uid) = true];
3707
3708 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003709 // Only following four ops are logged
3710 // COARSE_LOCATION = 0
3711 // FINE_LOCATION = 1
3712 // CAMERA = 26
3713 // RECORD_AUDIO = 27
3714 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003715
3716 // The uid's permission mode for accessing the AppOp during this fgs session.
3717 enum Mode {
3718 MODE_UNKNOWN = 0;
3719 MODE_ALLOWED = 1; // Always allowed
3720 MODE_IGNORED = 2; // Denied
3721 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3722 }
3723 optional Mode app_op_mode = 3;
3724
3725 // Number of times this AppOp was requested and allowed.
3726 optional int32 count_ops_accepted = 4;
3727 // Number of times this AppOp was requested but denied.
3728 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003729}
3730
Chenjie Yue8904192017-12-08 19:12:57 -08003731/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003732 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3733 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3734 * attributed back to the parent (host) uid. One example is Chrome.
3735 *
3736 * Logged from:
3737 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3738 */
3739message IsolatedUidChanged {
3740 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003741 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003742 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003743 optional int32 parent_uid = 1;
3744
3745 optional int32 isolated_uid = 2;
3746
3747 // We expect an isolated uid to be removed before if it's used for another parent uid.
3748 enum Event {
3749 REMOVED = 0;
3750 CREATED = 1;
3751 }
3752 optional Event event = 3;
3753}
3754
3755/*
3756 * Logs the reception of an incoming network packet causing the main system to wake up for
3757 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3758 * and processed by WakeupController.cpp.
3759 */
3760message PacketWakeupOccurred {
3761 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3762 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003763 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003764 // The interface name on which the packet was received.
3765 optional string iface = 2;
3766 // The ethertype value of the packet.
3767 optional int32 ethertype = 3;
3768 // String representation of the destination MAC address of the packet.
3769 optional string destination_hardware_address = 4;
3770 // String representation of the source address of the packet if this was an IP packet.
3771 optional string source_ip = 5;
3772 // String representation of the destination address of the packet if this was an IP packet.
3773 optional string destination_ip = 6;
3774 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3775 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3776 // families.
3777 optional int32 ip_next_header = 7;
3778 // The source port if this was a TCP or UDP packet.
3779 optional int32 source_port = 8;
3780 // The destination port if this was a TCP or UDP packet.
3781 optional int32 destination_port = 9;
3782}
3783
3784/*
3785 * Logs the memory stats for an app on startup.
3786 * Logged from:
3787 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3788 */
3789message AppStartMemoryStateCaptured {
3790 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003791 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003792
3793 // The process name.
3794 optional string process_name = 2;
3795
3796 // The activity name.
3797 optional string activity_name = 3;
3798
3799 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003800 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003801
3802 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003803 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003804
3805 // RSS
3806 optional int64 rss_in_bytes = 6;
3807
3808 // CACHE
3809 optional int64 cache_in_bytes = 7;
3810
3811 // SWAP
3812 optional int64 swap_in_bytes = 8;
3813}
3814
3815/*
3816 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3817 * for LMK event.
3818 * Logged from:
3819 * system/core/lmkd/lmkd.c
3820 */
3821message LmkStateChanged {
3822 enum State {
3823 UNKNOWN = 0;
3824 START = 1;
3825 STOP = 2;
3826 }
3827 optional State state = 1;
3828}
3829
3830/*
3831 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3832 * Logged from:
3833 * system/core/lmkd/lmkd.c
3834 */
3835message LmkKillOccurred {
3836 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003837 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003838
3839 // The process name.
3840 optional string process_name = 2;
3841
3842 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003843 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003844
3845 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003846 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003847
3848 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003849 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003850
3851 // RSS
3852 optional int64 rss_in_bytes = 6;
3853
3854 // CACHE
3855 optional int64 cache_in_bytes = 7;
3856
3857 // SWAP
3858 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003859
3860 // The elapsed real time of start of the process.
3861 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003862
3863 // Min oom adj score considered by lmkd.
3864 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003865}
3866
Rajeev Kumar51b54602018-03-01 12:18:26 -08003867/*
3868 * Logs when the ActivityManagerService detects that an app died.
3869 *
3870 * Logged from:
3871 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3872 */
3873message AppDied {
3874 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003875 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003876}
3877
Howard Ro21a039c2018-08-06 14:55:47 -07003878/**
3879 * An atom for generic metrics logging. Available from Android Q.
3880 */
3881message GenericAtom {
3882 // The uid of the application that sent this custom atom.
3883 optional int32 uid = 1 [(is_uid) = true];
3884
3885 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003886 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003887}
3888
Tej Singhd6d6d772018-09-05 17:41:25 -07003889/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003890 * Atom for simple logging of user interaction and impression events, such as "the user touched
3891 * this button" or "this dialog was displayed".
3892 * Keep the UI event stream clean: don't use for system or background events.
3893 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003894 *
3895 * Logged from:
3896 * frameworks/base/services/core/java/com/android/server/
3897 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003898 */
3899message UiEventReported {
3900 // The event_id.
3901 optional int32 event_id = 1;
3902 // The event's source or target uid and package, if applicable.
3903 // For example, the package posting a notification, or the destination package of a share.
3904 optional int32 uid = 2 [(is_uid) = true];
3905 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003906 // An identifier used to disambiguate which logs refer to a particular instance of some
3907 // UI element. Useful when there might be multiple instances simultaneously active.
3908 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003909}
3910
3911/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003912 * Reports a notification was created or updated.
3913 *
3914 * Logged from:
3915 * frameworks/base/services/core/java/com/android/server/notification/
3916 */
3917message NotificationReported {
3918 // The event_id (as for UiEventReported).
3919 optional int32 event_id = 1;
3920 // The notifying app's uid and package.
3921 optional int32 uid = 2 [(is_uid) = true];
3922 optional string package_name = 3;
3923 // A small system-assigned identifier for the notification.
3924 // Locally probably-unique, but expect collisions across users and/or days.
3925 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003926 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3927 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003928
3929 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003930 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3931 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3932 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003933
3934 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003935 optional string category = 10; // App-assigned notification category (API-defined strings)
3936 optional int32 style = 11; // App-assigned notification style
3937 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003938
3939 // Ordering, importance and interruptiveness
3940
Will Brockman7614f6962020-02-10 19:43:03 -05003941 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003942
Will Brockman7614f6962020-02-10 19:43:03 -05003943 optional android.stats.sysui.NotificationImportance importance = 14;
3944 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003945
3946 enum NotificationImportanceExplanation {
3947 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3948 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3949 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3950 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3951 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3952 // Like _APP, but based on pre-channels priority signal.
3953 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3954 }
3955
Will Brockman7614f6962020-02-10 19:43:03 -05003956 optional NotificationImportanceExplanation importance_source = 16;
3957 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3958 optional NotificationImportanceExplanation importance_initial_source = 18;
3959 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3960 optional int32 assistant_hash = 20;
3961 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003962}
3963
3964message Notification {
3965 // The notifying app's uid and package.
3966 optional int32 uid = 1 [(is_uid) = true];
3967 optional string package_name = 2;
3968 // A small system-assigned identifier for the notification.
3969 optional int32 instance_id = 3;
3970
3971 // Grouping information.
3972 optional int32 group_instance_id = 4;
3973 optional bool is_group_summary = 5;
3974
3975 // The section of the shade that the notification is in.
3976 // See NotificationSectionsManager.PriorityBucket.
3977 enum NotificationSection {
3978 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003979 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003980 SECTION_MEDIA_CONTROLS = 2;
3981 SECTION_PEOPLE = 3;
3982 SECTION_ALERTING = 4;
3983 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003984 }
3985 optional NotificationSection section = 6;
3986}
3987
3988message NotificationList {
3989 repeated Notification notifications = 1; // An ordered sequence of notifications.
3990}
3991
3992/**
3993 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3994 *
3995 * Logged from:
3996 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3997 */
3998message NotificationPanelReported {
3999 // The event_id (as for UiEventReported).
4000 optional int32 event_id = 1;
4001 optional int32 num_notifications = 2;
4002 // The notifications in the panel, in the order that they appear there.
4003 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
4004}
4005
4006/**
4007 * Reports a notification channel, or channel group, was created, updated, or deleted.
4008 *
4009 * Logged from:
4010 * frameworks/base/services/core/java/com/android/server/notification/
4011 */
4012message NotificationChannelModified {
4013 // The event_id (as for UiEventReported).
4014 optional int32 event_id = 1;
4015 // The notifying app's uid and package.
4016 optional int32 uid = 2 [(is_uid) = true];
4017 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05004018 // Hash of app-assigned notification channel ID or channel-group ID
4019 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05004020 // Previous importance setting, if applicable
4021 optional android.stats.sysui.NotificationImportance old_importance = 5;
4022 // New importance setting
4023 optional android.stats.sysui.NotificationImportance importance = 6;
4024}
4025
4026
4027/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004028 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004029 *
4030 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004031 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004032 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004033message BiometricAcquired {
4034 // Biometric modality that was acquired.
4035 optional android.hardware.biometrics.ModalityEnum modality = 1;
4036 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4037 optional int32 user = 2;
4038 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4039 optional bool is_crypto = 3;
4040 // Action that the device is performing. Acquired messages are only expected for enroll and
4041 // authenticate. Other actions may indicate an error.
4042 optional android.hardware.biometrics.ActionEnum action = 4;
4043 // The client that this acquisition was received for.
4044 optional android.hardware.biometrics.ClientEnum client = 5;
4045 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4046 optional int32 acquire_info = 6;
4047 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4048 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004049 // Dictates if this message should trigger additional debugging.
4050 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004051}
4052
4053/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004054 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004055 *
4056 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004057 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004058 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004059message BiometricAuthenticated {
4060 // Biometric modality that was used.
4061 optional android.hardware.biometrics.ModalityEnum modality = 1;
4062 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4063 optional int32 user = 2;
4064 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4065 // storage.
4066 optional bool is_crypto = 3;
4067 // The client that this acquisition was received for.
4068 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004069 // If authentication requires user confirmation. See BiometricPrompt's
4070 // setRequireConfirmation(bool) method.
4071 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004072
Kevin Chyn1741a072019-01-17 11:54:40 -08004073 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004074 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004075 REJECTED = 1;
4076 PENDING_CONFIRMATION = 2;
4077 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004078 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004079
4080 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004081 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004082 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4083 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4084 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4085 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004086 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004087 // Dictates if this message should trigger additional debugging.
4088 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004089}
4090
4091/**
4092 * Logs when a biometric error occurs.
4093 *
4094 * Logged from:
4095 * frameworks/base/services/core/java/com/android/server/biometrics
4096 */
4097message BiometricErrorOccurred {
4098 // Biometric modality that was used.
4099 optional android.hardware.biometrics.ModalityEnum modality = 1;
4100 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4101 optional int32 user = 2;
4102 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4103 optional bool is_crypto = 3;
4104 // Action that the device is performing.
4105 optional android.hardware.biometrics.ActionEnum action = 4;
4106 // The client that this acquisition was received for.
4107 optional android.hardware.biometrics.ClientEnum client = 5;
4108 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4109 // are unique to modality.
4110 optional int32 error_info = 6;
4111 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4112 // by the vendor and not specified by the HIDL interface.
4113 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004114 // Dictates if this message should trigger additional debugging.
4115 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004116 // Time spent during the authentication attempt.
4117 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004118}
4119
4120/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004121 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004122 * Logged from:
4123 * frameworks/base/services/core/java/com/android/server/biometrics
4124 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004125message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004126 // Biometric modality.
4127 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004128 // Type of issue detected.
4129 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004130 // Dictates if this message should trigger additional debugging.
4131 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004132}
Howard Ro688ae182018-09-25 00:09:36 -07004133
joshmccloskey6f952b22019-03-25 20:59:35 -07004134/**
4135 * Logs when a biometric enrollment occurs.
4136 *
4137 * Logged from:
4138 * frameworks/base/services/core/java/com/android/server/biometrics
4139 */
4140message BiometricEnrolled {
4141 // Biometric modality that was used.
4142 optional android.hardware.biometrics.ModalityEnum modality = 1;
4143 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4144 optional int32 user = 2;
4145 // The amount of time the enrollment took in milliseconds.
4146 optional int64 latency_millis = 3;
4147 // Whether or not the enrollment was successful.
4148 optional bool success = 4;
4149}
4150
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004151/*
Tej Singh0d176952019-01-16 19:10:54 -08004152 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004153 */
Tej Singh0d176952019-01-16 19:10:54 -08004154message FlagFlipUpdateOccurred {
4155 // If the event is from a flag config package, specify the package name.
4156 optional string flag_flip_package_name = 1;
4157
4158 // The order id of the package
4159 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004160}
4161
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004162/**
4163 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004164 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004165 */
4166message TrainExperimentIds {
4167 repeated int64 experiment_id = 1;
4168}
4169
Yangster-macb89807e2018-11-15 21:10:57 -08004170/*
4171 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004172 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004173 */
4174message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004175 // Name of the train.
4176 optional string train_name = 1;
4177 // Version code for a "train" of packages that need to be installed atomically
4178 optional int64 train_version_code = 2;
4179 // After installation of this package, device requires a restart.
4180 optional bool requires_staging = 3;
4181 // Rollback should be enabled for this install.
4182 optional bool rollback_enabled = 4;
4183 // Requires low latency monitoring if possible.
4184 optional bool requires_low_latency_monitor = 5;
4185
Yangster-macb89807e2018-11-15 21:10:57 -08004186 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004187 UNKNOWN = 0;
4188 INSTALL_REQUESTED = 1;
4189 INSTALL_STARTED = 2;
4190 INSTALL_STAGED_NOT_READY = 3;
4191 INSTALL_STAGED_READY = 4;
4192 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004193 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4194 // and INSTALL_FAILURE_COMMIT.
4195 INSTALL_FAILURE = 6 [deprecated = true];
4196 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004197 INSTALL_CANCELLED = 7;
4198 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004199 INSTALLER_ROLLBACK_INITIATED = 9;
4200 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4201 INSTALLER_ROLLBACK_STAGED = 11;
4202 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4203 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4204 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4205 INSTALLER_ROLLBACK_SUCCESS = 15;
4206 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004207 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4208 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4209 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4210 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4211 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4212 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004213 INSTALL_FAILURE_DOWNLOAD = 23;
4214 INSTALL_FAILURE_STATE_MISMATCH = 24;
4215 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004216 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004217 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004218 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004219 // Possible experiment ids for monitoring this push.
4220 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4221 // user id
4222 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004223 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004224 // Whether or not this is a rollback event
4225 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004226}
4227
Tej Singhc9203082019-05-03 13:42:23 -07004228/* Test atom, is not logged anywhere */
4229message TestAtomReported {
4230 repeated AttributionNode attribution_node = 1;
4231 optional int32 int_field = 2;
4232 optional int64 long_field = 3;
4233 optional float float_field = 4;
4234 optional string string_field = 5;
4235 optional bool boolean_field = 6;
4236 enum State {
4237 UNKNOWN = 0;
4238 OFF = 1;
4239 ON = 2;
4240 }
4241 optional State state = 7;
4242 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4243}
4244
Maggie Whitefc1aa592018-11-28 21:55:23 -08004245/** Represents USB port overheat event. */
4246message UsbPortOverheatEvent {
4247 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4248 optional int32 plug_temperature_deci_c = 1;
4249
4250 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4251 optional int32 max_temperature_deci_c = 2;
4252
4253 /* Time between USB plug event and overheat threshold trip, in seconds. */
4254 optional int32 time_to_overheat_secs = 3;
4255
4256 /* Time between overheat threshold trip and hysteresis, in seconds. */
4257 optional int32 time_to_hysteresis_secs = 4;
4258
4259 /* Time between hysteresis and active mitigation ending, in seconds. */
4260 optional int32 time_to_inactive_secs = 5;
4261};
4262
Maggie White8735b852019-01-18 11:40:49 -08004263/**
4264 * Logs total effective full charge and discharge cycles on a battery.
4265 * Here are some examples of one effective cycle:
4266 * 1) the battery charges from 0% to 100% and drains back to 0%,
4267 * 2) charging from 50% to 100% and draining back to 50% twice.
4268 * Pulled from:
4269 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4270 */
4271message BatteryCycleCount {
4272 /* Number of total charge and discharge cycles on the system battery. */
4273 optional int32 cycle_count = 1;
4274}
4275
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004276/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004277 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4278 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004279 * Pulled from:
4280 * StatsCompanionService
4281 */
4282
Carmen Agimof12dec122019-03-06 16:14:38 +00004283message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004284
Carmen Agimof12dec122019-03-06 16:14:38 +00004285 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004286 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004287 PUBLIC = 1;
4288 PRIVATE = 2;
4289 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004290 }
4291
Carmen Agimof12dec122019-03-06 16:14:38 +00004292 // The type of external storage.
4293 optional android.stats.storage.ExternalStorageType storage_type = 1;
4294 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4295 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004296 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004297 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004298}
4299
Yangster-macb89807e2018-11-15 21:10:57 -08004300/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004301 * Logs when a connection becomes available and lost.
4302 * Logged in StatsCompanionService.java
4303 */
4304message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004305 // Id of the network.
4306 optional int32 net_id = 1;
4307
4308 enum State {
4309 UNKNOWN = 0;
4310 CONNECTED = 1;
4311 DISCONNECTED = 2;
4312 }
4313 // Connected state of a network.
4314 optional State state = 2;
4315}
4316
4317/**
4318 * Logs when a service starts and stops.
4319 * Logged from:
4320 * services/core/java/com/android/server/am/ActiveServices.java
4321 */
4322message ServiceStateChanged {
4323
4324 optional int32 uid = 1 [(is_uid) = true];
4325
4326 optional string package_name = 2;
4327
4328 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004329
4330 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004331 START = 1;
4332 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004333 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004334
4335 optional State state = 4;
4336}
4337
4338/**
4339 * Logs when a service is launched.
4340 * Logged from:
4341 * services/core/java/com/android/server/am/ActiveServices.java
4342 */
4343message ServiceLaunchReported {
4344
4345 optional int32 uid = 1 [(is_uid) = true];
4346
4347 optional string package_name = 2;
4348
4349 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004350}
Howard Ro688ae182018-09-25 00:09:36 -07004351
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004352/**
4353 * Logs when a hidden API is used.
4354 *
4355 * Logged from:
4356 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4357 */
4358message HiddenApiUsed {
4359 // The uid of the app making the hidden access.
4360 optional int32 uid = 1 [(is_uid) = true];
4361
4362 // Signature of the method or field accessed.
4363 optional string signature = 2;
4364
4365 enum AccessMethod {
4366 NONE = 0;
4367 REFLECTION = 1;
4368 JNI = 2;
4369 LINKING = 3;
4370 }
4371
4372 // Type of access.
4373 optional AccessMethod access_method = 3;
4374
4375 // Whether the access was prevented or not.
4376 optional bool access_denied = 4;
4377}
4378
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004379/**
4380 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4381 * - When user sees privacy chip
4382 * - When user clicks privacy chip
4383 * - How does the user exit the Privacy Dialog
4384 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004385 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4386 */
4387message PrivacyIndicatorsInteracted {
4388
4389 enum Type {
4390 UNKNOWN = 0;
4391 CHIP_VIEWED = 1;
4392 CHIP_CLICKED = 2;
4393 DIALOG_PRIVACY_SETTINGS = 3;
4394 DIALOG_DISMISS = 4;
4395 DIALOG_LINE_ITEM = 5;
4396 }
4397
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004398 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004399
4400 // Used if the type is LINE_ITEM
4401 optional string package_name = 2;
4402}
4403
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004404/**
4405 * Logs information about a package that is moved from the internal to external storage and vice
4406 * versa.
4407 * It logs the package name, the type of the external storage where the package is installed
4408 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4409 * and the move type: if it's from internal to external or the other way around.
4410 *
4411 * Logged from:
4412 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4413 */
4414message AppMovedStorageReported {
4415 enum MoveType {
4416 UNKNOWN = 0;
4417 TO_EXTERNAL = 1;
4418 TO_INTERNAL = 2;
4419 }
4420 // The type of the external storage.
4421 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4422 // The type of move.
4423 optional MoveType move_type = 2;
4424 // The name of the package that was moved.
4425 optional string package_name = 3;
4426}
4427
jianjin8f2dee02019-03-29 14:03:08 -07004428/**
4429 * Logs when system server watchdog occurs.
4430 * Logged from:
4431 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4432 */
4433message SystemServerWatchdogOccurred {
4434 optional string subject = 1;
4435}
4436
4437/**
4438 * Logs when new file added to tombstones.
4439 * Logged from:
4440 * frameworks/base/core/java/com/android/server/BootReceiver.java
4441 */
4442message TombStoneOccurred {
4443}
4444
Hai Zhang5d3328d2019-04-13 21:25:06 +08004445/*
4446 * Information about a role request
4447 *
4448 * Logged from:
4449 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4450 */
4451message RoleRequestResultReported {
4452 // UID of application requesting the role
4453 optional int32 requesting_uid = 1;
4454
4455 // Package name of application requesting the role
4456 optional string requesting_package_name = 2;
4457
4458 // The role to be granted
4459 optional string role_name = 3;
4460
4461 // The count of applications qualifying for the role
4462 optional int32 qualifying_count = 4;
4463
4464 // UID of application current granted the role
4465 optional int32 current_uid = 5;
4466
4467 // Package name of application current granted the role
4468 optional string current_package_name = 6;
4469
4470 // UID of another application that user chose to grant the role to, instead of the requesting
4471 // application
4472 optional int32 granted_another_uid = 7;
4473
4474 // Package name of another application that user chose to grant the role to, instead of the
4475 // requesting application
4476 optional string granted_another_package_name = 8;
4477
4478 enum Result {
4479 UNDEFINED = 0;
4480 // role request was ignored
4481 IGNORED = 1;
4482 // role request was ignored because it's already granted
4483 IGNORED_ALREADY_GRANTED = 2;
4484 // role request was ignored because the application isn't qualified
4485 IGNORED_NOT_QUALIFIED = 3;
4486 // role request was ignored because user said it should be always denied
4487 IGNORED_USER_ALWAYS_DENIED = 4;
4488 // role was granted by user action
4489 USER_GRANTED = 5;
4490 // role was denied by user action
4491 USER_DENIED = 6;
4492 // role was denied by user granting another application the role
4493 USER_DENIED_GRANTED_ANOTHER = 7;
4494 // role was denied and set to be always denied by the user
4495 USER_DENIED_WITH_ALWAYS = 8;
4496 }
4497 // The result of the role request
4498 optional Result result = 9;
4499}
4500
Mark Tabrya824a642019-11-05 12:26:12 -08004501/**
4502 * Logs when a Vehicle Maps Service client's connection state has changed
4503 *
4504 * Logged from:
4505 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4506 */
4507message VmsClientConnectionStateChanged {
4508 // The UID of the VMS client app
4509 optional int32 uid = 1 [(is_uid) = true];
4510
4511 enum State {
4512 UNKNOWN = 0;
4513 // Attempting to connect to the client
4514 CONNECTING = 1;
4515 // Client connection established
4516 CONNECTED = 2;
4517 // Client connection closed unexpectedly
4518 DISCONNECTED = 3;
4519 // Client connection closed by VMS
4520 TERMINATED = 4;
4521 // Error establishing the client connection
4522 CONNECTION_ERROR = 5;
4523 }
4524
4525 optional State state = 2;
4526}
4527
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004528/**
4529 * Logs when MediaProvider has successfully finished scanning a storage volume.
4530 *
4531 * Logged from:
4532 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4533 */
shafik43825842020-04-02 17:30:24 +01004534message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004535 enum Reason {
4536 // Scan triggered due to unknown reason
4537 UNKNOWN = 0;
4538 // Scan triggered due to storage volume being mounted
4539 MOUNTED = 1;
4540 // Scan triggered due to explicit user action or app request
4541 DEMAND = 2;
4542 // Scan triggered due to idle maintenance
4543 IDLE = 3;
4544 }
4545
4546 // Volume type that this event pertains to
4547 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4548 // Reason why this scan was triggered
4549 optional Reason reason = 2;
4550 // Total number of files scanned
4551 optional int64 item_count = 3;
4552 // Duration of scan, normalized per file
4553 optional float normalized_duration_millis = 4;
4554 // Number of database inserts, normalized per file
4555 optional float normalized_insert_count = 5;
4556 // Number of database updates, normalized per file
4557 optional float normalized_update_count = 6;
4558 // Number of database deletes, normalized per file
4559 optional float normalized_delete_count = 7;
4560}
4561
4562/**
4563 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4564 *
4565 * Logged from:
4566 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4567 */
shafik43825842020-04-02 17:30:24 +01004568message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004569 // Volume type that this event pertains to
4570 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004571 // UID of app that requested deletion
4572 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004573 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004574 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004575}
4576
4577/**
4578 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4579 *
4580 * Logged from:
4581 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4582 */
shafik43825842020-04-02 17:30:24 +01004583message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004584 enum Result {
4585 UNKNOWN = 0;
4586 USER_GRANTED = 1;
4587 AUTO_GRANTED = 2;
4588 USER_DENIED = 3;
4589 USER_DENIED_WITH_PREJUDICE = 4;
4590 AUTO_DENIED = 5;
4591 }
4592
4593 // Volume type that this event pertains to
4594 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004595 // UID of app that requested permission
4596 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004597 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004598 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004599 // Result of this request
shafik43825842020-04-02 17:30:24 +01004600 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004601}
4602
4603/**
4604 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4605 *
4606 * Logged from:
4607 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4608 */
shafik43825842020-04-02 17:30:24 +01004609message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004610 // Volume type that this event pertains to
4611 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4612 // Old database version code
4613 optional int32 version_from = 2;
4614 // New database version code
4615 optional int32 version_to = 3;
4616 // Total number of files in database
4617 optional int64 item_count = 4;
4618 // Duration of schema change, normalized per file
4619 optional float normalized_duration_millis = 5;
4620}
4621
4622/**
4623 * Logs when MediaProvider has finished an idle maintenance job.
4624 *
4625 * Logged from:
4626 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4627 */
shafik43825842020-04-02 17:30:24 +01004628message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004629 // Volume type that this event pertains to
4630 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4631
4632 // Total number of files in database
4633 optional int64 item_count = 2;
4634 // Duration of idle maintenance, normalized per file
4635 optional float normalized_duration_millis = 3;
4636 // Number of thumbnails found to be stale, normalized per file
4637 optional float normalized_stale_thumbnails = 4;
4638 // Number of items found to be expired, normalized per file
4639 optional float normalized_expired_media = 5;
4640}
4641
Keun young Park3e033cb2019-12-18 11:27:35 -08004642/**
4643 * Represents boot time event with duration in ms.
4644 *
4645 * Logged from: bootstat and various system server components. Check each enums for details.
4646 */
4647message BootTimeEventDuration {
4648 enum DurationEvent {
4649 UNKNOWN = 0;
4650 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4651 ABSOLUTE_BOOT_TIME = 1;
4652 // Bootloader's 1st stage execution time.
4653 // Logged from bootstat.
4654 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4655 // Bootloader's 1st stage loading time.
4656 // Logged from bootstat.
4657 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4658 // Bootloader's kernel loading time.
4659 // Logged from bootstat.
4660 BOOTLOADER_KERNEL_LOAD = 4;
4661 // Bootloader's 2nd stage execution time.
4662 // Logged from bootstat.
4663 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4664 // Bootloader's 2nd stage loading time.
4665 // Logged from bootstat.
4666 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4667 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4668 // for locked device.
4669 // Logged from bootstat.
4670 BOOTLOADER_UI_WAIT = 7;
4671 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4672 // Logged from bootstat.
4673 BOOTLOADER_TOTAL = 8;
4674 // Shutdown duration inside init for the reboot before the current boot up.
4675 // Logged from f/b/services/.../BootReceiver.java.
4676 SHUTDOWN_DURATION = 9;
4677 // Total time for mounting of disk devices during bootup.
4678 // Logged from f/b/services/.../BootReceiver.java.
4679 MOUNT_DEFAULT_DURATION = 10;
4680 // Total time for early stage mounting of disk devices during bootup.
4681 // Logged from f/b/services/.../BootReceiver.java.
4682 MOUNT_EARLY_DURATION = 11;
4683 // Total time for late stage mounting of disk devices during bootup.
4684 // Logged from f/b/services/.../BootReceiver.java.
4685 MOUNT_LATE_DURATION = 12;
4686 // Average time to scan non-system app after OTA
4687 // Logged from f/b/services/.../PackageManagerService.java
4688 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4689 // Time to initialize Package manager after OTA
4690 // Logged from f/b/services/.../PackageManagerService.java
4691 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4692 // Time to scan all system app from Package manager after OTA
4693 // Logged from f/b/services/.../PackageManagerService.java
4694 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4695 // Init's total time for cold boot stage.
4696 // Logged from bootstat.
4697 COLDBOOT_WAIT = 16;
4698 // Init's total time for initializing selinux.
4699 // Logged from bootstat.
4700 SELINUX_INIT = 17;
4701 // Time since last factory reset.
4702 // Logged from bootstat.
4703 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004704 // Init's total time spent for completing the 1st stage.
4705 // Logged from bootstat.
4706 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004707 }
4708
4709 // Type of the event.
4710 optional DurationEvent event = 1;
4711 // Duration of the event in ms.
4712 optional int64 duration_millis = 2;
4713}
4714
4715/**
4716 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4717 * since boot-up.
4718 *
4719 * Logged from: bootstat and various system server components. Check each enums for details.
4720 */
4721message BootTimeEventElapsedTime {
4722 enum ElapsedTimeEvent {
4723 UNKNOWN = 0;
4724 // Time when init starts 1st stage. Logged from bootstat.
4725 ANDROID_INIT_STAGE_1 = 1;
4726 // Time when sys.boot_completed prop is set.
4727 // Logged from bootstat.
4728 BOOT_COMPLETE = 2;
4729 // BOOT_COMPLETE for encrypted device.
4730 BOOT_COMPLETE_ENCRYPTION = 3;
4731 // BOOT_COMPLETE for device with no encryption.
4732 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4733 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004734 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004735 // BOOT_COMPLETE after factory reset.
4736 FACTORY_RESET_BOOT_COMPLETE = 6;
4737 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4738 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004739 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4740 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004741 // BOOT_COMPLETE after OTA.
4742 OTA_BOOT_COMPLETE = 9;
4743 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4744 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004745 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4746 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004747 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4748 // Logged from f/b/services/.../UserController.java
4749 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4750 // Time when the system starts sending BOOT_COMPLETED broadcast.
4751 // Logged from f/b/services/.../UserController.java
4752 FRAMEWORK_BOOT_COMPLETED = 13;
4753 // Time when the package manager starts init.
4754 // Logged from f/b/services/.../SystemServer.java
4755 PACKAGE_MANAGER_INIT_START = 14;
4756 // Time when package manager is ready
4757 // Logged from f/b/services/.../SystemServer.java
4758 PACKAGE_MANAGER_INIT_READY = 15;
4759 // Represents the time when user has entered unlock credential for system with user pin.
4760 // Logged from bootstat.
4761 POST_DECRYPT = 16;
4762 // Represents the start of zygote's init.
4763 // Logged from zygote itself.
4764 ZYGOTE_INIT_START = 17;
4765 // Represents the start of secondary zygote's init.
4766 // TODO: add logging to zygote
4767 SECONDARY_ZYGOTE_INIT_START = 18;
4768 // Represents the start of system server's init.
4769 // Logged from f/b/services/.../SystemServer.java
4770 SYSTEM_SERVER_INIT_START = 19;
4771 // Represents the completion of system server's init.
4772 // Logged from f/b/services/.../SystemServer.java
4773 SYSTEM_SERVER_READY = 20;
4774 // Represents the start of launcher during boot-up.
4775 // TODO: add logging
4776 LAUNCHER_START = 21;
4777 // Represents the completion of launcher's initial rendering. User can use other apps from
4778 // launcher from this point.
4779 // TODO: add logging
4780 LAUNCHER_SHOWN = 22;
4781 }
4782
4783 // Type of the event.
4784 optional ElapsedTimeEvent event = 1;
4785 // Time since bootup for the event.
4786 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4787 optional int64 time_millis = 2;
4788}
4789
4790/**
4791 * Boot time events with UTC time.
4792 *
4793 * Logged from: bootstat and various system server components. Check each enums for details.
4794 */
4795message BootTimeEventUtcTime {
4796 enum UtcTimeEvent {
4797 UNKNOWN = 0;
4798 // Time of the bootstat's marking of 1st boot after the last factory reset.
4799 // Logged from bootstat.
4800 FACTORY_RESET_RESET_TIME = 1;
4801 // The time when bootstat records FACTORY_RESET_* events. This is close to
4802 // BOOT_COMPLETE time for the current bootup.
4803 // Logged from bootstat.
4804 FACTORY_RESET_CURRENT_TIME = 2;
4805 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4806 // Logged from bootstat.
4807 FACTORY_RESET_RECORD_VALUE = 3;
4808 }
4809
4810 // Type of the event.
4811 optional UtcTimeEvent event = 1;
4812 // UTC time for the event.
4813 optional int64 utc_time_secs = 2;
4814}
4815
4816/**
4817 * Boot time events representing specific error code during bootup.
4818 * Meaning of error code can be different per each event type.
4819 *
4820 * Logged from: bootstat and various system server components. Check each enums for details.
4821 */
4822message BootTimeEventErrorCode {
4823 enum ErrorCodeEvent {
4824 UNKNOWN = 0;
4825 // Linux error code for time() call to get the current UTC time.
4826 // Logged from bootstat.
4827 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4828 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4829 // as UMOUNT_STAT_* from init/reboot.cpp.
4830 // Logged from f/b/services/.../BootReceiver.java.
4831 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004832 // Reprepsents fie system mounting error code of /data partition for the current boot.
4833 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004834 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004835 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004836 }
4837
4838 // Type of the event.
4839 optional ErrorCodeEvent event = 1;
4840 // error code defined per each event type.
4841 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4842 // FS_MGR_FS_STAT.
4843 optional int32 error_code = 2;
4844}
4845
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004846/**
4847 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4848 * after an OTA.
4849 *
4850 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004851 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004852 */
4853message SnapshotMergeReported {
4854 // Keep in sync with
4855 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4856 enum UpdateState {
4857 // No update or merge is in progress.
4858 NONE = 0;
4859 // An update is applying; snapshots may already exist.
4860 INITIATED = 1;
4861 // An update is pending, but has not been successfully booted yet.
4862 UNVERIFIED = 2;
4863 // The kernel is merging in the background.
4864 MERGING = 3;
4865 // Post-merge cleanup steps could not be completed due to a transient
4866 // error, but the next reboot will finish any pending operations.
4867 MERGE_NEEDS_REBOOT = 4;
4868 // Merging is complete, and needs to be acknowledged.
4869 MERGE_COMPLETED = 5;
4870 // Merging failed due to an unrecoverable error.
4871 MERGE_FAILED = 6;
4872 // The update was implicitly cancelled, either by a rollback or a flash
4873 // operation via fastboot. This state can only be returned by WaitForMerge.
4874 CANCELLED = 7;
4875 };
4876
4877 // Status of the update after the merge attempts.
4878 optional UpdateState final_state = 1;
4879
4880 // Time to complete a merge operation in milliseconds.
4881 // A negative value corresponds to the case in which the merge operation
4882 // was interrupted and resumed (e.g. in case of a system reboot during the
4883 // merge).
4884 optional int64 duration_millis = 2;
4885
4886 // Number of reboots that occurred after issuing and before completing the
4887 // merge of all the snapshot devices.
4888 optional int32 intermediate_reboots = 3;
Alessio Balsini2294f392020-05-26 11:11:20 +01004889
4890 // The device has been upgraded to Virtual A/B.
4891 optional bool is_vab_retrofit = 4;
4892
4893 // Space that has been temporarily allocated in the /data partition
4894 // containing the dm-snapshot's copy-on-write data generated during a
4895 // Virtual A/B update.
4896 optional int64 cow_file_size_bytes = 5;
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004897}
4898
Chenjie Yubbcbc602018-02-05 16:51:52 -08004899//////////////////////////////////////////////////////////////////////
4900// Pulled atoms below this line //
4901//////////////////////////////////////////////////////////////////////
4902
4903/**
David Chenc8a43242017-10-17 16:23:28 -07004904 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4905 *
4906 * Pulled from:
4907 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4908 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004909message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004910 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004911
4912 optional int64 rx_bytes = 2;
4913
4914 optional int64 rx_packets = 3;
4915
4916 optional int64 tx_bytes = 4;
4917
4918 optional int64 tx_packets = 5;
4919}
4920
4921/**
4922 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4923 *
4924 * Pulled from:
4925 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4926 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004927message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004928 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004929
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004930 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4931 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004932
4933 optional int64 rx_bytes = 3;
4934
4935 optional int64 rx_packets = 4;
4936
4937 optional int64 tx_bytes = 5;
4938
4939 optional int64 tx_packets = 6;
4940}
4941
4942/**
4943 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4944 *
4945 * Pulled from:
4946 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4947 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004948message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004949 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004950
4951 optional int64 rx_bytes = 2;
4952
4953 optional int64 rx_packets = 3;
4954
4955 optional int64 tx_bytes = 4;
4956
4957 optional int64 tx_packets = 5;
4958}
4959
4960/**
4961 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4962 *
4963 * Pulled from:
4964 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4965 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004966message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004967 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004968
Yao Chenc40a19d2018-03-15 16:48:25 -07004969 // 1 denotes foreground and 0 denotes background. This is called Set in
4970 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004971 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004972
4973 optional int64 rx_bytes = 3;
4974
4975 optional int64 rx_packets = 4;
4976
4977 optional int64 tx_bytes = 5;
4978
4979 optional int64 tx_packets = 6;
4980}
4981
4982/**
junyulai8d1a6092020-05-07 13:38:15 +08004983 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08004984 * Note that the data is expected to be sliced into more dimensions in future. In other words,
4985 * the caller must not assume any row of data is one full report when filtering with a set of
4986 * matching conditions, because future data may represent with multiple rows what is currently
4987 * represented by one.
4988 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
4989 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08004990 *
4991 * Pulled from:
4992 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
4993 */
4994message DataUsageBytesTransfer {
4995 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
4996 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
4997 // states combined, not including debug states. See NetworkStats#SET_*.
4998 optional int32 state = 1;
4999
5000 optional int64 rx_bytes = 2;
5001
5002 optional int64 rx_packets = 3;
5003
5004 optional int64 tx_bytes = 4;
5005
5006 optional int64 tx_packets = 5;
5007
5008 // Radio Access Technology (RAT) type of this record, should be one of
5009 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
5010 // the record is for all rat types combined.
5011 optional int32 rat_type = 6;
5012
5013 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08005014 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005015 optional string sim_mcc = 7;
5016 optional string sim_mnc = 8;
5017
junyulai8b794b72020-05-19 17:36:13 +08005018 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
5019 // See TelephonyManager#getSimCarrierId.
5020 optional int32 carrier_id = 9;
5021
junyulai8d1a6092020-05-07 13:38:15 +08005022 // Enumeration of opportunistic states with an additional ALL state indicates the record is
5023 // combined regardless of the boolean value in its field.
5024 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08005025 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08005026 ALL = 1;
5027 OPPORTUNISTIC = 2;
5028 NOT_OPPORTUNISTIC = 3;
5029 }
5030 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08005031 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005032 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005033 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005034}
5035
5036/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005037 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5038 *
5039 * Pulled from:
5040 * StatsCompanionService
5041 */
5042message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005043 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005044
5045 optional int64 rx_bytes = 2;
5046
5047 optional int64 tx_bytes = 3;
5048}
5049
5050/**
David Chenc8a43242017-10-17 16:23:28 -07005051 * Pulls the kernel wakelock durations. This atom is adapted from
5052 * android/internal/os/KernelWakelockStats.java
5053 *
5054 * Pulled from:
5055 * StatsCompanionService using KernelWakelockReader.
5056 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005057message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005058 optional string name = 1;
5059
5060 optional int32 count = 2;
5061
5062 optional int32 version = 3;
5063
Yangster-maca8a30442018-10-13 23:46:34 -07005064 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005065}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005066
Chenjie Yu05013b32017-11-21 10:21:41 -08005067/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005068 * Pulls low power state information. If power.stats HAL is not available, this
5069 * includes platform and subsystem sleep state information,
5070 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5071 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005072 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005073 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005074 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5075 * as defined in:
5076 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005077 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005078message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005079 // Subsystem name
5080 optional string subsystem_name = 1;
5081 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5082 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005083 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5084 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005085 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005086 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005087 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005088 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005089 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005090}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005091
Chenjie Yu05013b32017-11-21 10:21:41 -08005092/**
Bookatz92da2832018-11-01 18:10:03 -07005093 * Pulls on-device power measurement information.
5094 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5095 * Pulled from:
5096 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5097 */
5098message OnDevicePowerMeasurement {
5099 // Name of the subsystem (to which the rail belongs).
5100 optional string subsystem_name = 1;
5101
5102 // Rail name. The rail lies within the subsystem.
5103 optional string rail_name = 2;
5104
5105 // Time (in ms since boot) at which the rail energy value was measured.
5106 // This may differ slightly from the time that statsd logs this information.
5107 optional uint64 measurement_timestamp_millis = 3;
5108
5109 // Accumulated energy used via the rail since device boot in uWs.
5110 optional uint64 energy_microwatt_secs = 4;
5111}
5112
5113/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005114 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005115 * Pulls the time the cpu spend on the frequency index. Frequency index
5116 * starts from highest to lowest. The value should be monotonically
5117 * increasing since boot. However, if there is a cpu
5118 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005119 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005120message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005121 optional uint32 cluster = 1;
5122 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005123 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005124}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005125
Chenjie Yu05013b32017-11-21 10:21:41 -08005126/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005127 * Pulls Cpu Time Per Uid.
5128 * Note that isolated process uid time should be attributed to host uids.
5129 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005130message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005131 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005132 optional uint64 user_time_micros = 2;
5133 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005134}
5135
5136/**
5137 * Pulls Cpu Time Per Uid per frequency.
5138 * Note that isolated process uid time should be attributed to host uids.
5139 * For each uid, we order the time by descending frequencies.
5140 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005141message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005142 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005143 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005144 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005145}
Hugo Benichi884970e2017-11-14 22:42:46 +09005146
Chenjie Yu05013b32017-11-21 10:21:41 -08005147/**
5148 * Pulls Wifi Controller Activity Energy Info
5149 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005150message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005151 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005152 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005153 // stack reported state
5154 // TODO: replace this with proto enum
5155 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005156 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005157 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005158 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005159 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005160 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005161 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005162 // product of current(mA), voltage(V) and time(ms)
5163 optional uint64 controller_energy_used = 6;
5164}
5165
5166/**
5167 * Pulls Modem Activity Energy Info
5168 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005169message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005170 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005171 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005172 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005173 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005174 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005175 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005176 /**
5177 * Tx power index
5178 * index 0 = tx_power < 0dBm
5179 * index 1 = 0dBm < tx_power < 5dBm
5180 * index 2 = 5dBm < tx_power < 15dBm
5181 * index 3 = 15dBm < tx_power < 20dBm
5182 * index 4 = tx_power > 20dBm
5183 */
5184 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005185 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005186 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005187 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005188 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005189 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005190 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005191 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005192 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005193 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005194 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005195 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005196 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005197 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005198}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005199
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005200/**
5201 * Pulls Bluetooth Activity Energy Info
5202 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5203 */
5204message BluetoothActivityInfo {
5205 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005206 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005207 // bluetooth stack state
5208 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005209 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005210 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005211 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005212 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005213 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005214 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005215 // product of current(mA), voltage(V) and time(ms)
5216 optional uint64 energy_used = 6;
5217}
5218
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005219/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005220 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005221 *
5222 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005223 */
5224message ProcessMemoryState {
5225 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005226 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005227
5228 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005229 // Usually package name, "system" for system server.
5230 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005231 optional string process_name = 2;
5232
Rafal Slawikda51b932018-12-13 16:31:33 +00005233 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005234 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005235
5236 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005237 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005238
5239 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005240 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005241
Rajeev Kumar90235992018-01-29 11:06:48 -08005242 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005243 // Value is read from memory.stat, field total_rss if per-app memory
5244 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005245 optional int64 rss_in_bytes = 6;
5246
5247 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005248 // Value is read from memory.stat, field total_cache if per-app memory
5249 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005250 optional int64 cache_in_bytes = 7;
5251
5252 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005253 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005254 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005255 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005256
Rafal Slawik203c3db2019-09-25 19:53:01 +01005257 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005258 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005259
Rafal Slawik203c3db2019-09-25 19:53:01 +01005260 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5261 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005262
Rafal Slawik203c3db2019-09-25 19:53:01 +01005263 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5264 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005265}
5266
5267/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005268 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005269 *
5270 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5271 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005272 *
5273 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005274 */
5275message ProcessMemoryHighWaterMark {
5276 // The uid if available. -1 means not available.
5277 optional int32 uid = 1 [(is_uid) = true];
5278
Rafal Slawikda51b932018-12-13 16:31:33 +00005279 // The process name.
5280 // Usually package name or process cmdline.
5281 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005282 optional string process_name = 2;
5283
Rafal Slawik239b6802019-09-09 18:46:01 +01005284 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5285 // computed by converting kilobytes to bytes.
5286 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5287
Rafal Slawik3bea8952018-11-15 12:39:33 +00005288 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5289 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005290 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005291}
5292
5293/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005294 * Logs the memory stats for a process.
5295 *
5296 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5297 * and for selected native processes.
5298 */
5299message ProcessMemorySnapshot {
5300 // The uid if available. -1 means not available.
5301 optional int32 uid = 1 [(is_uid) = true];
5302
5303 // The process name.
5304 // Usually package name or process cmdline.
5305 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5306 optional string process_name = 2;
5307
5308 // The pid of the process.
5309 // Allows to disambiguate instances of the process.
5310 optional int32 pid = 3;
5311
5312 // The current OOM score adjustment value.
5313 // Read from ProcessRecord for managed processes.
5314 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5315 optional int32 oom_score_adj = 4;
5316
5317 // The current RSS of the process.
5318 // VmRSS from /proc/pid/status.
5319 optional int32 rss_in_kilobytes = 5;
5320
5321 // The current anon RSS of the process.
5322 // RssAnon from /proc/pid/status.
5323 optional int32 anon_rss_in_kilobytes = 6;
5324
5325 // The current swap size of the process.
5326 // VmSwap from /proc/pid/status.
5327 optional int32 swap_in_kilobytes = 7;
5328
5329 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5330 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5331}
5332
5333/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005334 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005335 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005336message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005337 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005338}
5339
5340/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005341 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005342 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005343message SystemUptime {
5344 // Milliseconds since the system was booted.
5345 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5346 // for external input).
5347 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005348 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005349}
5350
5351/*
5352 * Reads from /proc/uid_concurrent_active_time which has the format:
5353 * active: X (X is # cores)
5354 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5355 * [uid1]: [time-0] [time-1] [time-2] ... ...
5356 * ...
5357 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5358 * The file contains a monotonically increasing count of time for a single boot.
5359 */
5360message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005361 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005362 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005363}
5364
5365/**
5366 * Reads from /proc/uid_concurrent_policy_time which has the format:
5367 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5368 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5369 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5370 * ...
5371 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5372 * The file contains a monotonically increasing count of time for a single boot.
5373 */
5374message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005375 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005376 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005377 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005378}
5379
5380/*
5381 * Pulls free disk space, for data, system partition and temporary directory.
5382 */
5383message DiskSpace {
5384 // available bytes in data partition
5385 optional uint64 data_available_bytes = 1;
5386 // available bytes in system partition
5387 optional uint64 system_available_bytes = 2;
5388 // available bytes in download cache or temp directories
5389 optional uint64 temp_available_bytes = 3;
5390}
Tej Singhbf972d92018-01-10 20:51:13 -08005391
5392/**
5393 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005394 *
5395 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005396 */
5397message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005398 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005399}
5400
5401/**
5402 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005403 * Pulled from:
5404 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005405 */
5406message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005407 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005408}
5409
5410/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005411 * Pulls battery voltage.
5412 * Pulled from:
5413 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5414 */
5415message BatteryVoltage {
5416 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005417 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005418}
5419
5420/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005421 * Pulls battery level (percent full, from 0 to 100).
5422 *
5423 * Pulled from:
5424 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5425 */
5426message BatteryLevel {
5427 // Battery level. Should be in [0, 100].
5428 optional int32 battery_level = 1;
5429}
5430
5431/**
Tej Singhd89137e2018-03-26 14:51:40 -07005432 * Pulls the temperature of various parts of the device.
5433 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005434 *
Maggie White442b6312019-04-05 16:26:44 -07005435 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005436 */
5437message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005438 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005439 optional android.os.TemperatureTypeEnum sensor_location = 1;
5440
5441 // The name of the temperature source. Eg. CPU0
5442 optional string sensor_name = 2;
5443
Tej Singhd89137e2018-03-26 14:51:40 -07005444 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005445 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005446 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005447
5448 // Relative severity of the throttling, see enum definition.
5449 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005450}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005451
5452/**
5453 * Pulls the statistics of calls to Binder.
5454 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005455 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5456 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005457 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005458 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005459 */
5460message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005461 // UID of the process responsible for the binder transaction. It will be set if the process
5462 // executing the binder transaction attribute the transaction to another uid using
5463 // Binder.setThreadWorkSource().
5464 //
5465 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005466 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005467 // UID of the process executing the binder transaction.
5468 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005469 // Fully qualified class name of the API call.
5470 //
5471 // This is a system server class name.
5472 //
5473 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5474 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5475 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5476 // commonly used APIs.
5477 optional string service_class_name = 2;
5478 // Method name of the API call. It can also be a transaction code if we cannot
5479 // resolve it to a name. See Binder#getTransactionName.
5480 //
5481 // This is a system server method name.
5482 optional string service_method_name = 3;
5483 // Total number of API calls.
5484 optional int64 call_count = 4;
5485 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5486 optional bool screen_interactive = 13;
5487 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5488 // call_count will be equal to recorded_call_count.
5489 //
5490 // If recorded_call_count is different than call_count, it means data collection has been
5491 // sampled. All the fields below will be sampled in this case.
5492 optional int64 recorded_call_count = 12;
5493 // Number of exceptions thrown by the API.
5494 optional int64 recorded_exception_count = 5;
5495 // Total latency of all API calls.
5496 // Average can be computed using total_latency_micros / recorded_call_count.
5497 optional int64 recorded_total_latency_micros = 6;
5498 // Maximum latency of one API call.
5499 optional int64 recorded_max_latency_micros = 7;
5500 // Total CPU usage of all API calls.
5501 // Average can be computed using total_cpu_micros / recorded_call_count.
5502 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5503 optional int64 recorded_total_cpu_micros = 8;
5504 // Maximum CPU usage of one API call.
5505 optional int64 recorded_max_cpu_micros = 9;
5506 // Maximum parcel reply size of one API call.
5507 optional int64 recorded_max_reply_size_bytes = 10;
5508 // Maximum parcel request size of one API call.
5509 optional int64 recorded_max_request_size_bytes = 11;
5510}
5511
5512/**
5513 * Pulls the statistics of exceptions during calls to Binder.
5514 *
5515 * Binder stats are cumulative from boot unless somebody reset the data using
5516 * > adb shell dumpsys binder_calls_stats --reset
5517 */
5518message BinderCallsExceptions {
5519 // Exception class name, e.g. java.lang.IllegalArgumentException.
5520 //
5521 // This is an exception class name thrown by the system server.
5522 optional string exception_class_name = 1;
5523 // Total number of exceptions.
5524 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005525}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005526
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005527/**
5528 * Pulls the statistics of message dispatching on HandlerThreads.
5529 *
5530 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5531 * config on the device.
5532 *
5533 * Next tag: 11
5534 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005535message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005536 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005537 optional int32 uid = 1 [(is_uid) = true];
5538
5539 // Fully qualified class name of the handler target class.
5540 //
5541 // This field does not contain PII. This is a system server class name.
5542 optional string handler_class_name = 2;
5543
5544 // The name of the thread that runs the Looper.
5545 //
5546 // This field does not contain PII. This is a system server thread name.
5547 optional string looper_thread_name = 3;
5548
5549 // The name of the dispatched message.
5550 //
5551 // This field does not contain PII. This is a system server constant or class
5552 // name.
5553 optional string message_name = 4;
5554
5555 // Total number of successfully dispatched messages.
5556 optional int64 message_count = 5;
5557
5558 // Total number of messages that failed dispatching.
5559 optional int64 exception_count = 6;
5560
5561 // Total number of processed messages we have data recorded for. If we
5562 // collected data for all the messages, message_count will be equal to
5563 // recorded_message_count.
5564 //
5565 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005566 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005567 optional int64 recorded_message_count = 7;
5568
5569 // Total latency of all processed messages.
5570 // Average can be computed using recorded_total_latency_micros /
5571 // recorded_message_count.
5572 optional int64 recorded_total_latency_micros = 8;
5573
5574 // Total CPU usage of all processed message.
5575 // Average can be computed using recorded_total_cpu_micros /
5576 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005577 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005578 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005579
5580 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5581 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005582
5583 // Max recorded CPU usage of all processed messages.
5584 optional int64 recorded_max_cpu_micros = 11;
5585
5586 // Max recorded latency of all processed messages.
5587 optional int64 recorded_max_latency_micros = 12;
5588
5589 // Total number of messages we tracked the dispatching delay for. If we
5590 // collected data for all the messages, message_count will be equal to
5591 // recorded_delay_message_count.
5592 //
5593 // If recorded_delay_message_count is different than message_count, it means data
5594 // collection has been sampled or/and not all messages specified the target dispatch time.
5595 // The fields below will be sampled in this case.
5596 optional int64 recorded_delay_message_count = 13;
5597
5598 // Total dispatching delay of all processed messages.
5599 // Calculated as a difference between the target dispatching time (Message.when)
5600 // and the actual dispatching time.
5601 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5602 optional int64 recorded_total_delay_millis = 14;
5603
5604 // Max dispatching delay of all processed messages.
5605 // Calculated as a difference between the target dispatching time (Message.when)
5606 // and the actual dispatching time.
5607 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005608}
Tej Singh86dc9db2018-09-06 00:39:57 +00005609
5610/**
5611 * Pulls disk information, such as write speed and latency.
5612 */
5613message DiskStats {
5614 // Time taken to open, write 512B to, and close a file.
5615 // -1 if error performing the check.
5616 optional int64 data_write_latency_millis = 1;
5617
5618 optional bool file_based_encryption = 2;
5619
5620 // Recent disk write speed in kB/s.
5621 // -1 if error querying storageed.
5622 // 0 if data is unavailable.
5623 optional int32 recent_disk_write_speed = 3;
5624}
5625
5626
5627/**
5628 * Free and total bytes of the Data, Cache, and System partition.
5629 */
5630message DirectoryUsage {
5631 enum Directory {
5632 UNKNOWN = 0;
5633 DATA = 1;
5634 CACHE = 2;
5635 SYSTEM = 3;
5636 }
5637 optional Directory directory = 1;
5638 optional int64 free_bytes = 2;
5639 optional int64 total_bytes = 3;
5640}
5641
5642
5643/**
5644 * Size of an application: apk size, data size, and cache size.
5645 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5646 * Information is only reported for apps with the primary user (user 0).
5647 * Sizes are aggregated by package name.
5648 */
5649message AppSize {
5650 // Including uids will involve modifying diskstats logic.
5651 optional string package_name = 1;
5652 // App size in bytes. -1 if unavailable.
5653 optional int64 app_size_bytes = 2;
5654 // App data size in bytes. -1 if unavailable.
5655 optional int64 app_data_size_bytes = 3;
5656 // App cache size in bytes. -1 if unavailable.
5657 optional int64 app_cache_size_bytes = 4;
5658 // Time that the cache file was produced.
5659 // Uses System.currentTimeMillis(), which is wall clock time.
5660 optional int64 cache_time_millis = 5;
5661}
5662
5663
5664/**
5665 * Size of a particular category. Eg: photos, videos.
5666 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5667 */
5668message CategorySize {
5669 enum Category {
5670 UNKNOWN = 0;
5671 APP_SIZE = 1;
5672 APP_DATA_SIZE = 2;
5673 APP_CACHE_SIZE = 3;
5674 PHOTOS = 4;
5675 VIDEOS = 5;
5676 AUDIO = 6;
5677 DOWNLOADS = 7;
5678 SYSTEM = 8;
5679 OTHER = 9;
5680 }
5681 optional Category category = 1;
5682 // Category size in bytes.
5683 optional int64 size_bytes = 2;
5684 // Time that the cache file was produced.
5685 // Uses System.currentTimeMillis(), which is wall clock time.
5686 optional int64 cache_time_millis = 3;
5687}
Tej Singhd6d6d772018-09-05 17:41:25 -07005688
5689/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005690 * Pulls per uid I/O stats. The stats are cumulative since boot.
5691 *
5692 * Read/write bytes are I/O events from a storage device
5693 * Read/write chars are data requested by read/write syscalls, and can be
5694 * satisfied by caching.
5695 *
5696 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5697 */
5698message DiskIo {
5699 optional int32 uid = 1 [(is_uid) = true];
5700 optional int64 fg_chars_read = 2;
5701 optional int64 fg_chars_write = 3;
5702 optional int64 fg_bytes_read = 4;
5703 optional int64 fg_bytes_write = 5;
5704 optional int64 bg_chars_read = 6;
5705 optional int64 bg_chars_write = 7;
5706 optional int64 bg_bytes_read = 8;
5707 optional int64 bg_bytes_write = 9;
5708 optional int64 fg_fsync = 10;
5709 optional int64 bg_fsync= 11;
5710}
5711
5712
5713/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005714 * Pulls the number of fingerprints for each user.
5715 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005716 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005717 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005718message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005719 // The associated user. Eg: 0 for owners, 10+ for others.
5720 // Defined in android/os/UserHandle.java
5721 optional int32 user = 1;
5722 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005723 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005724}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005725
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005726/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005727 * Pulls the number of faces for each user.
5728 *
5729 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5730 */
5731message NumFacesEnrolled {
5732 // The associated user. Eg: 0 for owners, 10+ for others.
5733 // Defined in android/os/UserHandle.java
5734 optional int32 user = 1;
5735 // Number of faces registered to that user.
5736 optional int32 num_faces_enrolled = 2;
5737}
5738/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005739 * A mapping of role holder -> role
5740 */
5741message RoleHolder {
5742 // uid of the role holder
5743 optional int32 uid = 1 [(is_uid) = true];
5744
5745 // package name of the role holder
5746 optional string package_name = 2;
5747
5748 // the role held
5749 optional string role = 3;
5750}
5751
Yangsteraf9aee72018-10-12 09:26:16 -07005752message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005753 // These are all in byte resolution.
5754 optional int64 min = 1 [deprecated = true];
5755 optional int64 average = 2 [deprecated = true];
5756 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005757
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005758 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5759 // int64 fields.
5760 optional int32 mean_kb = 4;
5761 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005762}
5763
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005764// A reduced subset of process states; reducing the number of possible states allows more
5765// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5766enum ProcessStateAggregated {
5767 PROCESS_STATE_UNKNOWN = 0;
5768 // Persistent system process.
5769 PROCESS_STATE_PERSISTENT = 1;
5770 // Top activity; actually any visible activity.
5771 PROCESS_STATE_TOP = 2;
5772 // Process binding to top or a foreground service.
5773 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5774 // Processing running a foreground service.
5775 PROCESS_STATE_FGS = 4;
5776 // Important foreground process (ime, wallpaper, etc).
5777 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5778 // Important background process.
5779 PROCESS_STATE_BACKGROUND = 6;
5780 // Process running a receiver.
5781 PROCESS_STATE_RECEIVER = 7;
5782 // All kinds of cached processes.
5783 PROCESS_STATE_CACHED = 8;
5784}
5785
5786// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005787message ProcessStatsStateProto {
5788 optional android.service.procstats.ScreenState screen_state = 1;
5789
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005790 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005791
5792 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5793 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005794 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5795
5796 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005797
5798 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005799 optional int64 duration_millis = 4 [deprecated = true];
5800 // Same as above, but with minute resolution so it fits into an int32.
5801 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005802
5803 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005804 optional int64 realtime_duration_millis = 9 [deprecated = true];
5805 // Same as above, but with minute resolution so it fits into an int32.
5806 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005807
5808 // # of samples taken
5809 optional int32 sample_size = 5;
5810
5811 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005812 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005813
5814 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005815 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005816
5817 // RSS is memory resident for this process
5818 optional AggStats rss = 8;
5819}
5820
Jing Ji060d6862020-04-13 19:36:31 -07005821// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005822message ProcessStatsProto {
5823 // Name of process.
5824 optional string process = 1;
5825
5826 // Uid of the process.
Jing Ji1cd1f602020-06-03 13:45:36 -07005827 optional int32 uid = 2 [(is_uid) = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005828
5829 // Information about how often kills occurred
5830 message Kill {
5831 // Count of excessive CPU kills
5832 optional int32 cpu = 1;
5833
5834 // Count of kills when cached
5835 optional int32 cached = 2;
5836
5837 // PSS stats during cached kill
5838 optional AggStats cached_pss = 3;
5839 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005840 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005841
5842 // Time and memory spent in various states.
5843 repeated ProcessStatsStateProto states = 5;
5844
5845 // Total time process has been running... screen_state, memory_state, and process_state
5846 // will not be set.
5847 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005848
5849 // Association data for this process in this state;
5850 // each entry here is one association.
5851 repeated ProcessStatsAssociationProto assocs = 7;
5852}
5853
Jing Ji1cd1f602020-06-03 13:45:36 -07005854// Next Tag: 6
Jing Ji060d6862020-04-13 19:36:31 -07005855message ProcessStatsAssociationProto {
5856 // Procss Name of the associated process (client process of service binding)
5857 optional string assoc_process_name = 1;
5858
5859 // Package Name of the associated package (client package of service binding)
Jing Ji1cd1f602020-06-03 13:45:36 -07005860 optional string assoc_package_name = 2 [deprecated = true];
5861
5862 // UID of the associated process/package (client package of service binding)
5863 optional int32 assoc_uid = 5 [(is_uid) = true];
Jing Ji060d6862020-04-13 19:36:31 -07005864
5865 // Total count of the times this association (service binding) appeared.
5866 optional int32 total_count = 3;
5867
5868 // Uptime total duration in seconds this association (service binding) was around.
5869 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005870}
5871
5872message PackageServiceOperationStatsProto {
5873 // Operate enum: Started, Foreground, Bound, Executing
5874 optional android.service.procstats.ServiceOperationState operation = 1;
5875
5876 // Number of times the service was in this operation.
5877 optional int32 count = 2;
5878
5879 // Information about a state the service can be in.
5880 message StateStats {
5881 // Screen state enum.
5882 optional android.service.procstats.ScreenState screen_state = 1;
5883 // Memory state enum.
5884 optional android.service.procstats.MemoryState memory_state = 2;
5885
5886 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005887 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005888 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005889 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005890 }
5891 repeated StateStats state_stats = 3;
5892}
5893
5894message PackageServiceStatsProto {
5895 // Name of service component.
5896 optional string service_name = 1;
5897
5898 // The operation stats.
5899 // The package_name, package_uid, package_version, service_name will not be set to save space.
5900 repeated PackageServiceOperationStatsProto operation_stats = 2;
5901}
5902
5903message PackageAssociationSourceProcessStatsProto {
5904 // Uid of the process.
5905 optional int32 process_uid = 1;
5906 // Process name.
5907 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005908 // Package name.
5909 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005910 // Total count of the times this association appeared.
5911 optional int32 total_count = 3;
5912
5913 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005914 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005915
5916 // Total count of the times this association became actively impacting its target process.
5917 optional int32 active_count = 5;
5918
5919 // Information on one source in this association.
5920 message StateStats {
5921 // Process state enum.
5922 optional android.service.procstats.ProcessState process_state = 1;
5923 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005924 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005925 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005926 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005927 }
5928 repeated StateStats active_state_stats = 6;
5929}
5930
5931message PackageAssociationProcessStatsProto {
5932 // Name of the target component.
5933 optional string component_name = 1;
5934 // Information on one source in this association.
5935 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5936}
5937
5938
5939message ProcessStatsPackageProto {
5940 // Name of package.
5941 optional string package = 1;
5942
5943 // Uid of the package.
5944 optional int32 uid = 2;
5945
5946 // Version of the package.
5947 optional int64 version = 3;
5948
5949 // Stats for each process running with the package loaded in to it.
5950 repeated ProcessStatsProto process_stats = 4;
5951
5952 // Stats for each of the package's services.
5953 repeated PackageServiceStatsProto service_stats = 5;
5954
5955 // Stats for each association with the package.
5956 repeated PackageAssociationProcessStatsProto association_stats = 6;
5957}
5958
5959message ProcessStatsSectionProto {
5960 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005961 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005962
5963 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005964 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005965
5966 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005967 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005968
5969 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005970 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005971
5972 // System runtime library. e.g. "libdvm.so", "libart.so".
5973 optional string runtime = 5;
5974
5975 // whether kernel reports swapped pss.
5976 optional bool has_swapped_pss = 6;
5977
5978 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5979 enum Status {
5980 STATUS_UNKNOWN = 0;
5981 STATUS_COMPLETE = 1;
5982 STATUS_PARTIAL = 2;
5983 STATUS_SHUTDOWN = 3;
5984 STATUS_SYSPROPS = 4;
5985 }
5986 repeated Status status = 7;
5987
Chenjie Yub2ecc792019-01-17 10:27:26 -08005988 // Number of pages available of various types and sizes, representation fragmentation.
5989 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5990
Yangsteraf9aee72018-10-12 09:26:16 -07005991 // Stats for each process.
5992 repeated ProcessStatsProto process_stats = 8;
5993
5994 // Stats for each package.
5995 repeated ProcessStatsPackageProto package_stats = 9;
5996}
5997
Chenjie Yub2ecc792019-01-17 10:27:26 -08005998message ProcessStatsAvailablePagesProto {
5999 // Node these pages are in (as per /proc/pagetypeinfo)
6000 optional int32 node = 1;
6001
6002 // Zone these pages are in (as per /proc/pagetypeinfo)
6003 optional string zone = 2;
6004
6005 // Label for the type of these pages (as per /proc/pagetypeinfo)
6006 optional string label = 3;
6007
6008 // Distribution of number of pages available by order size. First entry in array is
6009 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
6010 repeated int32 pages_per_order = 4;
6011}
6012
Chenjie Yu12e5e672018-09-14 15:54:59 -07006013/**
6014 * Pulled from ProcessStatsService.java
6015 */
6016message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07006017 optional ProcessStatsSectionProto proc_stats_section = 1;
6018}
6019
Chenjie Yuf910b7802019-01-11 16:08:20 -08006020/**
6021 * Pulled from ProcessStatsService.java
6022 */
6023message ProcStatsPkgProc {
6024 optional ProcessStatsSectionProto proc_stats_section = 1;
6025}
6026
Chris Wrencdea3b72019-11-22 16:58:17 -05006027// Next Tag: 2
6028message PackageRemoteViewInfoProto {
6029 optional string package_name = 1;
6030 // add per-package additional info here (like channels)
6031}
6032
6033// Next Tag: 2
6034message NotificationRemoteViewsProto {
6035 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6036}
6037
6038/**
6039 * Pulled from NotificationManagerService.java
6040 */
6041message NotificationRemoteViews {
6042 optional NotificationRemoteViewsProto notification_remote_views = 1;
6043}
6044
Yotam Aron74299972020-01-16 16:20:58 +02006045/**
6046 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6047 */
6048message PackageNotificationPreferences {
6049 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006050 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006051 // Notification importance, which specifies when and how a notification is displayed.
6052 // Specified under core/java/android/app/NotificationManager.java.
6053 optional int32 importance = 2;
6054 // Lockscreen visibility as set by the user.
6055 optional int32 visibility = 3;
6056 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6057 // PreferencesHelper.java)
6058 optional int32 user_locked_fields = 4;
6059}
6060
6061/**
6062 * Atom that contains a list of a package's channel preferences, pulled from
6063 * NotificationManagerService.java.
6064 */
6065message PackageNotificationChannelPreferences {
6066 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006067 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006068 // Channel's ID. Should always be available.
6069 optional string channel_id = 2;
6070 // Channel's name. Should always be available.
6071 optional string channel_name = 3;
6072 // Channel's description. Optionally set by the channel creator.
6073 optional string description = 4;
6074 // Notification importance, which specifies when and how a notification is displayed. Specified
6075 // under core/java/android/app/NotificationManager.java.
6076 optional int32 importance = 5;
6077 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6078 // at core/java/android/app/NotificationChannel.java
6079 optional int32 user_locked_fields = 6;
6080 // Indicates if the channel was deleted by the app.
6081 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006082 // Indicates if the channel was marked as a conversation by the app.
6083 optional bool is_conversation = 8;
6084 // Indicates if the channel is a conversation that was demoted by the user.
6085 optional bool is_demoted_conversation = 9;
6086 // Indicates if the channel is a conversation that was marked as important by the user.
6087 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006088}
6089
6090/**
6091 * Atom that contains a list of a package's channel group preferences, pulled from
6092 * NotificationManagerService.java.
6093 */
6094message PackageNotificationChannelGroupPreferences {
6095 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006096 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006097 // Channel Group's ID. Should always be available.
6098 optional string group_id = 2;
6099 // Channel Group's name. Should always be available.
6100 optional string group_name = 3;
6101 // Channel Group's description. Optionally set by group creator.
6102 optional string description = 4;
6103 // Indicates if notifications from this channel group are blocked.
6104 optional bool is_blocked = 5;
6105 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6106 // at core/java/android/app/NotificationChannelGroup.java
6107 optional int32 user_locked_fields = 6;
6108}
6109
Yangsteraf9aee72018-10-12 09:26:16 -07006110message PowerProfileProto {
6111 optional double cpu_suspend = 1;
6112
6113 optional double cpu_idle = 2;
6114
6115 optional double cpu_active = 3;
6116
6117 message CpuCluster {
6118 optional int32 id = 1;
6119 optional double cluster_power = 2;
6120 optional int32 cores = 3;
6121 repeated int64 speed = 4;
6122 repeated double core_power = 5;
6123 }
6124
6125 repeated CpuCluster cpu_cluster = 40;
6126
6127 optional double wifi_scan = 4;
6128
6129 optional double wifi_on = 5;
6130
6131 optional double wifi_active = 6;
6132
6133 optional double wifi_controller_idle = 7;
6134
6135 optional double wifi_controller_rx = 8;
6136
6137 optional double wifi_controller_tx = 9;
6138
6139 repeated double wifi_controller_tx_levels = 10;
6140
6141 optional double wifi_controller_operating_voltage = 11;
6142
6143 optional double bluetooth_controller_idle = 12;
6144
6145 optional double bluetooth_controller_rx = 13;
6146
6147 optional double bluetooth_controller_tx = 14;
6148
6149 optional double bluetooth_controller_operating_voltage = 15;
6150
6151 optional double modem_controller_sleep = 16;
6152
6153 optional double modem_controller_idle = 17;
6154
6155 optional double modem_controller_rx = 18;
6156
6157 repeated double modem_controller_tx = 19;
6158
6159 optional double modem_controller_operating_voltage = 20;
6160
6161 optional double gps_on = 21;
6162
6163 repeated double gps_signal_quality_based = 22;
6164
6165 optional double gps_operating_voltage = 23;
6166
6167 optional double bluetooth_on = 24;
6168
6169 optional double bluetooth_active = 25;
6170
6171 optional double bluetooth_at_cmd = 26;
6172
6173 optional double ambient_display = 27;
6174
6175 optional double screen_on = 28;
6176
6177 optional double radio_on = 29;
6178
6179 optional double radio_scanning = 30;
6180
6181 optional double radio_active = 31;
6182
6183 optional double screen_full = 32;
6184
6185 optional double audio = 33;
6186
6187 optional double video = 34;
6188
6189 optional double flashlight = 35;
6190
6191 optional double memory = 36;
6192
6193 optional double camera = 37;
6194
6195 optional double wifi_batched_scan = 38;
6196
6197 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006198}
Chenjie Yuab530202018-09-26 12:39:20 -07006199
6200/**
6201 * power_profile.xml and other constants for power model calculations.
6202 * Pulled from PowerProfile.java
6203 */
6204message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006205 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006206}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006207
6208/**
arangelovd5db50e2018-10-12 20:24:39 +01006209 * Logs when a user restriction was added or removed.
6210 *
6211 * Logged from:
6212 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6213 */
6214message UserRestrictionChanged {
6215 // The raw string of the user restriction as defined in UserManager.
6216 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6217 optional string restriction = 1;
6218 // Whether the restriction is enabled or disabled.
6219 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006220}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006221
6222/**
6223 * Pulls process user time and system time. Puller takes a snapshot of all pids
6224 * in the system and returns cpu stats for those that are working at the time.
6225 * Dead pids will be dropped. Kernel processes are excluded.
6226 * Min cool-down is 5 sec.
6227 */
6228message ProcessCpuTime {
6229 optional int32 uid = 1 [(is_uid) = true];
6230
6231 optional string process_name = 2;
6232 // Process cpu time in user space, cumulative from boot/process start
6233 optional int64 user_time_millis = 3;
6234 // Process cpu time in system space, cumulative from boot/process start
6235 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006236}
Misha Wagner5a51e002018-10-03 15:04:09 +01006237
6238/**
6239 * Pulls the CPU usage for each thread.
6240 *
6241 * Read from /proc/$PID/task/$TID/time_in_state files.
6242 *
6243 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6244 * time_in_state files not being present on some phones, have not been addressed. These should be
6245 * considered before a public release.
6246 */
6247message CpuTimePerThreadFreq {
6248 // UID that owns the process.
6249 optional int32 uid = 1 [(is_uid) = true];
6250 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006251 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006252 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006253 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006254 // Name of the process taken from `/proc/$PID/cmdline`.
6255 optional string process_name = 4;
6256 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6257 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006258
6259 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6260 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6261 // frequencies are given here as the alternative is sending eight separate atoms. This method
6262 // significantly reduces the amount of data created
6263 optional int32 frequency1_khz = 6;
6264 optional int32 time1_millis = 7;
6265 optional int32 frequency2_khz = 8;
6266 optional int32 time2_millis = 9;
6267 optional int32 frequency3_khz = 10;
6268 optional int32 time3_millis = 11;
6269 optional int32 frequency4_khz = 12;
6270 optional int32 time4_millis = 13;
6271 optional int32 frequency5_khz = 14;
6272 optional int32 time5_millis = 15;
6273 optional int32 frequency6_khz = 16;
6274 optional int32 time6_millis = 17;
6275 optional int32 frequency7_khz = 18;
6276 optional int32 time7_millis = 19;
6277 optional int32 frequency8_khz = 20;
6278 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006279}
Bookatz75ee60422018-11-09 12:27:37 -08006280
6281/**
Bookatz366a4432018-11-20 09:42:33 -08006282 * Pulls information about the device's build.
6283 */
6284message BuildInformation {
6285 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6286 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6287 optional string fingerprint = 1;
6288
6289 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6290 optional string brand = 2;
6291
6292 // Build.PRODUCT. The name of the overall product.
6293 optional string product = 3;
6294
6295 // Build.DEVICE. The name of the industrial design.
6296 optional string device = 4;
6297
6298 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6299 optional string version_release = 5;
6300
6301 // Build.ID. E.g. a label like "M4-rc20".
6302 optional string id = 6;
6303
6304 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6305 // represent this build.
6306 optional string version_incremental = 7;
6307
6308 // Build.TYPE. The type of build, like "user" or "eng".
6309 optional string type = 8;
6310
6311 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6312 optional string tags = 9;
6313}
6314
6315/**
Adam He420947c2019-01-23 15:59:09 -08006316 * Logs information about mismatched caller for content capture.
6317 *
6318 * Logged from:
6319 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6320 */
6321message ContentCaptureCallerMismatchReported {
6322 optional string intended_package = 1;
6323 optional string calling_package = 2;
6324}
6325
6326/**
6327 * Logs information about content capture service events.
6328 *
6329 * Logged from:
6330 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6331 */
6332message ContentCaptureServiceEvents {
6333 // The type of event.
6334 enum Event {
6335 UNKNOWN = 0;
6336 ON_CONNECTED = 1;
6337 ON_DISCONNECTED = 2;
6338 SET_WHITELIST = 3;
6339 SET_DISABLED = 4;
6340 ON_USER_DATA_REMOVED = 5;
6341 }
6342 optional Event event = 1;
6343 // component/package of content capture service.
6344 optional string service_info = 2;
6345 // component/package of target.
6346 // it's a concatenated list of component/package for SET_WHITELIST event
6347 // separated by " ".
6348 optional string target_info = 3;
6349}
6350
6351/**
6352 * Logs information about content capture session events.
6353 *
6354 * Logged from:
6355 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6356 */
6357message ContentCaptureSessionEvents {
6358 // The type of event.
6359 enum Event {
6360 UNKNOWN = 0;
6361 ON_SESSION_STARTED = 1;
6362 ON_SESSION_FINISHED = 2;
6363 SESSION_NOT_CREATED = 3;
6364 }
6365 optional int32 session_id = 1;
6366 optional Event event = 2;
6367 // (n/a on session finished)
6368 optional int32 state_flags = 3;
6369 // component/package of content capture service.
6370 optional string service_info = 4;
6371 // component/package of app.
6372 // (n/a on session finished)
6373 optional string app_info = 5;
6374 optional bool is_child_session = 6;
6375}
6376
6377/**
6378 * Logs information about session being flushed.
6379 *
6380 * Logged from:
6381 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6382 */
6383message ContentCaptureFlushed {
6384 optional int32 session_id = 1;
6385 // component/package of content capture service.
6386 optional string service_info = 2;
6387 // component/package of app.
6388 optional string app_info = 3;
6389 // session start/finish events
6390 optional int32 child_session_started = 4;
6391 optional int32 child_session_finished = 5;
6392 // count of view events.
6393 optional int32 view_appeared_count = 6;
6394 optional int32 view_disappeared_count = 7;
6395 optional int32 view_text_changed_count = 8;
6396
6397 // Flush stats.
6398 optional int32 max_events = 9;
6399 optional int32 idle_flush_freq = 10;
6400 optional int32 text_flush_freq = 11;
6401 optional int32 flush_reason = 12;
6402}
6403
6404/**
Bookatz75ee60422018-11-09 12:27:37 -08006405 * Pulls on-device BatteryStats power use calculations for the overall device.
6406 */
6407message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006408 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6409 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6410 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6411 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006412}
6413
6414/**
6415 * Pulls on-device BatteryStats power use calculations broken down by uid.
6416 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6417 * that is attributed to non-uid items. They must all be included to get the total power use.
6418 */
6419message DeviceCalculatedPowerBlameUid {
6420 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6421 optional int32 uid = 1 [(is_uid) = true];
6422
Bookatz3dbc13a2018-12-21 12:16:51 -08006423 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6424 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6425 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006426}
6427
6428/**
6429 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6430 * drain type.
6431 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6432 * is attributed uids. They must all be included to get the total power use.
6433 */
6434message DeviceCalculatedPowerBlameOther {
6435 // The type of item whose power use is being reported.
6436 enum DrainType {
6437 AMBIENT_DISPLAY = 0;
6438 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6439 BLUETOOTH = 2;
6440 CAMERA = 3;
6441 // Cell-standby
6442 CELL = 4;
6443 FLASHLIGHT = 5;
6444 IDLE = 6;
6445 MEMORY = 7;
6446 // Amount that total computed drain exceeded the drain estimated using the
6447 // battery level changes and capacity.
6448 OVERCOUNTED = 8;
6449 PHONE = 9;
6450 SCREEN = 10;
6451 // Amount that total computed drain was below the drain estimated using the
6452 // battery level changes and capacity.
6453 UNACCOUNTED = 11;
6454 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6455 WIFI = 13;
6456 }
6457 optional DrainType drain_type = 1;
6458
Bookatz3dbc13a2018-12-21 12:16:51 -08006459 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6460 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6461 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006462}
arangelov4e994062018-11-13 16:12:38 +00006463
6464/**
6465 * Logs device policy features.
6466 *
6467 * Logged from:
6468 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6469 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6470 */
6471message DevicePolicyEvent {
6472 // The event id - unique for each event.
6473 optional android.stats.devicepolicy.EventId event_id = 1;
6474 // The admin package name.
6475 optional string admin_package_name = 2;
6476 // A generic integer parameter.
6477 optional int32 integer_value = 3;
6478 // A generic boolean parameter.
6479 optional bool boolean_value = 4;
6480 // A parameter specifying a time period in milliseconds.
6481 optional uint64 time_period_millis = 5;
6482 // A parameter specifying a list of package names, bundle extras or string parameters.
6483 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6484}
shawnlinea5b66b2018-11-13 15:05:29 +08006485
6486/**
6487 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6488 *
6489 * Logged from:
6490 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6491 */
6492message DocsUILaunchReported {
6493 optional android.stats.docsui.LaunchAction launch_action = 1;
6494 optional bool has_initial_uri = 2;
6495 optional android.stats.docsui.MimeType mime_type = 3;
6496 optional android.stats.docsui.Root initial_root = 4;
6497}
6498
6499/**
6500 * Logs root/app visited event in file managers/picker. Call this when the user
6501 * taps on root/app in hamburger menu.
6502 *
6503 * Logged from:
6504 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6505 */
6506message DocsUIRootVisitedReported {
6507 optional android.stats.docsui.ContextScope scope = 1;
6508 optional android.stats.docsui.Root root = 2;
6509}
6510
6511/**
6512 * Logs file operation stats. Call this when a file operation has completed.
6513 *
6514 * Logged from:
6515 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6516 */
6517message DocsUIFileOperationReported {
6518 optional android.stats.docsui.Provider provider = 1;
6519 optional android.stats.docsui.FileOperation file_op = 2;
6520}
6521
6522/**
6523 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6524 * mode.
6525 *
6526 * Logged from:
6527 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6528 */
6529message DocsUIFileOperationCopyMoveModeReported {
6530 optional android.stats.docsui.FileOperation file_op = 1;
6531 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6532}
6533
6534
6535/**
6536 * Logs file sub operation stats. Call this when a file operation has failed.
6537 *
6538 * Logged from:
6539 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6540 */
6541message DocsUIFileOperationFailureReported {
6542 optional android.stats.docsui.Authority authority = 1;
6543 optional android.stats.docsui.SubFileOperation sub_op = 2;
6544}
6545
6546/**
6547* Logs the cancellation of a file operation. Call this when a job is canceled
6548*
6549* Logged from:
6550* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6551*/
6552message DocsUIFileOperationCanceledReported {
6553 optional android.stats.docsui.FileOperation file_op = 1;
6554}
6555
6556/**
6557 * Logs startup time in milliseconds.
6558 *
6559 * Logged from:
6560 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6561 */
6562message DocsUIStartupMsReported {
6563 optional int32 startup_millis = 1;
6564}
6565
6566/**
6567 * Logs the action that was started by user.
6568 *
6569 * Logged from:
6570 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6571 */
6572message DocsUIUserActionReported {
6573 optional android.stats.docsui.UserAction action = 1;
6574}
6575
6576/**
6577 * Logs the invalid type when invalid scoped access is requested.
6578 *
6579 * Logged from:
6580 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6581 */
6582message DocsUIInvalidScopedAccessRequestReported {
6583 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006584}
Ben Murdochbab399f2018-12-06 11:01:38 +00006585
6586/**
shawnlina75e82d2019-01-07 10:31:12 +08006587 * Logs the package name that launches docsui picker mode.
6588 *
6589 * Logged from:
6590 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6591 */
6592message DocsUIPickerLaunchedFromReported {
6593 optional string package_name = 1;
6594}
6595
6596/**
6597 * Logs the search type.
6598 *
6599 * Logged from:
6600 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6601 */
6602message DocsUISearchTypeReported {
6603 optional android.stats.docsui.SearchType search_type = 1;
6604}
6605
6606/**
6607 * Logs the search mode.
6608 *
6609 * Logged from:
6610 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6611 */
6612message DocsUISearchModeReported {
6613 optional android.stats.docsui.SearchMode search_mode = 1;
6614}
6615
6616/**
6617 * Logs the pick result information.
6618 *
6619 * Logged from:
6620 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6621 */
6622message DocsUIPickResultReported {
6623 optional int32 total_action_count = 1;
6624 optional int64 duration_millis = 2;
6625 optional int32 file_count= 3;
6626 optional bool is_searching = 4;
6627 optional android.stats.docsui.Root picked_from = 5;
6628 optional android.stats.docsui.MimeType mime_type = 6;
6629 optional int32 repeatedly_pick_times = 7;
6630}
6631
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006632/** Logs the drag and drop of files.
6633
6634 * Logged from:
6635 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6636 */
6637message DocsUIDragAndDropReported {
6638 optional bool drag_initiated_from_docsui = 1;
6639}
6640
shawnlina75e82d2019-01-07 10:31:12 +08006641/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006642 * Logs when an app's memory is compacted.
6643 *
6644 * Logged from:
6645 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6646 */
6647message AppCompacted {
6648 // The pid of the process being compacted.
6649 optional int32 pid = 1;
6650
6651 // The name of the process being compacted.
6652 optional string process_name = 2;
6653
6654 // The type of compaction.
6655 enum Action {
6656 UNKNOWN = 0;
6657 SOME = 1;
6658 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006659 PERSISTENT = 3;
6660 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006661 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006662 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006663
6664 // Total RSS in kilobytes consumed by the process prior to compaction.
6665 optional int64 before_rss_total_kilobytes = 4;
6666
6667 // File RSS in kilobytes consumed by the process prior to compaction.
6668 optional int64 before_rss_file_kilobytes = 5;
6669
6670 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6671 optional int64 before_rss_anon_kilobytes = 6;
6672
6673 // Swap in kilobytes consumed by the process prior to compaction.
6674 optional int64 before_swap_kilobytes = 7;
6675
6676 // Total RSS in kilobytes consumed by the process after compaction.
6677 optional int64 after_rss_total_kilobytes = 8;
6678
6679 // File RSS in kilobytes consumed by the process after compaction.
6680 optional int64 after_rss_file_kilobytes = 9;
6681
6682 // Anonymous RSS in kilobytes consumed by the process after compaction.
6683 optional int64 after_rss_anon_kilobytes = 10;
6684
6685 // Swap in kilobytes consumed by the process after compaction.
6686 optional int64 after_swap_kilobytes = 11;
6687
6688 // The time taken to perform compaction in milliseconds.
6689 optional int64 time_to_compact_millis = 12;
6690
6691 // The last compaction action performed for this app.
6692 optional Action last_action = 13;
6693
Ben Murdoch01720b82018-12-19 18:03:44 +00006694 // The last time that compaction was attempted on this process in milliseconds
6695 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6696 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006697
Ben Murdoch885c21b2019-03-15 18:02:04 +00006698 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006699 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006700
6701 // The process state at the time of compaction.
6702 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006703
6704 // Free ZRAM in kilobytes before compaction.
6705 optional int64 before_zram_free_kilobytes = 17;
6706
6707 // Free ZRAM in kilobytes after compaction.
6708 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006709}
lifr157fc552018-12-12 16:38:04 +08006710
6711/**
lifrb6b90b62019-03-29 00:40:17 +08006712 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6713 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6714 *
lifr1f74b052019-04-16 22:16:30 +08006715 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6716 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6717 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6718 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006719 */
6720message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006721 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006722
lifr1f74b052019-04-16 22:16:30 +08006723 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006724
6725 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006726 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006727
lifr1f74b052019-04-16 22:16:30 +08006728 // Only valid for event_type = EVENT_GETADDRINFO.
6729 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006730
lifr1f74b052019-04-16 22:16:30 +08006731 // Flags passed to android_res_nsend() defined in multinetwork.h
6732 // Only valid for event_type = EVENT_RESNSEND.
6733 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006734
lifrad9becc2019-05-20 11:04:41 +08006735 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006736
6737 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006738 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006739
6740 // Additional pass-through fields opaque to statsd.
6741 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006742 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006743
6744 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6745 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006746}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006747
6748/**
lifr1cc318d2020-03-19 21:58:30 +08006749 * logs the CapportApiData info
6750 * Logged from:
6751 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6752 */
6753message CapportApiData {
6754 // The TTL of the network connection provided by captive portal
6755 optional int32 remaining_ttl_secs = 1;
6756
6757 // The limit traffic data of the network connection provided by captive portal
6758 optional int32 remaining_bytes = 2;
6759
6760 // Is portal url option included in the DHCP packet (Yes, No)
6761 optional bool has_portal_url = 3;
6762
6763 // Is venue info (e.g. store info, maps, flight status) included (Yes, No)
6764 optional bool has_venue_info = 4;
6765}
6766
6767/**
6768 * logs a network Probe Event
6769 * Logged from:
6770 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6771 */
6772message ProbeEvent {
6773 // The probe type (http or https, or captive portal API...)
6774 optional android.stats.connectivity.ProbeType probe_type = 1;
6775
6776 // The latency in microseconds of the probe event
6777 optional int32 latency_micros = 2;
6778
6779 // The result of the probe event
6780 optional android.stats.connectivity.ProbeResult probe_result = 3;
6781
6782 // The CaptivePortal API info
6783 optional CapportApiData capport_api_data = 4;
6784}
6785
6786/**
6787 * log each ProbeEvent in ProbeEvents
6788 * Logged from:
6789 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6790 */
6791message ProbeEvents {
6792 // Record probe event during the validation
6793 repeated ProbeEvent probe_event = 1;
6794}
6795
6796/**
6797 * The DHCP (Dynamic Host Configuration Protocol) session info
6798 * Logged from:
6799 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
6800 */
6801message DhcpSession {
6802 // The DHCP Feature(s) enabled in this session
6803 repeated android.stats.connectivity.DhcpFeature used_features = 1;
6804
6805 // The discover packet (re)transmit count
6806 optional int32 discover_count = 2;
6807
6808 // The request packet (re)transmit count
6809 optional int32 request_count = 3;
6810
6811 // The IPv4 address conflict count
6812 // (only be meaningful when duplicate address detection is enabled)
6813 optional int32 conflict_count = 4;
6814
6815 // The DHCP packet parsing error code in this session
6816 // (defined in android.net.metrics.DhcpErrorEvent)
6817 repeated android.stats.connectivity.DhcpErrorCode error_code = 5;
6818
6819 // The result of DHCP hostname transliteration
6820 optional android.stats.connectivity.HostnameTransResult ht_result = 6;
6821}
6822
6823/**
6824 * Logs Network IP provisioning event
6825 * Logged from:
6826 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpProvisioningMetrics.java
6827 */
6828message NetworkIpProvisioningReported {
6829 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
6830 optional android.stats.connectivity.TransportType transport_type = 1;
6831
6832 // The latency in microseconds of IP Provisioning over IPV4
6833 optional int32 ipv4_latency_micros = 2;
6834
6835 // The latency in microseconds of IP Provisioning over IPV6
6836 optional int32 ipv6_latency_micros = 3;
6837
6838 // The time duration between provisioning start and end (success or failure)
6839 optional int64 provisioning_duration_micros = 4;
6840
6841 // The specific disconnect reason for this IP provisioning
6842 optional android.stats.connectivity.DisconnectCode disconnect_code = 5;
6843
6844 // Log DHCP session info (Only valid for IPv4)
6845 optional DhcpSession dhcp_session = 6 [(log_mode) = MODE_BYTES];
6846
6847 // The random number between 0 ~ 999 for sampling
6848 optional int32 random_number = 7;
6849}
6850
6851/**
6852 * Logs Network DHCP Renew event
6853 * Logged from:
6854 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
6855 */
6856message NetworkDhcpRenewReported {
6857 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
6858 optional android.stats.connectivity.TransportType transport_type = 1;
6859
6860 // The request packet (re)transmit count
6861 optional int32 request_count = 2;
6862
6863 // The latency in microseconds of DHCP Renew
6864 optional int32 latency_micros = 3;
6865
6866 // The DHCP error code is defined in android.net.metrics.DhcpErrorEvent
6867 optional android.stats.connectivity.DhcpErrorCode error_code = 4;
6868
6869 // The result of DHCP renew
6870 optional android.stats.connectivity.DhcpRenewResult renew_result = 5;
6871
6872 // The random number between 0 ~ 999 for sampling
6873 optional int32 random_number = 6;
6874}
6875
6876/**
6877 * Logs Network Validation event
6878 * Logged from:
6879 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6880 */
6881message NetworkValidationReported {
6882 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
6883 optional android.stats.connectivity.TransportType transport_type = 1;
6884
6885 // Record each probe event
6886 optional ProbeEvents probe_events = 2 [(log_mode) = MODE_BYTES];
6887
6888 // The result of the network validation
6889 optional android.stats.connectivity.ValidationResult validation_result = 3;
6890
6891 // The latency in microseconds of network validation
6892 optional int32 latency_micros = 4;
6893
6894 // The validation index (the first validation attempt or second, third...)
6895 optional int32 validation_index = 5;
6896
6897 // The random number between 0 ~ 999 for sampling
6898 optional int32 random_number = 6;
6899}
6900
6901/**
6902 * Logs NetworkStack Quirk event
6903 * Logged from:
6904 * packages/modules/NetworkStack/src/com/android/networkstack/
6905 */
6906message NetworkStackQuirkReported {
6907 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
6908 optional android.stats.connectivity.TransportType transport_type = 1;
6909
6910 // Record each Quirk event
6911 optional android.stats.connectivity.NetworkQuirkEvent event = 2;
6912}
6913
6914/**
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006915 * Logs when a data stall event occurs.
6916 *
6917 * Log from:
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006918 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006919 */
6920message DataStallEvent {
6921 // Data stall evaluation type.
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006922 // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006923 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6924 optional int32 evaluation_type = 1;
6925 // See definition in data_stall_event.proto.
6926 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6927 // See definition in data_stall_event.proto.
6928 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6929 // See definition in data_stall_event.proto.
6930 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6931 // See definition in data_stall_event.proto.
6932 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6933 // See definition in data_stall_event.proto.
6934 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006935 // The tcp packets fail rate from the latest tcp polling.
6936 optional int32 tcp_fail_rate = 7;
6937 // Number of packets sent since the last received packet.
6938 optional int32 tcp_sent_since_last_recv = 8;
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006939}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006940
6941/*
6942 * Logs when RescueParty resets some set of experiment flags.
6943 *
6944 * Logged from:
6945 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6946 */
6947message RescuePartyResetReported {
6948 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6949 optional int32 rescue_level = 1;
6950}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006951
6952/**
6953 * Logs when signed config is received from an APK, and if that config was applied successfully.
6954 * Logged from:
6955 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6956 */
6957message SignedConfigReported {
6958 enum Type {
6959 UNKNOWN_TYPE = 0;
6960 GLOBAL_SETTINGS = 1;
6961 }
6962 optional Type type = 1;
6963
6964 // The final status of the signed config received.
6965 enum Status {
6966 UNKNOWN_STATUS = 0;
6967 APPLIED = 1;
6968 BASE64_FAILURE_CONFIG = 2;
6969 BASE64_FAILURE_SIGNATURE = 3;
6970 SECURITY_EXCEPTION = 4;
6971 INVALID_CONFIG = 5;
6972 OLD_CONFIG = 6;
6973 SIGNATURE_CHECK_FAILED = 7;
6974 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006975 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006976 }
6977 optional Status status = 2;
6978
6979 // The version of the signed config processed.
6980 optional int32 version = 3;
6981
6982 // The package name that the config was extracted from.
6983 optional string from_package = 4;
6984
6985 enum Key {
6986 NO_KEY = 0;
6987 DEBUG = 1;
6988 PRODUCTION = 2;
6989 }
6990 // Which key was used to verify the config.
6991 optional Key verified_with = 5;
6992}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006993
6994/*
6995 * Logs GNSS Network-Initiated (NI) location events.
6996 *
6997 * Logged from:
6998 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6999 */
7000message GnssNiEventReported {
7001 // The type of GnssNiEvent.
7002 enum EventType {
7003 UNKNOWN = 0;
7004 NI_REQUEST = 1;
7005 NI_RESPONSE = 2;
7006 }
7007 optional EventType event_type = 1;
7008
7009 // An ID generated by HAL to associate NI notifications and UI responses.
7010 optional int32 notification_id = 2;
7011
7012 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007013 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007014
7015 // NI requires notification.
7016 optional bool need_notify = 4;
7017
7018 // NI requires verification.
7019 optional bool need_verify = 5;
7020
7021 // NI requires privacy override, no notification/minimal trace.
7022 optional bool privacy_override = 6;
7023
7024 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
7025 // seconds.
7026 optional int32 timeout = 7;
7027
7028 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007029 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007030
7031 // String representing the requester of the network inititated location request.
7032 optional string requestor_id = 9;
7033
7034 // Notification message text string representing the service(for eg. SUPL-service) who sent the
7035 // network initiated location request.
7036 optional string text = 10;
7037
7038 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007039 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007040
7041 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007042 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007043
7044 // True if SUPL ES is enabled.
7045 optional bool is_supl_es_enabled = 13;
7046
7047 // True if GNSS location is enabled.
7048 optional bool is_location_enabled = 14;
7049
7050 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007051 optional android.server.location.GnssUserResponseType user_response = 15;
7052}
7053
7054/**
7055 * Logs GNSS non-framework (NFW) location notification.
7056 *
7057 * Logged from:
7058 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
7059 */
7060message GnssNfwNotificationReported {
7061 // Package name of the Android proxy application representing the non-framework entity that
7062 // requested location. Set to empty string if unknown.
7063 optional string proxy_app_package_name = 1;
7064
7065 // Protocol stack that initiated the non-framework location request.
7066 optional android.server.location.NfwProtocolStack protocol_stack = 2;
7067
7068 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
7069 // set to empty string. This field is opaque to the framework and used for logging purposes.
7070 optional string other_protocol_stack_name = 3;
7071
7072 // Source initiating/receiving the location information.
7073 optional android.server.location.NfwRequestor requestor = 4;
7074
7075 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
7076 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
7077 // and used for logging purposes.
7078 optional string requestor_id = 5;
7079
7080 // Indicates whether location information was provided for this request.
7081 optional android.server.location.NfwResponseType response_type = 6;
7082
7083 // True if the device is in user initiated emergency session.
7084 optional bool in_emergency_mode = 7;
7085
7086 // True if cached location is provided.
7087 optional bool is_cached_location = 8;
7088
7089 // True if proxy app permission mismatch between framework and GNSS HAL.
7090 optional bool is_permission_mismatched = 9;
7091}
7092
7093/**
7094 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
7095 *
7096 * Logged from:
7097 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
7098 */
7099message GnssConfigurationReported {
7100 // SUPL host name.
7101 optional string supl_host = 1;
7102
7103 // SUPL port number.
7104 optional int32 supl_port = 2;
7105
7106 // C2K host name.
7107 optional string c2k_host = 3;
7108
7109 // C2K port number.
7110 optional int32 c2k_port = 4;
7111
7112 // The SUPL version requested by Carrier.
7113 optional int32 supl_ver = 5;
7114
7115 // The SUPL mode.
7116 optional android.server.location.SuplMode supl_mode = 6;
7117
7118 // True if NI emergency SUPL restrictions is enabled.
7119 optional bool supl_es = 7;
7120
7121 // LTE Positioning Profile settings
7122 optional android.server.location.LppProfile lpp_profile = 8;
7123
7124 // Positioning protocol on A-Glonass system.
7125 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
7126
7127 // True if emergency PDN is used. Otherwise, regular PDN is used.
7128 optional bool use_emergency_pdn_for_emergency_supl= 10;
7129
7130 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
7131 optional android.server.location.GpsLock gps_lock = 11;
7132
7133 // Number of seconds to extend the emergency session duration post emergency call.
7134 optional int32 es_extension_sec = 12;
7135
7136 // The full list of package names of proxy Android applications representing the non-framework
7137 // location access entities (on/off the device) for which the framework user has granted
7138 // non-framework location access permission. The package names are concatenated in one string
7139 // with spaces as separators.
7140 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007141}
Jack Yu95b64f32018-12-13 18:26:11 +08007142
7143/**
7144 * Logs when a NFC device's error occurred.
7145 * Logged from:
7146 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7147 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
7148 */
7149message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007150 enum Type {
7151 UNKNOWN = 0;
7152 CMD_TIMEOUT = 1;
7153 ERROR_NOTIFICATION = 2;
7154 AID_OVERFLOW = 3;
7155 }
7156 optional Type type = 1;
7157 // If it's nci cmd timeout, log the timeout command.
7158 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007159
Alex Salod7c3eef2019-01-25 14:43:27 -08007160 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007161}
7162
7163/**
7164 * Logs when a NFC device's state changed event
7165 * Logged from:
7166 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
7167 */
7168message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007169 enum State {
7170 UNKNOWN = 0;
7171 OFF = 1;
7172 ON = 2;
7173 ON_LOCKED = 3; // Secure Nfc enabled.
7174 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
7175 }
7176 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007177}
7178
7179/**
7180 * Logs when a NFC Beam Transaction occurred.
7181 * Logged from:
7182 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
7183 */
7184message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007185 enum Operation {
7186 UNKNOWN = 0;
7187 SEND = 1;
7188 RECEIVE = 2;
7189 }
7190 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007191}
7192
7193/**
7194 * Logs when a NFC Card Emulation Transaction occurred.
7195 * Logged from:
7196 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
7197 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
7198 */
7199message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007200 enum Category {
7201 UNKNOWN = 0;
7202 HCE_PAYMENT = 1;
7203 HCE_OTHER = 2;
7204 OFFHOST = 3;
7205 }
7206 // Transaction belongs to HCE payment or HCE other category, or offhost.
7207 optional Category category = 1;
7208 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7209 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007210}
7211
7212/**
7213 * Logs when a NFC Tag event occurred.
7214 * Logged from:
7215 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7216 */
7217message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007218 enum Type {
7219 UNKNOWN = 0;
7220 URL = 1;
7221 BT_PAIRING = 2;
7222 PROVISION = 3;
7223 WIFI_CONNECT = 4;
7224 APP_LAUNCH = 5;
7225 OTHERS = 6;
7226 }
7227 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007228}
7229
7230/**
7231 * Logs when Hce transaction triggered
7232 * Logged from:
7233 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7234 */
7235message NfcHceTransactionOccurred {
7236 // The latency period(in microseconds) it took for the first HCE data
7237 // exchange.
7238 optional uint32 latency_micros = 1;
7239}
7240
7241/**
7242 * Logs when SecureElement state event changed
7243 * Logged from:
7244 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7245 */
7246message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007247 enum State {
7248 UNKNOWN = 0;
7249 INITIALIZED = 1;
7250 DISCONNECTED = 2;
7251 CONNECTED = 3;
7252 HALCRASH = 4;
7253 }
7254 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007255
Alex Salod7c3eef2019-01-25 14:43:27 -08007256 optional string state_change_reason = 2;
7257 // SIMx or eSEx.
7258 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007259}
7260
7261/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007262 * Information about a permission grant request
7263 */
7264message PermissionGrantRequestResultReported {
7265 // unique value identifying an API call. A API call might result in multiple of these atoms
7266 optional int64 request_id = 1;
7267
7268 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007269 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007270
7271 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007272 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007273
7274 // The permission to be granted
7275 optional string permission_name = 4;
7276
7277 // If the permission was explicitly requested via the API or added by the system
7278 optional bool is_implicit = 5;
7279
7280 enum Result {
7281 UNDEFINED = 0;
7282 // permission request was ignored
7283 IGNORED = 1;
7284 // permission request was ignored because it was user fixed
7285 IGNORED_USER_FIXED = 2;
7286 // permission request was ignored because it was policy fixed
7287 IGNORED_POLICY_FIXED = 3;
7288 // permission was granted by user action
7289 USER_GRANTED = 4;
7290 // permission was automatically granted
7291 AUTO_GRANTED = 5;
7292 // permission was denied by user action
7293 USER_DENIED = 6;
7294 // permission was denied with prejudice by the user
7295 USER_DENIED_WITH_PREJUDICE = 7;
7296 // permission was automatically denied
7297 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007298 // permission request was ignored because permission is restricted
7299 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007300 // one time permission was granted by user action
7301 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007302 // user ignored request by leaving the request screen without choosing any option
7303 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007304 // user granted the permission after being linked to settings
7305 USER_GRANTED_IN_SETTINGS = 12;
7306 // user denied the permission after being linked to settings
7307 USER_DENIED_IN_SETTINGS = 13;
7308 // user denied the permission with prejudice after being linked to settings
7309 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7310 // permission was automatically revoked after one-time permission expired
7311 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007312 // permission was automatically revoked for unused app
7313 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007314 }
7315 // The result of the permission grant
7316 optional Result result = 6;
7317}
7318
7319/**
Jack Yu95b64f32018-12-13 18:26:11 +08007320 * Logs when Omapi API used
7321 * Logged from:
7322 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7323 */
7324message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007325 enum Operation {
7326 UNKNOWN = 0;
7327 OPEN_CHANNEL = 1;
7328 }
7329 optional Operation operation = 1;
7330 // SIMx or eSEx.
7331 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007332
Alex Salod7c3eef2019-01-25 14:43:27 -08007333 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007334}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007335
7336/**
Alex Saloa060aee2019-01-21 14:36:41 -08007337 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7338 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007339 * Logged from:
7340 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7341 */
7342message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007343 optional int64 dispatch_latency_millis = 1;
7344}
7345
7346/**
7347 * Logs AttentionManagerService attention check result.
7348 *
7349 * Logged from:
7350 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7351 */
7352message AttentionManagerServiceResultReported {
7353 // See core/java/android/service/attention/AttentionService.java
7354 enum AttentionCheckResult {
7355 UNKNOWN = 20;
7356 ATTENTION_SUCCESS_ABSENT = 0;
7357 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007358 ATTENTION_FAILURE_UNKNOWN = 2;
7359 ATTENTION_FAILURE_CANCELLED = 3;
7360 ATTENTION_FAILURE_PREEMPTED = 4;
7361 ATTENTION_FAILURE_TIMED_OUT = 5;
7362 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007363 }
7364 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007365}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007366
7367/**
7368 * Logs when an adb connection changes state.
7369 *
7370 * Logged from:
7371 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7372 */
7373message AdbConnectionChanged {
7374 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7375 // previously selected for this system.
7376 optional int64 last_connection_time_millis = 1;
7377
7378 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7379 // to reconnect via adb without user interaction.
7380 optional int64 auth_window_millis = 2;
7381
7382 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7383 optional android.debug.AdbConnectionStateEnum state = 3;
7384
7385 // True if the 'always allow' option was selected for this system.
7386 optional bool always_allow = 4;
7387}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007388
7389/*
7390 * Logs the reported speech DSP status.
7391 *
7392 * Logged from:
7393 * Vendor audio implementation.
7394 */
7395message SpeechDspStatReported {
7396 // The total Speech DSP uptime in milliseconds.
7397 optional int32 total_uptime_millis = 1;
7398 // The total Speech DSP downtime in milliseconds.
7399 optional int32 total_downtime_millis = 2;
7400 optional int32 total_crash_count = 3;
7401 optional int32 total_recover_count = 4;
7402}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007403
7404/**
7405 * Logs USB connector contaminant status.
7406 *
7407 * Logged from: USB Service.
7408 */
7409message UsbContaminantReported {
7410 optional string id = 1;
7411 optional android.service.usb.ContaminantPresenceStatus status = 2;
7412}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007413
7414/**
7415 * This atom is for debugging purpose.
7416 */
7417message DebugElapsedClock {
7418 // Monotically increasing value for each pull.
7419 optional int64 pull_count = 1;
7420 // Time from System.elapsedRealtime.
7421 optional int64 elapsed_clock_millis = 2;
7422 // Time from System.elapsedRealtime.
7423 optional int64 same_elapsed_clock_millis = 3;
7424 // Diff between current elapsed time and elapsed time from previous pull.
7425 optional int64 elapsed_clock_diff_millis = 4;
7426
7427 enum Type {
7428 TYPE_UNKNOWN = 0;
7429 ALWAYS_PRESENT = 1;
7430 PRESENT_ON_ODD_PULLS = 2;
7431 }
7432 // Type of behavior for the pulled data.
7433 optional Type type = 5;
7434}
7435
7436/**
7437 * This atom is for debugging purpose.
7438 */
7439message DebugFailingElapsedClock {
7440 // Monotically increasing value for each pull.
7441 optional int64 pull_count = 1;
7442 // Time from System.elapsedRealtime.
7443 optional int64 elapsed_clock_millis = 2;
7444 // Time from System.elapsedRealtime.
7445 optional int64 same_elapsed_clock_millis = 3;
7446 // Diff between current elapsed time and elapsed time from previous pull.
7447 optional int64 elapsed_clock_diff_millis = 4;
7448}
Steven Wuacef6bb2019-01-23 14:21:17 -05007449
7450/** Logs System UI bubbles event changed.
7451 *
7452 * Logged from:
7453 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7454 */
7455message BubbleUIChanged {
7456
7457 // The app package that is posting the bubble.
7458 optional string package_name = 1;
7459
7460 // The notification channel that is posting the bubble.
7461 optional string notification_channel = 2;
7462
7463 // The notification id associated with the posted bubble.
7464 optional int32 notification_id = 3;
7465
7466 // The position of the bubble within the bubble stack.
7467 optional int32 position = 4;
7468
7469 // The total number of bubbles within the bubble stack.
7470 optional int32 total_number = 5;
7471
7472 // User interactions with the bubble.
7473 enum Action {
7474 UNKNOWN = 0;
7475 POSTED = 1;
7476 UPDATED = 2;
7477 EXPANDED = 3;
7478 COLLAPSED = 4;
7479 DISMISSED = 5;
7480 STACK_DISMISSED = 6;
7481 STACK_MOVED = 7;
7482 HEADER_GO_TO_APP = 8;
7483 HEADER_GO_TO_SETTINGS = 9;
7484 PERMISSION_OPT_IN = 10;
7485 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007486 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007487 SWIPE_LEFT = 13;
7488 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007489 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007490 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007491 }
7492 optional Action action = 6;
7493
7494 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7495 optional float normalized_x_position = 7;
7496 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007497
7498 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7499 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007500
7501 // Whether the bubble is an on-going one.
7502 optional bool is_ongoing = 10;
7503
7504 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007505 // This is deprecated and the value should be ignored.
7506 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007507}
Kweku Adams8845d012018-12-11 20:06:45 -08007508
7509/**
Steven Wu552f63f2019-02-05 13:41:36 -05007510 * Logs System UI bubbles developer errors.
7511 *
7512 * Logged from:
7513 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7514 */
7515message BubbleDeveloperErrorReported {
7516
7517 // The app package that is posting the bubble.
7518 optional string package_name = 1;
7519
7520 // Bubble developer error type enums.
7521 enum Error {
7522 UNKNOWN = 0;
7523 ACTIVITY_INFO_MISSING = 1;
7524 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7525 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7526 }
7527 optional Error error = 2 [default = UNKNOWN];
7528}
7529
7530/**
Kweku Adams8845d012018-12-11 20:06:45 -08007531 * Logs that a constraint for a scheduled job has changed.
7532 *
7533 * Logged from:
7534 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7535 */
7536message ScheduledJobConstraintChanged {
7537 repeated AttributionNode attribution_node = 1;
7538
7539 // Name of the job.
7540 optional string job_name = 2;
7541
7542 optional com.android.server.job.ConstraintEnum constraint = 3;
7543
7544 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007545 UNKNOWN = 0;
7546 UNSATISFIED = 1;
7547 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007548 }
7549 optional State state = 4;
7550}
Alex Salod7c3eef2019-01-25 14:43:27 -08007551
7552/**
7553 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7554 * returns true.
7555 *
7556 * Logged from:
7557 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7558 */
7559message ScreenTimeoutExtensionReported {
7560 // Describes how many times in a row did the power manager reset the screen off timeout.
7561 optional uint32 consecutive_timeout_extended_count = 1;
7562}
Hui Yu885aca12019-01-10 17:11:34 -08007563
7564/*
7565* Logs number of milliseconds it takes to start a process.
7566* The definition of app process start time is from the app launch time to
7567* the time that Zygote finished forking the app process and loaded the
7568* application package's java classes.
7569
7570* This metric is different from AppStartOccurred which is for foreground
7571* activity only.
7572
7573* ProcessStartTime can report all processes (both foreground and background)
7574* start time.
7575*
7576* Logged from:
7577* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7578*/
7579message ProcessStartTime {
7580 // The uid of the ProcessRecord.
7581 optional int32 uid = 1 [(is_uid) = true];
7582
7583 // The process pid.
7584 optional int32 pid = 2;
7585
7586 // The process name.
7587 // Usually package name, "system" for system server.
7588 // Provided by ActivityManagerService.
7589 optional string process_name = 3;
7590
7591 enum StartType {
7592 UNKNOWN = 0;
7593 WARM = 1;
7594 HOT = 2;
7595 COLD = 3;
7596 }
7597
7598 // The start type.
7599 optional StartType type = 4;
7600
7601 // The elapsed realtime at the start of the process.
7602 optional int64 process_start_time_millis = 5;
7603
7604 // Number of milliseconds it takes to reach bind application.
7605 optional int32 bind_application_delay_millis = 6;
7606
7607 // Number of milliseconds it takes to finish start of the process.
7608 optional int32 process_start_delay_millis = 7;
7609
7610 // hostingType field in ProcessRecord, the component type such as "activity",
7611 // "service", "content provider", "broadcast" or other strings.
7612 optional string hosting_type = 8;
7613
7614 // hostingNameStr field in ProcessRecord. The component class name that runs
7615 // in this process.
7616 optional string hosting_name = 9;
7617}
7618
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007619/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007620 * Track Media Codec usage
7621 * Logged from:
7622 * frameworks/av/media/libstagefright/MediaCodec.cpp
7623 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7624 */
7625message MediametricsCodecReported {
7626 optional int64 timestamp_nanos = 1;
7627 optional string package_name = 2;
7628 optional int64 package_version_code = 3;
7629 optional int64 media_apex_version = 4;
7630
7631 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7632}
7633
7634/**
7635 * Track Media Extractor (pulling video/audio streams out of containers) usage
7636 * Logged from:
7637 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7638 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7639 */
7640message MediametricsExtractorReported {
7641 optional int64 timestamp_nanos = 1;
7642 optional string package_name = 2;
7643 optional int64 package_version_code = 3;
7644 optional int64 media_apex_version = 4;
7645
7646 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7647}
7648
7649/**
7650 * Track how we arbitrate between microphone/input requests.
7651 * Logged from
7652 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7653 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7654 */
7655message MediametricsAudiopolicyReported {
7656 optional int64 timestamp_nanos = 1;
7657 optional string package_name = 2;
7658 optional int64 package_version_code = 3;
7659 optional int64 media_apex_version = 4;
7660
7661 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7662}
7663
7664/**
7665 * Track how we arbitrate between microphone requests.
7666 * Logged from
7667 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7668 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7669 */
7670message MediametricsAudiorecordReported {
7671 optional int64 timestamp_nanos = 1;
7672 optional string package_name = 2;
7673 optional int64 package_version_code = 3;
7674 optional int64 media_apex_version = 4;
7675
7676 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7677}
7678
7679/**
7680 * Track how we arbitrate between microphone/input requests.
7681 * Logged from
7682 * frameworks/av/media/libnblog/ReportPerformance.cpp
7683 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7684 */
7685message MediametricsAudiothreadReported {
7686 optional int64 timestamp_nanos = 1;
7687 optional string package_name = 2;
7688 optional int64 package_version_code = 3;
7689 optional int64 media_apex_version = 4;
7690
7691 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7692}
7693
7694/**
7695 * Track how we arbitrate between microphone/input requests.
7696 * Logged from
7697 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7698 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7699 */
7700message MediametricsAudiotrackReported {
7701 optional int64 timestamp_nanos = 1;
7702 optional string package_name = 2;
7703 optional int64 package_version_code = 3;
7704 optional int64 media_apex_version = 4;
7705
7706 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7707}
7708
7709/**
7710 * Track information about DRM framework performance
7711 * Logged from
7712 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7713 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7714 */
7715message MediametricsMediadrmReported {
7716 optional int64 timestamp_nanos = 1;
7717 optional string package_name = 2;
7718 optional int64 package_version_code = 3;
7719 optional int64 media_apex_version = 4;
7720
7721 // vendor+description tell about which DRM plugin is in use on this device
7722 optional string vendor = 5;
7723 optional string description = 6;
7724 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7725 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7726}
7727
7728/**
7729 * Track information about the widevine DRM plugin performance
7730 * Logged from
7731 * vendor/widevine/libwvdrmengine/cdm/metrics
7732 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7733 */
7734message MediametricsDrmWidevineReported {
7735 optional int64 timestamp_nanos = 1;
7736 optional string package_name = 2;
7737 optional int64 package_version_code = 3;
7738 optional int64 media_apex_version = 4;
7739
7740 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7741}
7742
7743/**
7744 * Track information about recordings (e.g. camcorder)
7745 * Logged from
7746 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7747 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7748 */
7749message MediametricsRecorderReported {
7750 optional int64 timestamp_nanos = 1;
7751 optional string package_name = 2;
7752 optional int64 package_version_code = 3;
7753 optional int64 media_apex_version = 4;
7754
7755 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7756}
7757
7758/**
7759 * Track Media Player usage
7760 * Logged from:
7761 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7762 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7763 */
7764message MediametricsNuPlayerReported {
7765 optional int64 timestamp_nanos = 1;
7766 optional string package_name = 2;
7767 optional int64 package_version_code = 3;
7768 optional int64 media_apex_version = 4;
7769
7770 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7771}
7772
7773/**
Robert Shiha4beed32019-08-19 14:15:23 -07007774 * Track Legacy DRM usage
7775 * Logged from
7776 * frameworks/av/drm/drmserver/DrmManager.cpp
7777 */
7778message MediametricsDrmManagerReported {
7779 optional int64 timestamp_nanos = 1;
7780 optional string package_name = 2;
7781 optional int64 package_version_code = 3;
7782 optional int64 media_apex_version = 4;
7783
7784 enum Method {
7785 METHOD_NOT_FOUND = -1;
7786 GET_CONSTRAINTS = 0;
7787 GET_METADATA = 1;
7788 CAN_HANDLE = 2;
7789 PROCESS_DRM_INFO = 3;
7790 ACQUIRE_DRM_INFO = 4;
7791 SAVE_RIGHTS = 5;
7792 GET_ORIGINAL_MIME_TYPE = 6;
7793 GET_DRM_OBJECT_TYPE = 7;
7794 CHECK_RIGHTS_STATUS = 8;
7795 REMOVE_RIGHTS = 9;
7796 REMOVE_ALL_RIGHTS = 10;
7797 OPEN_CONVERT_SESSION = 11;
7798 OPEN_DECRYPT_SESSION = 12;
7799 }
7800
7801 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7802 optional string plugin_id = 5;
7803 optional string description = 6;
7804 optional Method method = 7;
7805 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007806
7807 optional int64 get_constraints_count = 9;
7808 optional int64 get_metadata_count = 10;
7809 optional int64 can_handle_count = 11;
7810 optional int64 process_drm_info_count = 12;
7811 optional int64 acquire_drm_info_count = 13;
7812 optional int64 save_rights_count = 14;
7813 optional int64 get_original_mime_type_count = 15;
7814 optional int64 get_drm_object_type_count = 16;
7815 optional int64 check_rights_status_count = 17;
7816 optional int64 remove_rights_count = 18;
7817 optional int64 remove_all_rights_count = 19;
7818 optional int64 open_convert_session_count = 20;
7819 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007820}
7821
7822/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007823 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007824 * Pulled from: StatsCompanionService
7825*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007826message DangerousPermissionState {
7827 // Name of the permission
7828 optional string permission_name = 1;
7829
7830 // Uid of the package
7831 optional int32 uid = 2 [(is_uid) = true];
7832
7833 // Package requesting the permission
7834 optional string package_name = 3;
7835
7836 // If the permission is granted to the uid
7837 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007838
7839 // Permission flags as per android.content.pm.PermissionFlags
7840 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007841}
7842
Michael Groover4a0ca942019-01-24 17:41:25 -08007843/**
7844 * Logs when a package is denied access to a device identifier based on the new access requirements.
7845 *
7846 * Logged from:
7847 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7848 */
7849message DeviceIdentifierAccessDenied {
7850 // The name of the package denied access to the requested device identifier.
7851 optional string package_name = 1;
7852
7853 // The name of the device identifier method the package attempted to invoke.
7854 optional string method_name = 2;
7855
7856 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007857 // Starting from Android 11, this boolean is not set and will always be false.
7858 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007859
7860 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007861 // Starting from Android 11, this boolean is not set and will always be false.
7862 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007863}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007864
7865/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007866 * Pulls the ongoing mainline install train version code.
7867 * Pulled from StatsCompanionService
7868 */
7869message TrainInfo {
7870 optional int64 train_version_code = 1;
7871
7872 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007873
7874 optional string train_name = 3;
7875
7876 enum Status {
7877 UNKNOWN = 0;
7878 INSTALL_REQUESTED = 1;
7879 INSTALL_STARTED = 2;
7880 INSTALL_STAGED_NOT_READY = 3;
7881 INSTALL_STAGED_READY = 4;
7882 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007883 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7884 // and INSTALL_FAILURE_COMMIT.
7885 INSTALL_FAILURE = 6 [deprecated = true];
7886 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007887 INSTALL_CANCELLED = 7;
7888 INSTALLER_ROLLBACK_REQUESTED = 8;
7889 INSTALLER_ROLLBACK_INITIATED = 9;
7890 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7891 INSTALLER_ROLLBACK_STAGED = 11;
7892 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7893 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7894 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7895 INSTALLER_ROLLBACK_SUCCESS = 15;
7896 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007897 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7898 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7899 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7900 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7901 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7902 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007903 INSTALL_FAILURE_DOWNLOAD = 23;
7904 INSTALL_FAILURE_STATE_MISMATCH = 24;
7905 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007906 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007907 }
7908 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007909}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007910
7911/**
7912 * Logs the gesture stage changed event.
7913 *
7914 * Logged from:
7915 * frameworks/base/packages/SystemUI/
7916 */
7917message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007918 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007919}
7920
7921/**
7922 * Logs the feedback type.
7923 *
7924 * Logged from:
7925 * frameworks/base/packages/SystemUI/
7926 */
7927message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007928 // Whether or not the gesture was used.
7929 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007930}
7931
7932/**
7933 * Logs the progress.
7934 *
7935 * Logged from:
7936 * frameworks/base/packages/SystemUI/
7937 */
7938message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007939 // [0,100] progress for the assist gesture.
7940 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007941}
Neil Fullerdb14b482019-02-05 19:44:44 +00007942
7943/*
7944 * Information about the time zone data on a device.
7945 */
7946message TimeZoneDataInfo {
7947 // A version identifier for the data set on device. e.g. "2018i"
7948 optional string tzdb_version = 1;
7949}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007950
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007951/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007952 * Logs the GPU stats global health information.
7953 *
7954 * Logged from:
7955 * frameworks/native/services/gpuservice/gpustats/
7956 */
7957message GpuStatsGlobalInfo {
7958 // Package name of the gpu driver.
7959 optional string driver_package_name = 1;
7960
7961 // Version name of the gpu driver.
7962 optional string driver_version_name = 2;
7963
7964 // Version code of the gpu driver.
7965 optional int64 driver_version_code = 3;
7966
7967 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7968 optional int64 driver_build_time = 4;
7969
7970 // Total count of the gl driver gets loaded.
7971 optional int64 gl_loading_count = 5;
7972
7973 // Total count of the gl driver fails to be loaded.
7974 optional int64 gl_loading_failure_count = 6;
7975
7976 // Total count of the Vulkan driver gets loaded.
7977 optional int64 vk_loading_count = 7;
7978
7979 // Total count of the Vulkan driver fails to be loaded.
7980 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007981
7982 // Api version of the system Vulkan driver.
7983 optional int32 vulkan_version = 9;
7984
7985 // Api version of the system CPU Vulkan driver.
7986 optional int32 cpu_vulkan_version = 10;
7987
7988 // Api version of the system GLES driver.
7989 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007990
7991 // Total count of the angle driver gets loaded.
7992 optional int64 angle_loading_count = 12;
7993
7994 // Total count of the angle driver fails to be loaded.
7995 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007996}
7997
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007998/**
7999 * GPU driver loading time info.
8000 */
8001message GpuDriverLoadingTime {
8002 // List of all the driver loading times for this app. The list size is
8003 // capped at 50.
8004 repeated int64 driver_loading_time = 1;
8005}
8006
8007/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008008 * Logs the GPU stats per app health information.
8009 *
8010 * Logged from:
8011 * frameworks/native/services/gpuservice/gpustats/
8012 */
8013message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008014 // Package name of the application that loads the gpu driver. Total number
8015 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008016 optional string app_package_name = 1;
8017
8018 // Version code of the gpu driver this app loads.
8019 optional int64 driver_version_code = 2;
8020
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008021 // gl driver loading time info.
8022 optional GpuDriverLoadingTime gl_driver_loading_time = 3
8023 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008024
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008025 // Vulkan driver loading time info.
8026 optional GpuDriverLoadingTime vk_driver_loading_time = 4
8027 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07008028
8029 // Angle driver loading time info.
8030 optional GpuDriverLoadingTime angle_driver_loading_time = 5
8031 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07008032
8033 // CPU Vulkan implementation is in use.
8034 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07008035
8036 // App is not doing pre-rotation correctly.
8037 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08008038
8039 // App creates GLESv1 context.
8040 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008041}
Rafal Slawikd4e87572019-03-12 13:08:38 +00008042
8043/*
8044 * Logs the size of the system ion heap.
8045 *
8046 * Pulled from StatsCompanionService.
8047 */
8048message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008049 // Deprecated due to limited support of ion stats in debugfs.
8050 // Use `IonHeapSize` instead.
8051 option deprecated = true;
8052
Rafal Slawikd4e87572019-03-12 13:08:38 +00008053 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008054 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00008055 optional int64 size_in_bytes = 1;
8056}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008057
Rafal Slawik77987ed2019-06-17 12:28:23 +01008058/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008059 * Logs the total size of the ion heap.
8060 *
8061 * Pulled from StatsCompanionService.
8062 */
8063message IonHeapSize {
8064 // Total size of all ion heaps in kilobytes.
8065 // Read from: /sys/kernel/ion/total_heaps_kb.
8066 optional int32 total_size_kb = 1;
8067}
8068
8069/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01008070 * Logs the per-process size of the system ion heap.
8071 *
8072 * Pulled from StatsCompanionService.
8073 */
8074message ProcessSystemIonHeapSize {
8075 // The uid if available. -1 means not available.
8076 optional int32 uid = 1 [(is_uid) = true];
8077
8078 // The process name (from /proc/PID/cmdline).
8079 optional string process_name = 2;
8080
8081 // Sum of sizes of all allocations.
8082 optional int32 total_size_in_kilobytes = 3;
8083
8084 // Number of allocations.
8085 optional int32 allocation_count = 4;
8086
8087 // Size of the largest allocation.
8088 optional int32 max_size_in_kilobytes = 5;
8089}
8090
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008091/**
8092 * Push network stack events.
8093 *
8094 * Log from:
8095 * frameworks/base/packages/NetworkStack/
8096 */
8097message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08008098 // The id that indicates the event reported from NetworkStack.
8099 optional int32 event_id = 1;
8100 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008101 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
8102}
Carmen Agimofa769c152019-03-04 14:39:14 +00008103
8104/**
8105 * Logs the apps that are installed on the external storage.
8106 * Pulled from:
8107 * StatsCompanionService
8108 */
8109message AppsOnExternalStorageInfo {
8110 // The type of the external storage.
8111 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
8112 // The name of the package that is installed on the external storage.
8113 optional string package_name = 2;
8114}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07008115
8116/**
8117 * Logs the settings related to Face.
8118 * Logged from:
8119 * frameworks/base/services/core/java/com/android/server/stats
8120 */
8121message FaceSettings {
8122 // Whether or not face unlock is allowed on Keyguard.
8123 optional bool unlock_keyguard_enabled = 1;
8124 // Whether or not face unlock dismisses the Keyguard.
8125 optional bool unlock_dismisses_keyguard = 2;
8126 // Whether or not face unlock requires attention.
8127 optional bool unlock_attention_required = 3;
8128 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
8129 optional bool unlock_app_enabled = 4;
8130 // Whether or not face unlock always requires user confirmation.
8131 optional bool unlock_always_require_confirmation = 5;
8132 // Whether or not a diverse set of poses are required during enrollment.
8133 optional bool unlock_diversity_required = 6;
8134}
Maggie White442b6312019-04-05 16:26:44 -07008135
8136/**
8137 * Logs cooling devices maintained by the kernel.
8138 *
8139 * Pulled from StatsCompanionService.java
8140 */
8141message CoolingDevice {
8142 // The type of cooling device being reported. Eg. CPU, GPU...
8143 optional android.os.CoolingTypeEnum device_location = 1;
8144 // The name of the cooling device source. Eg. CPU0
8145 optional string device_name = 2;
8146 // Current throttle state of the cooling device. The value can any unsigned
8147 // integer between 0 and max_state defined in its driver. 0 means device is
8148 // not in throttling, higher value means deeper throttling.
8149 optional int32 state = 3;
8150}
Ben Blount763a5d52019-04-10 11:48:58 -07008151
8152/**
8153 * Intelligence has several counter-type events that don't warrant a
8154 * full separate atom. These are primarily API call counters but also include
8155 * counters for feature usage and specific failure modes.
8156 *
8157 * Logged from the Intelligence mainline module.
8158 */
8159message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07008160 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07008161 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07008162 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07008163 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07008164 // How many times the event occured (to report a batch of high frequency events).
8165 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07008166 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07008167 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07008168}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07008169
8170/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008171 * Logs when Car Power state changed.
8172 *
8173 * Logged from:
8174 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8175 */
8176message CarPowerStateChanged {
8177 // States come from CpmsState in CarPowerManagementService.java.
8178 enum State {
8179 WAIT_FOR_VHAL = 0;
8180 ON = 1;
8181 SHUTDOWN_PREPARE = 2;
8182 WAIT_FOR_FINISH = 3;
8183 SUSPEND = 4;
8184 SIMULATE_SLEEP = 5;
8185 }
8186 optional State state = 1;
8187}
8188
8189/**
Mayank Gargda5ca012020-05-14 00:23:53 -07008190 * Logs when Car User Hal is requested to switch/create/remove user.
8191 *
8192 * Logged from:
8193 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8194 */
8195message CarUserHalModifyUserRequestReported {
8196 // Request id for the request.
8197 optional int32 request_id = 1;
8198 // Request type.
8199 enum RequestType {
8200 UNKNOWN = 0;
8201 // Car user manager requested user switch.
8202 SWITCH_REQUEST_ANDROID = 1;
8203 // OEM requested User switch.
8204 SWITCH_REQUEST_OEM = 2;
8205 // Hal switch requested after android switch using activity manager.
8206 SWITCH_REQUEST_LEGACY = 3;
8207 // Create User
8208 CREATE_REQUEST = 4;
8209 // Remove User
8210 REMOVE_REQUEST = 5;
8211 }
8212 optional RequestType request_type = 2;
8213 // Android User id of the current user which can only be 0, 10, 11 and so on.
8214 // -1 if not available.
8215 optional int32 user_id = 3;
8216 // VHAL flags of the current user. (-1 if not available)
8217 optional int32 user_flags = 4;
8218 // Android User id of the target user for switch/create/remove. It can only
8219 // be 0, 10, 11 and so on. -1 if not available.
8220 optional int32 target_user_id = 5;
8221 // VHAL flags of the target user for switch/create/remove. (-1 if not available)
8222 optional int32 target_user_flags = 6;
8223 // Request timeout Milliseconds (-1 if not available)
8224 optional int32 timeout_millis = 7;
8225}
8226
8227/**
8228 * Logs when Car User Hal responds to switch/create user request.
8229 *
8230 * Logged from:
8231 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8232 */
8233message CarUserHalModifyUserResponseReported {
8234 // Request id of the request associated with the response.
8235 optional int32 request_id = 1;
8236 // Car user hal callback status.
8237 enum CallbackStatus {
8238 UNKNOWN = 0;
8239 // Hal response was invalid.
8240 INVALID = 1;
8241 // Hal response was ok.
8242 OK = 2;
8243 // Hal timeout during set call.
8244 HAL_SET_TIMEOUT = 3;
8245 // Hal response timeout.
8246 HAL_RESPONSE_TIMEOUT = 4;
8247 // Hal responded with wrong info.
8248 WRONG_HAL_RESPONSE = 5;
8249 // Hal is processing multiple requests simultaneously.
8250 CONCURRENT_OPERATION = 6;
8251 }
8252 optional CallbackStatus callback_status = 2;
8253
8254 // Hal request status for user switch/create/remove.
8255 enum HalRequestStatus {
8256 UNSPECIFIED = 0;
8257 // Hal request for user switch/create is successful.
8258 SUCCESS = 1;
8259 // Hal request for user switch/create failed.
8260 FAILURE = 2;
8261 }
8262 optional HalRequestStatus request_status = 3;
8263}
8264
8265/**
8266 * Logs when post switch response is posted to Car User Hal.
8267 *
8268 * Logged from:
8269 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8270 */
8271message CarUserHalPostSwitchResponseReported {
8272 // Request id.
8273 optional int32 request_id = 1;
8274
8275 // Android user switch status.
8276 enum UserSwitchStatus {
8277 UNKNOWN = 0;
8278 // Android user switch is successful.
8279 SUCCESS = 1;
8280 // Android user switch failed.
8281 FAILURE = 2;
8282 }
8283 optional UserSwitchStatus switch_status = 2;
8284}
8285
8286/**
8287 * Logs when initial user information is requested from Car User Hal.
8288 *
8289 * Logged from:
8290 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8291 */
8292message CarUserHalInitialUserInfoRequestReported {
8293 // Request id for the request.
8294 optional int32 request_id = 1;
8295
8296 // Request type for initial user information.
8297 enum InitialUserInfoRequestType {
8298 UNKNOWN = 0;
8299 // At the first time Android was booted (or after a factory reset).
8300 FIRST_BOOT = 1;
8301 // At the first time Android was booted after the system was updated.
8302 FIRST_BOOT_AFTER_OTA = 2;
8303 // When Android was booted "from scratch".
8304 COLD_BOOT = 3;
8305 // When Android was resumed after the system was suspended to memory.
8306 RESUME = 4;
8307 }
8308 optional InitialUserInfoRequestType request_type = 2;
8309 // Request timeout Milliseconds (-1 if not available)
8310 optional int32 timeout_millis = 3;
8311}
8312
8313/**
8314 * Logs when Car User Hal responds to initial user information requests.
8315 *
8316 * Logged from:
8317 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8318 */
8319message CarUserHalInitialUserInfoResponseReported {
8320 // Request id of the request associated with the response.
8321 optional int32 request_id = 1;
8322 // Car user hal callback status.
8323 enum CallbackStatus {
8324 UNKNOWN = 0;
8325 // Hal response was invalid.
8326 INVALID = 1;
8327 // Hal response was ok.
8328 OK = 2;
8329 // Hal timeout during set call.
8330 HAL_SET_TIMEOUT = 3;
8331 // Hal response timeout.
8332 HAL_RESPONSE_TIMEOUT = 4;
8333 // Hal responded with wrong info.
8334 WRONG_HAL_RESPONSE = 5;
8335 // Hal is processing multiple requests simultaneously.
8336 CONCURRENT_OPERATION = 6;
8337 }
8338 optional CallbackStatus callback_status = 2;
8339 // Response for initial user information request.
8340 enum InitialUserInfoResponseAction {
8341 UNSPECIFIED = 0;
8342 // Let the Android System decide what to do.
8343 DEFAULT = 1;
8344 // Switch to an existing Android user.
8345 SWITCH = 2;
8346 // Create a new Android user (and switch to it).
8347 CREATE = 3;
8348 }
8349 optional InitialUserInfoResponseAction response_action = 3;
8350 // Android User id of the target user which can only be 0, 10, 11 and so on.
8351 // -1 if not available.
8352 optional int32 target_user = 4;
8353 // VHAL flags of the current user. (-1 if not available)
8354 optional int32 target_user_flags = 5;
8355 // User locales
8356 optional string user_locales = 6;
8357}
8358
8359/**
8360 * Logs when set user association is requested from Car User Hal.
8361 *
8362 * Logged from:
8363 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8364 */
8365message CarUserHalUserAssociationRequestReported {
8366 // Request id for the request.
8367 optional int32 request_id = 1;
8368 // Request type.
8369 enum RequestType {
8370 UNKNOWN = 0;
8371 // For setting user association information.
8372 SET = 1;
8373 // For getting user association information.
8374 GET = 2;
8375 }
8376 optional RequestType request_type = 2;
8377 // Android User id of the current user which can only be 0, 10, 11 and so on.
8378 // -1 if not available.
8379 optional int32 current_user_id = 3;
8380 // VHAL flags of the current user. (-1 if not available)
8381 optional int32 current_user_flags = 4;
8382 // Number of the set associations requested.
8383 optional int32 number_associations = 5;
8384 // Concatenated string for the types from set associations request.
8385 // This is a string converted from an array of integers.
8386 optional string user_identification_association_types = 6;
8387 // Concatenated string for the values from set associations request.
8388 // This is a string converted from an array of integers.
8389 optional string user_identification_association_values = 7;
8390}
8391
8392/**
8393 * Logs when Car User Hal responds to set user association requests.
8394 *
8395 * Logged from:
8396 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8397 */
8398message CarUserHalSetUserAssociationResponseReported {
8399 // Request id of the request associated with the response.
8400 optional int32 request_id = 1;
8401 // Car user hal callback status.
8402 enum CallbackStatus {
8403 UNKNOWN = 0;
8404 // Hal response was invalid.
8405 INVALID = 1;
8406 // Hal response was ok.
8407 OK = 2;
8408 // Hal timeout during set call.
8409 HAL_SET_TIMEOUT = 3;
8410 // Hal response timeout.
8411 HAL_RESPONSE_TIMEOUT = 4;
8412 // Hal responded with wrong info.
8413 WRONG_HAL_RESPONSE = 5;
8414 // Hal is processing multiple requests simultaneously.
8415 CONCURRENT_OPERATION = 6;
8416 }
8417 optional CallbackStatus callback_status = 2;
8418 // Number of the set associations in the response.
8419 optional int32 number_associations = 3;
8420 // Concatenated string for the types from set associations request.
8421 // This is a string converted from an array of integers.
8422 optional string user_identification_association_types = 4;
8423 // Concatenated string for the values from set associations request.
8424 // This is a string converted from an array of integers.
8425 optional string user_identification_association_values = 5;
8426}
8427
8428/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008429 * Logs whether GarageMode is entered.
8430 *
8431 * Logged from:
8432 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8433 */
8434message GarageModeInfo {
8435 // Whether GarageMode is entered.
8436 optional bool is_garage_mode = 1;
8437}
Martijn Coenencd95d462019-04-25 17:09:45 +02008438
8439/**
8440 * Historical app ops data per package.
8441 */
8442message AppOps {
8443 // Uid of the package requesting the op
8444 optional int32 uid = 1 [(is_uid) = true];
8445
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008446 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008447 optional string package_name = 2;
8448
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008449 // operation id
8450 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008451
8452 // The number of times the op was granted while the app was in the
8453 // foreground (only for trusted requests)
8454 optional int64 trusted_foreground_granted_count = 4;
8455
8456 // The number of times the op was granted while the app was in the
8457 // background (only for trusted requests)
8458 optional int64 trusted_background_granted_count = 5;
8459
8460 // The number of times the op was rejected while the app was in the
8461 // foreground (only for trusted requests)
8462 optional int64 trusted_foreground_rejected_count = 6;
8463
8464 // The number of times the op was rejected while the app was in the
8465 // background (only for trusted requests)
8466 optional int64 trusted_background_rejected_count = 7;
8467
8468 // For long-running operations, total duration of the operation
8469 // while the app was in the foreground (only for trusted requests)
8470 optional int64 trusted_foreground_duration_millis = 8;
8471
8472 // For long-running operations, total duration of the operation
8473 // while the app was in the background (only for trusted requests)
8474 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008475
8476 // Whether AppOps is guarded by Runtime permission
8477 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008478}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008479
8480/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008481 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008482 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008483message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008484 // Uid of the package requesting the op
8485 optional int32 uid = 1 [(is_uid) = true];
8486
8487 // Name of the package performing the op
8488 optional string package_name = 2;
8489
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008490 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8491 // Attributions must be provided through manifest using <attribution> tag available in R and
8492 // above.
8493 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008494
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008495 // operation id
8496 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008497
8498 // The number of times the op was granted while the app was in the
8499 // foreground (only for trusted requests)
8500 optional int64 trusted_foreground_granted_count = 5;
8501
8502 // The number of times the op was granted while the app was in the
8503 // background (only for trusted requests)
8504 optional int64 trusted_background_granted_count = 6;
8505
8506 // The number of times the op was rejected while the app was in the
8507 // foreground (only for trusted requests)
8508 optional int64 trusted_foreground_rejected_count = 7;
8509
8510 // The number of times the op was rejected while the app was in the
8511 // background (only for trusted requests)
8512 optional int64 trusted_background_rejected_count = 8;
8513
8514 // For long-running operations, total duration of the operation
8515 // while the app was in the foreground (only for trusted requests)
8516 optional int64 trusted_foreground_duration_millis = 9;
8517
8518 // For long-running operations, total duration of the operation
8519 // while the app was in the background (only for trusted requests)
8520 optional int64 trusted_background_duration_millis = 10;
8521
8522 // Whether AppOps is guarded by Runtime permission
8523 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008524
8525 // Sampling rate used on device, from 0 to 100
8526 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008527}
8528
8529/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008530 * Location Manager API Usage information(e.g. API under usage,
8531 * API call's parameters).
8532 * Logged from:
8533 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8534 */
8535message LocationManagerApiUsageReported {
8536
8537 // Indicating if usage starts or usage ends.
8538 optional android.stats.location.UsageState state = 1;
8539
8540 // LocationManagerService's API in use.
8541 // We can identify which API from LocationManager is
8542 // invoking current LMS API by the combination of
8543 // API parameter(e.g. is_listener_null, is_intent_null,
8544 // is_location_request_null)
8545 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8546
8547 // Name of the package calling the API.
8548 optional string calling_package_name = 3;
8549
8550 // Type of the location provider.
8551 optional android.stats.location.ProviderType provider = 4;
8552
8553 // Quality of the location request
8554 optional android.stats.location.LocationRequestQuality quality = 5;
8555
8556 // The desired interval for active location updates, in milliseconds.
8557 // Bucketized to reduce cardinality.
8558 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8559
8560 // Minimum distance between location updates, in meters.
8561 // Bucketized to reduce cardinality.
8562 optional android.stats.location.SmallestDisplacementBucket
8563 bucketized_smallest_displacement = 7;
8564
8565 // The number of location updates.
8566 optional int64 num_updates = 8;
8567
8568 // The request expiration time, in millisecond since boot.
8569 // Bucketized to reduce cardinality.
8570 optional android.stats.location.ExpirationBucket
8571 bucketized_expire_in = 9;
8572
8573 // Type of Callback passed in for this API.
8574 optional android.stats.location.CallbackType callback_type = 10;
8575
8576 // The radius of the central point of the alert
8577 // region, in meters. Only for API REQUEST_GEOFENCE.
8578 // Bucketized to reduce cardinality.
8579 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8580
8581 // Activity Importance of API caller.
8582 // Categorized to 3 types that are interesting from location's perspective.
8583 optional android.stats.location.ActivityImportance activiy_importance = 12;
8584}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008585
8586/**
8587 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8588 */
8589message ReviewPermissionsFragmentResultReported {
8590 // unique value identifying a permission group change. A permission group change might result
8591 // in multiple of these atoms
8592 optional int64 change_id = 1;
8593
8594 // UID of package the permission belongs to
8595 optional int32 uid = 2 [(is_uid) = true];
8596
8597 // Name of package the permission belongs to
8598 optional string package_name = 3;
8599
8600 // The permission to be granted
8601 optional string permission_name = 4;
8602
8603 // The result of the permission grant
8604 optional bool permission_granted = 5;
8605}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008606
8607/**
8608* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8609* Logged from: RuntimePermissionUpdgradeController
8610*/
8611message RuntimePermissionsUpgradeResult {
8612 // Permission granted as result of upgrade
8613 optional string permission_name = 1;
8614
8615 // UID of package granted permission
8616 optional int32 uid = 2 [(is_uid) = true];
8617
8618 // Name of package granted permission
8619 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008620}
8621
8622/**
8623* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8624*/
8625message GrantPermissionsActivityButtonActions {
8626 // Permission granted as result of upgrade
8627 optional string permission_group_name = 1;
8628
8629 // UID of package granted permission
8630 optional int32 uid = 2 [(is_uid) = true];
8631
8632 // Name of package requesting permission
8633 optional string package_name = 3;
8634
8635 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8636 // LABEL_ constants in GrantPermissionActivity.java
8637 optional int32 buttons_presented = 4;
8638
8639 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8640 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008641
8642 // id which identifies single session of user interacting with permission controller
8643 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008644}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008645
8646/**
8647 * Information about LocationAccessCheck notification presented to user
8648 */
8649message LocationAccessCheckNotificationAction {
8650
8651 // id which identifies single session of user interacting with permission controller
8652 optional int64 session_id = 1;
8653
8654 // Uid of package for which location access check is presented
8655 optional int32 package_uid = 2;
8656
8657 // Name of package for which location access check is presented
8658 optional string package_name = 3;
8659
8660 enum Result {
8661 UNDEFINED = 0;
8662 // notification was presented to the user
8663 NOTIFICATION_PRESENTED = 1;
8664 // notification was declined by the user
8665 NOTIFICATION_DECLINED = 2;
8666 // notification was clicked by the user
8667 NOTIFICATION_CLICKED = 3;
8668 }
8669
8670 // View / interaction recorded
8671 optional Result result = 4;
8672}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008673
8674/**
8675 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8676 */
8677message AppPermissionFragmentActionReported {
8678 // id which identifies single session of user interacting with permission controller
8679 optional int64 session_id = 1;
8680
8681 // unique value identifying a permission group change. A permission group change might result
8682 // in multiple of these atoms
8683 optional int64 change_id = 2;
8684
8685 // UID of package the permission belongs to
8686 optional int32 uid = 3 [(is_uid) = true];
8687
8688 // Name of package the permission belongs to
8689 optional string package_name = 4;
8690
8691 // The permission to be granted
8692 optional string permission_name = 5;
8693
8694 // The result of the permission grant
8695 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008696
8697 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8698 optional int32 permission_flags = 7;
8699
8700 enum Button {
8701 UNDEFINED = 0;
8702 // Allow button
8703 ALLOW = 1;
8704 // Deny button
8705 DENY = 2;
8706 // Ask every time button
8707 ASK_EVERY_TIME = 3;
8708 // Allow all the time button
8709 ALLOW_ALWAYS = 4;
8710 // Allow only while using the app button
8711 ALLOW_FOREGROUND = 5;
8712 // Same is Deny button but shown in while in use dialog
8713 DENY_FOREGROUND = 6;
8714 }
8715
8716 // Button pressed in the dialog
8717 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008718}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008719
8720/**
8721* Information about a AppPermissionFragment viewed by user
8722*/
8723message AppPermissionFragmentViewed {
8724 // id which identifies single session of user interacting with permission controller
8725 optional int64 session_id = 1;
8726
8727 // UID of package for which permissions are viewed
8728 optional int32 uid = 2 [(is_uid) = true];
8729
8730 // Name of package for which permissions are viewed
8731 optional string package_name = 3;
8732
8733 // Permission group viewed
8734 optional string permission_group_name = 4;
8735}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008736
8737/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008738* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8739* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008740*/
8741message AppPermissionsFragmentViewed {
8742 // id which identifies single session of user interacting with permission controller
8743 optional int64 session_id = 1;
8744
8745 // id which identifies single view as every view might have several logging records
8746 // with different package information attached
8747 optional int64 view_id = 2;
8748
8749 // Permission group viewed
8750 optional string permission_group_name = 3;
8751
8752 // UID of package for which permissions are viewed
8753 optional int32 uid = 4 [(is_uid) = true];
8754
8755 // Name of package for which permissions are viewed
8756 optional string package_name = 5;
8757
8758 // Category in which permission is included
8759 enum Category {
8760 UNDEFINED = 0;
8761 ALLOWED = 1;
8762 ALLOWED_FOREGROUND = 2;
8763 DENIED = 3;
8764 }
8765 optional Category category = 6;
8766}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008767/**
8768* Information about a PermissionAppsFragment viewed by user.
8769* Logged from ui/handheld/PermissionAppsFragment.java
8770*/
8771message PermissionAppsFragmentViewed {
8772 // id which identifies single session of user interacting with permission controller
8773 optional int64 session_id = 1;
8774
8775 // id which identifies single view as every view might have several logging records
8776 // with different package information attached
8777 optional int64 view_id = 2;
8778
8779 // Permission group viewed
8780 optional string permission_group_name = 3;
8781
8782 // UID of package for which permissions are viewed
8783 optional int32 uid = 4 [(is_uid) = true];
8784
8785 // Name of package for which permissions are viewed
8786 optional string package_name = 5;
8787
8788 // Category in which app is included
8789 enum Category {
8790 UNDEFINED = 0;
8791 ALLOWED = 1;
8792 ALLOWED_FOREGROUND = 2;
8793 DENIED = 3;
8794 }
8795 optional Category category = 6;
8796}
Tony Make2b1b672019-07-29 16:59:47 +01008797
8798/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008799* Log that the Auto Revoke notification has been clicked
8800* Logged from ui/ManagePermissionsActivity
8801*/
8802message AutoRevokeNotificationClicked {
8803 // id which identifies single session of user interacting with permission controller
8804 optional int64 session_id = 1;
8805}
8806
8807/**
8808* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8809* auto revoked for it.
8810* Logged from ui/handheld/AutoRevokeFragment
8811*/
8812message AutoRevokeFragmentAppViewed {
8813 // id which identifies single session of user interacting with permission controller
8814 optional int64 session_id = 1;
8815
8816 // UID of package for which permissions are viewed
8817 optional int32 uid = 2 [(is_uid) = true];
8818
8819 // Name of package for which permissions are viewed
8820 optional string package_name = 3;
8821
8822 // The name of a permission group that has been revoked
8823 optional string permission_group_name = 4;
8824
8825 // The age of the app- more than three months old, or more than six months
8826 enum Age {
8827 UNDEFINED = 0;
8828 NEWER_BUCKET = 1;
8829 OLDER_BUCKET = 2;
8830 }
8831
8832 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8833 optional Age age = 5;
8834}
8835
8836/**
8837* Log that the user has interacted with an app on the auto revoke fragment
8838* Logged from ui/handheld/AutoRevokeFragment
8839*/
8840message AutoRevokedAppInteraction {
8841 // id which identifies single session of user interacting with permission controller
8842 optional int64 session_id = 1;
8843
8844 // UID of package for which permissions are viewed
8845 optional int32 uid = 2 [(is_uid) = true];
8846
8847 // Name of package for which permissions are viewed
8848 optional string package_name = 3;
8849
8850 enum Action {
8851 UNDEFINED = 0;
8852 REMOVE = 1;
8853 OPEN = 2;
8854 APP_INFO = 3;
8855 PERMISSIONS = 4;
8856 REMOVE_IN_SETTINGS = 5;
8857 OPEN_IN_SETTINGS = 6;
8858 }
8859
8860 // The action the user took to interact with the app
8861 optional Action action = 4;
8862}
8863
8864/**
8865* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8866* auto revoke, or that the auto revoke switch has been changed
8867* Logged from ui/handheld/AppPermissionGroupsFragment
8868 */
8869message AppPermissionGroupsFragmentAutoRevokeAction {
8870 // id which identifies single session of user interacting with permission controller
8871 optional int64 session_id = 1;
8872
8873 // UID of package for which permissions are viewed
8874 optional int32 uid = 2 [(is_uid) = true];
8875
8876 // Name of package for which permissions are viewed
8877 optional string package_name = 3;
8878
8879 enum Action {
8880 UNDEFINED = 0;
8881 OPENED_FOR_AUTO_REVOKE = 1;
8882 OPENED_FROM_INTENT = 2;
8883 SWITCH_ENABLED = 3;
8884 SWITCH_DISABLED = 4;
8885 }
8886
8887 // The action the user took to interact with the fragment
8888 optional Action action = 4;
8889}
8890
8891/**
Tony Make2b1b672019-07-29 16:59:47 +01008892 * Logs when there is a smart selection related event.
8893 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8894 * Logged from: TextClassifierEventLogger.java
8895 */
8896message TextSelectionEvent {
8897 // A session ID.
8898 optional string session_id = 1;
8899
8900 // Event type of this event.
8901 optional android.stats.textclassifier.EventType event_type = 2;
8902
Tony Mak9c84bd22019-12-09 07:27:25 +00008903 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008904 optional string model_name = 3;
8905
8906 // Type of widget that was involved in triggering this event.
8907 optional android.stats.textclassifier.WidgetType widget_type = 4;
8908
8909 // Index of this event in a session.
8910 optional int32 event_index = 5;
8911
8912 // Entity type that is involved.
8913 optional string entity_type = 6;
8914
8915 // Relative word index of the start of the selection.
8916 optional int32 relative_word_start_index = 7;
8917
8918 // Relative word (exclusive) index of the end of the selection.
8919 optional int32 relative_word_end_index = 8;
8920
8921 // Relative word index of the start of the smart selection.
8922 optional int32 relative_suggested_word_start_index = 9;
8923
8924 // Relative word (exclusive) index of the end of the smart selection.
8925 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008926
8927 // Name of source package.
8928 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008929
8930 // Name of the LangID model that is involved in this event.
8931 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008932}
8933
8934/**
8935 * Logs when there is a smart linkify related event.
8936 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8937 * Logged from: TextClassifierEventLogger.java
8938 */
8939message TextLinkifyEvent {
8940 // A session ID.
8941 optional string session_id = 1;
8942
8943 // Event type of this event.
8944 optional android.stats.textclassifier.EventType event_type = 2;
8945
Tony Mak9c84bd22019-12-09 07:27:25 +00008946 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008947 optional string model_name = 3;
8948
8949 // Type of widget that was involved in triggering this event.
8950 optional android.stats.textclassifier.WidgetType widget_type = 4;
8951
8952 // Index of this event in a session.
8953 optional int32 event_index = 5;
8954
8955 // Entity type that is involved.
8956 optional string entity_type = 6;
8957
8958 // Number of links detected.
8959 optional int32 num_links = 7;
8960
8961 // The total length of all links.
8962 optional int32 linked_text_length = 8;
8963
8964 // Length of input text.
8965 optional int32 text_length = 9;
8966
8967 // Time spent on generating links in ms.
8968 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008969
8970 // Name of source package.
8971 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008972
8973 // Name of the LangID model that is involved in this event.
8974 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008975}
8976
8977/**
8978 * Logs when there is a conversation actions related event.
8979 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8980 * Logged from: TextClassifierEventLogger.java
8981 */
8982message ConversationActionsEvent {
8983 // A session ID.
8984 optional string session_id = 1;
8985
8986 // Event type of this event.
8987 optional android.stats.textclassifier.EventType event_type = 2;
8988
Tony Mak9c84bd22019-12-09 07:27:25 +00008989 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008990 optional string model_name = 3;
8991
8992 // Type of widget that was involved in triggering this event.
8993 optional android.stats.textclassifier.WidgetType widget_type = 4;
8994
8995 // The first entity type that is involved.
8996 optional string first_entity_type = 5;
8997
8998 // The second entity type that is involved.
8999 optional string second_entity_type = 6;
9000
9001 // The third entity type that is involved.
9002 optional string third_entity_type = 7;
9003
9004 // The score of the first entity type.
9005 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01009006
9007 // Name of source package.
9008 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00009009
9010 // Name of the annotator model that is involved in this event.
9011 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00009012
9013 // Name of the LangID model that is involved in this event.
9014 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01009015}
9016
9017/**
9018 * Logs when there is a language detection related event.
9019 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9020 * Logged from: TextClassifierEventLogger.java
9021 */
9022message LanguageDetectionEvent {
9023 // A session ID.
9024 optional string session_id = 1;
9025
9026 // Event type of this event.
9027 optional android.stats.textclassifier.EventType event_type = 2;
9028
Tony Mak9c84bd22019-12-09 07:27:25 +00009029 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009030 optional string model_name = 3;
9031
9032 // Type of widget that was involved in triggering this event.
9033 optional android.stats.textclassifier.WidgetType widget_type = 4;
9034
9035 // Detected language.
9036 optional string language_tag = 5;
9037
9038 // Score of the detected language.
9039 optional float score = 6;
9040
9041 // Position of this action.
9042 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01009043
9044 // Name of source package.
9045 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01009046}
Tianjie Xu167c3db2019-07-22 14:25:14 -07009047
9048/**
9049 * Information about an OTA update attempt by update_engine.
9050 * Logged from platform/system/update_engine/metrics_reporter_android.cc
9051 */
9052message UpdateEngineUpdateAttemptReported {
9053 // The number of attempts for the update engine to apply a given payload.
9054 optional int32 attempt_number = 1;
9055
9056 optional android.stats.otaupdate.PayloadType payload_type = 2;
9057
9058 // The total time in minutes for the update engine to apply a given payload.
9059 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
9060 // it's increased when the system is sleeping.
9061 optional int32 duration_boottime_in_minutes = 3;
9062
9063 // The total time in minutes for the update engine to apply a given payload.
9064 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
9065 // and it's not increased when the system is sleeping.
9066 optional int32 duration_monotonic_in_minutes = 4;
9067
9068 // The size of the payload in MiBs.
9069 optional int32 payload_size_mib = 5;
9070
9071 // The attempt result reported by the update engine for an OTA update.
9072 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
9073
9074 // The error code reported by the update engine after an OTA update attempt
9075 // on A/B devices.
9076 optional android.stats.otaupdate.ErrorCode error_code = 7;
9077
9078 // The build fingerprint of the source system. The value is read from a
9079 // system property when the device takes the update. e.g.
9080 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
9081 optional string source_fingerprint = 8;
Alessio Balsinid8698fa2020-05-26 22:26:56 +01009082
9083 // Size of super partition.
9084 optional int64 super_partition_size_bytes = 9;
9085
9086 // Size of current slot within the super partition.
9087 optional int64 slot_size_bytes = 10;
9088
9089 // Free space available in the super partition.
9090 optional int64 super_free_space_bytes = 11;
Tianjie Xu167c3db2019-07-22 14:25:14 -07009091}
9092
9093/**
9094 * Information about all the attempts the device make before finishing the
9095 * successful update.
9096 * Logged from platform/system/update_engine/metrics_reporter_android.cc
9097 */
9098message UpdateEngineSuccessfulUpdateReported {
9099 // The number of attempts for the update engine to apply the payload for a
9100 // successful update.
9101 optional int32 attempt_count = 1;
9102
9103 optional android.stats.otaupdate.PayloadType payload_type = 2;
9104
9105 optional int32 payload_size_mib = 3;
9106
9107 // The total number of bytes downloaded by update_engine since the last
9108 // successful update.
9109 optional int32 total_bytes_downloaded_mib = 4;
9110
9111 // The ratio in percentage of the over-downloaded bytes compared to the
9112 // total bytes needed to successfully install the update. e.g. 200 if we
9113 // download 200MiB in total for a 100MiB package.
9114 optional int32 download_overhead_percentage = 5;
9115
9116 // The total time in minutes for the update engine to apply the payload for a
9117 // successful update.
9118 optional int32 total_duration_minutes = 6;
9119
9120 // The number of reboot of the device during a successful update.
9121 optional int32 reboot_count = 7;
9122}
Alec Mourie088e762019-07-02 13:10:55 -07009123
9124/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08009125 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
9126 * key to indicate whether it was successful or not.
9127 *
9128 * Logged from:
9129 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
9130 */
9131message RebootEscrowRecoveryReported {
9132 optional bool successful = 1;
9133}
9134
9135/**
Alec Mourie088e762019-07-02 13:10:55 -07009136 * Global display pipeline metrics reported by SurfaceFlinger.
9137 * Pulled from:
9138 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9139 */
9140message SurfaceflingerStatsGlobalInfo {
9141 // Total number of frames presented during the tracing period
9142 optional int64 total_frames = 1;
9143 // Total number of frames missed
9144 optional int64 missed_frames = 2;
9145 // Total number of frames that fell back to client composition
9146 optional int64 client_composition_frames = 3;
9147 // Total time the display was turned on
9148 optional int64 display_on_millis = 4;
9149 // Total time that was spent performing animations.
9150 // This is derived from the present-to-present layer histogram
9151 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08009152 // Total number of event connections tracked by SurfaceFlinger at the time
9153 // of this pull. If this number grows prohibitively large, then this can
9154 // cause jank due to resource contention.
9155 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08009156 // Set of timings measured from when SurfaceFlinger began compositing a
9157 // frame, until the frame was requested to be presented to the display. This
9158 // measures SurfaceFlinger's total CPU walltime on the critical path per
9159 // frame.
9160 optional FrameTimingHistogram frame_duration = 7
9161 [(android.os.statsd.log_mode) = MODE_BYTES];
9162 // Set of timings measured from when SurfaceFlinger first began using the
9163 // GPU to composite a frame, until the GPU has finished compositing that
9164 // frame. This measures the total additional time SurfaceFlinger needed to
9165 // perform due to falling back into GPU composition.
9166 optional FrameTimingHistogram render_engine_timing = 8
9167 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07009168}
9169
9170/**
9171 * Per-layer display pipeline metrics reported by SurfaceFlinger.
9172 * The number of layers uploaded will be restricted due to size limitations.
9173 * Pulled from:
9174 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9175 */
9176message SurfaceflingerStatsLayerInfo {
9177 // The layer for this set of metrics
9178 // For now we can infer that the package name is included in the layer
9179 // name.
9180 optional string layer_name = 1;
9181 // Total number of frames presented
9182 optional int64 total_frames = 2;
9183 // Total number of dropped frames while latching a buffer for this layer.
9184 optional int64 dropped_frames = 3;
9185 // Set of timings measured between successive presentation timestamps.
9186 optional FrameTimingHistogram present_to_present = 4
9187 [(android.os.statsd.log_mode) = MODE_BYTES];
9188 // Set of timings measured from when an app queued a buffer for
9189 // presentation, until the buffer was actually presented to the
9190 // display.
9191 optional FrameTimingHistogram post_to_present = 5
9192 [(android.os.statsd.log_mode) = MODE_BYTES];
9193 // Set of timings measured from when a buffer is ready to be presented,
9194 // until the buffer was actually presented to the display.
9195 optional FrameTimingHistogram acquire_to_present = 6
9196 [(android.os.statsd.log_mode) = MODE_BYTES];
9197 // Set of timings measured from when a buffer was latched by
9198 // SurfaceFlinger, until the buffer was presented to the display
9199 optional FrameTimingHistogram latch_to_present = 7
9200 [(android.os.statsd.log_mode) = MODE_BYTES];
9201 // Set of timings measured from the desired presentation to the actual
9202 // presentation time
9203 optional FrameTimingHistogram desired_to_present = 8
9204 [(android.os.statsd.log_mode) = MODE_BYTES];
9205 // Set of timings measured from when an app queued a buffer for
9206 // presentation, until the buffer was ready to be presented.
9207 optional FrameTimingHistogram post_to_acquire = 9
9208 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08009209 // Frames missed latch because the acquire fence didn't fire
9210 optional int64 late_acquire_frames = 10;
9211 // Frames latched early because the desired present time was bad
9212 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07009213}
9214
9215/**
9216 * Histogram of frame counts bucketed by time in milliseconds.
9217 * Because of size limitations, we hard-cap the number of buckets, with
9218 * buckets for corresponding to larger milliseconds being less precise.
9219 */
9220message FrameTimingHistogram {
9221 // Timings in milliseconds that describes a set of histogram buckets
9222 repeated int32 time_millis_buckets = 1;
9223 // Number of frames that match to each time_millis, i.e. the bucket
9224 // contents
9225 // It's required that len(time_millis) == len(frame_count)
9226 repeated int64 frame_counts = 2;
9227}
Emilian Peev6729f372019-08-29 09:14:09 -07009228
Emilian Peev6729f372019-08-29 09:14:09 -07009229/**
Alec Mouri5ac32622020-02-06 08:44:25 -08009230 * Janky event as reported by SurfaceFlinger.
9231 * This event is intended to be consumed by a Perfetto subscriber for
9232 * automated trace collection.
9233 *
9234 * Logged from:
9235 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
9236 */
9237message DisplayJankReported {
9238 // Informational field for how long the janky event lasted in milliseconds
9239 optional int64 event_duration_millis = 1;
9240 // Number of frame deadlines missed, where SurfaceFlinger failed to update
9241 // the display on time.
9242 optional int32 present_deadlines_missed = 2;
9243}
9244
9245/**
Emilian Peev6729f372019-08-29 09:14:09 -07009246 * Information about camera facing and API level usage.
9247 * Logged from:
9248 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
9249 */
9250message CameraActionEvent {
9251 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08009252 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07009253
9254 // Camera API level used
9255 optional int32 api_level = 2;
9256
9257 // Name of client package
9258 optional string package_name = 3;
9259
9260 // Camera facing
9261 enum Facing {
9262 UNKNOWN = 0;
9263 BACK = 1;
9264 FRONT = 2;
9265 EXTERNAL = 3;
9266 }
9267 optional Facing facing = 4;
9268}
atrost01a20932019-08-28 15:40:37 +01009269
9270/**
9271 * Logs when a compatibility change is affecting an app.
9272 *
9273 * Logged from:
9274 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
9275 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
9276 */
9277message AppCompatibilityChangeReported {
9278 // The UID of the app being affected by the compatibilty change.
9279 optional int32 uid = 1 [(is_uid) = true];
9280
9281 // The ID of the change affecting the app.
9282 optional int64 change_id = 2;
9283
9284 enum State {
9285 UNKNOWN_STATE = 0;
9286 ENABLED = 1;
9287 DISABLED = 2;
9288 LOGGED = 3;
9289 }
9290
9291 // The state of the change - if logged from gating whether it was enabled or disabled, or just
9292 // logged otherwise.
9293 optional State state = 3;
9294
9295 enum Source {
9296 UNKNOWN_SOURCE = 0;
9297 APP_PROCESS = 1;
9298 SYSTEM_SERVER = 2;
9299 }
9300
9301 // Where it was logged from.
9302 optional Source source = 4;
9303
9304}
Hector Dearman40579f62019-11-01 13:19:30 +00009305
9306/**
9307 * Logged from
9308 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
9309 */
9310message PerfettoUploaded {
9311 enum Event {
9312 PERFETTO_UNDEFINED = 0;
9313 PERFETTO_TRACE_BEGIN = 1;
9314 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
9315 PERFETTO_ON_CONNECT = 3;
9316 PERFETTO_ON_TRACING_DISABLED = 4;
9317 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
9318 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
9319 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
9320 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
9321 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
9322 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
9323 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
9324 PERFETTO_TRIGGER_BEGIN = 12;
9325 PERFETTO_TRIGGER_SUCCESS = 13;
9326 PERFETTO_TRIGGER_FAILURE = 14;
9327 PERFETTO_HIT_GUARDRAILS = 15;
9328 PERFETTO_ON_TIMEOUT = 16;
9329 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
9330 }
9331
9332 // Which stage of the pipeline we are reporting from.
9333 optional Event event = 1;
9334
9335 // UUID matching the one set inside the SystemInfo trace packet.
9336 optional int64 trace_uuid_lsb = 2;
9337 optional int64 trace_uuid_msb = 3;
9338}
Mark Tabrya824a642019-11-05 12:26:12 -08009339
9340/**
9341 * Pulls client metrics on data transferred via Vehicle Maps Service.
9342 * Metrics are keyed by uid + layer.
9343 *
9344 * Pulled from:
9345 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
9346 */
9347message VmsClientStats {
9348 // UID of the VMS client app
9349 optional int32 uid = 1 [(is_uid) = true];
9350
9351 // VMS layer definition
9352 optional int32 layer_type = 2;
9353 optional int32 layer_channel = 3;
9354 optional int32 layer_version = 4;
9355
9356 // Bytes and packets sent by the client for the layer
9357 optional int64 tx_bytes = 5;
9358 optional int64 tx_packets = 6;
9359
9360 // Bytes and packets received by the client for the layer
9361 optional int64 rx_bytes = 7;
9362 optional int64 rx_packets = 8;
9363
9364 // Bytes and packets dropped due to client error
9365 optional int64 dropped_bytes = 9;
9366 optional int64 dropped_packets = 10;
9367}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00009368
9369/**
9370 * State of a dangerous permission requested by a package - sampled
9371 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
9372*/
9373message DangerousPermissionStateSampled {
9374 // Name of the permission
9375 optional string permission_name = 1;
9376
9377 // Uid of the package
9378 optional int32 uid = 2 [(is_uid) = true];
9379
9380 // If the permission is granted to the uid
9381 optional bool is_granted = 3;
9382
9383 // Permission flags as per android.content.pm.PermissionFlags
9384 optional int32 permission_flags = 4;
9385}
9386
Stan Iliev637ba5e2019-08-16 13:43:08 -04009387/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04009388 * HWUI stats for a given app.
9389 */
9390message GraphicsStats {
9391 // The package name of the app
9392 optional string package_name = 1;
9393
9394 // The version code of the app
9395 optional int64 version_code = 2;
9396
9397 // The start & end timestamps in UTC as
9398 // milliseconds since January 1, 1970
9399 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05009400 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04009401
Stan Ilievb6517192020-02-18 10:12:42 -05009402 optional int64 end_millis = 4;
9403
9404 // HWUI renders pipeline type: GL (1) or Vulkan (2).
9405 enum PipelineType {
9406 UNKNOWN = 0;
9407 GL = 1;
9408 VULKAN = 2;
9409 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04009410
9411 // HWUI renders pipeline type: GL or Vulkan.
9412 optional PipelineType pipeline = 5;
9413
9414 // Distinct frame count.
9415 optional int32 total_frames = 6;
9416
9417 // Number of "missed vsync" events.
9418 optional int32 missed_vsync_count = 7;
9419
9420 // Number of frames in triple-buffering scenario (high input latency)
9421 optional int32 high_input_latency_count = 8;
9422
9423 // Number of "slow UI thread" events.
9424 optional int32 slow_ui_thread_count = 9;
9425
9426 // Number of "slow bitmap upload" events.
9427 optional int32 slow_bitmap_upload_count = 10;
9428
9429 // Number of "slow draw" events.
9430 optional int32 slow_draw_count = 11;
9431
9432 // Number of frames that missed their deadline (aka, visibly janked)
9433 optional int32 missed_deadline_count = 12;
9434
9435 // The frame time histogram for the package
9436 optional FrameTimingHistogram cpu_histogram = 13
9437 [(android.os.statsd.log_mode) = MODE_BYTES];
9438
9439 // The gpu frame time histogram for the package
9440 optional FrameTimingHistogram gpu_histogram = 14
9441 [(android.os.statsd.log_mode) = MODE_BYTES];
9442
9443 // UI mainline module version.
9444 optional int64 version_ui_module = 15;
9445
9446 // If true, these are HWUI stats for up to a 24h period for a given app from today.
9447 // If false, these are HWUI stats for a 24h period for a given app from the last complete
9448 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
9449 // more apps are running / rendering.
9450 optional bool is_today = 16;
9451}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009452
9453/**
9454 * Message related to dangerous (runtime) app ops access
9455 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009456message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009457 // Uid of the package accessing app op
9458 optional int32 uid = 1 [(is_uid) = true];
9459
9460 // Name of the package accessing app op
9461 optional string package_name = 2;
9462
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009463 // deprecated - set to empty string
9464 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009465
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009466 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009467 // API. Attributions must be provided through manifest using <attribution> tag available in R
9468 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009469 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009470
9471 // message related to app op access, limited to 600 chars by API
9472 optional string message = 5;
9473
9474 enum SamplingStrategy {
9475 DEFAULT = 0;
9476 UNIFORM = 1;
9477 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009478 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009479 }
9480
9481 // sampling strategy used to collect this message
9482 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009483
9484 // operation id
9485 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009486}
9487
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009488/*
9489 * Logs userspace reboot outcome and duration.
9490 *
9491 * Logged from:
9492 * frameworks/base/core/java/com/android/server/BootReceiver.java
9493 */
9494message UserspaceRebootReported {
9495 // Possible outcomes of userspace reboot.
9496 enum Outcome {
9497 // Default value in case platform failed to determine the outcome.
9498 OUTCOME_UNKNOWN = 0;
9499 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9500 SUCCESS = 1;
9501 // Userspace reboot shutdown sequence was aborted.
9502 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9503 // Remounting userdata into checkpointing mode failed.
9504 FAILED_USERDATA_REMOUNT = 3;
9505 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9506 // reboot.
9507 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9508 }
9509 // Outcome of userspace reboot. Always set.
9510 optional Outcome outcome = 1;
9511 // Duration of userspace reboot in case it has a successful outcome.
9512 // Duration is measured as time between userspace reboot was initiated and until boot completed
9513 // (e.g. sys.boot_completed=1).
9514 optional int64 duration_millis = 2;
9515 // State of primary user's (user0) credential encryption storage.
9516 enum UserEncryptionState {
9517 // Default value.
9518 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9519 // Credential encrypted storage is unlocked.
9520 UNLOCKED = 1;
9521 // Credential encrypted storage is locked.
9522 LOCKED = 2;
9523 }
9524 // State of primary user's encryption storage at the moment boot completed. Always set.
9525 optional UserEncryptionState user_encryption_state = 3;
9526}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009527
9528/*
9529 * Logs integrity check information during each install.
9530 *
9531 * Logged from:
9532 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9533 */
9534message IntegrityCheckResultReported {
9535 optional string package_name = 1;
9536 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009537 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009538 optional string installer_package_name = 4;
9539 enum Response {
9540 UNKNOWN = 0;
9541 ALLOWED = 1;
9542 REJECTED = 2;
9543 FORCE_ALLOWED = 3;
9544 }
9545 optional Response response = 5;
9546 // An estimate on the cause of the response. This will only be populated for
9547 // REJECTED and FORCE_ALLOWED
9548 optional bool caused_by_app_cert_rule = 6;
9549 optional bool caused_by_installer_rule = 7;
9550}
9551
9552/**
9553 * Logs the information about the rules and the provider whenever rules are
9554 * pushed into AppIntegrityManager.
9555 *
9556 * Logged from:
9557 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9558 */
9559message IntegrityRulesPushed {
9560 optional bool success = 1;
9561 // Package name of the app that pushed the rules.
9562 optional string rule_provider = 2;
9563 // Version string of arbitrary format provided by the rule provider to
9564 // identify the rules.
9565 optional string rule_version = 3;
9566}
Jordan Liubedfa702019-12-20 15:08:45 -08009567
9568/**
9569 * Logs when a cell broadcast message is received on the device.
9570 *
Jordan Liu900e5cb2020-05-29 09:44:59 -07009571 * Logged from Cell Broadcast module and platform:
Jordan Liubedfa702019-12-20 15:08:45 -08009572 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
Jordan Liu900e5cb2020-05-29 09:44:59 -07009573 * packages/apps/CellBroadcastReceiver/
9574 * frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
Jordan Liubedfa702019-12-20 15:08:45 -08009575 */
9576message CellBroadcastMessageReported {
9577 // The type of Cell Broadcast message
9578 enum CbType {
9579 UNKNOWN_TYPE = 0;
9580 GSM = 1;
9581 CDMA = 2;
9582 CDMA_SPC = 3;
9583 }
9584
Jordan Liu900e5cb2020-05-29 09:44:59 -07009585 // The parts of the cell broadcast message pipeline
9586 enum ReportSource {
9587 UNKNOWN_SOURCE = 0;
9588 FRAMEWORK = 1;
9589 CB_SERVICE = 2;
9590 CB_RECEIVER_APP = 3;
9591 }
9592
Jordan Liubedfa702019-12-20 15:08:45 -08009593 // GSM, CDMA, CDMA-SCP
9594 optional CbType type = 1;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009595
9596 // The source of the report
9597 optional ReportSource source = 2;
9598}
9599
9600/**
9601 * Logs when a cell broadcast message is filtered out, or otherwise intentionally not sent to CBR.
9602 *
9603 * Logged from CellBroadcastService module:
9604 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9605 */
9606message CellBroadcastMessageFiltered {
9607 enum FilterReason {
9608 NOT_FILTERED = 0;
9609 DUPLICATE_MESSAGE = 1;
9610 GEOFENCED_MESSAGE = 2;
9611 AREA_INFO_MESSAGE = 3;
9612 }
9613
9614 // GSM, CDMA, CDMA-SCP
9615 optional CellBroadcastMessageReported.CbType type = 1;
9616
9617 // The source of the report
9618 optional FilterReason filter = 2;
Jordan Liubedfa702019-12-20 15:08:45 -08009619}
9620
9621/**
9622 * Logs when an error occurs while handling a cell broadcast message;
9623 *
9624 * Logged from CellBroadcastService module:
9625 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9626 */
9627message CellBroadcastMessageError {
9628 // The type of error raised when trying to handle a cell broadcast message
9629 enum ErrorType {
9630 UNKNOWN_TYPE = 0;
9631 CDMA_DECODING_ERROR = 1;
9632 CDMA_SCP_EMPTY = 2;
9633 CDMA_SCP_HANDLING_ERROR = 3;
9634 GSM_INVALID_HEADER_LENGTH = 4;
9635 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9636 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9637 GSM_INVALID_PDU = 7;
9638 GSM_INVALID_GEO_FENCING_DATA = 8;
9639 GSM_UMTS_INVALID_WAC = 9;
9640 FAILED_TO_INSERT_TO_DB = 10;
9641 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9642 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9643 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9644 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009645 NO_CONNECTION_TO_CB_SERVICE = 15;
Jordan Liubedfa702019-12-20 15:08:45 -08009646 }
9647
9648 // What kind of error occurred
9649 optional ErrorType type = 1;
9650
9651 // Exception message (or log message) associated with the error (max 1000 chars)
9652 optional string exception_message = 2;
9653}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009654
9655/**
Henry Fange316ab62020-04-21 18:43:14 -07009656 * Logs when a tune occurs through device's Frontend.
9657 * This is atom ID 276.
9658 *
9659 * Logged from:
9660 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9661 */
9662message TvTunerStateChanged {
9663 enum State {
9664 UNKNOWN = 0;
9665 TUNING = 1; // Signal is tuned
9666 LOCKED = 2; // the signal is locked
9667 NOT_LOCKED = 3; // the signal isn’t locked.
9668 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9669 SCANNING = 5; // the signal is scanned
9670 SCAN_STOPPED = 6; // the scan is stopped.
9671 }
9672 // The uid of the application that sent this custom atom.
9673 optional int32 uid = 1 [(is_uid) = true];
9674 // new state
9675 optional State state = 2;
9676}
Henry Fang1ae85bb2020-05-28 18:07:03 -07009677
9678/**
9679 * Logs the status of a dvr playback or record.
9680 * This is atom ID 279.
9681 *
9682 * Logged from:
9683 * frameworks/base/media/java/android/media/tv/tuner/dvr
9684 */
9685message TvTunerDvrStatus {
9686 enum Type {
9687 UNKNOWN_TYPE = 0;
9688 PLAYBACK = 1; // is a playback
9689 RECORD = 2; // is a record
9690 }
9691 enum State {
9692 UNKNOWN_STATE = 0;
9693 STARTED = 1; // DVR is started
9694 STOPPED = 2; // DVR is stopped
9695 }
9696 // The uid of the application that sent this custom atom.
9697 optional int32 uid = 1 [(is_uid) = true];
9698 // DVR type
9699 optional Type type = 2;
9700 // DVR state
9701 optional State state = 3;
9702 // Identify the segment of a record or playback
9703 optional int32 segment_id = 4;
9704 // indicate how many overflow or underflow happened between started to stopped
9705 optional int32 overflow_underflow_count = 5;
9706}
Henry Fangfd40c072020-06-01 14:59:17 -07009707
9708/**
9709 * Logs when a cas session opened through MediaCas.
9710 * This is atom ID 280.
9711 *
9712 * Logged from:
9713 * frameworks/base/media/java/android/media/MediaCas.java
9714 */
9715message TvCasSessionOpenStatus {
9716 enum State {
9717 UNKNOWN = 0;
9718 SUCCEEDED = 1; // indicate that the session is opened successfully.
9719 FAILED = 2; // indicate that the session isn’t opened successfully.
9720 }
9721 // The uid of the application that sent this custom atom.
9722 optional int32 uid = 1 [(is_uid) = true];
9723 // Cas system Id
9724 optional int32 cas_system_id = 2;
9725 // State of the session
9726 optional State state = 3;
9727}
9728
Henry Fange316ab62020-04-21 18:43:14 -07009729/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009730 * Logs when an app is frozen or unfrozen.
9731 *
9732 * Logged from:
9733 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9734 */
9735message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009736 // The type of event.
9737 enum Action {
9738 UNKNOWN = 0;
9739 FREEZE_APP = 1;
9740 UNFREEZE_APP = 2;
9741 }
9742 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009743
Blake Kragten6ce382a2020-01-16 20:20:46 -08009744 // Pid of the process being frozen.
9745 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009746
Blake Kragten6ce382a2020-01-16 20:20:46 -08009747 // Name of the process being frozen.
9748 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009749
Blake Kragten6ce382a2020-01-16 20:20:46 -08009750 // Time since last unfrozen.
9751 optional int64 time_unfrozen_millis = 4;
9752}
9753
9754/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009755 * Pulls information for a single voice call.
9756 *
9757 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9758 *
9759 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009760 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009761 */
9762message VoiceCallSession {
9763 // Bearer (IMS or CS) when the call started.
9764 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9765
9766 // Bearer (IMS or CS) when the call ended.
9767 // The bearer may change during the call, e.g. due to SRVCC.
9768 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9769
9770 // Direction of the call (incoming or outgoing).
9771 optional android.telephony.CallDirectionEnum direction = 3;
9772
9773 // Time spent setting up the call.
9774 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9775
9776 // Whether the call ended before the setup was completed.
9777 optional bool setup_failed = 5;
9778
9779 // IMS reason code or CS disconnect cause.
9780 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9781 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9782 optional int32 disconnect_reason_code = 6;
9783
9784 // IMS extra code or CS precise disconnect cause.
9785 // For IMS, this code is vendor-specific
9786 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9787 optional int32 disconnect_extra_code = 7;
9788
9789 // IMS extra message or CS vendor cause.
9790 optional string disconnect_extra_message = 8;
9791
9792 // Radio access technology (RAT) used when call started.
9793 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9794
9795 // Radio access technology (RAT) used when call terminated.
9796 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9797
9798 // Number of times RAT changed during the call.
9799 optional int64 rat_switch_count = 11;
9800
9801 // A bitmask of all codecs used during the call.
9802 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9803 optional int64 codec_bitmask = 12;
9804
9805 // Number of other calls going on during call setup, for the same SIM slot.
9806 optional int32 concurrent_call_count_at_start = 13;
9807
9808 // Number of other calls going on during call termination, for the same SIM slot.
9809 optional int32 concurrent_call_count_at_end = 14;
9810
9811 // Index of the SIM is used, 0 for single-SIM devices.
9812 optional int32 sim_slot_index = 15;
9813
9814 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9815 optional bool is_multi_sim = 16;
9816
9817 // Whether the call was made with an eSIM profile.
9818 optional bool is_esim = 17;
9819
9820 // Carrier ID of the SIM card.
9821 // See https://source.android.com/devices/tech/config/carrierid.
9822 optional int32 carrier_id = 18;
9823
Chi Zhangba1b03a2020-04-21 17:17:56 -07009824 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009825 optional bool srvcc_completed = 19;
9826
9827 // Number of SRVCC failures.
9828 optional int64 srvcc_failure_count = 20;
9829
9830 // Number of SRVCC cancellations.
9831 optional int64 srvcc_cancellation_count = 21;
9832
Chi Zhangba1b03a2020-04-21 17:17:56 -07009833 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9834 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009835 optional bool rtt_enabled = 22;
9836
9837 // Whether this was an emergency call.
9838 optional bool is_emergency = 23;
9839
9840 // Whether the call was performed while roaming.
9841 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009842
9843 // A random number used as the dimension field to pull multiple atoms.
9844 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009845}
9846
9847/**
9848 * Pulls voice call radio access technology (RAT) usage.
9849 *
9850 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9851 * time. The atom will be skipped if not enough data is available.
9852 *
9853 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009854 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009855 */
9856message VoiceCallRatUsage {
9857 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9858 optional int32 carrier_id = 1;
9859
9860 // Radio access technology.
9861 optional android.telephony.NetworkTypeEnum rat = 2;
9862
9863 // Total duration that voice calls spent on this carrier and RAT.
9864 optional int64 total_duration_seconds = 3;
9865
9866 // Total number of calls using this carrier and RAT.
9867 // A call is counted once even if it used the RAT multiple times.
9868 optional int64 call_count = 4;
9869}
9870
9871/**
9872 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9873 *
9874 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009875 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009876 */
9877message SimSlotState {
9878 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9879 optional int32 active_slot_count = 1;
9880
9881 // Number of SIM cards (both physical and active eSIM profiles).
9882 // This number is always equal to or less than the number of active SIM slots.
9883 optional int32 sim_count = 2;
9884
9885 // Number of active eSIM profiles.
9886 // This number is always equal to or less than the number of SIMs.
9887 optional int32 esim_count = 3;
9888}
9889
9890/**
9891 * Pulls supported cellular radio access technologies.
9892 *
9893 * This atom reports the capabilities of the device, rather than the network it has access to.
9894 *
9895 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009896 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009897 */
9898message SupportedRadioAccessFamily {
9899 // A bitmask of supported radio technologies.
9900 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9901 optional int64 network_type_bitmask = 1;
9902}
9903
9904/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009905 * Logs gnss stats from location service provider
9906 *
9907 * Pulled from:
9908 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9909 */
9910
9911message GnssStats {
9912 // Number of location reports since boot
9913 optional int64 location_reports = 1;
9914
9915 // Total pulled reports of Location failures since boot
9916 optional int64 location_failure_reports = 2;
9917
9918 // Number of time to first fix reports since boot
9919 optional int64 time_to_first_fix_reports = 3;
9920
9921 // Total pulled reported time to first fix (in milli-seconds) since boot
9922 optional int64 time_to_first_fix_milli_s = 4;
9923
9924 // Number of position accuracy reports since boot
9925 optional int64 position_accuracy_reports = 5;
9926
9927 // Total pulled reported position accuracy (in meters) since boot
9928 optional int64 position_accuracy_meters = 6;
9929
9930 // Number of top 4 average CN0 reports since boot
9931 optional int64 top_four_average_cn0_reports = 7;
9932
9933 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9934 optional int64 top_four_average_cn0_db_mhz = 8;
9935
9936 // Number of l5 top 4 average CN0 reports since boot
9937 optional int64 l5_top_four_average_cn0_reports = 9;
9938
9939 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9940 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9941
9942 // Total number of sv status messages reports since boot
9943 optional int64 sv_status_reports = 11;
9944
9945 // Total number of sv status messages reports, where sv is used in fix since boot
9946 optional int64 sv_status_reports_used_in_fix = 12;
9947
9948 // Total number of L5 sv status messages reports since boot
9949 optional int64 l5_sv_status_reports = 13;
9950
9951 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9952 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009953}
Kweku Adams12752132020-02-18 15:36:48 -08009954
9955/**
9956 * Logs when an app is moved to a different standby bucket.
9957 *
9958 * Logged from:
9959 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9960 */
9961message AppStandbyBucketChanged {
9962 optional string package_name = 1;
9963
9964 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9965 optional int32 user_id = 2;
9966
9967 // These enum values match the constants defined in UsageStatsManager.java.
9968 enum Bucket {
9969 BUCKET_UNKNOWN = 0;
9970 BUCKET_EXEMPTED = 5;
9971 BUCKET_ACTIVE = 10;
9972 BUCKET_WORKING_SET = 20;
9973 BUCKET_FREQUENT = 30;
9974 BUCKET_RARE = 40;
9975 BUCKET_RESTRICTED = 45;
9976 BUCKET_NEVER = 50;
9977 }
9978 optional Bucket bucket = 3;
9979
9980 enum MainReason {
9981 MAIN_UNKNOWN = 0;
9982 MAIN_DEFAULT = 0x0100;
9983 MAIN_TIMEOUT = 0x0200;
9984 MAIN_USAGE = 0x0300;
9985 MAIN_FORCED_BY_USER = 0x0400;
9986 MAIN_PREDICTED = 0x0500;
9987 MAIN_FORCED_BY_SYSTEM = 0x0600;
9988 }
9989 optional MainReason main_reason = 4;
9990
9991 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9992 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9993 // UsageStatsManager.java.
9994 optional int32 sub_reason = 5;
9995}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009996
9997/**
9998* Reports a started sharesheet transaction.
9999*
10000* Logged from:
10001* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
10002*/
10003message SharesheetStarted {
10004 // The event_id (as for UiEventReported).
10005 optional int32 event_id = 1;
10006 // The calling app's package name.
10007 optional string package_name = 2;
10008 // An identifier to tie together multiple logs relating to the same share event
10009 optional int32 instance_id = 3;
10010 // The mime type of the share
10011 optional string mime_type = 4;
10012 // The number of direct targets the calling app is providing that will be shown.
10013 optional int32 num_app_provided_direct_targets = 5;
10014 // The number of app targets the calling app is providing that will be shown.
10015 optional int32 num_app_provided_app_targets = 6;
10016 // True if the share originates from the workprofile
10017 optional bool is_workprofile = 7;
10018
10019 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010020 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010021 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
10022 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
10023 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
10024 }
10025 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010026 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010027
10028 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
10029 INTENT_DEFAULT = 0;
10030 INTENT_ACTION_VIEW = 1;
10031 INTENT_ACTION_EDIT = 2;
10032 INTENT_ACTION_SEND = 3;
10033 INTENT_ACTION_SENDTO = 4;
10034 INTENT_ACTION_SEND_MULTIPLE = 5;
10035 INTENT_ACTION_IMAGE_CAPTURE = 6;
10036 INTENT_ACTION_MAIN = 7;
10037 }
10038 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010039 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010040}
10041
10042/**
10043 * Reports a ranking selection event.
10044 *
10045 * Logged from:
10046 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
10047 */
10048message RankingSelected {
10049 // The event_id (as for UiEventReported).
10050 optional int32 event_id = 1;
10051 // The relevant app's package name (can be source or picked package).
10052 optional string package_name = 2;
10053 // An identifier to tie together multiple logs relating to the same share event.
10054 optional int32 instance_id = 3;
10055 // Which of the ranked targets got picked, default starting position 0.
10056 optional int32 position_picked = 4;
10057}
Raff Tsaiea4db182020-03-06 07:45:43 +080010058
10059/**
Zhen Sun0bec8d42020-03-25 17:17:29 -070010060 * Logs when TvSettings UI is interacted at.
10061 *
10062 * Logged from: packages/apps/TvSettings
10063 */
10064message TvSettingsUIInteracted {
10065
10066 /** The UI action category */
10067 optional android.app.tvsettings.Action action = 1;
10068
10069 /** The ID of the entry that the users actioned on */
10070 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -070010071}
10072
10073/**
Songchun Fanc296cf72020-03-31 18:38:52 -070010074 * Logs information about a package installation using package installer V2 APIs.
10075 *
10076 * Logged from:
10077 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
10078 */
10079message PackageInstallerV2Reported {
10080 // Whether this installation uses Incremental File System
10081 optional bool is_incremental = 1;
10082 // Name of the package that is intended to be installed
10083 optional string package_name = 2;
10084 // The duration between when the install was requested to when the install has completed
10085 optional int64 duration_millis = 3;
10086 // Installation result in final integer, which are SystemApi's.
10087 // Return_code 1 indicates success.
10088 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
10089 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -070010090 // Total size of the APKs installed for this package
10091 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -070010092}
10093
10094/**
Raff Tsaiea4db182020-03-06 07:45:43 +080010095 * Logs settings provider values.
10096 *
10097 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
10098 * then write the value to proto.
10099 *
10100 */
10101message SettingSnapshot {
10102
10103 // Setting key
10104 optional string name = 1;
10105
10106 enum SettingsValueType {
10107 NOTASSIGNED = 0;
10108 ASSIGNED_BOOL_TYPE = 1;
10109 ASSIGNED_INT_TYPE = 2;
10110 ASSIGNED_FLOAT_TYPE = 3;
10111 ASSIGNED_STRING_TYPE = 4;
10112 };
10113 // Setting value type
10114 optional SettingsValueType type = 2;
10115
10116 optional bool bool_value = 3;
10117
10118 optional int32 int_value = 4;
10119
10120 optional float float_value = 5;
10121
10122 optional string str_value = 6;
10123
10124 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
10125 optional int32 user_id = 7;
10126}
Varun Shahacb56342019-12-18 11:45:38 -080010127
10128/**
10129 * An event logged to indicate that a user journey is about to be performed. This atom includes
10130 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
10131 * will immediately follow this atom which will describe the event(s) and its state.
10132 *
10133 * Logged from:
10134 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10135 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10136 */
10137message UserLifecycleJourneyReported {
10138 // An identifier to track a chain of user lifecycle events occurring (referenced in the
10139 // UserLifecycleEventOccurred atom)
10140 optional int64 session_id = 1;
10141
10142 // Indicates what type of user journey this session is related to
10143 enum Journey {
10144 UNKNOWN = 0; // Undefined user lifecycle journey
10145 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
10146 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
10147 USER_START = 3; // A user start journey
10148 USER_CREATE = 4; // A user creation journey
10149 }
10150 optional Journey journey = 2;
10151 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
10152 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10153 optional int32 origin_user = 3;
10154 // Which user the journey is targeting
10155 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10156 optional int32 target_user = 4;
10157
10158 // What is the user type of the target user
10159 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
10160 enum UserType {
10161 TYPE_UNKNOWN = 0;
10162 FULL_SYSTEM = 1;
10163 FULL_SECONDARY = 2;
10164 FULL_GUEST = 3;
10165 FULL_DEMO = 4;
10166 FULL_RESTRICTED = 5;
10167 PROFILE_MANAGED = 6;
10168 SYSTEM_HEADLESS = 7;
10169 }
10170 optional UserType user_type = 5;
10171 // What are the flags attached to the target user
10172 optional int32 user_flags = 6;
10173}
10174
10175/**
10176 * An event logged when a specific user lifecycle event is performed. These events should be
10177 * correlated with a UserLifecycleJourneyReported atom via the session_id.
10178 * Note: journeys can span over multiple events, hence some events may share a single session id.
10179 *
10180 * Logged from:
10181 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10182 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10183 */
10184message UserLifecycleEventOccurred {
10185 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
10186 optional int64 session_id = 1;
10187 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
10188 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10189 optional int32 user_id = 2;
10190
10191 enum Event {
10192 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
10193 SWITCH_USER = 1; // Indicates that this is a user switch event
10194 START_USER = 2; // Indicates that this is a user start event
10195 CREATE_USER = 3; // Indicates that this is a user create event
Mayank Garg4f93a042020-05-12 23:05:21 -070010196 USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
10197 UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
10198 UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
Varun Shahacb56342019-12-18 11:45:38 -080010199 }
10200 optional Event event = 3;
10201
10202 enum State {
10203 NONE = 0; // Indicates the associated event has no start/end defined
10204 BEGIN = 1;
10205 FINISH = 2;
10206 }
10207 optional State state = 4; // Represents the state of an event (beginning/ending)
10208}
jasonwshsu81173e32020-03-27 15:22:03 +080010209
10210/**
10211 * Logs when accessibility shortcut clicked.
10212 *
10213 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010214 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010215 */
10216message AccessibilityShortcutReported {
10217 // The accessibility feature(including installed a11y service, framework a11y feature,
10218 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
10219 optional string package_name = 1;
10220
10221 // The definition of the accessibility shortcut.
10222 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10223 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
10224
10225 // The definition of the service status.
10226 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10227 optional android.stats.accessibility.ServiceStatus service_status = 3;
10228}
10229
10230/**
10231 * Logs when accessibility service status changed.
10232 *
10233 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010234 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010235 */
10236message AccessibilityServiceReported {
10237 // The accessibility service package name.
10238 optional string package_name = 1;
10239
10240 // The definition of the service status.
10241 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10242 optional android.stats.accessibility.ServiceStatus service_status = 2;
10243}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010244
Denny cy Leeca62fc42020-05-28 18:13:07 +080010245/**
10246 * Logs when display wake up.
10247 *
10248 * Logged from:
10249 * services/core/java/com/android/server/power/Notifier.java
10250 */
10251
10252message DisplayWakeReported {
Denny cy Lee57b31282020-04-17 10:08:52 +080010253 // Wake_up_reason code
10254 // If LOWORD(wake_up_reason) = 0
10255 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
10256 // else reference wake_up_reason to
Denny cy Leeca62fc42020-05-28 18:13:07 +080010257 // services/core/java/com/android/server/power/Notifier.java#onWakeUp
Denny cy Lee57b31282020-04-17 10:08:52 +080010258 optional int32 wake_up_reason = 1;
Denny cy Lee57b31282020-04-17 10:08:52 +080010259}
10260
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010261/**
10262 * Logs app usage events.
10263 */
10264message AppUsageEventOccurred {
10265 optional int32 uid = 1 [(is_uid) = true];
10266 optional string package_name = 2;
10267 optional string class_name = 3;
10268
10269 enum EventType {
10270 NONE = 0;
10271 MOVE_TO_FOREGROUND = 1;
10272 MOVE_TO_BACKGROUND = 2;
10273 }
10274 optional EventType event_type = 4;
10275}
Changyeon Jo51ae3582020-04-14 09:41:00 -070010276
10277/*
10278 * Quality metrics logged when EVS cameras are active.
10279 *
10280 * Logged from:
10281 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
10282 */
10283message EvsUsageStatsReported {
10284
10285 // Camera identifier to distinguish the source camera device. This is not
10286 // globally unique and therefore cannot be used to identify the user and/or
10287 // the device.
10288 optional int32 device_id = 1;
10289
10290 // Peak number of clients during the service
10291 optional int32 peak_num_clients = 2;
10292
10293 // Number of erroneous events during the service
10294 optional int32 num_errors = 3;
10295
10296 // Round trip latency of the very first frame
10297 optional int64 first_latency_millis = 4;
10298
10299 // Average frame round trip latency
10300 optional float avg_latency_millis = 5;
10301
10302 // Peak frame round trip latency
10303 optional int64 peak_latency_millis = 6;
10304
10305 // Total number of frames received
10306 optional int64 total_frames = 7;
10307
10308 // Number of frames ignored
10309 optional int64 ignored_frames = 8;
10310
10311 // Number of dropped frames to synchronize camera devices
10312 optional int64 dropped_frames_to_sync = 9;
10313
10314 // The duration of the service
10315 optional int64 duration_millis = 10;
10316}
Robert Leecccdc152020-04-23 13:22:46 +080010317
10318/**
10319 * Logs audio power usage stats.
10320 *
10321 * Pushed from:
10322 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
10323 */
10324message AudioPowerUsageDataReported {
10325 /**
10326 * Device used for input/output
10327 *
10328 * All audio devices please refer to below file:
10329 * system/media/audio/include/system/audio-base.h
10330 *
10331 * Define our own enum values because we don't report all audio devices.
10332 * Currently, we only report built-in audio devices such as handset, speaker,
10333 * built-in mics, common audio devices such as wired headset, usb headset
10334 * and bluetooth devices.
10335 */
10336 enum AudioDevice {
10337 OUTPUT_EARPIECE = 0x1; // handset
10338 OUTPUT_SPEAKER = 0x2; // dual speaker
10339 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
10340 OUTPUT_USB_HEADSET = 0x8; // usb headset
10341 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
10342 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
10343 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
10344
10345 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
10346 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
10347 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
10348 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
10349 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
10350 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
10351 }
10352 optional AudioDevice audio_device = 1;
10353
10354 // Duration of the audio in seconds
10355 optional int32 duration_secs = 2;
10356
10357 // Average volume (0 ... 1.0)
10358 optional float average_volume = 3;
10359
10360 enum AudioType {
10361 UNKNOWN_TYPE = 0;
10362 VOICE_CALL_TYPE = 1; // voice call
10363 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
10364 MEDIA_TYPE = 3; // music and system sound
10365 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
10366 ALARM_TYPE = 5; // alarm type
10367 // record type
10368 CAMCORDER_TYPE = 6; // camcorder
10369 RECORD_TYPE = 7; // other recording
10370 }
10371 optional AudioType type = 4;
10372}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -070010373
10374/**
10375 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
10376 *
10377 * Pulled from:
10378 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
10379 */
10380message BytesTransferByTagAndMetered {
10381 optional int32 uid = 1 [(is_uid) = true];
10382
10383 optional bool is_metered = 2;
10384
10385 optional int32 tag = 3;
10386
10387 optional int64 rx_bytes = 4;
10388
10389 optional int64 rx_packets = 5;
10390
10391 optional int64 tx_bytes = 6;
10392
10393 optional int64 tx_packets = 7;
10394}
Robert Luo2f52f042020-05-11 16:39:24 +080010395
10396/*
10397 * Logs when the Media Output Switcher finishes a media switch operation.
10398 *
10399 * Logged from:
10400 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
10401 */
10402message MediaOutputOpSwitchReported {
10403 // Source medium type before switching.
10404 optional android.app.settings.mediaoutput.MediumType source = 1;
10405
10406 // Target medium type after switching.
10407 optional android.app.settings.mediaoutput.MediumType target = 2;
10408
10409 // The result of switching.
10410 optional android.app.settings.mediaoutput.SwitchResult result = 3;
10411
10412 // The detail code of a switching result.
10413 optional android.app.settings.mediaoutput.SubResult subresult = 4;
10414
10415 /*
10416 * The package name of a pre-installed app, whose media session is being switched.
10417 */
10418 optional string media_session_package_name = 5;
10419
10420 // The amount of available wired devices when a switching is being performed.
10421 optional int32 available_wired_device_count = 6;
10422
10423 // The amount of available Bluetooth devices a switching is being performed.
10424 optional int32 available_bt_device_count = 7;
10425
10426 // The amount of available remote devices when a switching is being performed.
10427 optional int32 available_remote_device_count = 8;
10428
10429 // The amount of applied devices within a remote dynamic group after a switching is done.
10430 optional int32 applied_device_count_within_remote_group = 9;
10431}
Govinda Wassermane4640282020-04-30 09:30:56 -040010432
10433/**
10434 * Logs when the Assistant is invoked.
10435 *
10436 * Logged from:
10437 * frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
10438 */
10439message AssistantInvocationReported {
10440
10441 // The event_id (as for UiEventReported).
10442 optional int32 event_id = 1;
10443
10444 // The registered Assistant's uid and package (as for UiEventReported).
10445 optional int32 uid = 2 [(is_uid) = true];
10446 optional string package_name = 3;
10447
10448 // An identifier used to disambiguate which logs refer to a particular invocation of the
10449 // Assistant (as for UiEventReported).
10450 optional int32 instance_id = 4;
10451
10452 // The state of the device at the time of invocation.
10453 enum DeviceState {
10454 UNKNOWN_DEVICE_STATE = 0;
10455 AOD1 = 1;
10456 AOD2 = 2;
10457 BOUNCER = 3;
10458 UNLOCKED_LOCKSCREEN = 4;
10459 LAUNCHER_HOME = 5;
10460 LAUNCHER_OVERVIEW = 6;
10461 LAUNCHER_ALL_APPS = 7;
10462 APP_DEFAULT = 8;
10463 APP_IMMERSIVE = 9;
10464 APP_FULLSCREEN = 10;
10465 }
10466 optional DeviceState device_state = 5;
10467
10468 // Whether the Assistant handles were showing at the time of invocation.
10469 optional bool assistant_handles_showing = 6;
10470}