blob: 7c45cbb161adc4fb352f5085f900535460b49374 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070053import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050056import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080057import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080058import "frameworks/base/core/proto/android/telephony/enums.proto";
59import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080060import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010061import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070062import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080063
Yao Chend54f9dd2017-10-17 17:37:48 +000064/**
Stefan Lafonae2df012017-11-14 09:17:21 -080065 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000066 * raw stats log events from the Android system, also known as "atoms."
67 *
68 * This field contains a single oneof with all of the available messages.
69 * The stats-log-api-gen tool runs as part of the Android build and
70 * generates the android.util.StatsLog class, which contains the constants
71 * and methods that Android uses to log.
72 *
Stefan Lafonae2df012017-11-14 09:17:21 -080073 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000074 * Instead, statsd on Android constructs these messages synthetically,
75 * in the format defined here and in stats_log.proto.
76 */
Stefan Lafonae2df012017-11-14 09:17:21 -080077message Atom {
78 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070079 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070080 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070081 BleScanStateChanged ble_scan_state_changed = 2
82 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080083 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080084 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070085 SensorStateChanged sensor_state_changed =
86 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080087 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070088 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
89 ScheduledJobStateChanged scheduled_job_state_changed =
90 8 [(module) = "framework", (module) = "statsdtest"];
91 ScreenBrightnessChanged screen_brightness_changed =
92 9 [(module) = "framework", (module) = "statsdtest"];
93 WakelockStateChanged wakelock_state_changed =
94 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080095 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
96 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -070097 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
98 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080099 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
100 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
101 14 [(module) = "framework"];
102 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
103 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
104 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
105 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800106 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700107 BatterySaverModeStateChanged battery_saver_mode_state_changed =
108 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800109 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
110 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700111 AudioStateChanged audio_state_changed =
112 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800113 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
114 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
115 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700116 UidProcessStateChanged uid_process_state_changed =
117 27 [(module) = "framework", (module) = "statsdtest"];
118 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
119 28 [(module) = "framework", (module) = "statsdtest"];
120 ScreenStateChanged screen_state_changed =
121 29 [(module) = "framework", (module) = "statsdtest"];
122 BatteryLevelChanged battery_level_changed =
123 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800124 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
125 PluggedStateChanged plugged_state_changed = 32 [(module) = "framework"];
126 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800127 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800128 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
129 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800130 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
131 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
132 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700133 PhoneSignalStrengthChanged phone_signal_strength_changed =
134 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800135 SettingChanged setting_changed = 41 [(module) = "framework"];
136 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700137 42 [(module) = "framework", (module) = "statsdtest"];
138 IsolatedUidChanged isolated_uid_changed =
139 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800140 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
141 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800142 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800143 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800144 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700145 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800146 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
147 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800148 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800149 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800150 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800151 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800152 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
153 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800154 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800155 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700156 OverlayStateChanged overlay_state_changed =
157 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800158 ForegroundServiceStateChanged foreground_service_state_changed
159 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700160 CallStateChanged call_state_changed =
161 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800162 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
163 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
164 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800165 AppDied app_died = 65 [(module) = "framework"];
166 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
167 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800168 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
169 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800170 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
171 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800172 SpeakerImpedanceReported speaker_impedance_reported = 71;
173 HardwareFailed hardware_failed = 72;
174 PhysicalDropDetected physical_drop_detected = 73;
175 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800176 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
177 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800178 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700179 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800180 ANROccurred anr_occurred = 79 [(module) = "framework"];
181 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
182 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700183 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800185 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800186 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
187 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700188 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800189 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
190 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
191 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
192 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700193 BatteryHealthSnapshot battery_health_snapshot = 91;
194 SlowIo slow_io = 92;
195 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800196 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
197 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100198 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800199 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800200 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700201 // TODO: service state change is very noisy shortly after boot, as well
202 // as at other transitions - coming out of doze, device plugged in, etc.
203 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
205 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
206 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800207 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800208 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800209 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
210 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
211 105 [(module) = "docsui"];
212 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
213 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
214 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
215 108 [(module) = "docsui"];
216 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
217 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
218 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
219 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800220 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800221 WifiRunningStateChanged wifi_running_state_changed = 114
222 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800223 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800224 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800225 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800226 117 [(module) = "docsui"];
227 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
228 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
229 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
230 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800231 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
232 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
233 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800234 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
235 125 [(module) = "bluetooth"];
236 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
237 126 [(module) = "bluetooth"];
238 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
239 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800240 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000241 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800242 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
243 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
244 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800245 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800246 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
247 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
248 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
249 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
250 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
251 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800252 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
253 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800254 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
255 142 [(module) = "framework"];
256 AttentionManagerServiceResultReported attention_manager_service_result_reported =
257 143 [(module) = "framework"];
258 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800259 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800260 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800261 WatchdogRollbackOccurred watchdog_rollback_occurred =
262 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800263 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
264 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800265 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800266 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
267 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800268 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
269 151 [(module) = "bluetooth"];
270 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
271 152 [(module) = "bluetooth"];
272 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
273 153 [(module) = "bluetooth"];
274 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
275 154 [(module) = "bluetooth"];
276 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
277 155 [(module) = "bluetooth"];
278 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
279 156 [(module) = "bluetooth"];
280 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
281 157 [(module) = "bluetooth"];
282 BluetoothDeviceFailedContactCounterReported
283 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
284 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
285 159 [(module) = "bluetooth"];
286 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
287 160 [(module) = "bluetooth"];
288 BluetoothQualityReportReported bluetooth_quality_report_reported =
289 161 [(module) = "bluetooth"];
290 BluetoothDeviceInfoReported bluetooth_device_info_reported =
291 162 [(module) = "bluetooth"];
292 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
293 163 [(module) = "bluetooth"];
294 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
295 164 [(module) = "bluetooth"];
296 BluetoothBondStateChanged bluetooth_bond_state_changed =
297 165 [(module) = "bluetooth"];
298 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
299 166 [(module) = "bluetooth"];
300 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
301 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800302 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
303 168 [(module) = "framework"];
304 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700305 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800306 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800307 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800308 DeviceIdentifierAccessDenied device_identifier_access_denied =
309 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800310 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800311 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
312 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
313 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800314 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
315 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800316 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700317 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800318 180 [(module) = "permissioncontroller"];
319 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
320 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800321 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800322 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
323 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
324 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
325 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800326 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
327 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700328 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800329 188 [(module) = "intelligence"];
330 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
331 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800332 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800333 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800334 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
335 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
336 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
337 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
338 MediametricsCodecReported mediametrics_codec_reported = 195;
339 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
340 MediametricsExtractorReported mediametrics_extractor_reported = 197;
341 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
342 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
343 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700344 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800345 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
346 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800347 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800348 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
349 206 [(module) = "framework"];
350 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
351 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
352 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
353 LocationManagerApiUsageReported location_manager_api_usage_reported =
354 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100355 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800356 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100357 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800358 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100359 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800360 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100361 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100363 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100365 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800366 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100367 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800368 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100369 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800370 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800371 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
372 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
373 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
374 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800375 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800376 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700377 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
378 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800379 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100380 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800381 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800382 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800383 VmsClientConnectionStateChanged vms_client_connection_state_changed =
384 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800385 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
386 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700387 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800388 235 [(module) = "mediaprovider"];
389 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700390 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800391 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800392 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
393 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
394 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
395 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800396 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800397 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000398 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800399 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500400 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
401 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800402 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
403 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800404 CellBroadcastMessageReported cb_message_reported =
405 249 [(module) = "cellbroadcast"];
406 CellBroadcastMessageError cb_message_error =
407 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700408 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
409 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
410 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800411 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000412 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800413 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
414 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800415 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800416 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500417 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
418 RankingSelected ranking_selected = 260 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000419 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000420 }
David Chenc8a43242017-10-17 16:23:28 -0700421
David Chen6e3e6cb2018-01-03 16:14:06 -0800422 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700423 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700424 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800425 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
426 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700427 MobileBytesTransfer mobile_bytes_transfer =
428 10002 [(module) = "framework", (truncate_timestamp) = true];
429 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
430 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800431 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
432 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700433 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800434 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700435 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800436 CpuTimePerUidFreq cpu_time_per_uid_freq =
437 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800438 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
439 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
440 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
441 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
442 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700443 SystemUptime system_uptime = 10015 [(module) = "framework", (module) = "statsdtest"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700444 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700445 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework", (module) = "statsdtest"];
446 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800447 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
448 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700449 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800450 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800451 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800452 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800453 DiskStats disk_stats = 10025 [(module) = "framework"];
454 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
455 AppSize app_size = 10027 [(module) = "framework"];
456 CategorySize category_size = 10028 [(module) = "framework"];
457 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800458 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800459 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
460 DiskIo disk_io = 10032 [(module) = "framework"];
461 PowerProfile power_profile = 10033 [(module) = "framework"];
462 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
463 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
464 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700465 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800466 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
467 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
468 10040 [(module) = "framework"];
469 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
470 10041 [(module) = "framework"];
471 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800472 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800473 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800474 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800475 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
476 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
477 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
478 RoleHolder role_holder = 10049 [(module) = "framework"];
479 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800480 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800481 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
482 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800483 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
484 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800485 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
486 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
487 FaceSettings face_settings = 10058 [(module) = "framework"];
488 CoolingDevice cooling_device = 10059 [(module) = "framework"];
489 AppOps app_ops = 10060 [(module) = "framework"];
490 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700491 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
492 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800493 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800494 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800495 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
496 DangerousPermissionStateSampled dangerous_permission_state_sampled =
497 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400498 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000499 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000500 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200501 PackageNotificationPreferences package_notification_preferences =
502 10071 [(module) = "framework"];
503 PackageNotificationChannelPreferences package_notification_channel_preferences =
504 10072 [(module) = "framework"];
505 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
506 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800507 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800508 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700509 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
510 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
511 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
512 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800513 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700514 }
yroa1fe77c2018-02-26 14:22:54 -0800515
Bookatz76aafcf2018-09-17 16:17:10 -0700516 // DO NOT USE field numbers above 100,000 in AOSP.
517 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
518 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100519
520 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700521}
522
Yao Chend54f9dd2017-10-17 17:37:48 +0000523/**
Yangster-mac20877162017-12-22 17:19:39 -0800524 * This proto represents a node of an attribution chain.
525 * Note: All attribution chains are represented as a repeated field of type
526 * AttributionNode. It is understood that in such arrays, the order is that
527 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000528 */
Yangster-mac20877162017-12-22 17:19:39 -0800529message AttributionNode {
530 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800531 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800532
Yangster-mac20877162017-12-22 17:19:39 -0800533 // The (optional) string tag for an element in the attribution chain. If the
534 // element has no tag, it is encoded as an empty string.
535 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700536}
537
Yangster-mac48b3d622018-08-18 12:38:11 -0700538message KeyValuePair {
539 optional int32 key = 1;
540 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700541 int32 value_int = 2;
542 int64 value_long = 3;
543 string value_str = 4;
544 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700545 }
546}
547
548message KeyValuePairsAtom {
549 optional int32 uid = 1;
550 repeated KeyValuePair pairs = 2;
551}
552
Yao Chend54f9dd2017-10-17 17:37:48 +0000553/*
554 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800555 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000556 *
557 * RULES:
558 * - The field ids for each atom must start at 1, and count upwards by 1.
559 * Skipping field ids is not allowed.
560 * - These form an API, so renaming, renumbering or removing fields is
561 * not allowed between android releases. (This is not currently enforced,
562 * but there will be a tool to enforce this restriction).
563 * - The types must be built-in protocol buffer types, namely, no sub-messages
564 * are allowed (yet). The bytes type is also not allowed.
565 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800566 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000567 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800568 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000569 * - A field that is a uid should be a string field, tagged with the [xxx]
570 * annotation. The generated code on android will be represented by UIDs,
571 * and those UIDs will be translated in xxx to those strings.
572 *
573 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700574 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000575 * - If there is a UID, it goes first. Think in an object-oriented fashion.
576 * *****************************************************************************
577 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700578
Yao Chend54f9dd2017-10-17 17:37:48 +0000579/**
Tej Singha72344992019-04-17 18:55:08 -0700580 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700581 * Logs when the Thermal service HAL notifies the throttling start/stop events.
582 *
583 * Logged from:
584 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
585 */
586message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700587 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700588 optional android.os.TemperatureTypeEnum sensor_type = 1;
589
Maggie White442b6312019-04-05 16:26:44 -0700590 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700591 enum State {
592 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700593 START = 1; // START indicated that throttling was triggered.
594 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700595 }
Yangster-mace16189a2018-08-26 12:20:16 -0700596 optional State state = 2;
597
598 optional float temperature = 3;
599}
600
601/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000602 * Logs when the screen state changes.
603 *
604 * Logged from:
605 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
606 */
607message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800608 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800609 optional android.view.DisplayStateEnum state = 1
610 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700611}
Yao Chend54f9dd2017-10-17 17:37:48 +0000612
613/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700614 * Logs that the process state of the uid, as determined by ActivityManager
615 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000616 *
617 * Logged from:
618 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
619 */
Bookatzc1a050a2017-10-10 15:49:28 -0700620message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800621 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000622
Bookatzdb026a22018-01-10 19:01:56 -0800623 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800624 optional android.app.ProcessStateEnum state = 2
625 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000626}
627
628/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700629 * Logs process state change of a process, as per the activity manager.
630 *
631 * Logged from:
632 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
633 */
634message ProcessStateChanged {
635 optional int32 uid = 1;
636 optional string process_name = 2;
637 optional string package_name = 3;
638 // TODO: remove this when validation is done
639 optional int64 version = 5;
640 // The state, from frameworks/base/core/proto/android/app/enums.proto.
641 optional android.app.ProcessStateEnum state = 4;
642}
643
644/**
645 * Logs when ActivityManagerService sleep state is changed.
646 *
647 * Logged from:
648 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
649 */
650message ActivityManagerSleepStateChanged {
651 // TODO: import frameworks proto
652 enum State {
653 UNKNOWN = 0;
654 ASLEEP = 1;
655 AWAKE = 2;
656 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800657 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700658}
659
660/**
661 * Logs when system memory state changes.
662 *
663 * Logged from:
664 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
665 */
666message MemoryFactorStateChanged {
667 // TODO: import frameworks proto
668 enum State {
669 MEMORY_UNKNOWN = 0;
670 NORMAL = 1; // normal.
671 MODERATE = 2; // moderate memory pressure.
672 LOW = 3; // low memory.
673 CRITICAL = 4; // critical memory.
674
675 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800676 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700677}
678
679/**
680 * Logs when app is using too much cpu, according to ActivityManagerService.
681 *
682 * Logged from:
683 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
684 */
685message ExcessiveCpuUsageReported {
686 optional int32 uid = 1;
687 optional string process_name = 2;
688 optional string package_name = 3;
689 // package version. TODO: remove this when validation is done
690 optional int64 version = 4;
691}
692
693/**
694 * Logs when a cached process is killed, along with its pss.
695 *
696 * Logged from:
697 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
698 */
699message CachedKillReported {
700 optional int32 uid = 1;
701 optional string process_name = 2;
702 optional string package_name = 3;
703 // TODO: remove this when validation is done
704 optional int64 version = 5;
705 optional int64 pss = 4;
706}
707
708/**
xshu2c3d9e42019-09-26 17:54:02 -0700709 * Logs the change in wifi health.
710 *
711 * Logged from:
712 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
713 */
714message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800715 enum Band {
716 UNKNOWN = 0;
717 // All of 2.4GHz band
718 BAND_2G = 1;
719 // Frequencies in the range of [5150, 5250) GHz
720 BAND_5G_LOW = 2;
721 // Frequencies in the range of [5250, 5725) GHz
722 BAND_5G_MIDDLE = 3;
723 // Frequencies in the range of [5725, 5850) GHz
724 BAND_5G_HIGH = 4;
725 // Frequencies in the range of [5925, 6425) GHz
726 BAND_6G_LOW = 5;
727 // Frequencies in the range of [6425, 6875) GHz
728 BAND_6G_MIDDLE = 6;
729 // Frequencies in the range of [6875, 7125) GHz
730 BAND_6G_HIGH = 7;
731 }
xshu2c3d9e42019-09-26 17:54:02 -0700732 // duration this stat is obtained over in milliseconds
733 optional int32 duration_millis = 1;
734 // whether wifi is classified as sufficient for the user's data traffic, determined
735 // by whether the calculated throughput exceeds the average demand within |duration_millis|
736 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700737 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800738 optional bool is_cell_data_available = 3;
739 // the Band bucket the connected network is on
740 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700741}
742
743/**
744 * Logged when wifi detects a significant change in connection failure rate.
745 *
746 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
747 *
748 */
749message WifiFailureStatReported {
750 enum AbnormalityType {
751 UNKNOWN = 0;
752 SIGNIFICANT_INCREASE = 1;
753 SIGNIFICANT_DECREASE = 2;
754 SIMPLY_HIGH = 3;
755 }
756 enum FailureType {
757 FAILURE_UNKNOWN = 0;
758 FAILURE_CONNECTION = 1;
759 FAILURE_ASSOCIATION_REJECTION = 2;
760 FAILURE_ASSOCIATION_TIMEOUT = 3;
761 FAILURE_AUTHENTICATION = 4;
762 FAILURE_NON_LOCAL_DISCONNECTION = 5;
763 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
764 }
765 // Reason for uploading this stat
766 optional AbnormalityType abnormality_type = 1;
767 // The particular type of failure
768 optional FailureType failure_type = 2;
769 // How many times we have encountered this combination of AbnormalityType and FailureType
770 optional int32 failure_count = 3;
771}
772
773/**
774 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
775 *
776 * Logged from:
777 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
778 */
779message WifiConnectionResultReported {
780 enum FailureCode {
781 FAILURE_UNKNOWN = 0;
782 FAILURE_ASSOCIATION_TIMEOUT = 1;
783 FAILURE_ASSOCIATION_REJECTION = 2;
784 FAILURE_AUTHENTICATION_GENERAL = 3;
785 FAILURE_AUTHENTICATION_EAP = 4;
786 FAILURE_DHCP = 5;
787 FAILURE_NETWORK_DISCONNECTION = 6;
788 FAILURE_ROAM_TIMEOUT = 7;
789 }
790 // true represents a successful connection
791 optional bool connection_result = 1;
792 // reason for the connection failure
793 optional FailureCode failure_code = 2;
794 // scan rssi before the connection attempt
795 optional int32 rssi = 3;
796}
797
798/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700799 * Logs when memory stats of a process is reported.
800 *
801 * Logged from:
802 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
803 */
804message ProcessMemoryStatReported {
805 optional int32 uid = 1;
806 optional string process_name = 2;
807 optional string package_name = 3;
808 //TODO: remove this when validation is done
809 optional int64 version = 9;
810 optional int64 pss = 4;
811 optional int64 uss = 5;
812 optional int64 rss = 6;
813 enum Type {
814 ADD_PSS_INTERNAL_SINGLE = 0;
815 ADD_PSS_INTERNAL_ALL_MEM = 1;
816 ADD_PSS_INTERNAL_ALL_POLL = 2;
817 ADD_PSS_EXTERNAL = 3;
818 ADD_PSS_EXTERNAL_SLOW = 4;
819 }
820 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800821 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700822}
823
824/**
Bookatzc1a050a2017-10-10 15:49:28 -0700825 * Logs that a process started, finished, crashed, or ANRed.
826 *
827 * Logged from:
828 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
829 */
830message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700831 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700832
David Chen0b5c90c2018-01-25 16:51:49 -0800833 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800834 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700835
Bookatzddccf0a2017-11-28 16:48:14 -0800836 // What lifecycle state the process changed to.
837 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800838 enum State {
839 FINISHED = 0;
840 STARTED = 1;
841 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800842 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800843 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700844}
845
Bookatzc1a050a2017-10-10 15:49:28 -0700846/**
847 * Logs when the ble scan state changes.
848 *
849 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700850 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700851 */
852message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800853 repeated AttributionNode attribution_node = 1
854 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700855
856 enum State {
857 OFF = 0;
858 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700859 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
860 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700861 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800862 optional State state = 2 [
863 (state_field_option).option = EXCLUSIVE_STATE,
864 (state_field_option).default_state_value = 0 /* State.OFF */,
865 (state_field_option).reset_state_value = 2 /* State.RESET */,
866 (state_field_option).nested = true
867 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700868
Bookatze5ec0b42018-03-26 13:34:56 -0700869 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800870 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700871 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800872 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700873 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800874 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700875}
876
877/**
878 * Logs reporting of a ble scan finding results.
879 *
880 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700881 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700882 */
Bookatzae6738e2018-09-13 11:38:56 -0700883// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700884message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800885 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700886
887 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800888 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700889}
890
891/**
892 * Logs when a sensor state changes.
893 *
894 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700895 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700896 */
897message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800898 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700899
Bookatzc1a050a2017-10-10 15:49:28 -0700900 // The id (int) of the sensor.
901 optional int32 sensor_id = 2;
902
903 enum State {
904 OFF = 0;
905 ON = 1;
906 }
907 optional State state = 3;
908}
909
Bookatzc1a050a2017-10-10 15:49:28 -0700910/**
911 * Logs when GPS state changes.
912 *
913 * Logged from:
914 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
915 */
916message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800917 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700918
919 enum State {
920 OFF = 0;
921 ON = 1;
922 }
923 optional State state = 2;
924}
925
Bookatz48d362e2018-11-06 15:49:08 -0800926/**
927 * Logs when GPS signal quality.
928 *
929 * Logged from:
930 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
931 */
932message GpsSignalQualityChanged {
933 optional android.server.location.GpsSignalQualityEnum level = 1;
934}
935
Bookatzc1a050a2017-10-10 15:49:28 -0700936
937/**
938 * Logs when a sync manager sync state changes.
939 *
940 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700941 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700942 */
943message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800944 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700945
David Chen0b5c90c2018-01-25 16:51:49 -0800946 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800947 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700948
949 enum State {
950 OFF = 0;
951 ON = 1;
952 }
953 optional State state = 3;
954}
955
Yangster-mac96353002018-09-05 11:18:55 -0700956/*
957 * Deferred job stats.
958 *
959 * Logged from:
960 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
961*/
962message DeferredJobStatsReported {
963 repeated AttributionNode attribution_node = 1;
964
965 // Number of jobs deferred.
966 optional int32 num_jobs_deferred = 2;
967
968 // Time since the last job runs.
969 optional int64 time_since_last_job_millis = 3;
970}
971
Bookatzc1a050a2017-10-10 15:49:28 -0700972/**
973 * Logs when a job scheduler job state changes.
974 *
975 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700976 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700977 */
978message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800979 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700980
981 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800982 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700983
984 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800985 FINISHED = 0;
986 STARTED = 1;
987 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700988 }
989 optional State state = 3;
990
Tej Singh33a412b2018-03-16 18:43:59 -0700991 // The reason a job has stopped.
992 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700993 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700994 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100995
996 // The standby bucket of the app that scheduled the job. These match the framework constants
997 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
998 // already assigned 0.
999 enum Bucket {
1000 UNKNOWN = -1;
1001 ACTIVE = 0;
1002 WORKING_SET = 1;
1003 FREQUENT = 2;
1004 RARE = 3;
1005 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001006 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001007 }
1008 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1009
1010 // The job id (as assigned by the app).
1011 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001012
1013 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1014 // constraints as they are always assumed to be set.
1015 optional bool has_charging_constraint = 7;
1016 optional bool has_battery_not_low_constraint = 8;
1017 optional bool has_storage_not_low_constraint = 9;
1018 optional bool has_timing_delay_constraint = 10;
1019 optional bool has_deadline_constraint = 11;
1020 optional bool has_idle_constraint = 12;
1021 optional bool has_connectivity_constraint = 13;
1022 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001023}
1024
1025/**
1026 * Logs when the audio state changes.
1027 *
1028 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001029 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001030 */
1031message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001032 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001033
1034 enum State {
1035 OFF = 0;
1036 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001037 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1038 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001039 }
1040 optional State state = 2;
1041}
1042
1043/**
1044 * Logs when the video codec state changes.
1045 *
1046 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001047 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001048 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001049message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001050 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001051
1052 enum State {
1053 OFF = 0;
1054 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001055 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1056 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001057 }
1058 optional State state = 2;
1059}
1060
1061/**
1062 * Logs when the flashlight state changes.
1063 *
1064 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001065 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001066 */
1067message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001068 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001069
1070 enum State {
1071 OFF = 0;
1072 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001073 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1074 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001075 }
1076 optional State state = 2;
1077}
1078
1079/**
1080 * Logs when the camera state changes.
1081 *
1082 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001083 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001084 */
1085message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001086 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001087
1088 enum State {
1089 OFF = 0;
1090 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001091 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1092 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001093 }
1094 optional State state = 2;
1095}
1096
1097/**
1098 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001099 *
1100 * Logged from:
1101 * TODO
1102 */
Bookatzd6746242017-10-24 18:39:35 -07001103message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001104 repeated AttributionNode attribution_node = 1
1105 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001106
Bookatz1a1b0462018-01-12 11:47:03 -08001107 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1108 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001109 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001110 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001111
1112 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001113 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001114
1115 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001116 RELEASE = 0;
1117 ACQUIRE = 1;
1118 CHANGE_RELEASE = 2;
1119 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001120 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001121 optional State state = 4 [
1122 (state_field_option).option = EXCLUSIVE_STATE,
1123 (state_field_option).default_state_value = 0,
1124 (state_field_option).nested = true
1125 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001126}
1127
1128/**
Bookatzc1a050a2017-10-10 15:49:28 -07001129 * Logs when a partial wakelock is considered 'long' (over 1 min).
1130 *
1131 * Logged from:
1132 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1133 */
1134message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001135 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001136
Yao Chend54f9dd2017-10-17 17:37:48 +00001137 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1138 optional string tag = 2;
1139
Bookatzc1a050a2017-10-10 15:49:28 -07001140 // TODO: I have no idea what this is.
1141 optional string history_tag = 3;
1142
1143 enum State {
1144 OFF = 0;
1145 ON = 1;
1146 }
1147 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001148}
1149
Bookatzc1a050a2017-10-10 15:49:28 -07001150/**
Bookatza66083f2018-09-20 17:24:00 -07001151 * Logs when the device is interactive, according to the PowerManager Notifier.
1152 *
1153 * Logged from:
1154 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1155 */
1156message InteractiveStateChanged {
1157 enum State {
1158 OFF = 0;
1159 ON = 1;
1160 }
1161 optional State state = 1;
1162}
1163
1164/**
Bookatzc1a050a2017-10-10 15:49:28 -07001165 * Logs Battery Saver state change.
1166 *
1167 * Logged from:
1168 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1169 */
1170message BatterySaverModeStateChanged {
1171 enum State {
1172 OFF = 0;
1173 ON = 1;
1174 }
1175 optional State state = 1;
1176}
1177
1178/**
1179 * Logs Doze mode state change.
1180 *
1181 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001182 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001183 */
1184message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001185 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001186}
1187
1188
1189/**
1190 * Logs state change of Doze mode including maintenance windows.
1191 *
1192 * Logged from:
1193 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1194 */
1195message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001196 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001197}
1198
1199/**
1200 * Logs screen brightness level.
1201 *
1202 * Logged from:
1203 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1204 */
1205message ScreenBrightnessChanged {
1206 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1207 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001208}
1209
1210/**
1211 * Logs battery level (percent full, from 0 to 100).
1212 *
1213 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001214 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001215 */
1216message BatteryLevelChanged {
1217 // Battery level. Should be in [0, 100].
1218 optional int32 battery_level = 1;
1219}
1220
1221/**
1222 * Logs change in charging status of the device.
1223 *
1224 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001225 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001226 */
1227message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001228 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1229 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001230}
1231
1232/**
1233 * Logs whether the device is plugged in, and what power source it is using.
1234 *
1235 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001236 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001237 */
1238message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001239 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1240 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001241}
1242
Bookatz8c6571b2017-10-24 15:04:41 -07001243/**
1244 * Logs when an app's wakeup alarm fires.
1245 *
1246 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001247 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001248 */
1249message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001250 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001251
1252 // Name of the wakeup alarm.
1253 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001254
1255 // Name of source package (for historical reasons, since BatteryStats tracked it).
1256 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001257
Ben Murdoch3389f1522019-05-21 15:05:34 +01001258 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001259 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001260}
1261
1262/**
1263 * Logs when an an app causes the mobile radio to change state.
1264 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1265 *
1266 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001267 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001268 */
1269message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001270 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001271
Bookatz1a1b0462018-01-12 11:47:03 -08001272 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1273 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001274}
1275
1276/**
1277 * Logs when an an app causes the wifi radio to change state.
1278 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1279 *
1280 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001281 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001282 */
1283message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001284 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001285
Bookatz1a1b0462018-01-12 11:47:03 -08001286 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1287 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001288}
1289
1290/**
1291 * Logs kernel wakeup reasons and aborts.
1292 *
1293 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001294 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001295 */
1296message KernelWakeupReported {
1297 // Name of the kernel wakeup reason (or abort).
1298 optional string wakeup_reason_name = 1;
1299
1300 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001301 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001302}
1303
1304/**
Bookatzda1798c2018-12-13 14:16:00 -08001305 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001306 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001307 *
1308 * Logged from:
1309 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1310 */
1311message WifiEnabledStateChanged {
1312 enum State {
1313 OFF = 0;
1314 ON = 1;
1315 }
1316 optional State state = 1;
1317}
1318
1319/**
tsaichristinececebdc2020-02-04 14:05:56 -08001320 * This atom is deprecated starting in R.
1321 *
Bookatzda1798c2018-12-13 14:16:00 -08001322 * 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 -08001323 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1324 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001325 *
1326 * Logged from:
1327 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1328 */
1329message WifiRunningStateChanged {
1330 repeated AttributionNode attribution_node = 1;
1331
1332 enum State {
1333 OFF = 0;
1334 ON = 1;
1335 }
1336 optional State state = 2;
1337}
1338
1339/**
Bookatze5885242017-10-24 20:10:31 -07001340 * Logs wifi locks held by an app.
1341 *
1342 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001343 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001344 */
1345message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001346 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001347
1348 enum State {
1349 OFF = 0;
1350 ON = 1;
1351 }
1352 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001353
1354 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1355 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001356}
1357
1358/**
1359 * Logs wifi signal strength changes.
1360 *
1361 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001362 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001363 */
1364message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001365 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1366 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001367}
1368
1369/**
1370 * Logs wifi scans performed by an app.
1371 *
1372 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001373 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001374 */
1375message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001376 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001377
1378 enum State {
1379 OFF = 0;
1380 ON = 1;
1381 }
1382 optional State state = 2;
1383}
1384
1385/**
Tej Singh4503e102018-01-04 14:35:01 -08001386 * Logs wifi multicast locks held by an app
1387 *
1388 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001389 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001390 */
1391message WifiMulticastLockStateChanged {
1392 repeated AttributionNode attribution_node = 1;
1393
1394 enum State {
1395 OFF = 0;
1396 ON = 1;
1397 }
1398 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001399
1400 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001401}
1402
1403/**
Tej Singh1ea42892018-01-19 09:27:00 -08001404 * Logs shutdown reason and duration on next boot.
1405 *
1406 * Logged from:
1407 * frameworks/base/core/java/com/android/server/BootReceiver.java
1408 */
1409message ShutdownSequenceReported {
1410 // True if shutdown is for a reboot. Default: false if we do not know.
1411 optional bool reboot = 1;
1412
1413 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1414 optional string reason = 2;
1415
1416 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1417 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001418 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001419
1420 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001421 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001422}
1423
Tej Singh6483ea42018-01-25 17:45:49 -08001424
1425/**
1426 * Logs boot reason and duration.
1427 *
1428 * Logged from:
1429 * system/core/bootstat/bootstat.cpp
1430 */
1431message BootSequenceReported {
1432 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1433 // Default: "<EMPTY>" if not available.
1434 optional string bootloader_reason = 1;
1435
1436 // Reason for system boot. Eg. bootloader, reboot,userrequested
1437 // Default: "<EMPTY>" if not available.
1438 optional string system_reason = 2;
1439
1440 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001441 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001442
1443 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001444 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001445
1446 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001447 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001448
1449 // Time since last boot in ms. Default: 0 if not available.
1450 optional int64 time_since_last_boot = 6;
1451}
1452
Tej Singhc477d9c2018-02-05 18:31:39 -08001453
1454/**
1455 * Logs call state and disconnect cause (if applicable).
1456 *
1457 * Logged from:
1458 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1459 */
1460message CallStateChanged {
1461 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1462 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1463 optional android.telecom.CallStateEnum call_state = 1;
1464
1465 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1466 // This value is only applicable when the call_state is DISCONNECTED, and
1467 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1468 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1469 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1470
1471 // True if the call is self-managed, which are apps that use the
1472 // telecom infrastructure to make their own calls.
1473 optional bool self_managed = 3;
1474
1475 // True if call is external. External calls are calls on connected Wear
1476 // devices but show up in Telecom so the user can pull them onto the device.
1477 optional bool external_call = 4;
1478}
1479
Tej Singh1ea42892018-01-19 09:27:00 -08001480/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001481 * Logs keyguard state. The keyguard is the lock screen.
1482 *
1483 * Logged from:
1484 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1485 */
1486message KeyguardStateChanged {
1487 enum State {
1488 UNKNOWN = 0;
1489 // The keyguard is hidden when the phone is unlocked.
1490 HIDDEN = 1;
1491 // The keyguard is shown when the phone is locked (screen turns off).
1492 SHOWN= 2;
1493 // The keyguard is occluded when something is overlaying the keyguard.
1494 // Eg. Opening the camera while on the lock screen.
1495 OCCLUDED = 3;
1496 }
1497 optional State state = 1;
1498}
1499
1500/**
1501 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1502 * prompts the user to enter a password (pattern, pin, etc).
1503 *
1504 * Logged from:
1505 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1506 */
1507
1508message KeyguardBouncerStateChanged {
1509 enum State {
1510 UNKNOWN = 0;
1511 // Bouncer is hidden, either as a result of successfully entering the
1512 // password, screen timing out, or user going back to lock screen.
1513 HIDDEN = 1;
1514 // This is when the user is being prompted to enter the password.
1515 SHOWN = 2;
1516 }
1517 optional State state = 1;
1518}
1519
1520/**
1521 * Logs the result of entering a password into the keyguard bouncer.
1522 *
1523 * Logged from:
1524 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1525 */
1526message KeyguardBouncerPasswordEntered {
1527 enum BouncerResult {
1528 UNKNOWN = 0;
1529 // The password entered was incorrect.
1530 FAILURE = 1;
1531 // The password entered was correct.
1532 SUCCESS = 2;
1533 }
1534 optional BouncerResult result = 1;
1535}
1536
Tej Singha883b372018-02-15 11:30:01 -08001537/*
1538 * Logs changes to the configuration of the device. The configuration is defined
1539 * in frameworks/base/core/java/android/content/res/Configuration.java
1540 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1541 * Please go there to interpret the possible values each field can be.
1542 *
1543 * Logged from:
1544 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1545 */
1546message ResourceConfigurationChanged {
1547 // Bit mask of color capabilities of the screen.
1548 // Contains information about the color gamut and hdr mode of the screen.
1549 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001550 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001551
1552 // The target screen density being rendered to.
1553 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001554 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001555
1556 // Current user preference for the scaling factor for fonts,
1557 // relative to the base density scaling.
1558 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001559 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001560
1561 // Flag indicating whether the hard keyboard is hidden.
1562 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001563 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001564
1565 // The type of keyboard attached to the device.
1566 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1567 optional int32 keyboard = 5;
1568
1569 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1570 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001571 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001572
1573 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1574 // 0 if undefined.
1575 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1576 optional int32 mcc = 7;
1577
1578 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1579 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1580 // MNC_ZERO symbol defined in Configuration.java.
1581 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1582 optional int32 mnc = 8;
1583
1584 // The kind of navigation available on the device.
1585 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1586 optional int32 navigation = 9;
1587
1588 // Flag indicating whether the navigation is available.
1589 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001590 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001591
1592 // Overall orientation of the screen.
1593 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1594 optional int32 orientation = 11;
1595
1596 // The current height of the available screen space, in dp units.
1597 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001598 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001599
1600 // Bit mask of overall layout of the screen.
1601 // Contains information about screen size, whether the screen is wider/taller
1602 // than normal, whether the screen layout is right-tl-left or left-to-right,
1603 // and whether the screen has a rounded shape.
1604 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001605 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001606
1607 // Current width of the available screen space, in dp units.
1608 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001609 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001610
1611 // The smallest screen size an application will see in normal operation.
1612 // This is the smallest value of both screenWidthDp and screenHeightDp
1613 // in portrait and landscape.
1614 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001615 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001616
1617 // The type of touch screen attached to the device.
1618 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1619 optional int32 touchscreen = 16;
1620
1621 // Bit mask of the ui mode.
1622 // Contains information about the overall ui mode of the device.
1623 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1624 // Also contains information about whether the device is in night mode.
1625 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001626 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001627}
1628
Tej Singheee317b2018-03-07 19:28:05 -08001629
1630/**
1631 * Logs changes in the connection state of the mobile radio.
1632 *
1633 * Logged from:
1634 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1635 */
1636message MobileConnectionStateChanged {
1637 // States are from the state machine DataConnection.java.
1638 enum State {
1639 UNKNOWN = 0;
1640 // The connection is inactive, or disconnected.
1641 INACTIVE = 1;
1642 // The connection is being activated, or connecting.
1643 ACTIVATING = 2;
1644 // The connection is active, or connected.
1645 ACTIVE = 3;
1646 // The connection is disconnecting.
1647 DISCONNECTING = 4;
1648 // The connection is disconnecting after creating a connection.
1649 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1650 }
1651 optional State state = 1;
1652 // For multi-sim phones, this distinguishes between the sim cards.
1653 optional int32 sim_slot_index = 2;
1654 // Used to identify the connection. Starts at 0 and increments by 1 for
1655 // every new network created. Resets whenever the device reboots.
1656 optional int32 data_connection_id = 3;
1657 // A bitmask for the capabilities of this connection.
1658 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1659 // Default value (if we have no information): 0
1660 optional int64 capabilities = 4;
1661 // If this connection has internet.
1662 // This just checks if the DEFAULT bit of capabilities is set.
1663 optional bool has_internet = 5;
1664}
1665
1666/**
1667 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1668 *
1669 * Logged from:
1670 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1671 */
1672message MobileRadioTechnologyChanged {
1673 optional android.telephony.NetworkTypeEnum state = 1;
1674 // For multi-sim phones, this distinguishes between the sim cards.
1675 optional int32 sim_slot_index = 2;
1676}
1677
Andrew Chantb56388b2018-03-22 21:07:33 -07001678/**
1679 * Logs the VID and PID of any connected USB devices.
1680 *
1681 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1682 *
1683 * Logged by Vendor.
1684 */
1685message UsbDeviceAttached {
1686 optional int32 vid = 1;
1687 optional int32 pid = 2;
1688 optional bool has_audio = 3;
1689 optional bool has_hid = 4;
1690 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001691 enum State {
1692 STATE_DISCONNECTED = 0;
1693 STATE_CONNECTED = 1;
1694 }
1695 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001696 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001697}
1698
Tej Singheee317b2018-03-07 19:28:05 -08001699
Tej Singhdd7bd352018-02-09 19:33:15 -08001700/**
Tej Singh5d991e12018-03-09 19:48:11 -08001701 * Logs when Bluetooth is enabled and disabled.
1702 *
1703 * Logged from:
1704 * services/core/java/com/android/server/BluetoothManagerService.java
1705 */
1706message BluetoothEnabledStateChanged {
1707 repeated AttributionNode attribution_node = 1;
1708 // Whether or not bluetooth is enabled on the device.
1709 enum State {
1710 UNKNOWN = 0;
1711 ENABLED = 1;
1712 DISABLED = 2;
1713 }
1714 optional State state = 2;
1715 // The reason for being enabled/disabled.
1716 // Eg. Airplane mode, crash, application request.
1717 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1718 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001719 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001720}
1721
1722/**
Jack Hed9837c82019-01-09 01:19:13 -08001723 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001724 *
1725 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001726 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1727 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001728 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001729 */
1730message BluetoothConnectionStateChanged {
1731 // The state of the connection.
1732 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1733 optional android.bluetooth.ConnectionStateEnum state = 1;
1734 // An identifier that can be used to match connect and disconnect events.
1735 // Currently is last two bytes of a hash of a device level ID and
1736 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001737 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001738 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001739 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1740 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001741 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001742 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001743 // An identifier that can be used to match events for this device.
1744 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1745 // Salt: Randomly generated 256 bit value
1746 // Hash algorithm: HMAC-SHA256
1747 // Size: 32 byte
1748 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001749 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001750 // An identifier that can be used to match events for this device.
1751 // The incremental identifier is locally generated and guaranteed not derived
1752 // from any globally unique hardware id.
1753 // For paired devices, it stays consistent between Bluetooth toggling for the
1754 // same remote device.
1755 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1756 // session for the same remote device.
1757 // Default: 0 if the device's metric id is unknown.
1758 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001759}
1760
1761/**
1762 * Logs when a Bluetooth device connects and disconnects over ACL
1763 *
1764 * Logged from:
1765 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1766 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001767 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001768 */
1769message BluetoothAclConnectionStateChanged {
1770 // An identifier that can be used to match events for this device.
1771 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1772 // Salt: Randomly generated 256 bit value
1773 // Hash algorithm: HMAC-SHA256
1774 // Size: 32 byte
1775 // Default: null or empty if the device identifier is not known
1776 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1777 // The state of the connection.
1778 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1779 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001780 // An identifier that can be used to match events for this device.
1781 // The incremental identifier is locally generated and guaranteed not derived
1782 // from any globally unique hardware id.
1783 // For paired devices, it stays consistent between Bluetooth toggling for the
1784 // same remote device.
1785 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1786 // session for the same remote device.
1787 // Default: 0 if the device's metric id is unknown.
1788 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001789}
1790
1791/**
1792 * Logs when a Bluetooth device connects and disconnects over SCO
1793 *
1794 * Logged from:
1795 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1796 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1797 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001798 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001799 */
1800message BluetoothScoConnectionStateChanged {
1801 // An identifier that can be used to match events for this device.
1802 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1803 // Salt: Randomly generated 256 bit value
1804 // Hash algorithm: HMAC-SHA256
1805 // Size: 32 byte
1806 // Default: null or empty if the device identifier is not known
1807 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1808 // The state of the connection.
1809 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1810 optional android.bluetooth.ConnectionStateEnum state = 2;
1811 // Codec used for this SCO connection
1812 // Default: UNKNOWN
1813 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001814 // An identifier that can be used to match events for this device.
1815 // The incremental identifier is locally generated and guaranteed not derived
1816 // from any globally unique hardware id.
1817 // For paired devices, it stays consistent between Bluetooth toggling for the
1818 // same remote device.
1819 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1820 // session for the same remote device.
1821 // Default: 0 if the device's metric id is unknown.
1822 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001823}
1824
Jack Hec27040a2019-01-09 20:54:41 -08001825/**
1826 * Logged when active device of a profile changes
1827 *
1828 * Logged from:
1829 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1830 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1831 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1832 */
1833message BluetoothActiveDeviceChanged {
1834 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1835 // From android.bluetooth.BluetoothProfile
1836 optional int32 bt_profile = 1;
1837 // An identifier that can be used to match events for this new active device.
1838 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1839 // Salt: Randomly generated 256 bit value
1840 // Hash algorithm: HMAC-SHA256
1841 // Size: 32 byte
1842 // Default: null or empty if there is no active device for this profile
1843 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001844 // An identifier that can be used to match events for this device.
1845 // The incremental identifier is locally generated and guaranteed not derived
1846 // from any globally unique hardware id.
1847 // For paired devices, it stays consistent between Bluetooth toggling for the
1848 // same remote device.
1849 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1850 // session for the same remote device.
1851 // Default: 0 if the device's metric id is unknown.
1852 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001853}
1854
Jack Heab86dbd22018-12-18 15:43:27 -08001855// Logs when there is an event affecting Bluetooth device's link layer connection.
1856// - This event is triggered when there is a related HCI command or event
1857// - Users of this metrics can deduce Bluetooth device's connection state from these events
1858// - HCI commands are logged before the command is sent, after receiving command status, and after
1859// receiving command complete
1860// - HCI events are logged when they arrive
1861//
1862// Low level log from system/bt
1863//
1864// Bluetooth classic commands:
1865// - CMD_CREATE_CONNECTION
1866// - CMD_DISCONNECT
1867// - CMD_CREATE_CONNECTION_CANCEL
1868// - CMD_ACCEPT_CONNECTION_REQUEST
1869// - CMD_REJECT_CONNECTION_REQUEST
1870// - CMD_SETUP_ESCO_CONNECTION
1871// - CMD_ACCEPT_ESCO_CONNECTION
1872// - CMD_REJECT_ESCO_CONNECTION
1873// - CMD_ENH_SETUP_ESCO_CONNECTION
1874// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1875//
1876// Bluetooth low energy commands:
1877// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1878// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1879// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1880// - CMD_BLE_CLEAR_WHITE_LIST
1881// - CMD_BLE_ADD_WHITE_LIST
1882// - CMD_BLE_REMOVE_WHITE_LIST
1883//
1884// Bluetooth classic events:
1885// - EVT_CONNECTION_COMP
1886// - EVT_CONNECTION_REQUEST
1887// - EVT_DISCONNECTION_COMP
1888// - EVT_ESCO_CONNECTION_COMP
1889// - EVT_ESCO_CONNECTION_CHANGED
1890//
1891// Bluetooth low energy meta events:
1892// - BLE_EVT_CONN_COMPLETE_EVT
1893// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1894//
1895// Next tag: 10
1896message BluetoothLinkLayerConnectionEvent {
1897 // An identifier that can be used to match events for this device.
1898 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1899 // Salt: Randomly generated 256 bit value
1900 // Hash algorithm: HMAC-SHA256
1901 // Size: 32 byte
1902 // Default: null or empty if the device identifier is not known
1903 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1904 // Connection handle of this connection if available
1905 // Range: 0x0000 - 0x0EFF (12 bits)
1906 // Default: 0xFFFF if the handle is unknown
1907 optional int32 connection_handle = 2;
1908 // Direction of the link
1909 // Default: DIRECTION_UNKNOWN
1910 optional android.bluetooth.DirectionEnum direction = 3;
1911 // Type of this link
1912 // Default: LINK_TYPE_UNKNOWN
1913 optional android.bluetooth.LinkTypeEnum type = 4;
1914
1915 // Reason metadata for this link layer connection event, rules for interpretation:
1916 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1917 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1918 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1919 // set and valid, ignore hci_ble_event
1920
1921 // HCI command associated with this event
1922 // Default: CMD_UNKNOWN
1923 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1924 // HCI event associated with this event
1925 // Default: EVT_UNKNOWN
1926 optional android.bluetooth.hci.EventEnum hci_event = 6;
1927 // HCI BLE meta event associated with this event
1928 // Default: BLE_EVT_UNKNOWN
1929 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1930 // HCI command status code if this is triggerred by hci_cmd
1931 // Default: STATUS_UNKNOWN
1932 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1933 // HCI reason code associated with this event
1934 // Default: STATUS_UNKNOWN
1935 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001936 // An identifier that can be used to match events for this device.
1937 // The incremental identifier is locally generated and guaranteed not derived
1938 // from any globally unique hardware id.
1939 // For paired devices, it stays consistent between Bluetooth toggling for the
1940 // same remote device.
1941 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1942 // session for the same remote device.
1943 // Default: 0 if the device's metric id is unknown.
1944 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001945}
1946
Howard Roe103fe22019-01-17 16:52:16 -08001947/**
1948 * Logs when a module is rolled back by Watchdog.
1949 *
1950 * Logged from: Rollback Manager
1951 */
1952message WatchdogRollbackOccurred {
1953 enum RollbackType {
1954 UNKNOWN = 0;
1955 ROLLBACK_INITIATE = 1;
1956 ROLLBACK_SUCCESS = 2;
1957 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001958 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001959 }
1960 optional RollbackType rollback_type = 1;
1961
1962 optional string package_name = 2;
1963
1964 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001965
1966 enum RollbackReasonType {
1967 REASON_UNKNOWN = 0;
1968 REASON_NATIVE_CRASH = 1;
1969 REASON_EXPLICIT_HEALTH_CHECK = 2;
1970 REASON_APP_CRASH = 3;
1971 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001972 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001973 }
1974 optional RollbackReasonType rollback_reason = 4;
1975
1976 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1977 // is initiated. Empty if the package is unknown.
1978 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001979
1980 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001981}
1982
Jack Hec27040a2019-01-09 20:54:41 -08001983/**
1984 * Logs when there is a change in Bluetooth A2DP playback state
1985 *
1986 * Logged from:
1987 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1988 */
1989message BluetoothA2dpPlaybackStateChanged {
1990 // An identifier that can be used to match events for this device.
1991 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1992 // Salt: Randomly generated 256 bit value
1993 // Hash algorithm: HMAC-SHA256
1994 // Size: 32 byte
1995 // Default: null or empty if the device identifier is not known
1996 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1997 // Current playback state
1998 // Default: PLAYBACK_STATE_UNKNOWN
1999 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2000 // Current audio coding mode
2001 // Default: AUDIO_CODING_MODE_UNKNOWN
2002 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002003 // An identifier that can be used to match events for this device.
2004 // The incremental identifier is locally generated and guaranteed not derived
2005 // from any globally unique hardware id.
2006 // For paired devices, it stays consistent between Bluetooth toggling for the
2007 // same remote device.
2008 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2009 // session for the same remote device.
2010 // Default: 0 if the device's metric id is unknown.
2011 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002012}
2013
2014/**
2015 * Logs when there is a change in A2DP codec config for a particular remote device
2016 *
2017 * Logged from:
2018 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2019 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2020 */
2021message BluetoothA2dpCodecConfigChanged {
2022 // An identifier that can be used to match events for this device.
2023 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2024 // Salt: Randomly generated 256 bit value
2025 // Hash algorithm: HMAC-SHA256
2026 // Size: 32 byte
2027 // Default: null or empty if the device identifier is not known
2028 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2029 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2030 // Default SOURCE_CODEC_TYPE_INVALID
2031 optional int32 codec_type = 2;
2032 // Codec priroity, the higher the more preferred, -1 for disabled
2033 // Default: CODEC_PRIORITY_DEFAULT
2034 optional int32 codec_priority = 3;
2035 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2036 // Default: SAMPLE_RATE_NONE
2037 optional int32 sample_rate = 4;
2038 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2039 // Default: BITS_PER_SAMPLE_NONE
2040 optional int32 bits_per_sample = 5;
2041 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2042 // Default: CHANNEL_MODE_NONE
2043 optional int32 channel_mode = 6;
2044 // Codec specific values
2045 // Default 0
2046 optional int64 codec_specific_1 = 7;
2047 optional int64 codec_specific_2 = 8;
2048 optional int64 codec_specific_3 = 9;
2049 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002050 // An identifier that can be used to match events for this device.
2051 // The incremental identifier is locally generated and guaranteed not derived
2052 // from any globally unique hardware id.
2053 // For paired devices, it stays consistent between Bluetooth toggling for the
2054 // same remote device.
2055 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2056 // session for the same remote device.
2057 // Default: 0 if the device's metric id is unknown.
2058 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002059}
2060
2061/**
2062 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2063 * Each codec's capability is logged separately due to statsd restriction
2064 *
2065 * Logged from:
2066 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2067 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2068 */
2069message BluetoothA2dpCodecCapabilityChanged {
2070 // An identifier that can be used to match events for this device.
2071 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2072 // Salt: Randomly generated 256 bit value
2073 // Hash algorithm: HMAC-SHA256
2074 // Size: 32 byte
2075 // Default: null or empty if the device identifier is not known
2076 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2077 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2078 // Default SOURCE_CODEC_TYPE_INVALID
2079 optional int32 codec_type = 2;
2080 // Codec priroity, the higher the more preferred, -1 for disabled
2081 // Default: CODEC_PRIORITY_DEFAULT
2082 optional int32 codec_priority = 3;
2083 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2084 // in BluetoothCodecConfig
2085 // Default: empty and SAMPLE_RATE_NONE for individual item
2086 optional int32 sample_rate = 4;
2087 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2088 // in BluetoothCodecConfig
2089 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2090 optional int32 bits_per_sample = 5;
2091 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2092 // BluetoothCodecConfig
2093 // Default: empty and CHANNEL_MODE_NONE for individual item
2094 optional int32 channel_mode = 6;
2095 // Codec specific values
2096 // Default 0
2097 optional int64 codec_specific_1 = 7;
2098 optional int64 codec_specific_2 = 8;
2099 optional int64 codec_specific_3 = 9;
2100 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002101 // An identifier that can be used to match events for this device.
2102 // The incremental identifier is locally generated and guaranteed not derived
2103 // from any globally unique hardware id.
2104 // For paired devices, it stays consistent between Bluetooth toggling for the
2105 // same remote device.
2106 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2107 // session for the same remote device.
2108 // Default: 0 if the device's metric id is unknown.
2109 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002110}
2111
2112/**
2113 * Logs when A2DP failed to read from PCM source.
2114 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2115 *
2116 * Logged from:
2117 * system/bt
2118 */
2119message BluetoothA2dpAudioUnderrunReported {
2120 // An identifier that can be used to match events for this device.
2121 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2122 // Salt: Randomly generated 256 bit value
2123 // Hash algorithm: HMAC-SHA256
2124 // Size: 32 byte
2125 // Default: null or empty if the device identifier is not known
2126 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2127 // Encoding interval in nanoseconds
2128 // Default: 0
2129 optional int64 encoding_interval_nanos = 2;
2130 // Number of bytes of PCM data that could not be read from the source
2131 // Default: 0
2132 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002133 // An identifier that can be used to match events for this device.
2134 // The incremental identifier is locally generated and guaranteed not derived
2135 // from any globally unique hardware id.
2136 // For paired devices, it stays consistent between Bluetooth toggling for the
2137 // same remote device.
2138 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2139 // session for the same remote device.
2140 // Default: 0 if the device's metric id is unknown.
2141 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002142}
2143
2144/**
2145 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2146 * buffer queue is full and we have to drop data
2147 *
2148 * Logged from:
2149 * system/bt
2150 */
2151message BluetoothA2dpAudioOverrunReported {
2152 // An identifier that can be used to match events for this device.
2153 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2154 // Salt: Randomly generated 256 bit value
2155 // Hash algorithm: HMAC-SHA256
2156 // Size: 32 byte
2157 // Default: null or empty if the device identifier is not known
2158 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2159 // Encoding interval in nanoseconds
2160 // Default: 0
2161 optional int64 encoding_interval_nanos = 2;
2162 // Number of buffers dropped in this event
2163 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2164 // Default: 0
2165 optional int32 num_dropped_buffers = 3;
2166 // Number of encoded buffers dropped in this event
2167 // Default 0
2168 optional int32 num_dropped_encoded_frames = 4;
2169 // Number of encoded bytes dropped in this event
2170 // Default: 0
2171 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002172 // An identifier that can be used to match events for this device.
2173 // The incremental identifier is locally generated and guaranteed not derived
2174 // from any globally unique hardware id.
2175 // For paired devices, it stays consistent between Bluetooth toggling for the
2176 // same remote device.
2177 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2178 // session for the same remote device.
2179 // Default: 0 if the device's metric id is unknown.
2180 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002181}
2182
2183/**
2184 * Logs when we receive reports regarding a device's RSSI value
2185 *
2186 * Logged from:
2187 * system/bt
2188 */
2189message BluetoothDeviceRssiReported {
2190 // An identifier that can be used to match events for this device.
2191 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2192 // Salt: Randomly generated 256 bit value
2193 // Hash algorithm: HMAC-SHA256
2194 // Size: 32 byte
2195 // Default: null or empty if the device identifier is not known
2196 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2197 // Connection handle of this connection if available
2198 // Range: 0x0000 - 0x0EFF (12 bits)
2199 // Default: 0xFFFF if the handle is unknown
2200 optional int32 connection_handle = 2;
2201 // HCI command status code if this is triggerred by hci_cmd
2202 // Default: STATUS_UNKNOWN
2203 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2204 // BR/EDR
2205 // Range: -128 ≤ N ≤ 127 (signed integer)
2206 // Units: dB
2207 // LE:
2208 // Range: -127 to 20, 127 (signed integer)
2209 // Units: dBm
2210 // Invalid when an out of range value is reported
2211 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002212 // An identifier that can be used to match events for this device.
2213 // The incremental identifier is locally generated and guaranteed not derived
2214 // from any globally unique hardware id.
2215 // For paired devices, it stays consistent between Bluetooth toggling for the
2216 // same remote device.
2217 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2218 // session for the same remote device.
2219 // Default: 0 if the device's metric id is unknown.
2220 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002221}
2222
2223/**
2224 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2225 *
2226 * Logged from:
2227 * system/bt
2228 */
2229message BluetoothDeviceFailedContactCounterReported {
2230 // An identifier that can be used to match events for this device.
2231 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2232 // Salt: Randomly generated 256 bit value
2233 // Hash algorithm: HMAC-SHA256
2234 // Size: 32 byte
2235 // Default: null or empty if the device identifier is not known
2236 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2237 // Connection handle of this connection if available
2238 // Range: 0x0000 - 0x0EFF (12 bits)
2239 // Default: 0xFFFF if the handle is unknown
2240 optional int32 connection_handle = 2;
2241 // HCI command status code if this is triggerred by hci_cmd
2242 // Default: STATUS_UNKNOWN
2243 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2244 // Number of consecutive failed contacts for a connection corresponding to the Handle
2245 // Range: uint16_t, 0-0xFFFF
2246 // Default: 0xFFFFF
2247 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002248 // An identifier that can be used to match events for this device.
2249 // The incremental identifier is locally generated and guaranteed not derived
2250 // from any globally unique hardware id.
2251 // For paired devices, it stays consistent between Bluetooth toggling for the
2252 // same remote device.
2253 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2254 // session for the same remote device.
2255 // Default: 0 if the device's metric id is unknown.
2256 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002257}
2258
2259/**
2260 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2261 *
2262 * Logged from:
2263 * system/bt
2264 */
2265message BluetoothDeviceTxPowerLevelReported {
2266 // An identifier that can be used to match events for this device.
2267 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2268 // Salt: Randomly generated 256 bit value
2269 // Hash algorithm: HMAC-SHA256
2270 // Size: 32 byte
2271 // Default: null or empty if the device identifier is not known
2272 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2273 // Connection handle of this connection if available
2274 // Range: 0x0000 - 0x0EFF (12 bits)
2275 // Default: 0xFFFF if the handle is unknown
2276 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002277 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002278 // Default: STATUS_UNKNOWN
2279 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2280 // Range: -30 ≤ N ≤ 20
2281 // Units: dBm
2282 // Invalid when an out of range value is reported
2283 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002284 // An identifier that can be used to match events for this device.
2285 // The incremental identifier is locally generated and guaranteed not derived
2286 // from any globally unique hardware id.
2287 // For paired devices, it stays consistent between Bluetooth toggling for the
2288 // same remote device.
2289 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2290 // session for the same remote device.
2291 // Default: 0 if the device's metric id is unknown.
2292 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002293}
Jack Heab86dbd22018-12-18 15:43:27 -08002294
Tej Singh5d991e12018-03-09 19:48:11 -08002295/**
Jack He1021a612019-01-20 21:22:46 -08002296 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2297 * receiving an HCI command from the host
2298 *
2299 * Logged from: system/bt
2300 */
2301message BluetoothHciTimeoutReported {
2302 // HCI command associated with this event
2303 // Default: CMD_UNKNOWN
2304 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2305}
2306
2307/**
2308 * Logs when we receive Bluetooth Link Quality Report event from the controller
2309 * See Android Bluetooth HCI specification for more details
2310 *
2311 * Note: all count and bytes field are counted since last event
2312 *
2313 * Logged from: system/bt
2314 */
2315message BluetoothQualityReportReported {
2316 // Quality report ID
2317 // Original type: uint8_t
2318 // Default: BQR_ID_UNKNOWN
2319 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2320 // Packet type of the connection
2321 // Original type: uint8_t
2322 // Default: BQR_PACKET_TYPE_UNKNOWN
2323 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2324 // Connection handle of the connection
2325 // Original type: uint16_t
2326 optional int32 connection_handle = 3;
2327 // Performing Role for the connection
2328 // Original type: uint8_t
2329 optional int32 connection_role = 4;
2330 // Current Transmit Power Level for the connection. This value is the same as the controller's
2331 // response to the HCI_Read_Transmit_Power_Level HCI command
2332 // Original type: uint8_t
2333 optional int32 tx_power_level = 5;
2334 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2335 // absolute receiver signal strength value
2336 // Original type: int8_t
2337 optional int32 rssi = 6;
2338 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2339 // channels used by the link currently
2340 // Original type: uint8_t
2341 optional int32 snr = 7;
2342 // Indicates the number of unused channels in AFH_channel_map
2343 // Original type: uint8_t
2344 optional int32 unused_afh_channel_count = 8;
2345 // Indicates the number of the channels which are interfered and quality is bad but are still
2346 // selected for AFH
2347 // Original type: uint8_t
2348 optional int32 afh_select_unideal_channel_count = 9;
2349 // Current Link Supervision Timeout Setting
2350 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2351 // Original type: uint16_t
2352 optional int32 lsto = 10;
2353 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2354 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2355 // 0x01 (Piconet Clock)
2356 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2357 // Original type: uint32_t
2358 optional int64 connection_piconet_clock = 11;
2359 // The count of retransmission
2360 // Original type: uint32_t
2361 optional int64 retransmission_count = 12;
2362 // The count of no RX
2363 // Original type: uint32_t
2364 optional int64 no_rx_count = 13;
2365 // The count of NAK (Negative Acknowledge)
2366 // Original type: uint32_t
2367 optional int64 nak_count = 14;
2368 // Controller timestamp of last TX ACK
2369 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2370 // Original type: uint32_t
2371 optional int64 last_tx_ack_timestamp = 15;
2372 // The count of Flow-off (STOP)
2373 // Original type: uint32_t
2374 optional int64 flow_off_count = 16;
2375 // Controller timestamp of last Flow-on (GO)
2376 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2377 // Original type: uint32_t
2378 optional int64 last_flow_on_timestamp = 17;
2379 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2380 // Original type: uint32_t
2381 optional int64 buffer_overflow_bytes = 18;
2382 // Buffer underflow count (in byte) since last event
2383 // Original type: uint32_t
2384 optional int64 buffer_underflow_bytes = 19;
2385}
2386
2387/**
2388 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2389 *
2390 * Notes:
2391 * - Each event can be partially filled as we might learn different pieces of device
2392 * information at different time
2393 * - Multiple device info events can be combined to give more complete picture
2394 * - When multiple device info events tries to describe the same information, the
2395 * later one wins
2396 *
2397 * Logged from:
2398 * packages/apps/Bluetooth
2399 */
Jack Heaea26982019-04-04 11:19:48 -07002400message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002401 // An identifier that can be used to match events for this device.
2402 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2403 // Salt: Randomly generated 256 bit value
2404 // Hash algorithm: HMAC-SHA256
2405 // Size: 32 byte
2406 // Default: null or empty if the device identifier is not known
2407 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2408 // Where is this device info obtained from
2409 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2410 // Name of the data source
2411 // For EXTERNAL: package name of the data source
2412 // For INTERNAL: null for general case, component name otherwise
2413 optional string source_name = 3;
2414 // Name of the manufacturer of this device
2415 optional string manufacturer = 4;
2416 // Model of this device
2417 optional string model = 5;
2418 // Hardware version of this device
2419 optional string hardware_version = 6;
2420 // Software version of this device
2421 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002422 // An identifier that can be used to match events for this device.
2423 // The incremental identifier is locally generated and guaranteed not derived
2424 // from any globally unique hardware id.
2425 // For paired devices, it stays consistent between Bluetooth toggling for the
2426 // same remote device.
2427 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2428 // session for the same remote device.
2429 // Default: 0 if the device's metric id is unknown.
2430 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002431}
2432
2433/**
2434 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2435 * device, as documented by the Bluetooth Core HCI specification
2436 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2437 * Vol 2, Part E, Page 1118
2438 *
2439 * Logged from:
2440 * system/bt
2441 */
2442message BluetoothRemoteVersionInfoReported {
2443 // Connection handle of the connection
2444 // Original type: uint16_t
2445 optional int32 connection_handle = 1;
2446 // HCI command status code
2447 // Default: STATUS_UNKNOWN
2448 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2449 // 1 byte Version of current LMP in the remote controller
2450 optional int32 lmp_version = 3;
2451 // 2 bytes LMP manufacturer code of the remote controller
2452 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2453 optional int32 lmp_manufacturer_code = 4;
2454 // 4 bytes subversion of the LMP in the remote controller
2455 optional int32 lmp_subversion = 5;
2456}
2457
2458/**
2459 * Logs when certain Bluetooth SDP attributes are discovered
2460 * Constant definitions are from:
2461 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2462 *
2463 * Current logged attributes:
2464 * - BluetoothProfileDescriptorList
2465 * - Supported Features Bitmask
2466 *
2467 * Logged from:
2468 * system/bt
2469 */
2470message BluetoothSdpAttributeReported {
2471 // An identifier that can be used to match events for this device.
2472 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2473 // Salt: Randomly generated 256 bit value
2474 // Hash algorithm: HMAC-SHA256
2475 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2476 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2477 // Original type: uint16_t
2478 optional int32 protocol_uuid = 2;
2479 // Short form UUIDs used to identify Bluetooth SDP attribute types
2480 // Original type: uint16_t
2481 optional int32 attribute_id = 3;
2482 // Attribute value for the particular attribute
2483 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002484 // An identifier that can be used to match events for this device.
2485 // The incremental identifier is locally generated and guaranteed not derived
2486 // from any globally unique hardware id.
2487 // For paired devices, it stays consistent between Bluetooth toggling for the
2488 // same remote device.
2489 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2490 // session for the same remote device.
2491 // Default: 0 if the device's metric id is unknown.
2492 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002493}
2494
2495/**
2496 * Logs when bond state of a Bluetooth device changes
2497 *
2498 * Logged from:
2499 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2500 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2501 */
2502message BluetoothBondStateChanged {
2503 // An identifier that can be used to match events for this device.
2504 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2505 // Salt: Randomly generated 256 bit value
2506 // Hash algorithm: HMAC-SHA256
2507 // Size: 32 byte
2508 // Default: null or empty if the device identifier is not known
2509 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2510 // Preferred transport type to remote dual mode device
2511 // Default: TRANSPORT_AUTO means no preference
2512 optional android.bluetooth.TransportTypeEnum transport = 2;
2513 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2514 // Default: UNKNOWN
2515 optional android.bluetooth.DeviceTypeEnum type = 3;
2516 // Current bond state (NONE, BONDING, BONDED)
2517 // Default: BOND_STATE_UNKNOWN
2518 optional android.bluetooth.BondStateEnum bond_state = 4;
2519 // Bonding sub state
2520 // Default: BOND_SUB_STATE_UNKNOWN
2521 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2522 // Unbond Reason
2523 // Default: UNBOND_REASON_UNKNOWN
2524 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002525 // An identifier that can be used to match events for this device.
2526 // The incremental identifier is locally generated and guaranteed not derived
2527 // from any globally unique hardware id.
2528 // For paired devices, it stays consistent between Bluetooth toggling for the
2529 // same remote device.
2530 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2531 // session for the same remote device.
2532 // Default: 0 if the device's metric id is unknown.
2533 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002534}
2535
2536/**
2537 * Logs there is an event related Bluetooth classic pairing
2538 *
2539 * Logged from:
2540 * system/bt
2541 */
2542message BluetoothClassicPairingEventReported {
2543 // An identifier that can be used to match events for this device.
2544 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2545 // Salt: Randomly generated 256 bit value
2546 // Hash algorithm: HMAC-SHA256
2547 // Size: 32 byte
2548 // Default: null or empty if the device identifier is not known
2549 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2550 // Connection handle of this connection if available
2551 // Range: 0x0000 - 0x0EFF (12 bits)
2552 // Default: 0xFFFF if the handle is unknown
2553 optional int32 connection_handle = 2;
2554 // HCI command associated with this event
2555 // Default: CMD_UNKNOWN
2556 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2557 // HCI event associated with this event
2558 // Default: EVT_UNKNOWN
2559 optional android.bluetooth.hci.EventEnum hci_event = 4;
2560 // HCI command status code if this is triggerred by hci_cmd
2561 // Default: STATUS_UNKNOWN
2562 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2563 // HCI reason code associated with this event
2564 // Default: STATUS_UNKNOWN
2565 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002566 // A status value related to this specific event
2567 // Default: 0
2568 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002569 // An identifier that can be used to match events for this device.
2570 // The incremental identifier is locally generated and guaranteed not derived
2571 // from any globally unique hardware id.
2572 // For paired devices, it stays consistent between Bluetooth toggling for the
2573 // same remote device.
2574 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2575 // session for the same remote device.
2576 // Default: 0 if the device's metric id is unknown.
2577 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002578}
2579
2580/**
2581 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2582 *
2583 * Logged from:
2584 * system/bt
2585 */
2586message BluetoothSmpPairingEventReported {
2587 // An identifier that can be used to match events for this device.
2588 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2589 // Salt: Randomly generated 256 bit value
2590 // Hash algorithm: HMAC-SHA256
2591 // Size: 32 byte
2592 // Default: null or empty if the device identifier is not known
2593 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2594 // SMP command sent or received over L2CAP
2595 // Default: CMD_UNKNOWN
2596 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2597 // Whether this command is sent or received
2598 // Default: DIRECTION_UNKNOWN
2599 optional android.bluetooth.DirectionEnum direction = 3;
2600 // SMP failure reason code
2601 // Default: PAIRING_FAIL_REASON_DEFAULT
2602 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002603 // An identifier that can be used to match events for this device.
2604 // The incremental identifier is locally generated and guaranteed not derived
2605 // from any globally unique hardware id.
2606 // For paired devices, it stays consistent between Bluetooth toggling for the
2607 // same remote device.
2608 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2609 // session for the same remote device.
2610 // Default: 0 if the device's metric id is unknown.
2611 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002612}
2613
2614/**
Jack He815cdba2019-01-30 17:24:55 -08002615 * Logs when a Bluetooth socket’s connection state changed
2616 *
2617 * Logged from:
2618 * system/bt
2619 */
2620message BluetoothSocketConnectionStateChanged {
2621 // An identifier that can be used to match events for this device.
2622 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2623 // Salt: Randomly generated 256 bit value
2624 // Hash algorithm: HMAC-SHA256
2625 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002626 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002627 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002628 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002629 // Default 0 when unknown or don't care
2630 optional int32 port = 2;
2631 // Socket type as mentioned in
2632 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2633 // Default: SOCKET_TYPE_UNKNOWN
2634 optional android.bluetooth.SocketTypeEnum type = 3;
2635 // Socket connection state
2636 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2637 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2638 // Number of bytes sent to remote device during this connection
2639 optional int64 tx_bytes = 5;
2640 // Number of bytes received from remote device during this connection
2641 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002642 // Socket owner's UID
2643 optional int32 uid = 7 [(is_uid) = true];
2644 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2645 // |port| must be spawned by |server_port|
2646 // Default 0 when unknown or don't care
2647 optional int32 server_port = 8;
2648 // Whether this is a server listener socket
2649 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002650 // An identifier that can be used to match events for this device.
2651 // The incremental identifier is locally generated and guaranteed not derived
2652 // from any globally unique hardware id.
2653 // For paired devices, it stays consistent between Bluetooth toggling for the
2654 // same remote device.
2655 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2656 // session for the same remote device.
2657 // Default: 0 if the device's metric id is unknown.
2658 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002659}
2660
2661/**
Jack He71426802019-04-02 13:32:52 -07002662 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2663 *
2664 * Logged from:
2665 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2666 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2667 *
2668 */
2669message BluetoothClassOfDeviceReported {
2670 // An identifier that can be used to match events for this device.
2671 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2672 // Salt: Randomly generated 256 bit value
2673 // Hash algorithm: HMAC-SHA256
2674 // Size: 32 byte
2675 // Default: null or empty if this is a server listener socket
2676 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2677 // Class of Device (CoD) value including both Major, Minor device class and service class
2678 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2679 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2680 // Default: 0
2681 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002682 // An identifier that can be used to match events for this device.
2683 // The incremental identifier is locally generated and guaranteed not derived
2684 // from any globally unique hardware id.
2685 // For paired devices, it stays consistent between Bluetooth toggling for the
2686 // same remote device.
2687 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2688 // session for the same remote device.
2689 // Default: 0 if the device's metric id is unknown.
2690 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002691}
2692
2693/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002694 * Logs when something is plugged into or removed from the USB-C connector.
2695 *
2696 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002697 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002698 */
2699message UsbConnectorStateChanged {
2700 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002701 STATE_DISCONNECTED = 0;
2702 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002703 }
2704 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002705 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002706 // Last active session in ms.
2707 // 0 when the port is in connected state.
2708 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002709}
2710
2711/**
2712 * Logs the reported speaker impedance.
2713 *
2714 * Logged from:
2715 * Vendor audio implementation.
2716 */
2717message SpeakerImpedanceReported {
2718 optional int32 speaker_location = 1;
2719 optional int32 impedance = 2;
2720}
2721
2722/**
2723 * Logs the report of a failed hardware.
2724 *
2725 * Logged from:
2726 * Vendor HALs.
2727 *
2728 */
2729message HardwareFailed {
2730 enum HardwareType {
2731 HARDWARE_FAILED_UNKNOWN = 0;
2732 HARDWARE_FAILED_MICROPHONE = 1;
2733 HARDWARE_FAILED_CODEC = 2;
2734 HARDWARE_FAILED_SPEAKER = 3;
2735 HARDWARE_FAILED_FINGERPRINT = 4;
2736 }
2737 optional HardwareType hardware_type = 1;
2738
Maggie White6dcd8572019-01-31 14:11:50 -08002739 /**
2740 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002741 * the same hardware_type. The specific locations are vendor defined integers,
2742 * referring to board-specific numbering schemes.
2743 */
2744 optional int32 hardware_location = 2;
2745
Maggie White6dcd8572019-01-31 14:11:50 -08002746 /**
2747 * failure_code is specific to the HardwareType of the failed hardware.
2748 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002749 */
Maggie White6dcd8572019-01-31 14:11:50 -08002750 enum HardwareErrorCode {
2751 UNKNOWN = 0;
2752 COMPLETE = 1;
2753 SPEAKER_HIGH_Z = 2;
2754 SPEAKER_SHORT = 3;
2755 FINGERPRINT_SENSOR_BROKEN = 4;
2756 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002757 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002758 }
2759 optional int32 failure_code = 3;
2760}
2761
2762/**
2763 * Log an event when the device has been physically dropped.
2764 * Reported from the /vendor partition.
2765 */
2766message PhysicalDropDetected {
2767 // Confidence that the event was actually a drop, 0 -> 100
2768 optional int32 confidence_pctg = 1;
2769 // Peak acceleration of the drop, in 1/1000s of a g.
2770 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002771 // Duration of freefall in ms
2772 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002773}
2774
2775/**
2776 * Log bucketed battery charge cycles.
2777 *
2778 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002779 * a given charge point. For example, if 10 cycle buckets are
2780 * initialized, bucket 1 is the lowest 1/10th of the battery,
2781 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002782 *
2783 * Logged from:
2784 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2785 */
2786message ChargeCyclesReported {
2787 optional int32 cycle_bucket_1 = 1;
2788 optional int32 cycle_bucket_2 = 2;
2789 optional int32 cycle_bucket_3 = 3;
2790 optional int32 cycle_bucket_4 = 4;
2791 optional int32 cycle_bucket_5 = 5;
2792 optional int32 cycle_bucket_6 = 6;
2793 optional int32 cycle_bucket_7 = 7;
2794 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002795 optional int32 cycle_bucket_9 = 9;
2796 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002797}
2798
2799/**
Howard Roa46b6582018-09-18 16:45:02 -07002800 * Log battery health snapshot.
2801 *
2802 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2803 * are snapshotted periodically over 24hrs.
2804 */
2805message BatteryHealthSnapshot {
2806 enum BatterySnapshotType {
2807 UNKNOWN = 0;
2808 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2809 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2810 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2811 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2812 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2813 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2814 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2815 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2816 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2817 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2818 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2819 }
2820 optional BatterySnapshotType type = 1;
2821 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002822 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002823 // Voltage Battery Voltage, in microVolts.
2824 optional int32 voltage_micro_volt = 3;
2825 // Current Battery current, in microAmps.
2826 optional int32 current_micro_amps = 4;
2827 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2828 optional int32 open_circuit_micro_volt = 5;
2829 // Resistance Battery Resistance, in microOhms.
2830 optional int32 resistance_micro_ohm = 6;
2831 // Level Battery Level, as % of full.
2832 optional int32 level_percent = 7;
2833}
2834
2835/**
2836 * Log slow I/O operations on the primary storage.
2837 */
2838message SlowIo {
2839 // Classifications of IO Operations.
2840 enum IoOperation {
2841 UNKNOWN = 0;
2842 READ = 1;
2843 WRITE = 2;
2844 UNMAP = 3;
2845 SYNC = 4;
2846 }
2847 optional IoOperation operation = 1;
2848
2849 // The number of slow IO operations of this type over 24 hours.
2850 optional int32 count = 2;
2851}
2852
2853/**
2854 * Log battery caused shutdown with the last recorded voltage.
2855 */
2856message BatteryCausedShutdown {
2857 // The last recorded battery voltage prior to shutdown.
2858 optional int32 last_recorded_micro_volt = 1;
2859}
2860
2861/**
Tej Singha72344992019-04-17 18:55:08 -07002862 * Logs when ThermalService receives throttling events.
2863 *
2864 * Logged from:
2865 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2866 */
2867message ThermalThrottlingSeverityStateChanged {
2868 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2869 optional android.os.TemperatureTypeEnum sensor_type = 1;
2870
2871 // The name of the temperature source. Eg. CPU0
2872 optional string sensor_name = 2;
2873
2874 // Temperature in tenths of a degree C.
2875 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2876 optional int32 temperature_deci_celsius = 3;
2877
2878 // Relative severity of the throttling, see enum definition.
2879 optional android.os.ThrottlingSeverityEnum severity = 4;
2880}
2881
2882/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002883 * Logs the duration of a davey (jank of >=700ms) when it occurs
2884 *
2885 * Logged from:
2886 * frameworks/base/libs/hwui/JankTracker.cpp
2887 */
2888message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002889 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002890 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002891
Tej Singhbb8554a2018-01-26 11:59:14 -08002892 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002893 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002894}
2895
2896/**
Bookatze5885242017-10-24 20:10:31 -07002897 * Logs phone signal strength changes.
2898 *
2899 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002900 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002901 */
2902message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002903 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2904 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002905}
2906
Yangster4ccebea2018-10-09 17:09:02 -07002907
2908/**
2909 * Logs when the phone state, sim state or signal strength changes
2910 *
2911 * Logged from:
2912 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2913 */
2914message PhoneServiceStateChanged {
2915 optional android.telephony.ServiceStateEnum state = 1;
2916 optional android.telephony.SimStateEnum sim_state = 2;
2917 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2918}
2919
2920/**
2921 * Logs when the phone becomes on or off.
2922 *
2923 * Logged from:
2924 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2925 */
2926message PhoneStateChanged {
2927 enum State {
2928 OFF = 0;
2929 ON = 1;
2930 }
2931 optional State state = 1;
2932}
2933
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002934message BackGesture {
2935 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002936 DEFAULT_BACK_TYPE = 0;
2937 COMPLETED = 1;
2938 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2939 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2940 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2941 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2942 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2943 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2944 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002945 }
2946 optional BackType type = 1;
2947
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002948 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2949 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2950 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2951 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2952 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2953 optional int32 left_boundary = 8; // left edge width + left inset
2954 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2955
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002956 enum WindowHorizontalLocation {
2957 DEFAULT_LOCATION = 0;
2958 LEFT = 1;
2959 RIGHT = 2;
2960 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002961 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002962}
2963
2964message ExclusionRectStateChanged {
2965 optional string component_name = 1; // if not available, simply packageName
2966 optional int32 requested_height = 2; // px
2967 optional int32 rejected_height = 3; // px
2968
2969 enum WindowHorizontalLocation {
2970 DEFAULT_LOCATION = 0;
2971 LEFT = 1;
2972 RIGHT = 2;
2973 }
2974 optional WindowHorizontalLocation x_location = 4;
2975 optional bool landscape = 5;
2976 optional bool splitscreen = 6;
2977 optional int32 duration_millis = 7;
2978}
2979
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002980message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002981 optional android.stats.launcher.LauncherAction action = 1;
2982 optional android.stats.launcher.LauncherState src_state = 2;
2983 optional android.stats.launcher.LauncherState dst_state = 3;
2984 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002985 optional bool is_swipe_up_enabled = 5;
2986}
2987
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002988message StyleUIChanged {
2989 optional android.stats.style.Action action = 1;
2990 optional int32 color_package_hash = 2;
2991 optional int32 font_package_hash = 3;
2992 optional int32 shape_package_hash = 4;
2993 optional int32 clock_package_hash = 5;
2994 optional int32 launcher_grid = 6;
2995 optional int32 wallpaper_category_hash = 7;
2996 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002997 optional int32 color_preference = 9;
2998 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002999}
3000
David Chenc28b2bb2017-10-24 12:52:52 -07003001/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003002 * Logs when Settings UI has changed.
3003 *
3004 * Logged from:
3005 * packages/apps/Settings
3006 */
3007message SettingsUIChanged {
3008 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003009 * Where this SettingsUIChange event comes from. For example, if
3010 * it's a PAGE_VISIBLE event, where the page is opened from.
3011 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003012 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003013
3014 /**
3015 * What the UI action is.
3016 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003017 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003018
3019 /**
3020 * Where the action is happening
3021 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003022 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003023
3024 /**
3025 * What preference changed in this event.
3026 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003027 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003028
3029 /**
3030 * The new value of the changed preference.
3031 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003032 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003033}
3034
3035/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003036 * Logs basic timing information about touch events.
3037 * Reported at most every 5 minutes while device is being interacted with.
3038 *
3039 * Logged from:
3040 * frameworks/native/services/inputflinger
3041 */
3042message TouchEventReported {
3043 /**
3044 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003045 * and the standard deviation of the time spent processing touchscreen events
3046 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003047 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003048 * On supported devices, the starting point is taken during the hard interrupt inside the
3049 * kernel touch driver. On all other devices, the starting point is taken inside
3050 * the kernel's input event subsystem upon receipt of the input event.
3051 * The ending point is taken inside InputDispatcher, just after the input event
3052 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003053 */
3054 // Minimum value
3055 optional float latency_min_micros = 1;
3056 // Maximum value
3057 optional float latency_max_micros = 2;
3058 // Average value
3059 optional float latency_mean_micros = 3;
3060 // Standard deviation
3061 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003062 // Number of touch events (input_event) in this report
3063 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003064}
3065
3066/**
Philip Quinn0eded622019-01-29 12:46:28 -08003067 * Logs gesture classification and timing information for touch events.
3068 *
3069 * Logged from:
3070 * frameworks/base/core/java/android/view/GestureDetector.java
3071 * frameworks/base/core/java/android/view/View.java
3072 */
3073message TouchGestureClassified {
3074 // The source of the classification (e.g. Java class name).
3075 optional string source = 1;
3076
3077 enum Classification {
3078 UNKNOWN_CLASSIFICATION = 0;
3079 SINGLE_TAP = 1;
3080 DOUBLE_TAP = 2;
3081 LONG_PRESS = 3;
3082 DEEP_PRESS = 4;
3083 SCROLL = 5;
3084 }
3085 // The classification of the gesture.
3086 optional Classification classification = 2;
3087
3088 // The interval from the start of a touch event stream until the
3089 // classification was made.
3090 optional int32 latency_millis = 3;
3091
3092 // The distance from the location of the first touch event to the
3093 // location of the touch event when the classification was made.
3094 optional float displacement_px = 4;
3095}
3096
3097/**
David Chenc28b2bb2017-10-24 12:52:52 -07003098 * Logs that a setting was updated.
3099 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003100 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003101 * The tag and is_default allow resetting of settings to default values based on the specified
3102 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3103 */
3104message SettingChanged {
3105 // The name of the setting.
3106 optional string setting = 1;
3107
3108 // The change being imposed on this setting. May represent a number, eg "3".
3109 optional string value = 2;
3110
3111 // The new value of this setting. For most settings, this is same as value. For some settings,
3112 // value is +X or -X where X represents an element in a set. For example, if the previous value
3113 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3114 // The +/- feature is currently only used for location_providers_allowed.
3115 optional string new_value = 3;
3116
3117 // The previous value of this setting.
3118 optional string prev_value = 4;
3119
3120 // The tag used with the is_default for resetting sets of settings. This is generally null.
3121 optional string tag = 5;
3122
Bookatz90867622018-01-31 15:05:57 -08003123 // True if this setting with tag should be resettable.
3124 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003125
David Chenbd789912018-03-16 17:19:55 -07003126 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003127 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003128
3129 enum ChangeReason {
3130 UPDATED = 1; // Updated can be an insertion or an update.
3131 DELETED = 2;
3132 }
3133 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003134}
Chenjie Yub3dda412017-10-24 13:41:59 -07003135
Chenjie Yu05013b32017-11-21 10:21:41 -08003136/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003137 * Logs activity going to foreground or background
3138 *
3139 * Logged from:
3140 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3141 */
3142message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003143 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003144 optional string pkg_name = 2;
3145 optional string class_name = 3;
3146
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003147 enum State {
3148 BACKGROUND = 0;
3149 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003150 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003151 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003152}
David Chenc8a43242017-10-17 16:23:28 -07003153
3154/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003155 * Logs when a volume entered low Storage state.
3156 * Logged from:
3157 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3158 */
3159message LowStorageStateChanged {
3160 // Volume that ran out of storage.
3161 optional string volume_description = 1;
3162
3163 enum State {
3164 UNKNOWN = 0;
3165 OFF = 1;
3166 ON = 2;
3167 }
3168 optional State state = 2;
3169}
3170
3171/**
3172 * Logs when an app is downgraded.
3173 * Logged from:
3174 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3175 */
3176message AppDowngraded {
3177 optional string package_name = 1;
3178 // Size of the package (all data) before being downgraded.
3179 optional int64 size_in_bytes_before = 2;
3180 // Size of the package (all data) after being downgraded.
3181 optional int64 size_in_bytes_after = 3;
3182
3183 optional bool aggressive = 4;
3184}
3185
3186/**
3187 * Logs when an app is optimized after being downgraded.
3188 * Logged from:
3189 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3190 */
3191message AppOptimizedAfterDowngraded {
3192 optional string package_name = 1;
3193}
3194
3195/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003196 * Logs whenever an app is installed on external storage.
3197 * Logged from:
3198 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3199 */
3200message AppInstallOnExternalStorageReported {
3201 // The type of external storage.
3202 optional android.stats.storage.ExternalStorageType storage_type = 1;
3203 // The name of the package that is installed on the sd card.
3204 optional string package_name = 2;
3205}
3206
3207/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003208 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003209 * Logged from:
3210 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3211 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003212message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003213 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003214
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003215 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003216
3217 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003218 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003219 optional string process_name = 3;
3220
3221 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003222 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003223
3224 optional string package_name = 5;
3225
3226 enum InstantApp {
3227 UNAVAILABLE = 0;
3228 FALSE = 1;
3229 TRUE = 2;
3230 }
3231 optional InstantApp is_instant_app = 6;
3232
3233 enum ForegroundState {
3234 UNKNOWN = 0;
3235 BACKGROUND = 1;
3236 FOREGROUND = 2;
3237 }
3238 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003239
3240 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003241}
David Chen9e3808c2017-11-20 17:25:34 -08003242
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003243/**
3244 * Logs when a WTF (What a Terrible Failure) happened.
3245 * Logged from:
3246 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3247 */
3248message WTFOccurred {
3249 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003250
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003251 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003252
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003253 // The name of the process.
3254 // system_server if it is not by an app
3255 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003256
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003257 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003258 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003259
3260 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003261}
3262
3263/**
3264 * Logs when system server reports low memory.
3265 * Logged from:
3266 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3267 */
3268message LowMemReported {
3269}
3270
3271/**
3272 * Logs when an app ANR (App Not Responding) occurs.
3273 * Logged from:
3274 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3275 */
3276message ANROccurred {
3277 optional int32 uid = 1 [(is_uid) = true];
3278
3279 optional string process_name = 2;
3280
3281 optional string short_component_name = 3;
3282
3283 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003284
3285 enum InstantApp {
3286 UNAVAILABLE = 0;
3287 FALSE = 1;
3288 TRUE = 2;
3289 }
3290 optional InstantApp is_instant_app = 5;
3291
3292 enum ForegroundState {
3293 UNKNOWN = 0;
3294 BACKGROUND = 1;
3295 FOREGROUND = 2;
3296 }
3297 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003298
3299 optional android.server.ErrorSource error_source = 7;
3300
3301 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003302}
3303
Bookatza7020bd2018-08-28 16:29:35 -07003304/**
3305 * Logs when the vibrator state changes.
3306 * Logged from:
3307 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3308 */
3309message VibratorStateChanged {
3310 repeated AttributionNode attribution_node = 1;
3311
3312 enum State {
3313 OFF = 0;
3314 ON = 1;
3315 }
3316 optional State state = 2;
3317
3318 // Duration (in milliseconds) requested to keep the vibrator on.
3319 // Only applicable for State == ON.
3320 optional int64 duration_millis = 3;
3321}
3322
David Chen0a368b22017-12-06 16:28:16 -08003323/*
3324 * Allows other apps to push events into statsd.
3325 * Logged from:
3326 * frameworks/base/core/java/android/util/StatsLog.java
3327 */
David Chen0b5c90c2018-01-25 16:51:49 -08003328message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003329 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003330 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003331
3332 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3333 optional int32 label = 2;
3334
3335 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3336 // predicates for the metrics).
3337 enum State {
3338 UNKNOWN = 0;
3339 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3340 STOP = 2;
3341 START = 3;
3342 }
3343 optional State state = 3;
3344}
3345
David Chen9e3808c2017-11-20 17:25:34 -08003346/**
Bookatz7948c872018-09-04 12:58:33 -07003347 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3348 * For example, this could be due to the user manually changing the time.
3349 *
3350 * Logged from:
3351 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3352 */
3353message WallClockTimeShifted {
3354 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3355 optional int64 wall_clock_timestamp_millis = 1;
3356}
3357
3358/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003359 * Logs when statsd detects an anomaly.
3360 *
3361 * Logged from:
3362 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3363 */
3364message AnomalyDetected {
3365 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003366 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003367
Yangster-mac94e197c2018-01-02 16:03:03 -08003368 // Id of the config whose anomaly detection alert fired.
3369 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003370
Yangster-mac94e197c2018-01-02 16:03:03 -08003371 // Id of the alert (i.e. name of the anomaly that was detected).
3372 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003373}
3374
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003375message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003376 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003377 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003378
3379 // The app package name.
3380 optional string pkg_name = 2;
3381
3382 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003383 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003384 WARM = 1;
3385 HOT = 2;
3386 COLD = 3;
3387 }
3388 // The transition type.
3389 optional TransitionType type = 3;
3390
3391 // The activity name.
3392 optional string activity_name = 4;
3393
3394 // The name of the calling app. Empty if not set.
3395 optional string calling_pkg_name = 5;
3396
3397 // Whether the app is an instant app.
3398 optional bool is_instant_app = 6;
3399
3400 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003401 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003402
Bookatz80d11a02018-01-16 10:46:35 -08003403 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003404
David Chen0b5c90c2018-01-25 16:51:49 -08003405 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003406 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003407 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003408 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003409 optional int32 bind_application_delay_millis = 11;
3410 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003411
3412 // Empty if not set.
3413 optional string launch_token = 13;
3414
Calin Juravle759fbda2018-02-20 19:52:30 +00003415 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003416 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003417
3418 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003419 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003420}
3421
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003422message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003423 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003424 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003425
3426 // The app package name.
3427 optional string pkg_name = 2;
3428
3429 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003430 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003431 WARM = 1;
3432 HOT = 2;
3433 COLD = 3;
3434 }
3435 // The transition type.
3436 optional TransitionType type = 3;
3437
3438 // The activity name.
3439 optional string activity_name = 4;
3440}
3441
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003442message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003443 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003444 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003445
3446 // The app package name.
3447 optional string pkg_name = 2;
3448
3449 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003450 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003451 WITH_BUNDLE = 1;
3452 WITHOUT_BUNDLE = 2;
3453 }
3454 // The transition type.
3455 optional TransitionType type = 3;
3456
3457 // The activity name.
3458 optional string activity_name = 4;
3459
3460 optional bool transition_process_running = 5;
3461
3462 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003463 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003464}
3465
Bookatz8fcd09a2017-12-18 13:01:10 -08003466/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003467 * Logs a picture-in-picture action
3468 * Logged from:
3469 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3470 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3471 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3472 */
3473message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003474 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003475 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003476
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003477 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003478
Chenjie Yu52cacc62017-12-08 18:11:45 -08003479 enum State {
3480 ENTERED = 1;
3481 EXPANDED_TO_FULL_SCREEN = 2;
3482 MINIMIZED = 3;
3483 DISMISSED = 4;
3484 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003485 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003486}
3487
3488/**
Chenjie Yue8904192017-12-08 19:12:57 -08003489 * Logs overlay action
3490 * Logged from:
3491 * services/core/java/com/android/server/wm/Session.java
3492 */
3493message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003494 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003495
tsaichristine5adc7e02020-01-14 17:07:39 -08003496 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003497
3498 optional bool using_alert_window = 3;
3499
3500 enum State {
3501 ENTERED = 1;
3502 EXITED = 2;
3503 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003504 optional State state = 4 [
3505 (state_field_option).option = EXCLUSIVE_STATE,
3506 (state_field_option).nested = false,
3507 (state_field_option).default_state_value = 2
3508 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003509}
3510
Adam Bookatz38767932020-02-05 12:13:40 -08003511/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003512 * Logs foreground service starts and stops.
3513 * Note that this is not when a service starts or stops, but when it is
3514 * considered foreground.
3515 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003516 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003517 */
3518message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003519 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003520 // package_name + "/" + class_name
3521 optional string short_name = 2;
3522
3523 enum State {
3524 ENTER = 1;
3525 EXIT = 2;
3526 }
3527 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003528
3529 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3530 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3531 optional bool allow_while_in_use_permission = 4;
3532}
3533
3534/**
3535 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3536 * A foreground service session is any continuous period during which the uid holds at least one
3537 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3538 * Accesses initiated while the uid is in the TOP state are ignored.
3539 * Sessions with no attempted accesses are not logged.
3540 * Logged from
3541 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3542 */
3543message ForegroundServiceAppOpSessionEnded {
3544 optional int32 uid = 1 [(is_uid) = true];
3545
3546 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003547 // Only following four ops are logged
3548 // COARSE_LOCATION = 0
3549 // FINE_LOCATION = 1
3550 // CAMERA = 26
3551 // RECORD_AUDIO = 27
3552 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003553
3554 // The uid's permission mode for accessing the AppOp during this fgs session.
3555 enum Mode {
3556 MODE_UNKNOWN = 0;
3557 MODE_ALLOWED = 1; // Always allowed
3558 MODE_IGNORED = 2; // Denied
3559 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3560 }
3561 optional Mode app_op_mode = 3;
3562
3563 // Number of times this AppOp was requested and allowed.
3564 optional int32 count_ops_accepted = 4;
3565 // Number of times this AppOp was requested but denied.
3566 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003567}
3568
Chenjie Yue8904192017-12-08 19:12:57 -08003569/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003570 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3571 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3572 * attributed back to the parent (host) uid. One example is Chrome.
3573 *
3574 * Logged from:
3575 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3576 */
3577message IsolatedUidChanged {
3578 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003579 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003580 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003581 optional int32 parent_uid = 1;
3582
3583 optional int32 isolated_uid = 2;
3584
3585 // We expect an isolated uid to be removed before if it's used for another parent uid.
3586 enum Event {
3587 REMOVED = 0;
3588 CREATED = 1;
3589 }
3590 optional Event event = 3;
3591}
3592
3593/*
3594 * Logs the reception of an incoming network packet causing the main system to wake up for
3595 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3596 * and processed by WakeupController.cpp.
3597 */
3598message PacketWakeupOccurred {
3599 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3600 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003601 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003602 // The interface name on which the packet was received.
3603 optional string iface = 2;
3604 // The ethertype value of the packet.
3605 optional int32 ethertype = 3;
3606 // String representation of the destination MAC address of the packet.
3607 optional string destination_hardware_address = 4;
3608 // String representation of the source address of the packet if this was an IP packet.
3609 optional string source_ip = 5;
3610 // String representation of the destination address of the packet if this was an IP packet.
3611 optional string destination_ip = 6;
3612 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3613 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3614 // families.
3615 optional int32 ip_next_header = 7;
3616 // The source port if this was a TCP or UDP packet.
3617 optional int32 source_port = 8;
3618 // The destination port if this was a TCP or UDP packet.
3619 optional int32 destination_port = 9;
3620}
3621
3622/*
3623 * Logs the memory stats for an app on startup.
3624 * Logged from:
3625 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3626 */
3627message AppStartMemoryStateCaptured {
3628 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003629 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003630
3631 // The process name.
3632 optional string process_name = 2;
3633
3634 // The activity name.
3635 optional string activity_name = 3;
3636
3637 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003638 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003639
3640 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003641 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003642
3643 // RSS
3644 optional int64 rss_in_bytes = 6;
3645
3646 // CACHE
3647 optional int64 cache_in_bytes = 7;
3648
3649 // SWAP
3650 optional int64 swap_in_bytes = 8;
3651}
3652
3653/*
3654 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3655 * for LMK event.
3656 * Logged from:
3657 * system/core/lmkd/lmkd.c
3658 */
3659message LmkStateChanged {
3660 enum State {
3661 UNKNOWN = 0;
3662 START = 1;
3663 STOP = 2;
3664 }
3665 optional State state = 1;
3666}
3667
3668/*
3669 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3670 * Logged from:
3671 * system/core/lmkd/lmkd.c
3672 */
3673message LmkKillOccurred {
3674 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003675 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003676
3677 // The process name.
3678 optional string process_name = 2;
3679
3680 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003681 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003682
3683 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003684 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003685
3686 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003687 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003688
3689 // RSS
3690 optional int64 rss_in_bytes = 6;
3691
3692 // CACHE
3693 optional int64 cache_in_bytes = 7;
3694
3695 // SWAP
3696 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003697
3698 // The elapsed real time of start of the process.
3699 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003700
3701 // Min oom adj score considered by lmkd.
3702 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003703}
3704
Rajeev Kumar51b54602018-03-01 12:18:26 -08003705/*
3706 * Logs when the ActivityManagerService detects that an app died.
3707 *
3708 * Logged from:
3709 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3710 */
3711message AppDied {
3712 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003713 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003714}
3715
Howard Ro21a039c2018-08-06 14:55:47 -07003716/**
3717 * An atom for generic metrics logging. Available from Android Q.
3718 */
3719message GenericAtom {
3720 // The uid of the application that sent this custom atom.
3721 optional int32 uid = 1 [(is_uid) = true];
3722
3723 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003724 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003725}
3726
Tej Singhd6d6d772018-09-05 17:41:25 -07003727/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003728 * Atom for simple logging of user interaction and impression events, such as "the user touched
3729 * this button" or "this dialog was displayed".
3730 * Keep the UI event stream clean: don't use for system or background events.
3731 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003732 *
3733 * Logged from:
3734 * frameworks/base/services/core/java/com/android/server/
3735 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003736 */
3737message UiEventReported {
3738 // The event_id.
3739 optional int32 event_id = 1;
3740 // The event's source or target uid and package, if applicable.
3741 // For example, the package posting a notification, or the destination package of a share.
3742 optional int32 uid = 2 [(is_uid) = true];
3743 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003744 // An identifier used to disambiguate which logs refer to a particular instance of some
3745 // UI element. Useful when there might be multiple instances simultaneously active.
3746 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003747}
3748
3749/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003750 * Reports a notification was created or updated.
3751 *
3752 * Logged from:
3753 * frameworks/base/services/core/java/com/android/server/notification/
3754 */
3755message NotificationReported {
3756 // The event_id (as for UiEventReported).
3757 optional int32 event_id = 1;
3758 // The notifying app's uid and package.
3759 optional int32 uid = 2 [(is_uid) = true];
3760 optional string package_name = 3;
3761 // A small system-assigned identifier for the notification.
3762 // Locally probably-unique, but expect collisions across users and/or days.
3763 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003764 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3765 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003766
3767 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003768 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3769 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3770 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003771
3772 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003773 optional string category = 10; // App-assigned notification category (API-defined strings)
3774 optional int32 style = 11; // App-assigned notification style
3775 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003776
3777 // Ordering, importance and interruptiveness
3778
Will Brockman7614f6962020-02-10 19:43:03 -05003779 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003780
Will Brockman7614f6962020-02-10 19:43:03 -05003781 optional android.stats.sysui.NotificationImportance importance = 14;
3782 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003783
3784 enum NotificationImportanceExplanation {
3785 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3786 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3787 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3788 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3789 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3790 // Like _APP, but based on pre-channels priority signal.
3791 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3792 }
3793
Will Brockman7614f6962020-02-10 19:43:03 -05003794 optional NotificationImportanceExplanation importance_source = 16;
3795 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3796 optional NotificationImportanceExplanation importance_initial_source = 18;
3797 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3798 optional int32 assistant_hash = 20;
3799 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003800}
3801
3802message Notification {
3803 // The notifying app's uid and package.
3804 optional int32 uid = 1 [(is_uid) = true];
3805 optional string package_name = 2;
3806 // A small system-assigned identifier for the notification.
3807 optional int32 instance_id = 3;
3808
3809 // Grouping information.
3810 optional int32 group_instance_id = 4;
3811 optional bool is_group_summary = 5;
3812
3813 // The section of the shade that the notification is in.
3814 // See NotificationSectionsManager.PriorityBucket.
3815 enum NotificationSection {
3816 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003817 SECTION_HEADS_UP = 1;
3818 SECTION_PEOPLE = 2;
3819 SECTION_ALERTING = 3;
3820 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003821 }
3822 optional NotificationSection section = 6;
3823}
3824
3825message NotificationList {
3826 repeated Notification notifications = 1; // An ordered sequence of notifications.
3827}
3828
3829/**
3830 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3831 *
3832 * Logged from:
3833 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3834 */
3835message NotificationPanelReported {
3836 // The event_id (as for UiEventReported).
3837 optional int32 event_id = 1;
3838 optional int32 num_notifications = 2;
3839 // The notifications in the panel, in the order that they appear there.
3840 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3841}
3842
3843/**
3844 * Reports a notification channel, or channel group, was created, updated, or deleted.
3845 *
3846 * Logged from:
3847 * frameworks/base/services/core/java/com/android/server/notification/
3848 */
3849message NotificationChannelModified {
3850 // The event_id (as for UiEventReported).
3851 optional int32 event_id = 1;
3852 // The notifying app's uid and package.
3853 optional int32 uid = 2 [(is_uid) = true];
3854 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003855 // Hash of app-assigned notification channel ID or channel-group ID
3856 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003857 // Previous importance setting, if applicable
3858 optional android.stats.sysui.NotificationImportance old_importance = 5;
3859 // New importance setting
3860 optional android.stats.sysui.NotificationImportance importance = 6;
3861}
3862
3863
3864/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003865 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003866 *
3867 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003868 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003869 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003870message BiometricAcquired {
3871 // Biometric modality that was acquired.
3872 optional android.hardware.biometrics.ModalityEnum modality = 1;
3873 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3874 optional int32 user = 2;
3875 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3876 optional bool is_crypto = 3;
3877 // Action that the device is performing. Acquired messages are only expected for enroll and
3878 // authenticate. Other actions may indicate an error.
3879 optional android.hardware.biometrics.ActionEnum action = 4;
3880 // The client that this acquisition was received for.
3881 optional android.hardware.biometrics.ClientEnum client = 5;
3882 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3883 optional int32 acquire_info = 6;
3884 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3885 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003886 // Dictates if this message should trigger additional debugging.
3887 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003888}
3889
3890/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003891 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003892 *
3893 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003894 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003895 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003896message BiometricAuthenticated {
3897 // Biometric modality that was used.
3898 optional android.hardware.biometrics.ModalityEnum modality = 1;
3899 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3900 optional int32 user = 2;
3901 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3902 // storage.
3903 optional bool is_crypto = 3;
3904 // The client that this acquisition was received for.
3905 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003906 // If authentication requires user confirmation. See BiometricPrompt's
3907 // setRequireConfirmation(bool) method.
3908 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003909
Kevin Chyn1741a072019-01-17 11:54:40 -08003910 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003911 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003912 REJECTED = 1;
3913 PENDING_CONFIRMATION = 2;
3914 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003915 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003916
3917 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003918 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003919 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3920 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3921 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3922 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003923 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003924 // Dictates if this message should trigger additional debugging.
3925 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003926}
3927
3928/**
3929 * Logs when a biometric error occurs.
3930 *
3931 * Logged from:
3932 * frameworks/base/services/core/java/com/android/server/biometrics
3933 */
3934message BiometricErrorOccurred {
3935 // Biometric modality that was used.
3936 optional android.hardware.biometrics.ModalityEnum modality = 1;
3937 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3938 optional int32 user = 2;
3939 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3940 optional bool is_crypto = 3;
3941 // Action that the device is performing.
3942 optional android.hardware.biometrics.ActionEnum action = 4;
3943 // The client that this acquisition was received for.
3944 optional android.hardware.biometrics.ClientEnum client = 5;
3945 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3946 // are unique to modality.
3947 optional int32 error_info = 6;
3948 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3949 // by the vendor and not specified by the HIDL interface.
3950 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003951 // Dictates if this message should trigger additional debugging.
3952 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003953 // Time spent during the authentication attempt.
3954 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003955}
3956
3957/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003958 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003959 * Logged from:
3960 * frameworks/base/services/core/java/com/android/server/biometrics
3961 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003962message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003963 // Biometric modality.
3964 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003965 // Type of issue detected.
3966 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003967 // Dictates if this message should trigger additional debugging.
3968 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003969}
Howard Ro688ae182018-09-25 00:09:36 -07003970
joshmccloskey6f952b22019-03-25 20:59:35 -07003971/**
3972 * Logs when a biometric enrollment occurs.
3973 *
3974 * Logged from:
3975 * frameworks/base/services/core/java/com/android/server/biometrics
3976 */
3977message BiometricEnrolled {
3978 // Biometric modality that was used.
3979 optional android.hardware.biometrics.ModalityEnum modality = 1;
3980 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3981 optional int32 user = 2;
3982 // The amount of time the enrollment took in milliseconds.
3983 optional int64 latency_millis = 3;
3984 // Whether or not the enrollment was successful.
3985 optional bool success = 4;
3986}
3987
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003988/*
Tej Singh0d176952019-01-16 19:10:54 -08003989 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003990 */
Tej Singh0d176952019-01-16 19:10:54 -08003991message FlagFlipUpdateOccurred {
3992 // If the event is from a flag config package, specify the package name.
3993 optional string flag_flip_package_name = 1;
3994
3995 // The order id of the package
3996 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003997}
3998
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003999/**
4000 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004001 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004002 */
4003message TrainExperimentIds {
4004 repeated int64 experiment_id = 1;
4005}
4006
Yangster-macb89807e2018-11-15 21:10:57 -08004007/*
4008 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004009 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004010 */
4011message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004012 // Name of the train.
4013 optional string train_name = 1;
4014 // Version code for a "train" of packages that need to be installed atomically
4015 optional int64 train_version_code = 2;
4016 // After installation of this package, device requires a restart.
4017 optional bool requires_staging = 3;
4018 // Rollback should be enabled for this install.
4019 optional bool rollback_enabled = 4;
4020 // Requires low latency monitoring if possible.
4021 optional bool requires_low_latency_monitor = 5;
4022
Yangster-macb89807e2018-11-15 21:10:57 -08004023 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004024 UNKNOWN = 0;
4025 INSTALL_REQUESTED = 1;
4026 INSTALL_STARTED = 2;
4027 INSTALL_STAGED_NOT_READY = 3;
4028 INSTALL_STAGED_READY = 4;
4029 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004030 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4031 // and INSTALL_FAILURE_COMMIT.
4032 INSTALL_FAILURE = 6 [deprecated = true];
4033 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004034 INSTALL_CANCELLED = 7;
4035 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004036 INSTALLER_ROLLBACK_INITIATED = 9;
4037 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4038 INSTALLER_ROLLBACK_STAGED = 11;
4039 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4040 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4041 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4042 INSTALLER_ROLLBACK_SUCCESS = 15;
4043 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004044 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4045 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4046 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4047 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4048 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4049 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004050 INSTALL_FAILURE_DOWNLOAD = 23;
4051 INSTALL_FAILURE_STATE_MISMATCH = 24;
4052 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004053 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004054 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004055 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004056 // Possible experiment ids for monitoring this push.
4057 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4058 // user id
4059 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004060 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004061 // Whether or not this is a rollback event
4062 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004063}
4064
Tej Singhc9203082019-05-03 13:42:23 -07004065/* Test atom, is not logged anywhere */
4066message TestAtomReported {
4067 repeated AttributionNode attribution_node = 1;
4068 optional int32 int_field = 2;
4069 optional int64 long_field = 3;
4070 optional float float_field = 4;
4071 optional string string_field = 5;
4072 optional bool boolean_field = 6;
4073 enum State {
4074 UNKNOWN = 0;
4075 OFF = 1;
4076 ON = 2;
4077 }
4078 optional State state = 7;
4079 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4080}
4081
Maggie Whitefc1aa592018-11-28 21:55:23 -08004082/** Represents USB port overheat event. */
4083message UsbPortOverheatEvent {
4084 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4085 optional int32 plug_temperature_deci_c = 1;
4086
4087 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4088 optional int32 max_temperature_deci_c = 2;
4089
4090 /* Time between USB plug event and overheat threshold trip, in seconds. */
4091 optional int32 time_to_overheat_secs = 3;
4092
4093 /* Time between overheat threshold trip and hysteresis, in seconds. */
4094 optional int32 time_to_hysteresis_secs = 4;
4095
4096 /* Time between hysteresis and active mitigation ending, in seconds. */
4097 optional int32 time_to_inactive_secs = 5;
4098};
4099
Maggie White8735b852019-01-18 11:40:49 -08004100/**
4101 * Logs total effective full charge and discharge cycles on a battery.
4102 * Here are some examples of one effective cycle:
4103 * 1) the battery charges from 0% to 100% and drains back to 0%,
4104 * 2) charging from 50% to 100% and draining back to 50% twice.
4105 * Pulled from:
4106 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4107 */
4108message BatteryCycleCount {
4109 /* Number of total charge and discharge cycles on the system battery. */
4110 optional int32 cycle_count = 1;
4111}
4112
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004113/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004114 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4115 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004116 * Pulled from:
4117 * StatsCompanionService
4118 */
4119
Carmen Agimof12dec122019-03-06 16:14:38 +00004120message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004121
Carmen Agimof12dec122019-03-06 16:14:38 +00004122 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004123 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004124 PUBLIC = 1;
4125 PRIVATE = 2;
4126 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004127 }
4128
Carmen Agimof12dec122019-03-06 16:14:38 +00004129 // The type of external storage.
4130 optional android.stats.storage.ExternalStorageType storage_type = 1;
4131 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4132 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004133 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004134 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004135}
4136
Yangster-macb89807e2018-11-15 21:10:57 -08004137/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004138 * Logs when a connection becomes available and lost.
4139 * Logged in StatsCompanionService.java
4140 */
4141message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004142 // Id of the network.
4143 optional int32 net_id = 1;
4144
4145 enum State {
4146 UNKNOWN = 0;
4147 CONNECTED = 1;
4148 DISCONNECTED = 2;
4149 }
4150 // Connected state of a network.
4151 optional State state = 2;
4152}
4153
4154/**
4155 * Logs when a service starts and stops.
4156 * Logged from:
4157 * services/core/java/com/android/server/am/ActiveServices.java
4158 */
4159message ServiceStateChanged {
4160
4161 optional int32 uid = 1 [(is_uid) = true];
4162
4163 optional string package_name = 2;
4164
4165 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004166
4167 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004168 START = 1;
4169 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004170 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004171
4172 optional State state = 4;
4173}
4174
4175/**
4176 * Logs when a service is launched.
4177 * Logged from:
4178 * services/core/java/com/android/server/am/ActiveServices.java
4179 */
4180message ServiceLaunchReported {
4181
4182 optional int32 uid = 1 [(is_uid) = true];
4183
4184 optional string package_name = 2;
4185
4186 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004187}
Howard Ro688ae182018-09-25 00:09:36 -07004188
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004189/**
4190 * Logs when a hidden API is used.
4191 *
4192 * Logged from:
4193 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4194 */
4195message HiddenApiUsed {
4196 // The uid of the app making the hidden access.
4197 optional int32 uid = 1 [(is_uid) = true];
4198
4199 // Signature of the method or field accessed.
4200 optional string signature = 2;
4201
4202 enum AccessMethod {
4203 NONE = 0;
4204 REFLECTION = 1;
4205 JNI = 2;
4206 LINKING = 3;
4207 }
4208
4209 // Type of access.
4210 optional AccessMethod access_method = 3;
4211
4212 // Whether the access was prevented or not.
4213 optional bool access_denied = 4;
4214}
4215
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004216/**
4217 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4218 * - When user sees privacy chip
4219 * - When user clicks privacy chip
4220 * - How does the user exit the Privacy Dialog
4221 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004222 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4223 */
4224message PrivacyIndicatorsInteracted {
4225
4226 enum Type {
4227 UNKNOWN = 0;
4228 CHIP_VIEWED = 1;
4229 CHIP_CLICKED = 2;
4230 DIALOG_PRIVACY_SETTINGS = 3;
4231 DIALOG_DISMISS = 4;
4232 DIALOG_LINE_ITEM = 5;
4233 }
4234
tsaichristine5adc7e02020-01-14 17:07:39 -08004235 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004236
4237 // Used if the type is LINE_ITEM
4238 optional string package_name = 2;
4239}
4240
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004241/**
4242 * Logs information about a package that is moved from the internal to external storage and vice
4243 * versa.
4244 * It logs the package name, the type of the external storage where the package is installed
4245 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4246 * and the move type: if it's from internal to external or the other way around.
4247 *
4248 * Logged from:
4249 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4250 */
4251message AppMovedStorageReported {
4252 enum MoveType {
4253 UNKNOWN = 0;
4254 TO_EXTERNAL = 1;
4255 TO_INTERNAL = 2;
4256 }
4257 // The type of the external storage.
4258 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4259 // The type of move.
4260 optional MoveType move_type = 2;
4261 // The name of the package that was moved.
4262 optional string package_name = 3;
4263}
4264
jianjin8f2dee02019-03-29 14:03:08 -07004265/**
4266 * Logs when system server watchdog occurs.
4267 * Logged from:
4268 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4269 */
4270message SystemServerWatchdogOccurred {
4271 optional string subject = 1;
4272}
4273
4274/**
4275 * Logs when new file added to tombstones.
4276 * Logged from:
4277 * frameworks/base/core/java/com/android/server/BootReceiver.java
4278 */
4279message TombStoneOccurred {
4280}
4281
Hai Zhang5d3328d2019-04-13 21:25:06 +08004282/*
4283 * Information about a role request
4284 *
4285 * Logged from:
4286 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4287 */
4288message RoleRequestResultReported {
4289 // UID of application requesting the role
4290 optional int32 requesting_uid = 1;
4291
4292 // Package name of application requesting the role
4293 optional string requesting_package_name = 2;
4294
4295 // The role to be granted
4296 optional string role_name = 3;
4297
4298 // The count of applications qualifying for the role
4299 optional int32 qualifying_count = 4;
4300
4301 // UID of application current granted the role
4302 optional int32 current_uid = 5;
4303
4304 // Package name of application current granted the role
4305 optional string current_package_name = 6;
4306
4307 // UID of another application that user chose to grant the role to, instead of the requesting
4308 // application
4309 optional int32 granted_another_uid = 7;
4310
4311 // Package name of another application that user chose to grant the role to, instead of the
4312 // requesting application
4313 optional string granted_another_package_name = 8;
4314
4315 enum Result {
4316 UNDEFINED = 0;
4317 // role request was ignored
4318 IGNORED = 1;
4319 // role request was ignored because it's already granted
4320 IGNORED_ALREADY_GRANTED = 2;
4321 // role request was ignored because the application isn't qualified
4322 IGNORED_NOT_QUALIFIED = 3;
4323 // role request was ignored because user said it should be always denied
4324 IGNORED_USER_ALWAYS_DENIED = 4;
4325 // role was granted by user action
4326 USER_GRANTED = 5;
4327 // role was denied by user action
4328 USER_DENIED = 6;
4329 // role was denied by user granting another application the role
4330 USER_DENIED_GRANTED_ANOTHER = 7;
4331 // role was denied and set to be always denied by the user
4332 USER_DENIED_WITH_ALWAYS = 8;
4333 }
4334 // The result of the role request
4335 optional Result result = 9;
4336}
4337
Mark Tabrya824a642019-11-05 12:26:12 -08004338/**
4339 * Logs when a Vehicle Maps Service client's connection state has changed
4340 *
4341 * Logged from:
4342 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4343 */
4344message VmsClientConnectionStateChanged {
4345 // The UID of the VMS client app
4346 optional int32 uid = 1 [(is_uid) = true];
4347
4348 enum State {
4349 UNKNOWN = 0;
4350 // Attempting to connect to the client
4351 CONNECTING = 1;
4352 // Client connection established
4353 CONNECTED = 2;
4354 // Client connection closed unexpectedly
4355 DISCONNECTED = 3;
4356 // Client connection closed by VMS
4357 TERMINATED = 4;
4358 // Error establishing the client connection
4359 CONNECTION_ERROR = 5;
4360 }
4361
4362 optional State state = 2;
4363}
4364
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004365/**
4366 * Logs when MediaProvider has successfully finished scanning a storage volume.
4367 *
4368 * Logged from:
4369 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4370 */
4371message MediaProviderScanEvent {
4372 enum Reason {
4373 // Scan triggered due to unknown reason
4374 UNKNOWN = 0;
4375 // Scan triggered due to storage volume being mounted
4376 MOUNTED = 1;
4377 // Scan triggered due to explicit user action or app request
4378 DEMAND = 2;
4379 // Scan triggered due to idle maintenance
4380 IDLE = 3;
4381 }
4382
4383 // Volume type that this event pertains to
4384 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4385 // Reason why this scan was triggered
4386 optional Reason reason = 2;
4387 // Total number of files scanned
4388 optional int64 item_count = 3;
4389 // Duration of scan, normalized per file
4390 optional float normalized_duration_millis = 4;
4391 // Number of database inserts, normalized per file
4392 optional float normalized_insert_count = 5;
4393 // Number of database updates, normalized per file
4394 optional float normalized_update_count = 6;
4395 // Number of database deletes, normalized per file
4396 optional float normalized_delete_count = 7;
4397}
4398
4399/**
4400 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4401 *
4402 * Logged from:
4403 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4404 */
4405message MediaProviderDeletionEvent {
4406 // Volume type that this event pertains to
4407 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4408 // Device timestamp when this deletion event occurred
4409 optional int64 timestamp_millis = 2;
4410 // App that requested deletion
4411 optional string package_name = 3;
4412 // Number of items that were deleted
4413 optional int32 item_count = 4;
4414}
4415
4416/**
4417 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4418 *
4419 * Logged from:
4420 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4421 */
4422message MediaProviderPermissionEvent {
4423 enum Result {
4424 UNKNOWN = 0;
4425 USER_GRANTED = 1;
4426 AUTO_GRANTED = 2;
4427 USER_DENIED = 3;
4428 USER_DENIED_WITH_PREJUDICE = 4;
4429 AUTO_DENIED = 5;
4430 }
4431
4432 // Volume type that this event pertains to
4433 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4434 // Device timestamp when this permission event occurred
4435 optional int64 timestamp_millis = 2;
4436 // App that requested permission
4437 optional string package_name = 3;
4438 // Number of items that were requested
4439 optional int32 item_count = 4;
4440 // Result of this request
4441 optional Result result = 5;
4442}
4443
4444/**
4445 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4446 *
4447 * Logged from:
4448 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4449 */
4450message MediaProviderSchemaChange {
4451 // Volume type that this event pertains to
4452 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4453 // Old database version code
4454 optional int32 version_from = 2;
4455 // New database version code
4456 optional int32 version_to = 3;
4457 // Total number of files in database
4458 optional int64 item_count = 4;
4459 // Duration of schema change, normalized per file
4460 optional float normalized_duration_millis = 5;
4461}
4462
4463/**
4464 * Logs when MediaProvider has finished an idle maintenance job.
4465 *
4466 * Logged from:
4467 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4468 */
4469message MediaProviderIdleMaintenance {
4470 // Volume type that this event pertains to
4471 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4472
4473 // Total number of files in database
4474 optional int64 item_count = 2;
4475 // Duration of idle maintenance, normalized per file
4476 optional float normalized_duration_millis = 3;
4477 // Number of thumbnails found to be stale, normalized per file
4478 optional float normalized_stale_thumbnails = 4;
4479 // Number of items found to be expired, normalized per file
4480 optional float normalized_expired_media = 5;
4481}
4482
Keun young Park3e033cb2019-12-18 11:27:35 -08004483/**
4484 * Represents boot time event with duration in ms.
4485 *
4486 * Logged from: bootstat and various system server components. Check each enums for details.
4487 */
4488message BootTimeEventDuration {
4489 enum DurationEvent {
4490 UNKNOWN = 0;
4491 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4492 ABSOLUTE_BOOT_TIME = 1;
4493 // Bootloader's 1st stage execution time.
4494 // Logged from bootstat.
4495 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4496 // Bootloader's 1st stage loading time.
4497 // Logged from bootstat.
4498 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4499 // Bootloader's kernel loading time.
4500 // Logged from bootstat.
4501 BOOTLOADER_KERNEL_LOAD = 4;
4502 // Bootloader's 2nd stage execution time.
4503 // Logged from bootstat.
4504 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4505 // Bootloader's 2nd stage loading time.
4506 // Logged from bootstat.
4507 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4508 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4509 // for locked device.
4510 // Logged from bootstat.
4511 BOOTLOADER_UI_WAIT = 7;
4512 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4513 // Logged from bootstat.
4514 BOOTLOADER_TOTAL = 8;
4515 // Shutdown duration inside init for the reboot before the current boot up.
4516 // Logged from f/b/services/.../BootReceiver.java.
4517 SHUTDOWN_DURATION = 9;
4518 // Total time for mounting of disk devices during bootup.
4519 // Logged from f/b/services/.../BootReceiver.java.
4520 MOUNT_DEFAULT_DURATION = 10;
4521 // Total time for early stage mounting of disk devices during bootup.
4522 // Logged from f/b/services/.../BootReceiver.java.
4523 MOUNT_EARLY_DURATION = 11;
4524 // Total time for late stage mounting of disk devices during bootup.
4525 // Logged from f/b/services/.../BootReceiver.java.
4526 MOUNT_LATE_DURATION = 12;
4527 // Average time to scan non-system app after OTA
4528 // Logged from f/b/services/.../PackageManagerService.java
4529 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4530 // Time to initialize Package manager after OTA
4531 // Logged from f/b/services/.../PackageManagerService.java
4532 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4533 // Time to scan all system app from Package manager after OTA
4534 // Logged from f/b/services/.../PackageManagerService.java
4535 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4536 // Init's total time for cold boot stage.
4537 // Logged from bootstat.
4538 COLDBOOT_WAIT = 16;
4539 // Init's total time for initializing selinux.
4540 // Logged from bootstat.
4541 SELINUX_INIT = 17;
4542 // Time since last factory reset.
4543 // Logged from bootstat.
4544 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004545 // Init's total time spent for completing the 1st stage.
4546 // Logged from bootstat.
4547 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004548 }
4549
4550 // Type of the event.
4551 optional DurationEvent event = 1;
4552 // Duration of the event in ms.
4553 optional int64 duration_millis = 2;
4554}
4555
4556/**
4557 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4558 * since boot-up.
4559 *
4560 * Logged from: bootstat and various system server components. Check each enums for details.
4561 */
4562message BootTimeEventElapsedTime {
4563 enum ElapsedTimeEvent {
4564 UNKNOWN = 0;
4565 // Time when init starts 1st stage. Logged from bootstat.
4566 ANDROID_INIT_STAGE_1 = 1;
4567 // Time when sys.boot_completed prop is set.
4568 // Logged from bootstat.
4569 BOOT_COMPLETE = 2;
4570 // BOOT_COMPLETE for encrypted device.
4571 BOOT_COMPLETE_ENCRYPTION = 3;
4572 // BOOT_COMPLETE for device with no encryption.
4573 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4574 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004575 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004576 // BOOT_COMPLETE after factory reset.
4577 FACTORY_RESET_BOOT_COMPLETE = 6;
4578 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4579 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004580 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4581 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004582 // BOOT_COMPLETE after OTA.
4583 OTA_BOOT_COMPLETE = 9;
4584 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4585 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004586 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4587 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004588 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4589 // Logged from f/b/services/.../UserController.java
4590 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4591 // Time when the system starts sending BOOT_COMPLETED broadcast.
4592 // Logged from f/b/services/.../UserController.java
4593 FRAMEWORK_BOOT_COMPLETED = 13;
4594 // Time when the package manager starts init.
4595 // Logged from f/b/services/.../SystemServer.java
4596 PACKAGE_MANAGER_INIT_START = 14;
4597 // Time when package manager is ready
4598 // Logged from f/b/services/.../SystemServer.java
4599 PACKAGE_MANAGER_INIT_READY = 15;
4600 // Represents the time when user has entered unlock credential for system with user pin.
4601 // Logged from bootstat.
4602 POST_DECRYPT = 16;
4603 // Represents the start of zygote's init.
4604 // Logged from zygote itself.
4605 ZYGOTE_INIT_START = 17;
4606 // Represents the start of secondary zygote's init.
4607 // TODO: add logging to zygote
4608 SECONDARY_ZYGOTE_INIT_START = 18;
4609 // Represents the start of system server's init.
4610 // Logged from f/b/services/.../SystemServer.java
4611 SYSTEM_SERVER_INIT_START = 19;
4612 // Represents the completion of system server's init.
4613 // Logged from f/b/services/.../SystemServer.java
4614 SYSTEM_SERVER_READY = 20;
4615 // Represents the start of launcher during boot-up.
4616 // TODO: add logging
4617 LAUNCHER_START = 21;
4618 // Represents the completion of launcher's initial rendering. User can use other apps from
4619 // launcher from this point.
4620 // TODO: add logging
4621 LAUNCHER_SHOWN = 22;
4622 }
4623
4624 // Type of the event.
4625 optional ElapsedTimeEvent event = 1;
4626 // Time since bootup for the event.
4627 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4628 optional int64 time_millis = 2;
4629}
4630
4631/**
4632 * Boot time events with UTC time.
4633 *
4634 * Logged from: bootstat and various system server components. Check each enums for details.
4635 */
4636message BootTimeEventUtcTime {
4637 enum UtcTimeEvent {
4638 UNKNOWN = 0;
4639 // Time of the bootstat's marking of 1st boot after the last factory reset.
4640 // Logged from bootstat.
4641 FACTORY_RESET_RESET_TIME = 1;
4642 // The time when bootstat records FACTORY_RESET_* events. This is close to
4643 // BOOT_COMPLETE time for the current bootup.
4644 // Logged from bootstat.
4645 FACTORY_RESET_CURRENT_TIME = 2;
4646 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4647 // Logged from bootstat.
4648 FACTORY_RESET_RECORD_VALUE = 3;
4649 }
4650
4651 // Type of the event.
4652 optional UtcTimeEvent event = 1;
4653 // UTC time for the event.
4654 optional int64 utc_time_secs = 2;
4655}
4656
4657/**
4658 * Boot time events representing specific error code during bootup.
4659 * Meaning of error code can be different per each event type.
4660 *
4661 * Logged from: bootstat and various system server components. Check each enums for details.
4662 */
4663message BootTimeEventErrorCode {
4664 enum ErrorCodeEvent {
4665 UNKNOWN = 0;
4666 // Linux error code for time() call to get the current UTC time.
4667 // Logged from bootstat.
4668 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4669 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4670 // as UMOUNT_STAT_* from init/reboot.cpp.
4671 // Logged from f/b/services/.../BootReceiver.java.
4672 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004673 // Reprepsents fie system mounting error code of /data partition for the current boot.
4674 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004675 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004676 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004677 }
4678
4679 // Type of the event.
4680 optional ErrorCodeEvent event = 1;
4681 // error code defined per each event type.
4682 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4683 // FS_MGR_FS_STAT.
4684 optional int32 error_code = 2;
4685}
4686
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004687/**
4688 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4689 * after an OTA.
4690 *
4691 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004692 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004693 */
4694message SnapshotMergeReported {
4695 // Keep in sync with
4696 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4697 enum UpdateState {
4698 // No update or merge is in progress.
4699 NONE = 0;
4700 // An update is applying; snapshots may already exist.
4701 INITIATED = 1;
4702 // An update is pending, but has not been successfully booted yet.
4703 UNVERIFIED = 2;
4704 // The kernel is merging in the background.
4705 MERGING = 3;
4706 // Post-merge cleanup steps could not be completed due to a transient
4707 // error, but the next reboot will finish any pending operations.
4708 MERGE_NEEDS_REBOOT = 4;
4709 // Merging is complete, and needs to be acknowledged.
4710 MERGE_COMPLETED = 5;
4711 // Merging failed due to an unrecoverable error.
4712 MERGE_FAILED = 6;
4713 // The update was implicitly cancelled, either by a rollback or a flash
4714 // operation via fastboot. This state can only be returned by WaitForMerge.
4715 CANCELLED = 7;
4716 };
4717
4718 // Status of the update after the merge attempts.
4719 optional UpdateState final_state = 1;
4720
4721 // Time to complete a merge operation in milliseconds.
4722 // A negative value corresponds to the case in which the merge operation
4723 // was interrupted and resumed (e.g. in case of a system reboot during the
4724 // merge).
4725 optional int64 duration_millis = 2;
4726
4727 // Number of reboots that occurred after issuing and before completing the
4728 // merge of all the snapshot devices.
4729 optional int32 intermediate_reboots = 3;
4730}
4731
Chenjie Yubbcbc602018-02-05 16:51:52 -08004732//////////////////////////////////////////////////////////////////////
4733// Pulled atoms below this line //
4734//////////////////////////////////////////////////////////////////////
4735
4736/**
David Chenc8a43242017-10-17 16:23:28 -07004737 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4738 *
4739 * Pulled from:
4740 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4741 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004742message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004743 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004744
4745 optional int64 rx_bytes = 2;
4746
4747 optional int64 rx_packets = 3;
4748
4749 optional int64 tx_bytes = 4;
4750
4751 optional int64 tx_packets = 5;
4752}
4753
4754/**
4755 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4756 *
4757 * Pulled from:
4758 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4759 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004760message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004761 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004762
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004763 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4764 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004765
4766 optional int64 rx_bytes = 3;
4767
4768 optional int64 rx_packets = 4;
4769
4770 optional int64 tx_bytes = 5;
4771
4772 optional int64 tx_packets = 6;
4773}
4774
4775/**
4776 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4777 *
4778 * Pulled from:
4779 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4780 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004781message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004782 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004783
4784 optional int64 rx_bytes = 2;
4785
4786 optional int64 rx_packets = 3;
4787
4788 optional int64 tx_bytes = 4;
4789
4790 optional int64 tx_packets = 5;
junyulaif8893302019-12-11 21:18:11 +08004791
4792 optional int32 rat_type = 6;
David Chenc8a43242017-10-17 16:23:28 -07004793}
4794
4795/**
4796 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4797 *
4798 * Pulled from:
4799 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4800 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004801message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004802 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004803
Yao Chenc40a19d2018-03-15 16:48:25 -07004804 // 1 denotes foreground and 0 denotes background. This is called Set in
4805 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004806 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004807
4808 optional int64 rx_bytes = 3;
4809
4810 optional int64 rx_packets = 4;
4811
4812 optional int64 tx_bytes = 5;
4813
4814 optional int64 tx_packets = 6;
junyulaif8893302019-12-11 21:18:11 +08004815
4816 optional int32 rat_type = 7;
David Chenc8a43242017-10-17 16:23:28 -07004817}
4818
4819/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004820 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4821 *
4822 * Pulled from:
4823 * StatsCompanionService
4824 */
4825message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004826 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004827
4828 optional int64 rx_bytes = 2;
4829
4830 optional int64 tx_bytes = 3;
4831}
4832
4833/**
David Chenc8a43242017-10-17 16:23:28 -07004834 * Pulls the kernel wakelock durations. This atom is adapted from
4835 * android/internal/os/KernelWakelockStats.java
4836 *
4837 * Pulled from:
4838 * StatsCompanionService using KernelWakelockReader.
4839 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004840message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004841 optional string name = 1;
4842
4843 optional int32 count = 2;
4844
4845 optional int32 version = 3;
4846
Yangster-maca8a30442018-10-13 23:46:34 -07004847 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004848}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004849
Chenjie Yu05013b32017-11-21 10:21:41 -08004850/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004851 * Pulls low power state information. If power.stats HAL is not available, this
4852 * includes platform and subsystem sleep state information,
4853 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4854 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004855 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004856 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004857 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4858 * as defined in:
4859 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004860 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004861message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004862 // Subsystem name
4863 optional string subsystem_name = 1;
4864 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4865 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004866 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4867 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004868 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004869 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004870 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004871 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004872 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004873}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004874
Chenjie Yu05013b32017-11-21 10:21:41 -08004875/**
Bookatz92da2832018-11-01 18:10:03 -07004876 * Pulls on-device power measurement information.
4877 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4878 * Pulled from:
4879 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4880 */
4881message OnDevicePowerMeasurement {
4882 // Name of the subsystem (to which the rail belongs).
4883 optional string subsystem_name = 1;
4884
4885 // Rail name. The rail lies within the subsystem.
4886 optional string rail_name = 2;
4887
4888 // Time (in ms since boot) at which the rail energy value was measured.
4889 // This may differ slightly from the time that statsd logs this information.
4890 optional uint64 measurement_timestamp_millis = 3;
4891
4892 // Accumulated energy used via the rail since device boot in uWs.
4893 optional uint64 energy_microwatt_secs = 4;
4894}
4895
4896/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004897 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004898 * Pulls the time the cpu spend on the frequency index. Frequency index
4899 * starts from highest to lowest. The value should be monotonically
4900 * increasing since boot. However, if there is a cpu
4901 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004902 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004903message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004904 optional uint32 cluster = 1;
4905 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004906 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004907}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004908
Chenjie Yu05013b32017-11-21 10:21:41 -08004909/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004910 * Pulls Cpu Time Per Uid.
4911 * Note that isolated process uid time should be attributed to host uids.
4912 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004913message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004914 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004915 optional uint64 user_time_micros = 2;
4916 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004917}
4918
4919/**
4920 * Pulls Cpu Time Per Uid per frequency.
4921 * Note that isolated process uid time should be attributed to host uids.
4922 * For each uid, we order the time by descending frequencies.
4923 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004924message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004925 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004926 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004927 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004928}
Hugo Benichi884970e2017-11-14 22:42:46 +09004929
Chenjie Yu05013b32017-11-21 10:21:41 -08004930/**
4931 * Pulls Wifi Controller Activity Energy Info
4932 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004933message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004934 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004935 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004936 // stack reported state
4937 // TODO: replace this with proto enum
4938 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004939 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004940 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004941 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004942 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004943 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004944 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004945 // product of current(mA), voltage(V) and time(ms)
4946 optional uint64 controller_energy_used = 6;
4947}
4948
4949/**
4950 * Pulls Modem Activity Energy Info
4951 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004952message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004953 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004954 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004955 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004956 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004957 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004958 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004959 /**
4960 * Tx power index
4961 * index 0 = tx_power < 0dBm
4962 * index 1 = 0dBm < tx_power < 5dBm
4963 * index 2 = 5dBm < tx_power < 15dBm
4964 * index 3 = 15dBm < tx_power < 20dBm
4965 * index 4 = tx_power > 20dBm
4966 */
4967 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004968 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004969 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004970 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004971 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004972 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004973 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004974 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004975 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004976 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004977 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004978 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004979 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004980 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004981}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004982
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004983/**
4984 * Pulls Bluetooth Activity Energy Info
4985 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4986 */
4987message BluetoothActivityInfo {
4988 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004989 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004990 // bluetooth stack state
4991 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004992 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004993 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004994 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004995 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004996 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004997 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004998 // product of current(mA), voltage(V) and time(ms)
4999 optional uint64 energy_used = 6;
5000}
5001
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005002/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005003 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005004 *
5005 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005006 */
5007message ProcessMemoryState {
5008 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005009 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005010
5011 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005012 // Usually package name, "system" for system server.
5013 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005014 optional string process_name = 2;
5015
Rafal Slawikda51b932018-12-13 16:31:33 +00005016 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005017 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005018
5019 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005020 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005021
5022 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005023 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005024
Rajeev Kumar90235992018-01-29 11:06:48 -08005025 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005026 // Value is read from memory.stat, field total_rss if per-app memory
5027 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005028 optional int64 rss_in_bytes = 6;
5029
5030 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005031 // Value is read from memory.stat, field total_cache if per-app memory
5032 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005033 optional int64 cache_in_bytes = 7;
5034
5035 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005036 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005037 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005038 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005039
Rafal Slawik203c3db2019-09-25 19:53:01 +01005040 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005041 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005042
Rafal Slawik203c3db2019-09-25 19:53:01 +01005043 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5044 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005045
Rafal Slawik203c3db2019-09-25 19:53:01 +01005046 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5047 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005048}
5049
5050/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005051 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005052 *
5053 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5054 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005055 *
5056 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005057 */
5058message ProcessMemoryHighWaterMark {
5059 // The uid if available. -1 means not available.
5060 optional int32 uid = 1 [(is_uid) = true];
5061
Rafal Slawikda51b932018-12-13 16:31:33 +00005062 // The process name.
5063 // Usually package name or process cmdline.
5064 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005065 optional string process_name = 2;
5066
Rafal Slawik239b6802019-09-09 18:46:01 +01005067 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5068 // computed by converting kilobytes to bytes.
5069 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5070
Rafal Slawik3bea8952018-11-15 12:39:33 +00005071 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5072 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005073 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005074}
5075
5076/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005077 * Logs the memory stats for a process.
5078 *
5079 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5080 * and for selected native processes.
5081 */
5082message ProcessMemorySnapshot {
5083 // The uid if available. -1 means not available.
5084 optional int32 uid = 1 [(is_uid) = true];
5085
5086 // The process name.
5087 // Usually package name or process cmdline.
5088 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5089 optional string process_name = 2;
5090
5091 // The pid of the process.
5092 // Allows to disambiguate instances of the process.
5093 optional int32 pid = 3;
5094
5095 // The current OOM score adjustment value.
5096 // Read from ProcessRecord for managed processes.
5097 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5098 optional int32 oom_score_adj = 4;
5099
5100 // The current RSS of the process.
5101 // VmRSS from /proc/pid/status.
5102 optional int32 rss_in_kilobytes = 5;
5103
5104 // The current anon RSS of the process.
5105 // RssAnon from /proc/pid/status.
5106 optional int32 anon_rss_in_kilobytes = 6;
5107
5108 // The current swap size of the process.
5109 // VmSwap from /proc/pid/status.
5110 optional int32 swap_in_kilobytes = 7;
5111
5112 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5113 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5114}
5115
5116/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005117 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005118 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005119message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005120 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005121}
5122
5123/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005124 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005125 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005126message SystemUptime {
5127 // Milliseconds since the system was booted.
5128 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5129 // for external input).
5130 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005131 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005132}
5133
5134/*
5135 * Reads from /proc/uid_concurrent_active_time which has the format:
5136 * active: X (X is # cores)
5137 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5138 * [uid1]: [time-0] [time-1] [time-2] ... ...
5139 * ...
5140 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5141 * The file contains a monotonically increasing count of time for a single boot.
5142 */
5143message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005144 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005145 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005146}
5147
5148/**
5149 * Reads from /proc/uid_concurrent_policy_time which has the format:
5150 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5151 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5152 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5153 * ...
5154 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5155 * The file contains a monotonically increasing count of time for a single boot.
5156 */
5157message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005158 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005159 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005160 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005161}
5162
5163/*
5164 * Pulls free disk space, for data, system partition and temporary directory.
5165 */
5166message DiskSpace {
5167 // available bytes in data partition
5168 optional uint64 data_available_bytes = 1;
5169 // available bytes in system partition
5170 optional uint64 system_available_bytes = 2;
5171 // available bytes in download cache or temp directories
5172 optional uint64 temp_available_bytes = 3;
5173}
Tej Singhbf972d92018-01-10 20:51:13 -08005174
5175/**
5176 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005177 *
5178 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005179 */
5180message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005181 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005182}
5183
5184/**
5185 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005186 * Pulled from:
5187 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005188 */
5189message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005190 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005191}
5192
5193/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005194 * Pulls battery voltage.
5195 * Pulled from:
5196 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5197 */
5198message BatteryVoltage {
5199 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005200 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005201}
5202
5203/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005204 * Pulls battery level (percent full, from 0 to 100).
5205 *
5206 * Pulled from:
5207 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5208 */
5209message BatteryLevel {
5210 // Battery level. Should be in [0, 100].
5211 optional int32 battery_level = 1;
5212}
5213
5214/**
Tej Singhd89137e2018-03-26 14:51:40 -07005215 * Pulls the temperature of various parts of the device.
5216 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005217 *
Maggie White442b6312019-04-05 16:26:44 -07005218 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005219 */
5220message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005221 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005222 optional android.os.TemperatureTypeEnum sensor_location = 1;
5223
5224 // The name of the temperature source. Eg. CPU0
5225 optional string sensor_name = 2;
5226
Tej Singhd89137e2018-03-26 14:51:40 -07005227 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005228 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005229 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005230
5231 // Relative severity of the throttling, see enum definition.
5232 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005233}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005234
5235/**
5236 * Pulls the statistics of calls to Binder.
5237 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005238 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5239 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005240 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005241 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005242 */
5243message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005244 // UID of the process responsible for the binder transaction. It will be set if the process
5245 // executing the binder transaction attribute the transaction to another uid using
5246 // Binder.setThreadWorkSource().
5247 //
5248 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005249 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005250 // UID of the process executing the binder transaction.
5251 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005252 // Fully qualified class name of the API call.
5253 //
5254 // This is a system server class name.
5255 //
5256 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5257 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5258 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5259 // commonly used APIs.
5260 optional string service_class_name = 2;
5261 // Method name of the API call. It can also be a transaction code if we cannot
5262 // resolve it to a name. See Binder#getTransactionName.
5263 //
5264 // This is a system server method name.
5265 optional string service_method_name = 3;
5266 // Total number of API calls.
5267 optional int64 call_count = 4;
5268 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5269 optional bool screen_interactive = 13;
5270 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5271 // call_count will be equal to recorded_call_count.
5272 //
5273 // If recorded_call_count is different than call_count, it means data collection has been
5274 // sampled. All the fields below will be sampled in this case.
5275 optional int64 recorded_call_count = 12;
5276 // Number of exceptions thrown by the API.
5277 optional int64 recorded_exception_count = 5;
5278 // Total latency of all API calls.
5279 // Average can be computed using total_latency_micros / recorded_call_count.
5280 optional int64 recorded_total_latency_micros = 6;
5281 // Maximum latency of one API call.
5282 optional int64 recorded_max_latency_micros = 7;
5283 // Total CPU usage of all API calls.
5284 // Average can be computed using total_cpu_micros / recorded_call_count.
5285 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5286 optional int64 recorded_total_cpu_micros = 8;
5287 // Maximum CPU usage of one API call.
5288 optional int64 recorded_max_cpu_micros = 9;
5289 // Maximum parcel reply size of one API call.
5290 optional int64 recorded_max_reply_size_bytes = 10;
5291 // Maximum parcel request size of one API call.
5292 optional int64 recorded_max_request_size_bytes = 11;
5293}
5294
5295/**
5296 * Pulls the statistics of exceptions during calls to Binder.
5297 *
5298 * Binder stats are cumulative from boot unless somebody reset the data using
5299 * > adb shell dumpsys binder_calls_stats --reset
5300 */
5301message BinderCallsExceptions {
5302 // Exception class name, e.g. java.lang.IllegalArgumentException.
5303 //
5304 // This is an exception class name thrown by the system server.
5305 optional string exception_class_name = 1;
5306 // Total number of exceptions.
5307 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005308}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005309
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005310/**
5311 * Pulls the statistics of message dispatching on HandlerThreads.
5312 *
5313 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5314 * config on the device.
5315 *
5316 * Next tag: 11
5317 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005318message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005319 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005320 optional int32 uid = 1 [(is_uid) = true];
5321
5322 // Fully qualified class name of the handler target class.
5323 //
5324 // This field does not contain PII. This is a system server class name.
5325 optional string handler_class_name = 2;
5326
5327 // The name of the thread that runs the Looper.
5328 //
5329 // This field does not contain PII. This is a system server thread name.
5330 optional string looper_thread_name = 3;
5331
5332 // The name of the dispatched message.
5333 //
5334 // This field does not contain PII. This is a system server constant or class
5335 // name.
5336 optional string message_name = 4;
5337
5338 // Total number of successfully dispatched messages.
5339 optional int64 message_count = 5;
5340
5341 // Total number of messages that failed dispatching.
5342 optional int64 exception_count = 6;
5343
5344 // Total number of processed messages we have data recorded for. If we
5345 // collected data for all the messages, message_count will be equal to
5346 // recorded_message_count.
5347 //
5348 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005349 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005350 optional int64 recorded_message_count = 7;
5351
5352 // Total latency of all processed messages.
5353 // Average can be computed using recorded_total_latency_micros /
5354 // recorded_message_count.
5355 optional int64 recorded_total_latency_micros = 8;
5356
5357 // Total CPU usage of all processed message.
5358 // Average can be computed using recorded_total_cpu_micros /
5359 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005360 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005361 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005362
5363 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5364 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005365
5366 // Max recorded CPU usage of all processed messages.
5367 optional int64 recorded_max_cpu_micros = 11;
5368
5369 // Max recorded latency of all processed messages.
5370 optional int64 recorded_max_latency_micros = 12;
5371
5372 // Total number of messages we tracked the dispatching delay for. If we
5373 // collected data for all the messages, message_count will be equal to
5374 // recorded_delay_message_count.
5375 //
5376 // If recorded_delay_message_count is different than message_count, it means data
5377 // collection has been sampled or/and not all messages specified the target dispatch time.
5378 // The fields below will be sampled in this case.
5379 optional int64 recorded_delay_message_count = 13;
5380
5381 // Total dispatching delay of all processed messages.
5382 // Calculated as a difference between the target dispatching time (Message.when)
5383 // and the actual dispatching time.
5384 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5385 optional int64 recorded_total_delay_millis = 14;
5386
5387 // Max dispatching delay of all processed messages.
5388 // Calculated as a difference between the target dispatching time (Message.when)
5389 // and the actual dispatching time.
5390 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005391}
Tej Singh86dc9db2018-09-06 00:39:57 +00005392
5393/**
5394 * Pulls disk information, such as write speed and latency.
5395 */
5396message DiskStats {
5397 // Time taken to open, write 512B to, and close a file.
5398 // -1 if error performing the check.
5399 optional int64 data_write_latency_millis = 1;
5400
5401 optional bool file_based_encryption = 2;
5402
5403 // Recent disk write speed in kB/s.
5404 // -1 if error querying storageed.
5405 // 0 if data is unavailable.
5406 optional int32 recent_disk_write_speed = 3;
5407}
5408
5409
5410/**
5411 * Free and total bytes of the Data, Cache, and System partition.
5412 */
5413message DirectoryUsage {
5414 enum Directory {
5415 UNKNOWN = 0;
5416 DATA = 1;
5417 CACHE = 2;
5418 SYSTEM = 3;
5419 }
5420 optional Directory directory = 1;
5421 optional int64 free_bytes = 2;
5422 optional int64 total_bytes = 3;
5423}
5424
5425
5426/**
5427 * Size of an application: apk size, data size, and cache size.
5428 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5429 * Information is only reported for apps with the primary user (user 0).
5430 * Sizes are aggregated by package name.
5431 */
5432message AppSize {
5433 // Including uids will involve modifying diskstats logic.
5434 optional string package_name = 1;
5435 // App size in bytes. -1 if unavailable.
5436 optional int64 app_size_bytes = 2;
5437 // App data size in bytes. -1 if unavailable.
5438 optional int64 app_data_size_bytes = 3;
5439 // App cache size in bytes. -1 if unavailable.
5440 optional int64 app_cache_size_bytes = 4;
5441 // Time that the cache file was produced.
5442 // Uses System.currentTimeMillis(), which is wall clock time.
5443 optional int64 cache_time_millis = 5;
5444}
5445
5446
5447/**
5448 * Size of a particular category. Eg: photos, videos.
5449 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5450 */
5451message CategorySize {
5452 enum Category {
5453 UNKNOWN = 0;
5454 APP_SIZE = 1;
5455 APP_DATA_SIZE = 2;
5456 APP_CACHE_SIZE = 3;
5457 PHOTOS = 4;
5458 VIDEOS = 5;
5459 AUDIO = 6;
5460 DOWNLOADS = 7;
5461 SYSTEM = 8;
5462 OTHER = 9;
5463 }
5464 optional Category category = 1;
5465 // Category size in bytes.
5466 optional int64 size_bytes = 2;
5467 // Time that the cache file was produced.
5468 // Uses System.currentTimeMillis(), which is wall clock time.
5469 optional int64 cache_time_millis = 3;
5470}
Tej Singhd6d6d772018-09-05 17:41:25 -07005471
5472/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005473 * Pulls per uid I/O stats. The stats are cumulative since boot.
5474 *
5475 * Read/write bytes are I/O events from a storage device
5476 * Read/write chars are data requested by read/write syscalls, and can be
5477 * satisfied by caching.
5478 *
5479 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5480 */
5481message DiskIo {
5482 optional int32 uid = 1 [(is_uid) = true];
5483 optional int64 fg_chars_read = 2;
5484 optional int64 fg_chars_write = 3;
5485 optional int64 fg_bytes_read = 4;
5486 optional int64 fg_bytes_write = 5;
5487 optional int64 bg_chars_read = 6;
5488 optional int64 bg_chars_write = 7;
5489 optional int64 bg_bytes_read = 8;
5490 optional int64 bg_bytes_write = 9;
5491 optional int64 fg_fsync = 10;
5492 optional int64 bg_fsync= 11;
5493}
5494
5495
5496/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005497 * Pulls the number of fingerprints for each user.
5498 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005499 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005500 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005501message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005502 // The associated user. Eg: 0 for owners, 10+ for others.
5503 // Defined in android/os/UserHandle.java
5504 optional int32 user = 1;
5505 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005506 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005507}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005508
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005509/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005510 * Pulls the number of faces for each user.
5511 *
5512 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5513 */
5514message NumFacesEnrolled {
5515 // The associated user. Eg: 0 for owners, 10+ for others.
5516 // Defined in android/os/UserHandle.java
5517 optional int32 user = 1;
5518 // Number of faces registered to that user.
5519 optional int32 num_faces_enrolled = 2;
5520}
5521/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005522 * A mapping of role holder -> role
5523 */
5524message RoleHolder {
5525 // uid of the role holder
5526 optional int32 uid = 1 [(is_uid) = true];
5527
5528 // package name of the role holder
5529 optional string package_name = 2;
5530
5531 // the role held
5532 optional string role = 3;
5533}
5534
Yangsteraf9aee72018-10-12 09:26:16 -07005535message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005536 // These are all in byte resolution.
5537 optional int64 min = 1 [deprecated = true];
5538 optional int64 average = 2 [deprecated = true];
5539 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005540
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005541 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5542 // int64 fields.
5543 optional int32 mean_kb = 4;
5544 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005545}
5546
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005547// A reduced subset of process states; reducing the number of possible states allows more
5548// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5549enum ProcessStateAggregated {
5550 PROCESS_STATE_UNKNOWN = 0;
5551 // Persistent system process.
5552 PROCESS_STATE_PERSISTENT = 1;
5553 // Top activity; actually any visible activity.
5554 PROCESS_STATE_TOP = 2;
5555 // Process binding to top or a foreground service.
5556 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5557 // Processing running a foreground service.
5558 PROCESS_STATE_FGS = 4;
5559 // Important foreground process (ime, wallpaper, etc).
5560 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5561 // Important background process.
5562 PROCESS_STATE_BACKGROUND = 6;
5563 // Process running a receiver.
5564 PROCESS_STATE_RECEIVER = 7;
5565 // All kinds of cached processes.
5566 PROCESS_STATE_CACHED = 8;
5567}
5568
5569// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005570message ProcessStatsStateProto {
5571 optional android.service.procstats.ScreenState screen_state = 1;
5572
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005573 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005574
5575 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5576 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005577 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5578
5579 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005580
5581 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005582 optional int64 duration_millis = 4 [deprecated = true];
5583 // Same as above, but with minute resolution so it fits into an int32.
5584 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005585
5586 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005587 optional int64 realtime_duration_millis = 9 [deprecated = true];
5588 // Same as above, but with minute resolution so it fits into an int32.
5589 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005590
5591 // # of samples taken
5592 optional int32 sample_size = 5;
5593
5594 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005595 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005596
5597 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005598 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005599
5600 // RSS is memory resident for this process
5601 optional AggStats rss = 8;
5602}
5603
5604// Next Tag: 7
5605message ProcessStatsProto {
5606 // Name of process.
5607 optional string process = 1;
5608
5609 // Uid of the process.
5610 optional int32 uid = 2;
5611
5612 // Information about how often kills occurred
5613 message Kill {
5614 // Count of excessive CPU kills
5615 optional int32 cpu = 1;
5616
5617 // Count of kills when cached
5618 optional int32 cached = 2;
5619
5620 // PSS stats during cached kill
5621 optional AggStats cached_pss = 3;
5622 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005623 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005624
5625 // Time and memory spent in various states.
5626 repeated ProcessStatsStateProto states = 5;
5627
5628 // Total time process has been running... screen_state, memory_state, and process_state
5629 // will not be set.
5630 optional ProcessStatsStateProto total_running_state = 6;
5631}
5632
5633message PackageServiceOperationStatsProto {
5634 // Operate enum: Started, Foreground, Bound, Executing
5635 optional android.service.procstats.ServiceOperationState operation = 1;
5636
5637 // Number of times the service was in this operation.
5638 optional int32 count = 2;
5639
5640 // Information about a state the service can be in.
5641 message StateStats {
5642 // Screen state enum.
5643 optional android.service.procstats.ScreenState screen_state = 1;
5644 // Memory state enum.
5645 optional android.service.procstats.MemoryState memory_state = 2;
5646
5647 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005648 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005649 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005650 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005651 }
5652 repeated StateStats state_stats = 3;
5653}
5654
5655message PackageServiceStatsProto {
5656 // Name of service component.
5657 optional string service_name = 1;
5658
5659 // The operation stats.
5660 // The package_name, package_uid, package_version, service_name will not be set to save space.
5661 repeated PackageServiceOperationStatsProto operation_stats = 2;
5662}
5663
5664message PackageAssociationSourceProcessStatsProto {
5665 // Uid of the process.
5666 optional int32 process_uid = 1;
5667 // Process name.
5668 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005669 // Package name.
5670 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005671 // Total count of the times this association appeared.
5672 optional int32 total_count = 3;
5673
5674 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005675 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005676
5677 // Total count of the times this association became actively impacting its target process.
5678 optional int32 active_count = 5;
5679
5680 // Information on one source in this association.
5681 message StateStats {
5682 // Process state enum.
5683 optional android.service.procstats.ProcessState process_state = 1;
5684 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005685 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005686 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005687 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005688 }
5689 repeated StateStats active_state_stats = 6;
5690}
5691
5692message PackageAssociationProcessStatsProto {
5693 // Name of the target component.
5694 optional string component_name = 1;
5695 // Information on one source in this association.
5696 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5697}
5698
5699
5700message ProcessStatsPackageProto {
5701 // Name of package.
5702 optional string package = 1;
5703
5704 // Uid of the package.
5705 optional int32 uid = 2;
5706
5707 // Version of the package.
5708 optional int64 version = 3;
5709
5710 // Stats for each process running with the package loaded in to it.
5711 repeated ProcessStatsProto process_stats = 4;
5712
5713 // Stats for each of the package's services.
5714 repeated PackageServiceStatsProto service_stats = 5;
5715
5716 // Stats for each association with the package.
5717 repeated PackageAssociationProcessStatsProto association_stats = 6;
5718}
5719
5720message ProcessStatsSectionProto {
5721 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005722 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005723
5724 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005725 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005726
5727 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005728 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005729
5730 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005731 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005732
5733 // System runtime library. e.g. "libdvm.so", "libart.so".
5734 optional string runtime = 5;
5735
5736 // whether kernel reports swapped pss.
5737 optional bool has_swapped_pss = 6;
5738
5739 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5740 enum Status {
5741 STATUS_UNKNOWN = 0;
5742 STATUS_COMPLETE = 1;
5743 STATUS_PARTIAL = 2;
5744 STATUS_SHUTDOWN = 3;
5745 STATUS_SYSPROPS = 4;
5746 }
5747 repeated Status status = 7;
5748
Chenjie Yub2ecc792019-01-17 10:27:26 -08005749 // Number of pages available of various types and sizes, representation fragmentation.
5750 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5751
Yangsteraf9aee72018-10-12 09:26:16 -07005752 // Stats for each process.
5753 repeated ProcessStatsProto process_stats = 8;
5754
5755 // Stats for each package.
5756 repeated ProcessStatsPackageProto package_stats = 9;
5757}
5758
Chenjie Yub2ecc792019-01-17 10:27:26 -08005759message ProcessStatsAvailablePagesProto {
5760 // Node these pages are in (as per /proc/pagetypeinfo)
5761 optional int32 node = 1;
5762
5763 // Zone these pages are in (as per /proc/pagetypeinfo)
5764 optional string zone = 2;
5765
5766 // Label for the type of these pages (as per /proc/pagetypeinfo)
5767 optional string label = 3;
5768
5769 // Distribution of number of pages available by order size. First entry in array is
5770 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5771 repeated int32 pages_per_order = 4;
5772}
5773
Chenjie Yu12e5e672018-09-14 15:54:59 -07005774/**
5775 * Pulled from ProcessStatsService.java
5776 */
5777message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005778 optional ProcessStatsSectionProto proc_stats_section = 1;
5779}
5780
Chenjie Yuf910b7802019-01-11 16:08:20 -08005781/**
5782 * Pulled from ProcessStatsService.java
5783 */
5784message ProcStatsPkgProc {
5785 optional ProcessStatsSectionProto proc_stats_section = 1;
5786}
5787
Chris Wrencdea3b72019-11-22 16:58:17 -05005788// Next Tag: 2
5789message PackageRemoteViewInfoProto {
5790 optional string package_name = 1;
5791 // add per-package additional info here (like channels)
5792}
5793
5794// Next Tag: 2
5795message NotificationRemoteViewsProto {
5796 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5797}
5798
5799/**
5800 * Pulled from NotificationManagerService.java
5801 */
5802message NotificationRemoteViews {
5803 optional NotificationRemoteViewsProto notification_remote_views = 1;
5804}
5805
Yotam Aron74299972020-01-16 16:20:58 +02005806/**
5807 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5808 */
5809message PackageNotificationPreferences {
5810 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005811 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005812 // Notification importance, which specifies when and how a notification is displayed.
5813 // Specified under core/java/android/app/NotificationManager.java.
5814 optional int32 importance = 2;
5815 // Lockscreen visibility as set by the user.
5816 optional int32 visibility = 3;
5817 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5818 // PreferencesHelper.java)
5819 optional int32 user_locked_fields = 4;
5820}
5821
5822/**
5823 * Atom that contains a list of a package's channel preferences, pulled from
5824 * NotificationManagerService.java.
5825 */
5826message PackageNotificationChannelPreferences {
5827 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005828 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005829 // Channel's ID. Should always be available.
5830 optional string channel_id = 2;
5831 // Channel's name. Should always be available.
5832 optional string channel_name = 3;
5833 // Channel's description. Optionally set by the channel creator.
5834 optional string description = 4;
5835 // Notification importance, which specifies when and how a notification is displayed. Specified
5836 // under core/java/android/app/NotificationManager.java.
5837 optional int32 importance = 5;
5838 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5839 // at core/java/android/app/NotificationChannel.java
5840 optional int32 user_locked_fields = 6;
5841 // Indicates if the channel was deleted by the app.
5842 optional bool is_deleted = 7;
5843}
5844
5845/**
5846 * Atom that contains a list of a package's channel group preferences, pulled from
5847 * NotificationManagerService.java.
5848 */
5849message PackageNotificationChannelGroupPreferences {
5850 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005851 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005852 // Channel Group's ID. Should always be available.
5853 optional string group_id = 2;
5854 // Channel Group's name. Should always be available.
5855 optional string group_name = 3;
5856 // Channel Group's description. Optionally set by group creator.
5857 optional string description = 4;
5858 // Indicates if notifications from this channel group are blocked.
5859 optional bool is_blocked = 5;
5860 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5861 // at core/java/android/app/NotificationChannelGroup.java
5862 optional int32 user_locked_fields = 6;
5863}
5864
Yangsteraf9aee72018-10-12 09:26:16 -07005865message PowerProfileProto {
5866 optional double cpu_suspend = 1;
5867
5868 optional double cpu_idle = 2;
5869
5870 optional double cpu_active = 3;
5871
5872 message CpuCluster {
5873 optional int32 id = 1;
5874 optional double cluster_power = 2;
5875 optional int32 cores = 3;
5876 repeated int64 speed = 4;
5877 repeated double core_power = 5;
5878 }
5879
5880 repeated CpuCluster cpu_cluster = 40;
5881
5882 optional double wifi_scan = 4;
5883
5884 optional double wifi_on = 5;
5885
5886 optional double wifi_active = 6;
5887
5888 optional double wifi_controller_idle = 7;
5889
5890 optional double wifi_controller_rx = 8;
5891
5892 optional double wifi_controller_tx = 9;
5893
5894 repeated double wifi_controller_tx_levels = 10;
5895
5896 optional double wifi_controller_operating_voltage = 11;
5897
5898 optional double bluetooth_controller_idle = 12;
5899
5900 optional double bluetooth_controller_rx = 13;
5901
5902 optional double bluetooth_controller_tx = 14;
5903
5904 optional double bluetooth_controller_operating_voltage = 15;
5905
5906 optional double modem_controller_sleep = 16;
5907
5908 optional double modem_controller_idle = 17;
5909
5910 optional double modem_controller_rx = 18;
5911
5912 repeated double modem_controller_tx = 19;
5913
5914 optional double modem_controller_operating_voltage = 20;
5915
5916 optional double gps_on = 21;
5917
5918 repeated double gps_signal_quality_based = 22;
5919
5920 optional double gps_operating_voltage = 23;
5921
5922 optional double bluetooth_on = 24;
5923
5924 optional double bluetooth_active = 25;
5925
5926 optional double bluetooth_at_cmd = 26;
5927
5928 optional double ambient_display = 27;
5929
5930 optional double screen_on = 28;
5931
5932 optional double radio_on = 29;
5933
5934 optional double radio_scanning = 30;
5935
5936 optional double radio_active = 31;
5937
5938 optional double screen_full = 32;
5939
5940 optional double audio = 33;
5941
5942 optional double video = 34;
5943
5944 optional double flashlight = 35;
5945
5946 optional double memory = 36;
5947
5948 optional double camera = 37;
5949
5950 optional double wifi_batched_scan = 38;
5951
5952 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005953}
Chenjie Yuab530202018-09-26 12:39:20 -07005954
5955/**
5956 * power_profile.xml and other constants for power model calculations.
5957 * Pulled from PowerProfile.java
5958 */
5959message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005960 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005961}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005962
5963/**
arangelovd5db50e2018-10-12 20:24:39 +01005964 * Logs when a user restriction was added or removed.
5965 *
5966 * Logged from:
5967 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5968 */
5969message UserRestrictionChanged {
5970 // The raw string of the user restriction as defined in UserManager.
5971 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5972 optional string restriction = 1;
5973 // Whether the restriction is enabled or disabled.
5974 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005975}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005976
5977/**
5978 * Pulls process user time and system time. Puller takes a snapshot of all pids
5979 * in the system and returns cpu stats for those that are working at the time.
5980 * Dead pids will be dropped. Kernel processes are excluded.
5981 * Min cool-down is 5 sec.
5982 */
5983message ProcessCpuTime {
5984 optional int32 uid = 1 [(is_uid) = true];
5985
5986 optional string process_name = 2;
5987 // Process cpu time in user space, cumulative from boot/process start
5988 optional int64 user_time_millis = 3;
5989 // Process cpu time in system space, cumulative from boot/process start
5990 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005991}
Misha Wagner5a51e002018-10-03 15:04:09 +01005992
5993/**
5994 * Pulls the CPU usage for each thread.
5995 *
5996 * Read from /proc/$PID/task/$TID/time_in_state files.
5997 *
5998 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5999 * time_in_state files not being present on some phones, have not been addressed. These should be
6000 * considered before a public release.
6001 */
6002message CpuTimePerThreadFreq {
6003 // UID that owns the process.
6004 optional int32 uid = 1 [(is_uid) = true];
6005 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006006 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006007 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006008 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006009 // Name of the process taken from `/proc/$PID/cmdline`.
6010 optional string process_name = 4;
6011 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6012 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006013
6014 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6015 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6016 // frequencies are given here as the alternative is sending eight separate atoms. This method
6017 // significantly reduces the amount of data created
6018 optional int32 frequency1_khz = 6;
6019 optional int32 time1_millis = 7;
6020 optional int32 frequency2_khz = 8;
6021 optional int32 time2_millis = 9;
6022 optional int32 frequency3_khz = 10;
6023 optional int32 time3_millis = 11;
6024 optional int32 frequency4_khz = 12;
6025 optional int32 time4_millis = 13;
6026 optional int32 frequency5_khz = 14;
6027 optional int32 time5_millis = 15;
6028 optional int32 frequency6_khz = 16;
6029 optional int32 time6_millis = 17;
6030 optional int32 frequency7_khz = 18;
6031 optional int32 time7_millis = 19;
6032 optional int32 frequency8_khz = 20;
6033 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006034}
Bookatz75ee60422018-11-09 12:27:37 -08006035
6036/**
Bookatz366a4432018-11-20 09:42:33 -08006037 * Pulls information about the device's build.
6038 */
6039message BuildInformation {
6040 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6041 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6042 optional string fingerprint = 1;
6043
6044 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6045 optional string brand = 2;
6046
6047 // Build.PRODUCT. The name of the overall product.
6048 optional string product = 3;
6049
6050 // Build.DEVICE. The name of the industrial design.
6051 optional string device = 4;
6052
6053 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6054 optional string version_release = 5;
6055
6056 // Build.ID. E.g. a label like "M4-rc20".
6057 optional string id = 6;
6058
6059 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6060 // represent this build.
6061 optional string version_incremental = 7;
6062
6063 // Build.TYPE. The type of build, like "user" or "eng".
6064 optional string type = 8;
6065
6066 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6067 optional string tags = 9;
6068}
6069
6070/**
Adam He420947c2019-01-23 15:59:09 -08006071 * Logs information about mismatched caller for content capture.
6072 *
6073 * Logged from:
6074 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6075 */
6076message ContentCaptureCallerMismatchReported {
6077 optional string intended_package = 1;
6078 optional string calling_package = 2;
6079}
6080
6081/**
6082 * Logs information about content capture service events.
6083 *
6084 * Logged from:
6085 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6086 */
6087message ContentCaptureServiceEvents {
6088 // The type of event.
6089 enum Event {
6090 UNKNOWN = 0;
6091 ON_CONNECTED = 1;
6092 ON_DISCONNECTED = 2;
6093 SET_WHITELIST = 3;
6094 SET_DISABLED = 4;
6095 ON_USER_DATA_REMOVED = 5;
6096 }
6097 optional Event event = 1;
6098 // component/package of content capture service.
6099 optional string service_info = 2;
6100 // component/package of target.
6101 // it's a concatenated list of component/package for SET_WHITELIST event
6102 // separated by " ".
6103 optional string target_info = 3;
6104}
6105
6106/**
6107 * Logs information about content capture session events.
6108 *
6109 * Logged from:
6110 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6111 */
6112message ContentCaptureSessionEvents {
6113 // The type of event.
6114 enum Event {
6115 UNKNOWN = 0;
6116 ON_SESSION_STARTED = 1;
6117 ON_SESSION_FINISHED = 2;
6118 SESSION_NOT_CREATED = 3;
6119 }
6120 optional int32 session_id = 1;
6121 optional Event event = 2;
6122 // (n/a on session finished)
6123 optional int32 state_flags = 3;
6124 // component/package of content capture service.
6125 optional string service_info = 4;
6126 // component/package of app.
6127 // (n/a on session finished)
6128 optional string app_info = 5;
6129 optional bool is_child_session = 6;
6130}
6131
6132/**
6133 * Logs information about session being flushed.
6134 *
6135 * Logged from:
6136 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6137 */
6138message ContentCaptureFlushed {
6139 optional int32 session_id = 1;
6140 // component/package of content capture service.
6141 optional string service_info = 2;
6142 // component/package of app.
6143 optional string app_info = 3;
6144 // session start/finish events
6145 optional int32 child_session_started = 4;
6146 optional int32 child_session_finished = 5;
6147 // count of view events.
6148 optional int32 view_appeared_count = 6;
6149 optional int32 view_disappeared_count = 7;
6150 optional int32 view_text_changed_count = 8;
6151
6152 // Flush stats.
6153 optional int32 max_events = 9;
6154 optional int32 idle_flush_freq = 10;
6155 optional int32 text_flush_freq = 11;
6156 optional int32 flush_reason = 12;
6157}
6158
6159/**
Bookatz75ee60422018-11-09 12:27:37 -08006160 * Pulls on-device BatteryStats power use calculations for the overall device.
6161 */
6162message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006163 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6164 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6165 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6166 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006167}
6168
6169/**
6170 * Pulls on-device BatteryStats power use calculations broken down by uid.
6171 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6172 * that is attributed to non-uid items. They must all be included to get the total power use.
6173 */
6174message DeviceCalculatedPowerBlameUid {
6175 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6176 optional int32 uid = 1 [(is_uid) = true];
6177
Bookatz3dbc13a2018-12-21 12:16:51 -08006178 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6179 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6180 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006181}
6182
6183/**
6184 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6185 * drain type.
6186 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6187 * is attributed uids. They must all be included to get the total power use.
6188 */
6189message DeviceCalculatedPowerBlameOther {
6190 // The type of item whose power use is being reported.
6191 enum DrainType {
6192 AMBIENT_DISPLAY = 0;
6193 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6194 BLUETOOTH = 2;
6195 CAMERA = 3;
6196 // Cell-standby
6197 CELL = 4;
6198 FLASHLIGHT = 5;
6199 IDLE = 6;
6200 MEMORY = 7;
6201 // Amount that total computed drain exceeded the drain estimated using the
6202 // battery level changes and capacity.
6203 OVERCOUNTED = 8;
6204 PHONE = 9;
6205 SCREEN = 10;
6206 // Amount that total computed drain was below the drain estimated using the
6207 // battery level changes and capacity.
6208 UNACCOUNTED = 11;
6209 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6210 WIFI = 13;
6211 }
6212 optional DrainType drain_type = 1;
6213
Bookatz3dbc13a2018-12-21 12:16:51 -08006214 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6215 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6216 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006217}
arangelov4e994062018-11-13 16:12:38 +00006218
6219/**
6220 * Logs device policy features.
6221 *
6222 * Logged from:
6223 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6224 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6225 */
6226message DevicePolicyEvent {
6227 // The event id - unique for each event.
6228 optional android.stats.devicepolicy.EventId event_id = 1;
6229 // The admin package name.
6230 optional string admin_package_name = 2;
6231 // A generic integer parameter.
6232 optional int32 integer_value = 3;
6233 // A generic boolean parameter.
6234 optional bool boolean_value = 4;
6235 // A parameter specifying a time period in milliseconds.
6236 optional uint64 time_period_millis = 5;
6237 // A parameter specifying a list of package names, bundle extras or string parameters.
6238 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6239}
shawnlinea5b66b2018-11-13 15:05:29 +08006240
6241/**
6242 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6243 *
6244 * Logged from:
6245 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6246 */
6247message DocsUILaunchReported {
6248 optional android.stats.docsui.LaunchAction launch_action = 1;
6249 optional bool has_initial_uri = 2;
6250 optional android.stats.docsui.MimeType mime_type = 3;
6251 optional android.stats.docsui.Root initial_root = 4;
6252}
6253
6254/**
6255 * Logs root/app visited event in file managers/picker. Call this when the user
6256 * taps on root/app in hamburger menu.
6257 *
6258 * Logged from:
6259 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6260 */
6261message DocsUIRootVisitedReported {
6262 optional android.stats.docsui.ContextScope scope = 1;
6263 optional android.stats.docsui.Root root = 2;
6264}
6265
6266/**
6267 * Logs file operation stats. Call this when a file operation has completed.
6268 *
6269 * Logged from:
6270 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6271 */
6272message DocsUIFileOperationReported {
6273 optional android.stats.docsui.Provider provider = 1;
6274 optional android.stats.docsui.FileOperation file_op = 2;
6275}
6276
6277/**
6278 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6279 * mode.
6280 *
6281 * Logged from:
6282 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6283 */
6284message DocsUIFileOperationCopyMoveModeReported {
6285 optional android.stats.docsui.FileOperation file_op = 1;
6286 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6287}
6288
6289
6290/**
6291 * Logs file sub operation stats. Call this when a file operation has failed.
6292 *
6293 * Logged from:
6294 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6295 */
6296message DocsUIFileOperationFailureReported {
6297 optional android.stats.docsui.Authority authority = 1;
6298 optional android.stats.docsui.SubFileOperation sub_op = 2;
6299}
6300
6301/**
6302* Logs the cancellation of a file operation. Call this when a job is canceled
6303*
6304* Logged from:
6305* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6306*/
6307message DocsUIFileOperationCanceledReported {
6308 optional android.stats.docsui.FileOperation file_op = 1;
6309}
6310
6311/**
6312 * Logs startup time in milliseconds.
6313 *
6314 * Logged from:
6315 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6316 */
6317message DocsUIStartupMsReported {
6318 optional int32 startup_millis = 1;
6319}
6320
6321/**
6322 * Logs the action that was started by user.
6323 *
6324 * Logged from:
6325 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6326 */
6327message DocsUIUserActionReported {
6328 optional android.stats.docsui.UserAction action = 1;
6329}
6330
6331/**
6332 * Logs the invalid type when invalid scoped access is requested.
6333 *
6334 * Logged from:
6335 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6336 */
6337message DocsUIInvalidScopedAccessRequestReported {
6338 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006339}
Ben Murdochbab399f62018-12-06 11:01:38 +00006340
6341/**
shawnlina75e82d2019-01-07 10:31:12 +08006342 * Logs the package name that launches docsui picker mode.
6343 *
6344 * Logged from:
6345 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6346 */
6347message DocsUIPickerLaunchedFromReported {
6348 optional string package_name = 1;
6349}
6350
6351/**
6352 * Logs the search type.
6353 *
6354 * Logged from:
6355 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6356 */
6357message DocsUISearchTypeReported {
6358 optional android.stats.docsui.SearchType search_type = 1;
6359}
6360
6361/**
6362 * Logs the search mode.
6363 *
6364 * Logged from:
6365 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6366 */
6367message DocsUISearchModeReported {
6368 optional android.stats.docsui.SearchMode search_mode = 1;
6369}
6370
6371/**
6372 * Logs the pick result information.
6373 *
6374 * Logged from:
6375 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6376 */
6377message DocsUIPickResultReported {
6378 optional int32 total_action_count = 1;
6379 optional int64 duration_millis = 2;
6380 optional int32 file_count= 3;
6381 optional bool is_searching = 4;
6382 optional android.stats.docsui.Root picked_from = 5;
6383 optional android.stats.docsui.MimeType mime_type = 6;
6384 optional int32 repeatedly_pick_times = 7;
6385}
6386
6387/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006388 * Logs when an app's memory is compacted.
6389 *
6390 * Logged from:
6391 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6392 */
6393message AppCompacted {
6394 // The pid of the process being compacted.
6395 optional int32 pid = 1;
6396
6397 // The name of the process being compacted.
6398 optional string process_name = 2;
6399
6400 // The type of compaction.
6401 enum Action {
6402 UNKNOWN = 0;
6403 SOME = 1;
6404 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006405 PERSISTENT = 3;
6406 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006407 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006408 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006409
6410 // Total RSS in kilobytes consumed by the process prior to compaction.
6411 optional int64 before_rss_total_kilobytes = 4;
6412
6413 // File RSS in kilobytes consumed by the process prior to compaction.
6414 optional int64 before_rss_file_kilobytes = 5;
6415
6416 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6417 optional int64 before_rss_anon_kilobytes = 6;
6418
6419 // Swap in kilobytes consumed by the process prior to compaction.
6420 optional int64 before_swap_kilobytes = 7;
6421
6422 // Total RSS in kilobytes consumed by the process after compaction.
6423 optional int64 after_rss_total_kilobytes = 8;
6424
6425 // File RSS in kilobytes consumed by the process after compaction.
6426 optional int64 after_rss_file_kilobytes = 9;
6427
6428 // Anonymous RSS in kilobytes consumed by the process after compaction.
6429 optional int64 after_rss_anon_kilobytes = 10;
6430
6431 // Swap in kilobytes consumed by the process after compaction.
6432 optional int64 after_swap_kilobytes = 11;
6433
6434 // The time taken to perform compaction in milliseconds.
6435 optional int64 time_to_compact_millis = 12;
6436
6437 // The last compaction action performed for this app.
6438 optional Action last_action = 13;
6439
Ben Murdoch01720b82018-12-19 18:03:44 +00006440 // The last time that compaction was attempted on this process in milliseconds
6441 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6442 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006443
Ben Murdoch885c21b2019-03-15 18:02:04 +00006444 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006445 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006446
6447 // The process state at the time of compaction.
6448 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006449
6450 // Free ZRAM in kilobytes before compaction.
6451 optional int64 before_zram_free_kilobytes = 17;
6452
6453 // Free ZRAM in kilobytes after compaction.
6454 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006455}
lifr157fc552018-12-12 16:38:04 +08006456
6457/**
lifrb6b90b62019-03-29 00:40:17 +08006458 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6459 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6460 *
lifr1f74b052019-04-16 22:16:30 +08006461 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6462 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6463 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6464 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006465 */
6466message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006467 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006468
lifr1f74b052019-04-16 22:16:30 +08006469 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006470
6471 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006472 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006473
lifr1f74b052019-04-16 22:16:30 +08006474 // Only valid for event_type = EVENT_GETADDRINFO.
6475 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006476
lifr1f74b052019-04-16 22:16:30 +08006477 // Flags passed to android_res_nsend() defined in multinetwork.h
6478 // Only valid for event_type = EVENT_RESNSEND.
6479 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006480
lifrad9becc2019-05-20 11:04:41 +08006481 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006482
6483 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006484 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006485
6486 // Additional pass-through fields opaque to statsd.
6487 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006488 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006489
6490 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6491 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006492}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006493
6494/**
6495 * Logs when a data stall event occurs.
6496 *
6497 * Log from:
6498 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6499 */
6500message DataStallEvent {
6501 // Data stall evaluation type.
6502 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6503 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6504 optional int32 evaluation_type = 1;
6505 // See definition in data_stall_event.proto.
6506 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6507 // See definition in data_stall_event.proto.
6508 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6509 // See definition in data_stall_event.proto.
6510 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6511 // See definition in data_stall_event.proto.
6512 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6513 // See definition in data_stall_event.proto.
6514 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6515}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006516
6517/*
6518 * Logs when RescueParty resets some set of experiment flags.
6519 *
6520 * Logged from:
6521 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6522 */
6523message RescuePartyResetReported {
6524 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6525 optional int32 rescue_level = 1;
6526}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006527
6528/**
6529 * Logs when signed config is received from an APK, and if that config was applied successfully.
6530 * Logged from:
6531 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6532 */
6533message SignedConfigReported {
6534 enum Type {
6535 UNKNOWN_TYPE = 0;
6536 GLOBAL_SETTINGS = 1;
6537 }
6538 optional Type type = 1;
6539
6540 // The final status of the signed config received.
6541 enum Status {
6542 UNKNOWN_STATUS = 0;
6543 APPLIED = 1;
6544 BASE64_FAILURE_CONFIG = 2;
6545 BASE64_FAILURE_SIGNATURE = 3;
6546 SECURITY_EXCEPTION = 4;
6547 INVALID_CONFIG = 5;
6548 OLD_CONFIG = 6;
6549 SIGNATURE_CHECK_FAILED = 7;
6550 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006551 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006552 }
6553 optional Status status = 2;
6554
6555 // The version of the signed config processed.
6556 optional int32 version = 3;
6557
6558 // The package name that the config was extracted from.
6559 optional string from_package = 4;
6560
6561 enum Key {
6562 NO_KEY = 0;
6563 DEBUG = 1;
6564 PRODUCTION = 2;
6565 }
6566 // Which key was used to verify the config.
6567 optional Key verified_with = 5;
6568}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006569
6570/*
6571 * Logs GNSS Network-Initiated (NI) location events.
6572 *
6573 * Logged from:
6574 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6575 */
6576message GnssNiEventReported {
6577 // The type of GnssNiEvent.
6578 enum EventType {
6579 UNKNOWN = 0;
6580 NI_REQUEST = 1;
6581 NI_RESPONSE = 2;
6582 }
6583 optional EventType event_type = 1;
6584
6585 // An ID generated by HAL to associate NI notifications and UI responses.
6586 optional int32 notification_id = 2;
6587
6588 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006589 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006590
6591 // NI requires notification.
6592 optional bool need_notify = 4;
6593
6594 // NI requires verification.
6595 optional bool need_verify = 5;
6596
6597 // NI requires privacy override, no notification/minimal trace.
6598 optional bool privacy_override = 6;
6599
6600 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6601 // seconds.
6602 optional int32 timeout = 7;
6603
6604 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006605 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006606
6607 // String representing the requester of the network inititated location request.
6608 optional string requestor_id = 9;
6609
6610 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6611 // network initiated location request.
6612 optional string text = 10;
6613
6614 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006615 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006616
6617 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006618 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006619
6620 // True if SUPL ES is enabled.
6621 optional bool is_supl_es_enabled = 13;
6622
6623 // True if GNSS location is enabled.
6624 optional bool is_location_enabled = 14;
6625
6626 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006627 optional android.server.location.GnssUserResponseType user_response = 15;
6628}
6629
6630/**
6631 * Logs GNSS non-framework (NFW) location notification.
6632 *
6633 * Logged from:
6634 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6635 */
6636message GnssNfwNotificationReported {
6637 // Package name of the Android proxy application representing the non-framework entity that
6638 // requested location. Set to empty string if unknown.
6639 optional string proxy_app_package_name = 1;
6640
6641 // Protocol stack that initiated the non-framework location request.
6642 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6643
6644 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6645 // set to empty string. This field is opaque to the framework and used for logging purposes.
6646 optional string other_protocol_stack_name = 3;
6647
6648 // Source initiating/receiving the location information.
6649 optional android.server.location.NfwRequestor requestor = 4;
6650
6651 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6652 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6653 // and used for logging purposes.
6654 optional string requestor_id = 5;
6655
6656 // Indicates whether location information was provided for this request.
6657 optional android.server.location.NfwResponseType response_type = 6;
6658
6659 // True if the device is in user initiated emergency session.
6660 optional bool in_emergency_mode = 7;
6661
6662 // True if cached location is provided.
6663 optional bool is_cached_location = 8;
6664
6665 // True if proxy app permission mismatch between framework and GNSS HAL.
6666 optional bool is_permission_mismatched = 9;
6667}
6668
6669/**
6670 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6671 *
6672 * Logged from:
6673 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6674 */
6675message GnssConfigurationReported {
6676 // SUPL host name.
6677 optional string supl_host = 1;
6678
6679 // SUPL port number.
6680 optional int32 supl_port = 2;
6681
6682 // C2K host name.
6683 optional string c2k_host = 3;
6684
6685 // C2K port number.
6686 optional int32 c2k_port = 4;
6687
6688 // The SUPL version requested by Carrier.
6689 optional int32 supl_ver = 5;
6690
6691 // The SUPL mode.
6692 optional android.server.location.SuplMode supl_mode = 6;
6693
6694 // True if NI emergency SUPL restrictions is enabled.
6695 optional bool supl_es = 7;
6696
6697 // LTE Positioning Profile settings
6698 optional android.server.location.LppProfile lpp_profile = 8;
6699
6700 // Positioning protocol on A-Glonass system.
6701 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6702
6703 // True if emergency PDN is used. Otherwise, regular PDN is used.
6704 optional bool use_emergency_pdn_for_emergency_supl= 10;
6705
6706 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6707 optional android.server.location.GpsLock gps_lock = 11;
6708
6709 // Number of seconds to extend the emergency session duration post emergency call.
6710 optional int32 es_extension_sec = 12;
6711
6712 // The full list of package names of proxy Android applications representing the non-framework
6713 // location access entities (on/off the device) for which the framework user has granted
6714 // non-framework location access permission. The package names are concatenated in one string
6715 // with spaces as separators.
6716 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006717}
Jack Yu95b64f32018-12-13 18:26:11 +08006718
6719/**
6720 * Logs when a NFC device's error occurred.
6721 * Logged from:
6722 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6723 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6724 */
6725message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006726 enum Type {
6727 UNKNOWN = 0;
6728 CMD_TIMEOUT = 1;
6729 ERROR_NOTIFICATION = 2;
6730 AID_OVERFLOW = 3;
6731 }
6732 optional Type type = 1;
6733 // If it's nci cmd timeout, log the timeout command.
6734 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006735
Alex Salod7c3eef2019-01-25 14:43:27 -08006736 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006737}
6738
6739/**
6740 * Logs when a NFC device's state changed event
6741 * Logged from:
6742 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6743 */
6744message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006745 enum State {
6746 UNKNOWN = 0;
6747 OFF = 1;
6748 ON = 2;
6749 ON_LOCKED = 3; // Secure Nfc enabled.
6750 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6751 }
6752 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006753}
6754
6755/**
6756 * Logs when a NFC Beam Transaction occurred.
6757 * Logged from:
6758 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6759 */
6760message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006761 enum Operation {
6762 UNKNOWN = 0;
6763 SEND = 1;
6764 RECEIVE = 2;
6765 }
6766 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006767}
6768
6769/**
6770 * Logs when a NFC Card Emulation Transaction occurred.
6771 * Logged from:
6772 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6773 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6774 */
6775message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006776 enum Category {
6777 UNKNOWN = 0;
6778 HCE_PAYMENT = 1;
6779 HCE_OTHER = 2;
6780 OFFHOST = 3;
6781 }
6782 // Transaction belongs to HCE payment or HCE other category, or offhost.
6783 optional Category category = 1;
6784 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6785 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006786}
6787
6788/**
6789 * Logs when a NFC Tag event occurred.
6790 * Logged from:
6791 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6792 */
6793message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006794 enum Type {
6795 UNKNOWN = 0;
6796 URL = 1;
6797 BT_PAIRING = 2;
6798 PROVISION = 3;
6799 WIFI_CONNECT = 4;
6800 APP_LAUNCH = 5;
6801 OTHERS = 6;
6802 }
6803 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006804}
6805
6806/**
6807 * Logs when Hce transaction triggered
6808 * Logged from:
6809 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6810 */
6811message NfcHceTransactionOccurred {
6812 // The latency period(in microseconds) it took for the first HCE data
6813 // exchange.
6814 optional uint32 latency_micros = 1;
6815}
6816
6817/**
6818 * Logs when SecureElement state event changed
6819 * Logged from:
6820 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6821 */
6822message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006823 enum State {
6824 UNKNOWN = 0;
6825 INITIALIZED = 1;
6826 DISCONNECTED = 2;
6827 CONNECTED = 3;
6828 HALCRASH = 4;
6829 }
6830 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006831
Alex Salod7c3eef2019-01-25 14:43:27 -08006832 optional string state_change_reason = 2;
6833 // SIMx or eSEx.
6834 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006835}
6836
6837/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006838 * Information about a permission grant request
6839 */
6840message PermissionGrantRequestResultReported {
6841 // unique value identifying an API call. A API call might result in multiple of these atoms
6842 optional int64 request_id = 1;
6843
6844 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006845 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006846
6847 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006848 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006849
6850 // The permission to be granted
6851 optional string permission_name = 4;
6852
6853 // If the permission was explicitly requested via the API or added by the system
6854 optional bool is_implicit = 5;
6855
6856 enum Result {
6857 UNDEFINED = 0;
6858 // permission request was ignored
6859 IGNORED = 1;
6860 // permission request was ignored because it was user fixed
6861 IGNORED_USER_FIXED = 2;
6862 // permission request was ignored because it was policy fixed
6863 IGNORED_POLICY_FIXED = 3;
6864 // permission was granted by user action
6865 USER_GRANTED = 4;
6866 // permission was automatically granted
6867 AUTO_GRANTED = 5;
6868 // permission was denied by user action
6869 USER_DENIED = 6;
6870 // permission was denied with prejudice by the user
6871 USER_DENIED_WITH_PREJUDICE = 7;
6872 // permission was automatically denied
6873 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006874 // permission request was ignored because permission is restricted
6875 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006876 // one time permission was granted by user action
6877 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006878 // user ignored request by leaving the request screen without choosing any option
6879 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006880 // user granted the permission after being linked to settings
6881 USER_GRANTED_IN_SETTINGS = 12;
6882 // user denied the permission after being linked to settings
6883 USER_DENIED_IN_SETTINGS = 13;
6884 // user denied the permission with prejudice after being linked to settings
6885 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6886 // permission was automatically revoked after one-time permission expired
6887 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006888 // permission was automatically revoked for unused app
6889 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006890 }
6891 // The result of the permission grant
6892 optional Result result = 6;
6893}
6894
6895/**
Jack Yu95b64f32018-12-13 18:26:11 +08006896 * Logs when Omapi API used
6897 * Logged from:
6898 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6899 */
6900message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006901 enum Operation {
6902 UNKNOWN = 0;
6903 OPEN_CHANNEL = 1;
6904 }
6905 optional Operation operation = 1;
6906 // SIMx or eSEx.
6907 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006908
Alex Salod7c3eef2019-01-25 14:43:27 -08006909 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006910}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006911
6912/**
Alex Saloa060aee2019-01-21 14:36:41 -08006913 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6914 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006915 * Logged from:
6916 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6917 */
6918message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006919 optional int64 dispatch_latency_millis = 1;
6920}
6921
6922/**
6923 * Logs AttentionManagerService attention check result.
6924 *
6925 * Logged from:
6926 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6927 */
6928message AttentionManagerServiceResultReported {
6929 // See core/java/android/service/attention/AttentionService.java
6930 enum AttentionCheckResult {
6931 UNKNOWN = 20;
6932 ATTENTION_SUCCESS_ABSENT = 0;
6933 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006934 ATTENTION_FAILURE_UNKNOWN = 2;
6935 ATTENTION_FAILURE_CANCELLED = 3;
6936 ATTENTION_FAILURE_PREEMPTED = 4;
6937 ATTENTION_FAILURE_TIMED_OUT = 5;
6938 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006939 }
6940 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006941}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006942
6943/**
6944 * Logs when an adb connection changes state.
6945 *
6946 * Logged from:
6947 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6948 */
6949message AdbConnectionChanged {
6950 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6951 // previously selected for this system.
6952 optional int64 last_connection_time_millis = 1;
6953
6954 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6955 // to reconnect via adb without user interaction.
6956 optional int64 auth_window_millis = 2;
6957
6958 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6959 optional android.debug.AdbConnectionStateEnum state = 3;
6960
6961 // True if the 'always allow' option was selected for this system.
6962 optional bool always_allow = 4;
6963}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006964
6965/*
6966 * Logs the reported speech DSP status.
6967 *
6968 * Logged from:
6969 * Vendor audio implementation.
6970 */
6971message SpeechDspStatReported {
6972 // The total Speech DSP uptime in milliseconds.
6973 optional int32 total_uptime_millis = 1;
6974 // The total Speech DSP downtime in milliseconds.
6975 optional int32 total_downtime_millis = 2;
6976 optional int32 total_crash_count = 3;
6977 optional int32 total_recover_count = 4;
6978}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006979
6980/**
6981 * Logs USB connector contaminant status.
6982 *
6983 * Logged from: USB Service.
6984 */
6985message UsbContaminantReported {
6986 optional string id = 1;
6987 optional android.service.usb.ContaminantPresenceStatus status = 2;
6988}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006989
6990/**
6991 * This atom is for debugging purpose.
6992 */
6993message DebugElapsedClock {
6994 // Monotically increasing value for each pull.
6995 optional int64 pull_count = 1;
6996 // Time from System.elapsedRealtime.
6997 optional int64 elapsed_clock_millis = 2;
6998 // Time from System.elapsedRealtime.
6999 optional int64 same_elapsed_clock_millis = 3;
7000 // Diff between current elapsed time and elapsed time from previous pull.
7001 optional int64 elapsed_clock_diff_millis = 4;
7002
7003 enum Type {
7004 TYPE_UNKNOWN = 0;
7005 ALWAYS_PRESENT = 1;
7006 PRESENT_ON_ODD_PULLS = 2;
7007 }
7008 // Type of behavior for the pulled data.
7009 optional Type type = 5;
7010}
7011
7012/**
7013 * This atom is for debugging purpose.
7014 */
7015message DebugFailingElapsedClock {
7016 // Monotically increasing value for each pull.
7017 optional int64 pull_count = 1;
7018 // Time from System.elapsedRealtime.
7019 optional int64 elapsed_clock_millis = 2;
7020 // Time from System.elapsedRealtime.
7021 optional int64 same_elapsed_clock_millis = 3;
7022 // Diff between current elapsed time and elapsed time from previous pull.
7023 optional int64 elapsed_clock_diff_millis = 4;
7024}
Steven Wuacef6bb2019-01-23 14:21:17 -05007025
7026/** Logs System UI bubbles event changed.
7027 *
7028 * Logged from:
7029 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7030 */
7031message BubbleUIChanged {
7032
7033 // The app package that is posting the bubble.
7034 optional string package_name = 1;
7035
7036 // The notification channel that is posting the bubble.
7037 optional string notification_channel = 2;
7038
7039 // The notification id associated with the posted bubble.
7040 optional int32 notification_id = 3;
7041
7042 // The position of the bubble within the bubble stack.
7043 optional int32 position = 4;
7044
7045 // The total number of bubbles within the bubble stack.
7046 optional int32 total_number = 5;
7047
7048 // User interactions with the bubble.
7049 enum Action {
7050 UNKNOWN = 0;
7051 POSTED = 1;
7052 UPDATED = 2;
7053 EXPANDED = 3;
7054 COLLAPSED = 4;
7055 DISMISSED = 5;
7056 STACK_DISMISSED = 6;
7057 STACK_MOVED = 7;
7058 HEADER_GO_TO_APP = 8;
7059 HEADER_GO_TO_SETTINGS = 9;
7060 PERMISSION_OPT_IN = 10;
7061 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007062 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007063 SWIPE_LEFT = 13;
7064 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007065 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007066 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007067 }
7068 optional Action action = 6;
7069
7070 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7071 optional float normalized_x_position = 7;
7072 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007073
7074 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7075 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007076
7077 // Whether the bubble is an on-going one.
7078 optional bool is_ongoing = 10;
7079
7080 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007081 // This is deprecated and the value should be ignored.
7082 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007083}
Kweku Adams8845d012018-12-11 20:06:45 -08007084
7085/**
Steven Wu552f63f2019-02-05 13:41:36 -05007086 * Logs System UI bubbles developer errors.
7087 *
7088 * Logged from:
7089 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7090 */
7091message BubbleDeveloperErrorReported {
7092
7093 // The app package that is posting the bubble.
7094 optional string package_name = 1;
7095
7096 // Bubble developer error type enums.
7097 enum Error {
7098 UNKNOWN = 0;
7099 ACTIVITY_INFO_MISSING = 1;
7100 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7101 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7102 }
7103 optional Error error = 2 [default = UNKNOWN];
7104}
7105
7106/**
Kweku Adams8845d012018-12-11 20:06:45 -08007107 * Logs that a constraint for a scheduled job has changed.
7108 *
7109 * Logged from:
7110 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7111 */
7112message ScheduledJobConstraintChanged {
7113 repeated AttributionNode attribution_node = 1;
7114
7115 // Name of the job.
7116 optional string job_name = 2;
7117
7118 optional com.android.server.job.ConstraintEnum constraint = 3;
7119
7120 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007121 UNKNOWN = 0;
7122 UNSATISFIED = 1;
7123 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007124 }
7125 optional State state = 4;
7126}
Alex Salod7c3eef2019-01-25 14:43:27 -08007127
7128/**
7129 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7130 * returns true.
7131 *
7132 * Logged from:
7133 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7134 */
7135message ScreenTimeoutExtensionReported {
7136 // Describes how many times in a row did the power manager reset the screen off timeout.
7137 optional uint32 consecutive_timeout_extended_count = 1;
7138}
Hui Yu885aca12019-01-10 17:11:34 -08007139
7140/*
7141* Logs number of milliseconds it takes to start a process.
7142* The definition of app process start time is from the app launch time to
7143* the time that Zygote finished forking the app process and loaded the
7144* application package's java classes.
7145
7146* This metric is different from AppStartOccurred which is for foreground
7147* activity only.
7148
7149* ProcessStartTime can report all processes (both foreground and background)
7150* start time.
7151*
7152* Logged from:
7153* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7154*/
7155message ProcessStartTime {
7156 // The uid of the ProcessRecord.
7157 optional int32 uid = 1 [(is_uid) = true];
7158
7159 // The process pid.
7160 optional int32 pid = 2;
7161
7162 // The process name.
7163 // Usually package name, "system" for system server.
7164 // Provided by ActivityManagerService.
7165 optional string process_name = 3;
7166
7167 enum StartType {
7168 UNKNOWN = 0;
7169 WARM = 1;
7170 HOT = 2;
7171 COLD = 3;
7172 }
7173
7174 // The start type.
7175 optional StartType type = 4;
7176
7177 // The elapsed realtime at the start of the process.
7178 optional int64 process_start_time_millis = 5;
7179
7180 // Number of milliseconds it takes to reach bind application.
7181 optional int32 bind_application_delay_millis = 6;
7182
7183 // Number of milliseconds it takes to finish start of the process.
7184 optional int32 process_start_delay_millis = 7;
7185
7186 // hostingType field in ProcessRecord, the component type such as "activity",
7187 // "service", "content provider", "broadcast" or other strings.
7188 optional string hosting_type = 8;
7189
7190 // hostingNameStr field in ProcessRecord. The component class name that runs
7191 // in this process.
7192 optional string hosting_name = 9;
7193}
7194
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007195/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007196 * Track Media Codec usage
7197 * Logged from:
7198 * frameworks/av/media/libstagefright/MediaCodec.cpp
7199 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7200 */
7201message MediametricsCodecReported {
7202 optional int64 timestamp_nanos = 1;
7203 optional string package_name = 2;
7204 optional int64 package_version_code = 3;
7205 optional int64 media_apex_version = 4;
7206
7207 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7208}
7209
7210/**
7211 * Track Media Extractor (pulling video/audio streams out of containers) usage
7212 * Logged from:
7213 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7214 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7215 */
7216message MediametricsExtractorReported {
7217 optional int64 timestamp_nanos = 1;
7218 optional string package_name = 2;
7219 optional int64 package_version_code = 3;
7220 optional int64 media_apex_version = 4;
7221
7222 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7223}
7224
7225/**
7226 * Track how we arbitrate between microphone/input requests.
7227 * Logged from
7228 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7229 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7230 */
7231message MediametricsAudiopolicyReported {
7232 optional int64 timestamp_nanos = 1;
7233 optional string package_name = 2;
7234 optional int64 package_version_code = 3;
7235 optional int64 media_apex_version = 4;
7236
7237 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7238}
7239
7240/**
7241 * Track how we arbitrate between microphone requests.
7242 * Logged from
7243 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7244 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7245 */
7246message MediametricsAudiorecordReported {
7247 optional int64 timestamp_nanos = 1;
7248 optional string package_name = 2;
7249 optional int64 package_version_code = 3;
7250 optional int64 media_apex_version = 4;
7251
7252 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7253}
7254
7255/**
7256 * Track how we arbitrate between microphone/input requests.
7257 * Logged from
7258 * frameworks/av/media/libnblog/ReportPerformance.cpp
7259 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7260 */
7261message MediametricsAudiothreadReported {
7262 optional int64 timestamp_nanos = 1;
7263 optional string package_name = 2;
7264 optional int64 package_version_code = 3;
7265 optional int64 media_apex_version = 4;
7266
7267 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7268}
7269
7270/**
7271 * Track how we arbitrate between microphone/input requests.
7272 * Logged from
7273 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7274 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7275 */
7276message MediametricsAudiotrackReported {
7277 optional int64 timestamp_nanos = 1;
7278 optional string package_name = 2;
7279 optional int64 package_version_code = 3;
7280 optional int64 media_apex_version = 4;
7281
7282 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7283}
7284
7285/**
7286 * Track information about DRM framework performance
7287 * Logged from
7288 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7289 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7290 */
7291message MediametricsMediadrmReported {
7292 optional int64 timestamp_nanos = 1;
7293 optional string package_name = 2;
7294 optional int64 package_version_code = 3;
7295 optional int64 media_apex_version = 4;
7296
7297 // vendor+description tell about which DRM plugin is in use on this device
7298 optional string vendor = 5;
7299 optional string description = 6;
7300 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7301 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7302}
7303
7304/**
7305 * Track information about the widevine DRM plugin performance
7306 * Logged from
7307 * vendor/widevine/libwvdrmengine/cdm/metrics
7308 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7309 */
7310message MediametricsDrmWidevineReported {
7311 optional int64 timestamp_nanos = 1;
7312 optional string package_name = 2;
7313 optional int64 package_version_code = 3;
7314 optional int64 media_apex_version = 4;
7315
7316 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7317}
7318
7319/**
7320 * Track information about recordings (e.g. camcorder)
7321 * Logged from
7322 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7323 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7324 */
7325message MediametricsRecorderReported {
7326 optional int64 timestamp_nanos = 1;
7327 optional string package_name = 2;
7328 optional int64 package_version_code = 3;
7329 optional int64 media_apex_version = 4;
7330
7331 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7332}
7333
7334/**
7335 * Track Media Player usage
7336 * Logged from:
7337 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7338 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7339 */
7340message MediametricsNuPlayerReported {
7341 optional int64 timestamp_nanos = 1;
7342 optional string package_name = 2;
7343 optional int64 package_version_code = 3;
7344 optional int64 media_apex_version = 4;
7345
7346 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7347}
7348
7349/**
Robert Shiha4beed32019-08-19 14:15:23 -07007350 * Track Legacy DRM usage
7351 * Logged from
7352 * frameworks/av/drm/drmserver/DrmManager.cpp
7353 */
7354message MediametricsDrmManagerReported {
7355 optional int64 timestamp_nanos = 1;
7356 optional string package_name = 2;
7357 optional int64 package_version_code = 3;
7358 optional int64 media_apex_version = 4;
7359
7360 enum Method {
7361 METHOD_NOT_FOUND = -1;
7362 GET_CONSTRAINTS = 0;
7363 GET_METADATA = 1;
7364 CAN_HANDLE = 2;
7365 PROCESS_DRM_INFO = 3;
7366 ACQUIRE_DRM_INFO = 4;
7367 SAVE_RIGHTS = 5;
7368 GET_ORIGINAL_MIME_TYPE = 6;
7369 GET_DRM_OBJECT_TYPE = 7;
7370 CHECK_RIGHTS_STATUS = 8;
7371 REMOVE_RIGHTS = 9;
7372 REMOVE_ALL_RIGHTS = 10;
7373 OPEN_CONVERT_SESSION = 11;
7374 OPEN_DECRYPT_SESSION = 12;
7375 }
7376
7377 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7378 optional string plugin_id = 5;
7379 optional string description = 6;
7380 optional Method method = 7;
7381 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007382
7383 optional int64 get_constraints_count = 9;
7384 optional int64 get_metadata_count = 10;
7385 optional int64 can_handle_count = 11;
7386 optional int64 process_drm_info_count = 12;
7387 optional int64 acquire_drm_info_count = 13;
7388 optional int64 save_rights_count = 14;
7389 optional int64 get_original_mime_type_count = 15;
7390 optional int64 get_drm_object_type_count = 16;
7391 optional int64 check_rights_status_count = 17;
7392 optional int64 remove_rights_count = 18;
7393 optional int64 remove_all_rights_count = 19;
7394 optional int64 open_convert_session_count = 20;
7395 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007396}
7397
7398/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007399 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007400 * Pulled from: StatsCompanionService
7401*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007402message DangerousPermissionState {
7403 // Name of the permission
7404 optional string permission_name = 1;
7405
7406 // Uid of the package
7407 optional int32 uid = 2 [(is_uid) = true];
7408
7409 // Package requesting the permission
7410 optional string package_name = 3;
7411
7412 // If the permission is granted to the uid
7413 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007414
7415 // Permission flags as per android.content.pm.PermissionFlags
7416 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007417}
7418
Michael Groover4a0ca942019-01-24 17:41:25 -08007419/**
7420 * Logs when a package is denied access to a device identifier based on the new access requirements.
7421 *
7422 * Logged from:
7423 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7424 */
7425message DeviceIdentifierAccessDenied {
7426 // The name of the package denied access to the requested device identifier.
7427 optional string package_name = 1;
7428
7429 // The name of the device identifier method the package attempted to invoke.
7430 optional string method_name = 2;
7431
7432 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007433 // Starting from Android 11, this boolean is not set and will always be false.
7434 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007435
7436 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007437 // Starting from Android 11, this boolean is not set and will always be false.
7438 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007439}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007440
7441/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007442 * Pulls the ongoing mainline install train version code.
7443 * Pulled from StatsCompanionService
7444 */
7445message TrainInfo {
7446 optional int64 train_version_code = 1;
7447
7448 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007449
7450 optional string train_name = 3;
7451
7452 enum Status {
7453 UNKNOWN = 0;
7454 INSTALL_REQUESTED = 1;
7455 INSTALL_STARTED = 2;
7456 INSTALL_STAGED_NOT_READY = 3;
7457 INSTALL_STAGED_READY = 4;
7458 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007459 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7460 // and INSTALL_FAILURE_COMMIT.
7461 INSTALL_FAILURE = 6 [deprecated = true];
7462 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007463 INSTALL_CANCELLED = 7;
7464 INSTALLER_ROLLBACK_REQUESTED = 8;
7465 INSTALLER_ROLLBACK_INITIATED = 9;
7466 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7467 INSTALLER_ROLLBACK_STAGED = 11;
7468 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7469 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7470 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7471 INSTALLER_ROLLBACK_SUCCESS = 15;
7472 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007473 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7474 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7475 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7476 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7477 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7478 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007479 INSTALL_FAILURE_DOWNLOAD = 23;
7480 INSTALL_FAILURE_STATE_MISMATCH = 24;
7481 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007482 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007483 }
7484 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007485}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007486
7487/**
7488 * Logs the gesture stage changed event.
7489 *
7490 * Logged from:
7491 * frameworks/base/packages/SystemUI/
7492 */
7493message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007494 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007495}
7496
7497/**
7498 * Logs the feedback type.
7499 *
7500 * Logged from:
7501 * frameworks/base/packages/SystemUI/
7502 */
7503message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007504 // Whether or not the gesture was used.
7505 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007506}
7507
7508/**
7509 * Logs the progress.
7510 *
7511 * Logged from:
7512 * frameworks/base/packages/SystemUI/
7513 */
7514message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007515 // [0,100] progress for the assist gesture.
7516 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007517}
Neil Fullerdb14b482019-02-05 19:44:44 +00007518
7519/*
7520 * Information about the time zone data on a device.
7521 */
7522message TimeZoneDataInfo {
7523 // A version identifier for the data set on device. e.g. "2018i"
7524 optional string tzdb_version = 1;
7525}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007526
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007527/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007528 * Logs the GPU stats global health information.
7529 *
7530 * Logged from:
7531 * frameworks/native/services/gpuservice/gpustats/
7532 */
7533message GpuStatsGlobalInfo {
7534 // Package name of the gpu driver.
7535 optional string driver_package_name = 1;
7536
7537 // Version name of the gpu driver.
7538 optional string driver_version_name = 2;
7539
7540 // Version code of the gpu driver.
7541 optional int64 driver_version_code = 3;
7542
7543 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7544 optional int64 driver_build_time = 4;
7545
7546 // Total count of the gl driver gets loaded.
7547 optional int64 gl_loading_count = 5;
7548
7549 // Total count of the gl driver fails to be loaded.
7550 optional int64 gl_loading_failure_count = 6;
7551
7552 // Total count of the Vulkan driver gets loaded.
7553 optional int64 vk_loading_count = 7;
7554
7555 // Total count of the Vulkan driver fails to be loaded.
7556 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007557
7558 // Api version of the system Vulkan driver.
7559 optional int32 vulkan_version = 9;
7560
7561 // Api version of the system CPU Vulkan driver.
7562 optional int32 cpu_vulkan_version = 10;
7563
7564 // Api version of the system GLES driver.
7565 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007566
7567 // Total count of the angle driver gets loaded.
7568 optional int64 angle_loading_count = 12;
7569
7570 // Total count of the angle driver fails to be loaded.
7571 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007572}
7573
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007574/**
7575 * GPU driver loading time info.
7576 */
7577message GpuDriverLoadingTime {
7578 // List of all the driver loading times for this app. The list size is
7579 // capped at 50.
7580 repeated int64 driver_loading_time = 1;
7581}
7582
7583/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007584 * Logs the GPU stats per app health information.
7585 *
7586 * Logged from:
7587 * frameworks/native/services/gpuservice/gpustats/
7588 */
7589message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007590 // Package name of the application that loads the gpu driver. Total number
7591 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007592 optional string app_package_name = 1;
7593
7594 // Version code of the gpu driver this app loads.
7595 optional int64 driver_version_code = 2;
7596
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007597 // gl driver loading time info.
7598 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7599 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007600
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007601 // Vulkan driver loading time info.
7602 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7603 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007604
7605 // Angle driver loading time info.
7606 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7607 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007608
7609 // CPU Vulkan implementation is in use.
7610 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007611
7612 // App is not doing pre-rotation correctly.
7613 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007614
7615 // App creates GLESv1 context.
7616 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007617}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007618
7619/*
7620 * Logs the size of the system ion heap.
7621 *
7622 * Pulled from StatsCompanionService.
7623 */
7624message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007625 // Deprecated due to limited support of ion stats in debugfs.
7626 // Use `IonHeapSize` instead.
7627 option deprecated = true;
7628
Rafal Slawikd4e87572019-03-12 13:08:38 +00007629 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007630 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007631 optional int64 size_in_bytes = 1;
7632}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007633
Rafal Slawik77987ed2019-06-17 12:28:23 +01007634/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007635 * Logs the total size of the ion heap.
7636 *
7637 * Pulled from StatsCompanionService.
7638 */
7639message IonHeapSize {
7640 // Total size of all ion heaps in kilobytes.
7641 // Read from: /sys/kernel/ion/total_heaps_kb.
7642 optional int32 total_size_kb = 1;
7643}
7644
7645/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007646 * Logs the per-process size of the system ion heap.
7647 *
7648 * Pulled from StatsCompanionService.
7649 */
7650message ProcessSystemIonHeapSize {
7651 // The uid if available. -1 means not available.
7652 optional int32 uid = 1 [(is_uid) = true];
7653
7654 // The process name (from /proc/PID/cmdline).
7655 optional string process_name = 2;
7656
7657 // Sum of sizes of all allocations.
7658 optional int32 total_size_in_kilobytes = 3;
7659
7660 // Number of allocations.
7661 optional int32 allocation_count = 4;
7662
7663 // Size of the largest allocation.
7664 optional int32 max_size_in_kilobytes = 5;
7665}
7666
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007667/**
7668 * Push network stack events.
7669 *
7670 * Log from:
7671 * frameworks/base/packages/NetworkStack/
7672 */
7673message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007674 // The id that indicates the event reported from NetworkStack.
7675 optional int32 event_id = 1;
7676 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007677 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7678}
Carmen Agimofa769c152019-03-04 14:39:14 +00007679
7680/**
7681 * Logs the apps that are installed on the external storage.
7682 * Pulled from:
7683 * StatsCompanionService
7684 */
7685message AppsOnExternalStorageInfo {
7686 // The type of the external storage.
7687 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7688 // The name of the package that is installed on the external storage.
7689 optional string package_name = 2;
7690}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007691
7692/**
7693 * Logs the settings related to Face.
7694 * Logged from:
7695 * frameworks/base/services/core/java/com/android/server/stats
7696 */
7697message FaceSettings {
7698 // Whether or not face unlock is allowed on Keyguard.
7699 optional bool unlock_keyguard_enabled = 1;
7700 // Whether or not face unlock dismisses the Keyguard.
7701 optional bool unlock_dismisses_keyguard = 2;
7702 // Whether or not face unlock requires attention.
7703 optional bool unlock_attention_required = 3;
7704 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7705 optional bool unlock_app_enabled = 4;
7706 // Whether or not face unlock always requires user confirmation.
7707 optional bool unlock_always_require_confirmation = 5;
7708 // Whether or not a diverse set of poses are required during enrollment.
7709 optional bool unlock_diversity_required = 6;
7710}
Maggie White442b6312019-04-05 16:26:44 -07007711
7712/**
7713 * Logs cooling devices maintained by the kernel.
7714 *
7715 * Pulled from StatsCompanionService.java
7716 */
7717message CoolingDevice {
7718 // The type of cooling device being reported. Eg. CPU, GPU...
7719 optional android.os.CoolingTypeEnum device_location = 1;
7720 // The name of the cooling device source. Eg. CPU0
7721 optional string device_name = 2;
7722 // Current throttle state of the cooling device. The value can any unsigned
7723 // integer between 0 and max_state defined in its driver. 0 means device is
7724 // not in throttling, higher value means deeper throttling.
7725 optional int32 state = 3;
7726}
Ben Blount763a5d52019-04-10 11:48:58 -07007727
7728/**
7729 * Intelligence has several counter-type events that don't warrant a
7730 * full separate atom. These are primarily API call counters but also include
7731 * counters for feature usage and specific failure modes.
7732 *
7733 * Logged from the Intelligence mainline module.
7734 */
7735message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007736 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007737 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007738 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007739 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007740 // How many times the event occured (to report a batch of high frequency events).
7741 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007742 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007743 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007744}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007745
7746/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007747 * Logs when Car Power state changed.
7748 *
7749 * Logged from:
7750 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7751 */
7752message CarPowerStateChanged {
7753 // States come from CpmsState in CarPowerManagementService.java.
7754 enum State {
7755 WAIT_FOR_VHAL = 0;
7756 ON = 1;
7757 SHUTDOWN_PREPARE = 2;
7758 WAIT_FOR_FINISH = 3;
7759 SUSPEND = 4;
7760 SIMULATE_SLEEP = 5;
7761 }
7762 optional State state = 1;
7763}
7764
7765/**
7766 * Logs whether GarageMode is entered.
7767 *
7768 * Logged from:
7769 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7770 */
7771message GarageModeInfo {
7772 // Whether GarageMode is entered.
7773 optional bool is_garage_mode = 1;
7774}
Martijn Coenencd95d462019-04-25 17:09:45 +02007775
7776/**
7777 * Historical app ops data per package.
7778 */
7779message AppOps {
7780 // Uid of the package requesting the op
7781 optional int32 uid = 1 [(is_uid) = true];
7782
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007783 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007784 optional string package_name = 2;
7785
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007786 // operation id
7787 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007788
7789 // The number of times the op was granted while the app was in the
7790 // foreground (only for trusted requests)
7791 optional int64 trusted_foreground_granted_count = 4;
7792
7793 // The number of times the op was granted while the app was in the
7794 // background (only for trusted requests)
7795 optional int64 trusted_background_granted_count = 5;
7796
7797 // The number of times the op was rejected while the app was in the
7798 // foreground (only for trusted requests)
7799 optional int64 trusted_foreground_rejected_count = 6;
7800
7801 // The number of times the op was rejected while the app was in the
7802 // background (only for trusted requests)
7803 optional int64 trusted_background_rejected_count = 7;
7804
7805 // For long-running operations, total duration of the operation
7806 // while the app was in the foreground (only for trusted requests)
7807 optional int64 trusted_foreground_duration_millis = 8;
7808
7809 // For long-running operations, total duration of the operation
7810 // while the app was in the background (only for trusted requests)
7811 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007812
7813 // Whether AppOps is guarded by Runtime permission
7814 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007815}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007816
7817/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007818 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007819 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007820message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007821 // Uid of the package requesting the op
7822 optional int32 uid = 1 [(is_uid) = true];
7823
7824 // Name of the package performing the op
7825 optional string package_name = 2;
7826
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007827 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7828 // Attributions must be provided through manifest using <attribution> tag available in R and
7829 // above.
7830 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007831
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007832 // operation id
7833 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007834
7835 // The number of times the op was granted while the app was in the
7836 // foreground (only for trusted requests)
7837 optional int64 trusted_foreground_granted_count = 5;
7838
7839 // The number of times the op was granted while the app was in the
7840 // background (only for trusted requests)
7841 optional int64 trusted_background_granted_count = 6;
7842
7843 // The number of times the op was rejected while the app was in the
7844 // foreground (only for trusted requests)
7845 optional int64 trusted_foreground_rejected_count = 7;
7846
7847 // The number of times the op was rejected while the app was in the
7848 // background (only for trusted requests)
7849 optional int64 trusted_background_rejected_count = 8;
7850
7851 // For long-running operations, total duration of the operation
7852 // while the app was in the foreground (only for trusted requests)
7853 optional int64 trusted_foreground_duration_millis = 9;
7854
7855 // For long-running operations, total duration of the operation
7856 // while the app was in the background (only for trusted requests)
7857 optional int64 trusted_background_duration_millis = 10;
7858
7859 // Whether AppOps is guarded by Runtime permission
7860 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007861
7862 // Sampling rate used on device, from 0 to 100
7863 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007864}
7865
7866/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007867 * Location Manager API Usage information(e.g. API under usage,
7868 * API call's parameters).
7869 * Logged from:
7870 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7871 */
7872message LocationManagerApiUsageReported {
7873
7874 // Indicating if usage starts or usage ends.
7875 optional android.stats.location.UsageState state = 1;
7876
7877 // LocationManagerService's API in use.
7878 // We can identify which API from LocationManager is
7879 // invoking current LMS API by the combination of
7880 // API parameter(e.g. is_listener_null, is_intent_null,
7881 // is_location_request_null)
7882 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7883
7884 // Name of the package calling the API.
7885 optional string calling_package_name = 3;
7886
7887 // Type of the location provider.
7888 optional android.stats.location.ProviderType provider = 4;
7889
7890 // Quality of the location request
7891 optional android.stats.location.LocationRequestQuality quality = 5;
7892
7893 // The desired interval for active location updates, in milliseconds.
7894 // Bucketized to reduce cardinality.
7895 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7896
7897 // Minimum distance between location updates, in meters.
7898 // Bucketized to reduce cardinality.
7899 optional android.stats.location.SmallestDisplacementBucket
7900 bucketized_smallest_displacement = 7;
7901
7902 // The number of location updates.
7903 optional int64 num_updates = 8;
7904
7905 // The request expiration time, in millisecond since boot.
7906 // Bucketized to reduce cardinality.
7907 optional android.stats.location.ExpirationBucket
7908 bucketized_expire_in = 9;
7909
7910 // Type of Callback passed in for this API.
7911 optional android.stats.location.CallbackType callback_type = 10;
7912
7913 // The radius of the central point of the alert
7914 // region, in meters. Only for API REQUEST_GEOFENCE.
7915 // Bucketized to reduce cardinality.
7916 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7917
7918 // Activity Importance of API caller.
7919 // Categorized to 3 types that are interesting from location's perspective.
7920 optional android.stats.location.ActivityImportance activiy_importance = 12;
7921}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007922
7923/**
7924 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7925 */
7926message ReviewPermissionsFragmentResultReported {
7927 // unique value identifying a permission group change. A permission group change might result
7928 // in multiple of these atoms
7929 optional int64 change_id = 1;
7930
7931 // UID of package the permission belongs to
7932 optional int32 uid = 2 [(is_uid) = true];
7933
7934 // Name of package the permission belongs to
7935 optional string package_name = 3;
7936
7937 // The permission to be granted
7938 optional string permission_name = 4;
7939
7940 // The result of the permission grant
7941 optional bool permission_granted = 5;
7942}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007943
7944/**
7945* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7946* Logged from: RuntimePermissionUpdgradeController
7947*/
7948message RuntimePermissionsUpgradeResult {
7949 // Permission granted as result of upgrade
7950 optional string permission_name = 1;
7951
7952 // UID of package granted permission
7953 optional int32 uid = 2 [(is_uid) = true];
7954
7955 // Name of package granted permission
7956 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007957}
7958
7959/**
7960* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7961*/
7962message GrantPermissionsActivityButtonActions {
7963 // Permission granted as result of upgrade
7964 optional string permission_group_name = 1;
7965
7966 // UID of package granted permission
7967 optional int32 uid = 2 [(is_uid) = true];
7968
7969 // Name of package requesting permission
7970 optional string package_name = 3;
7971
7972 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7973 // LABEL_ constants in GrantPermissionActivity.java
7974 optional int32 buttons_presented = 4;
7975
7976 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7977 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007978
7979 // id which identifies single session of user interacting with permission controller
7980 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007981}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007982
7983/**
7984 * Information about LocationAccessCheck notification presented to user
7985 */
7986message LocationAccessCheckNotificationAction {
7987
7988 // id which identifies single session of user interacting with permission controller
7989 optional int64 session_id = 1;
7990
7991 // Uid of package for which location access check is presented
7992 optional int32 package_uid = 2;
7993
7994 // Name of package for which location access check is presented
7995 optional string package_name = 3;
7996
7997 enum Result {
7998 UNDEFINED = 0;
7999 // notification was presented to the user
8000 NOTIFICATION_PRESENTED = 1;
8001 // notification was declined by the user
8002 NOTIFICATION_DECLINED = 2;
8003 // notification was clicked by the user
8004 NOTIFICATION_CLICKED = 3;
8005 }
8006
8007 // View / interaction recorded
8008 optional Result result = 4;
8009}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008010
8011/**
8012 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8013 */
8014message AppPermissionFragmentActionReported {
8015 // id which identifies single session of user interacting with permission controller
8016 optional int64 session_id = 1;
8017
8018 // unique value identifying a permission group change. A permission group change might result
8019 // in multiple of these atoms
8020 optional int64 change_id = 2;
8021
8022 // UID of package the permission belongs to
8023 optional int32 uid = 3 [(is_uid) = true];
8024
8025 // Name of package the permission belongs to
8026 optional string package_name = 4;
8027
8028 // The permission to be granted
8029 optional string permission_name = 5;
8030
8031 // The result of the permission grant
8032 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008033
8034 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8035 optional int32 permission_flags = 7;
8036
8037 enum Button {
8038 UNDEFINED = 0;
8039 // Allow button
8040 ALLOW = 1;
8041 // Deny button
8042 DENY = 2;
8043 // Ask every time button
8044 ASK_EVERY_TIME = 3;
8045 // Allow all the time button
8046 ALLOW_ALWAYS = 4;
8047 // Allow only while using the app button
8048 ALLOW_FOREGROUND = 5;
8049 // Same is Deny button but shown in while in use dialog
8050 DENY_FOREGROUND = 6;
8051 }
8052
8053 // Button pressed in the dialog
8054 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008055}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008056
8057/**
8058* Information about a AppPermissionFragment viewed by user
8059*/
8060message AppPermissionFragmentViewed {
8061 // id which identifies single session of user interacting with permission controller
8062 optional int64 session_id = 1;
8063
8064 // UID of package for which permissions are viewed
8065 optional int32 uid = 2 [(is_uid) = true];
8066
8067 // Name of package for which permissions are viewed
8068 optional string package_name = 3;
8069
8070 // Permission group viewed
8071 optional string permission_group_name = 4;
8072}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008073
8074/**
8075* Information about a AppPermissionsFragment viewed by user
8076*/
8077message AppPermissionsFragmentViewed {
8078 // id which identifies single session of user interacting with permission controller
8079 optional int64 session_id = 1;
8080
8081 // id which identifies single view as every view might have several logging records
8082 // with different package information attached
8083 optional int64 view_id = 2;
8084
8085 // Permission group viewed
8086 optional string permission_group_name = 3;
8087
8088 // UID of package for which permissions are viewed
8089 optional int32 uid = 4 [(is_uid) = true];
8090
8091 // Name of package for which permissions are viewed
8092 optional string package_name = 5;
8093
8094 // Category in which permission is included
8095 enum Category {
8096 UNDEFINED = 0;
8097 ALLOWED = 1;
8098 ALLOWED_FOREGROUND = 2;
8099 DENIED = 3;
8100 }
8101 optional Category category = 6;
8102}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008103
8104/**
8105* Information about a PermissionAppsFragment viewed by user.
8106* Logged from ui/handheld/PermissionAppsFragment.java
8107*/
8108message PermissionAppsFragmentViewed {
8109 // id which identifies single session of user interacting with permission controller
8110 optional int64 session_id = 1;
8111
8112 // id which identifies single view as every view might have several logging records
8113 // with different package information attached
8114 optional int64 view_id = 2;
8115
8116 // Permission group viewed
8117 optional string permission_group_name = 3;
8118
8119 // UID of package for which permissions are viewed
8120 optional int32 uid = 4 [(is_uid) = true];
8121
8122 // Name of package for which permissions are viewed
8123 optional string package_name = 5;
8124
8125 // Category in which app is included
8126 enum Category {
8127 UNDEFINED = 0;
8128 ALLOWED = 1;
8129 ALLOWED_FOREGROUND = 2;
8130 DENIED = 3;
8131 }
8132 optional Category category = 6;
8133}
Tony Make2b1b672019-07-29 16:59:47 +01008134
8135/**
8136 * Logs when there is a smart selection related event.
8137 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8138 * Logged from: TextClassifierEventLogger.java
8139 */
8140message TextSelectionEvent {
8141 // A session ID.
8142 optional string session_id = 1;
8143
8144 // Event type of this event.
8145 optional android.stats.textclassifier.EventType event_type = 2;
8146
Tony Mak9c84bd22019-12-09 07:27:25 +00008147 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008148 optional string model_name = 3;
8149
8150 // Type of widget that was involved in triggering this event.
8151 optional android.stats.textclassifier.WidgetType widget_type = 4;
8152
8153 // Index of this event in a session.
8154 optional int32 event_index = 5;
8155
8156 // Entity type that is involved.
8157 optional string entity_type = 6;
8158
8159 // Relative word index of the start of the selection.
8160 optional int32 relative_word_start_index = 7;
8161
8162 // Relative word (exclusive) index of the end of the selection.
8163 optional int32 relative_word_end_index = 8;
8164
8165 // Relative word index of the start of the smart selection.
8166 optional int32 relative_suggested_word_start_index = 9;
8167
8168 // Relative word (exclusive) index of the end of the smart selection.
8169 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008170
8171 // Name of source package.
8172 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008173}
8174
8175/**
8176 * Logs when there is a smart linkify related event.
8177 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8178 * Logged from: TextClassifierEventLogger.java
8179 */
8180message TextLinkifyEvent {
8181 // A session ID.
8182 optional string session_id = 1;
8183
8184 // Event type of this event.
8185 optional android.stats.textclassifier.EventType event_type = 2;
8186
Tony Mak9c84bd22019-12-09 07:27:25 +00008187 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008188 optional string model_name = 3;
8189
8190 // Type of widget that was involved in triggering this event.
8191 optional android.stats.textclassifier.WidgetType widget_type = 4;
8192
8193 // Index of this event in a session.
8194 optional int32 event_index = 5;
8195
8196 // Entity type that is involved.
8197 optional string entity_type = 6;
8198
8199 // Number of links detected.
8200 optional int32 num_links = 7;
8201
8202 // The total length of all links.
8203 optional int32 linked_text_length = 8;
8204
8205 // Length of input text.
8206 optional int32 text_length = 9;
8207
8208 // Time spent on generating links in ms.
8209 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008210
8211 // Name of source package.
8212 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008213}
8214
8215/**
8216 * Logs when there is a conversation actions related event.
8217 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8218 * Logged from: TextClassifierEventLogger.java
8219 */
8220message ConversationActionsEvent {
8221 // A session ID.
8222 optional string session_id = 1;
8223
8224 // Event type of this event.
8225 optional android.stats.textclassifier.EventType event_type = 2;
8226
Tony Mak9c84bd22019-12-09 07:27:25 +00008227 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008228 optional string model_name = 3;
8229
8230 // Type of widget that was involved in triggering this event.
8231 optional android.stats.textclassifier.WidgetType widget_type = 4;
8232
8233 // The first entity type that is involved.
8234 optional string first_entity_type = 5;
8235
8236 // The second entity type that is involved.
8237 optional string second_entity_type = 6;
8238
8239 // The third entity type that is involved.
8240 optional string third_entity_type = 7;
8241
8242 // The score of the first entity type.
8243 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008244
8245 // Name of source package.
8246 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008247
8248 // Name of the annotator model that is involved in this event.
8249 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008250}
8251
8252/**
8253 * Logs when there is a language detection related event.
8254 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8255 * Logged from: TextClassifierEventLogger.java
8256 */
8257message LanguageDetectionEvent {
8258 // A session ID.
8259 optional string session_id = 1;
8260
8261 // Event type of this event.
8262 optional android.stats.textclassifier.EventType event_type = 2;
8263
Tony Mak9c84bd22019-12-09 07:27:25 +00008264 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008265 optional string model_name = 3;
8266
8267 // Type of widget that was involved in triggering this event.
8268 optional android.stats.textclassifier.WidgetType widget_type = 4;
8269
8270 // Detected language.
8271 optional string language_tag = 5;
8272
8273 // Score of the detected language.
8274 optional float score = 6;
8275
8276 // Position of this action.
8277 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008278
8279 // Name of source package.
8280 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008281}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008282
8283/**
8284 * Information about an OTA update attempt by update_engine.
8285 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8286 */
8287message UpdateEngineUpdateAttemptReported {
8288 // The number of attempts for the update engine to apply a given payload.
8289 optional int32 attempt_number = 1;
8290
8291 optional android.stats.otaupdate.PayloadType payload_type = 2;
8292
8293 // The total time in minutes for the update engine to apply a given payload.
8294 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8295 // it's increased when the system is sleeping.
8296 optional int32 duration_boottime_in_minutes = 3;
8297
8298 // The total time in minutes for the update engine to apply a given payload.
8299 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8300 // and it's not increased when the system is sleeping.
8301 optional int32 duration_monotonic_in_minutes = 4;
8302
8303 // The size of the payload in MiBs.
8304 optional int32 payload_size_mib = 5;
8305
8306 // The attempt result reported by the update engine for an OTA update.
8307 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8308
8309 // The error code reported by the update engine after an OTA update attempt
8310 // on A/B devices.
8311 optional android.stats.otaupdate.ErrorCode error_code = 7;
8312
8313 // The build fingerprint of the source system. The value is read from a
8314 // system property when the device takes the update. e.g.
8315 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8316 optional string source_fingerprint = 8;
8317}
8318
8319/**
8320 * Information about all the attempts the device make before finishing the
8321 * successful update.
8322 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8323 */
8324message UpdateEngineSuccessfulUpdateReported {
8325 // The number of attempts for the update engine to apply the payload for a
8326 // successful update.
8327 optional int32 attempt_count = 1;
8328
8329 optional android.stats.otaupdate.PayloadType payload_type = 2;
8330
8331 optional int32 payload_size_mib = 3;
8332
8333 // The total number of bytes downloaded by update_engine since the last
8334 // successful update.
8335 optional int32 total_bytes_downloaded_mib = 4;
8336
8337 // The ratio in percentage of the over-downloaded bytes compared to the
8338 // total bytes needed to successfully install the update. e.g. 200 if we
8339 // download 200MiB in total for a 100MiB package.
8340 optional int32 download_overhead_percentage = 5;
8341
8342 // The total time in minutes for the update engine to apply the payload for a
8343 // successful update.
8344 optional int32 total_duration_minutes = 6;
8345
8346 // The number of reboot of the device during a successful update.
8347 optional int32 reboot_count = 7;
8348}
Alec Mourie088e762019-07-02 13:10:55 -07008349
8350/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008351 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8352 * key to indicate whether it was successful or not.
8353 *
8354 * Logged from:
8355 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8356 */
8357message RebootEscrowRecoveryReported {
8358 optional bool successful = 1;
8359}
8360
8361/**
Alec Mourie088e762019-07-02 13:10:55 -07008362 * Global display pipeline metrics reported by SurfaceFlinger.
8363 * Pulled from:
8364 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8365 */
8366message SurfaceflingerStatsGlobalInfo {
8367 // Total number of frames presented during the tracing period
8368 optional int64 total_frames = 1;
8369 // Total number of frames missed
8370 optional int64 missed_frames = 2;
8371 // Total number of frames that fell back to client composition
8372 optional int64 client_composition_frames = 3;
8373 // Total time the display was turned on
8374 optional int64 display_on_millis = 4;
8375 // Total time that was spent performing animations.
8376 // This is derived from the present-to-present layer histogram
8377 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008378 // Total number of event connections tracked by SurfaceFlinger at the time
8379 // of this pull. If this number grows prohibitively large, then this can
8380 // cause jank due to resource contention.
8381 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008382 // Set of timings measured from when SurfaceFlinger began compositing a
8383 // frame, until the frame was requested to be presented to the display. This
8384 // measures SurfaceFlinger's total CPU walltime on the critical path per
8385 // frame.
8386 optional FrameTimingHistogram frame_duration = 7
8387 [(android.os.statsd.log_mode) = MODE_BYTES];
8388 // Set of timings measured from when SurfaceFlinger first began using the
8389 // GPU to composite a frame, until the GPU has finished compositing that
8390 // frame. This measures the total additional time SurfaceFlinger needed to
8391 // perform due to falling back into GPU composition.
8392 optional FrameTimingHistogram render_engine_timing = 8
8393 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008394}
8395
8396/**
8397 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8398 * The number of layers uploaded will be restricted due to size limitations.
8399 * Pulled from:
8400 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8401 */
8402message SurfaceflingerStatsLayerInfo {
8403 // The layer for this set of metrics
8404 // For now we can infer that the package name is included in the layer
8405 // name.
8406 optional string layer_name = 1;
8407 // Total number of frames presented
8408 optional int64 total_frames = 2;
8409 // Total number of dropped frames while latching a buffer for this layer.
8410 optional int64 dropped_frames = 3;
8411 // Set of timings measured between successive presentation timestamps.
8412 optional FrameTimingHistogram present_to_present = 4
8413 [(android.os.statsd.log_mode) = MODE_BYTES];
8414 // Set of timings measured from when an app queued a buffer for
8415 // presentation, until the buffer was actually presented to the
8416 // display.
8417 optional FrameTimingHistogram post_to_present = 5
8418 [(android.os.statsd.log_mode) = MODE_BYTES];
8419 // Set of timings measured from when a buffer is ready to be presented,
8420 // until the buffer was actually presented to the display.
8421 optional FrameTimingHistogram acquire_to_present = 6
8422 [(android.os.statsd.log_mode) = MODE_BYTES];
8423 // Set of timings measured from when a buffer was latched by
8424 // SurfaceFlinger, until the buffer was presented to the display
8425 optional FrameTimingHistogram latch_to_present = 7
8426 [(android.os.statsd.log_mode) = MODE_BYTES];
8427 // Set of timings measured from the desired presentation to the actual
8428 // presentation time
8429 optional FrameTimingHistogram desired_to_present = 8
8430 [(android.os.statsd.log_mode) = MODE_BYTES];
8431 // Set of timings measured from when an app queued a buffer for
8432 // presentation, until the buffer was ready to be presented.
8433 optional FrameTimingHistogram post_to_acquire = 9
8434 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008435 // Frames missed latch because the acquire fence didn't fire
8436 optional int64 late_acquire_frames = 10;
8437 // Frames latched early because the desired present time was bad
8438 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008439}
8440
8441/**
8442 * Histogram of frame counts bucketed by time in milliseconds.
8443 * Because of size limitations, we hard-cap the number of buckets, with
8444 * buckets for corresponding to larger milliseconds being less precise.
8445 */
8446message FrameTimingHistogram {
8447 // Timings in milliseconds that describes a set of histogram buckets
8448 repeated int32 time_millis_buckets = 1;
8449 // Number of frames that match to each time_millis, i.e. the bucket
8450 // contents
8451 // It's required that len(time_millis) == len(frame_count)
8452 repeated int64 frame_counts = 2;
8453}
Emilian Peev6729f372019-08-29 09:14:09 -07008454
Emilian Peev6729f372019-08-29 09:14:09 -07008455/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008456 * Janky event as reported by SurfaceFlinger.
8457 * This event is intended to be consumed by a Perfetto subscriber for
8458 * automated trace collection.
8459 *
8460 * Logged from:
8461 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8462 */
8463message DisplayJankReported {
8464 // Informational field for how long the janky event lasted in milliseconds
8465 optional int64 event_duration_millis = 1;
8466 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8467 // the display on time.
8468 optional int32 present_deadlines_missed = 2;
8469}
8470
8471/**
Emilian Peev6729f372019-08-29 09:14:09 -07008472 * Information about camera facing and API level usage.
8473 * Logged from:
8474 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8475 */
8476message CameraActionEvent {
8477 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008478 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008479
8480 // Camera API level used
8481 optional int32 api_level = 2;
8482
8483 // Name of client package
8484 optional string package_name = 3;
8485
8486 // Camera facing
8487 enum Facing {
8488 UNKNOWN = 0;
8489 BACK = 1;
8490 FRONT = 2;
8491 EXTERNAL = 3;
8492 }
8493 optional Facing facing = 4;
8494}
atrost01a20932019-08-28 15:40:37 +01008495
8496/**
8497 * Logs when a compatibility change is affecting an app.
8498 *
8499 * Logged from:
8500 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8501 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8502 */
8503message AppCompatibilityChangeReported {
8504 // The UID of the app being affected by the compatibilty change.
8505 optional int32 uid = 1 [(is_uid) = true];
8506
8507 // The ID of the change affecting the app.
8508 optional int64 change_id = 2;
8509
8510 enum State {
8511 UNKNOWN_STATE = 0;
8512 ENABLED = 1;
8513 DISABLED = 2;
8514 LOGGED = 3;
8515 }
8516
8517 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8518 // logged otherwise.
8519 optional State state = 3;
8520
8521 enum Source {
8522 UNKNOWN_SOURCE = 0;
8523 APP_PROCESS = 1;
8524 SYSTEM_SERVER = 2;
8525 }
8526
8527 // Where it was logged from.
8528 optional Source source = 4;
8529
8530}
Hector Dearman40579f62019-11-01 13:19:30 +00008531
8532/**
8533 * Logged from
8534 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8535 */
8536message PerfettoUploaded {
8537 enum Event {
8538 PERFETTO_UNDEFINED = 0;
8539 PERFETTO_TRACE_BEGIN = 1;
8540 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8541 PERFETTO_ON_CONNECT = 3;
8542 PERFETTO_ON_TRACING_DISABLED = 4;
8543 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8544 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8545 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8546 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8547 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8548 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8549 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8550 PERFETTO_TRIGGER_BEGIN = 12;
8551 PERFETTO_TRIGGER_SUCCESS = 13;
8552 PERFETTO_TRIGGER_FAILURE = 14;
8553 PERFETTO_HIT_GUARDRAILS = 15;
8554 PERFETTO_ON_TIMEOUT = 16;
8555 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8556 }
8557
8558 // Which stage of the pipeline we are reporting from.
8559 optional Event event = 1;
8560
8561 // UUID matching the one set inside the SystemInfo trace packet.
8562 optional int64 trace_uuid_lsb = 2;
8563 optional int64 trace_uuid_msb = 3;
8564}
Mark Tabrya824a642019-11-05 12:26:12 -08008565
8566/**
8567 * Pulls client metrics on data transferred via Vehicle Maps Service.
8568 * Metrics are keyed by uid + layer.
8569 *
8570 * Pulled from:
8571 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8572 */
8573message VmsClientStats {
8574 // UID of the VMS client app
8575 optional int32 uid = 1 [(is_uid) = true];
8576
8577 // VMS layer definition
8578 optional int32 layer_type = 2;
8579 optional int32 layer_channel = 3;
8580 optional int32 layer_version = 4;
8581
8582 // Bytes and packets sent by the client for the layer
8583 optional int64 tx_bytes = 5;
8584 optional int64 tx_packets = 6;
8585
8586 // Bytes and packets received by the client for the layer
8587 optional int64 rx_bytes = 7;
8588 optional int64 rx_packets = 8;
8589
8590 // Bytes and packets dropped due to client error
8591 optional int64 dropped_bytes = 9;
8592 optional int64 dropped_packets = 10;
8593}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008594
8595/**
8596 * State of a dangerous permission requested by a package - sampled
8597 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8598*/
8599message DangerousPermissionStateSampled {
8600 // Name of the permission
8601 optional string permission_name = 1;
8602
8603 // Uid of the package
8604 optional int32 uid = 2 [(is_uid) = true];
8605
8606 // If the permission is granted to the uid
8607 optional bool is_granted = 3;
8608
8609 // Permission flags as per android.content.pm.PermissionFlags
8610 optional int32 permission_flags = 4;
8611}
8612
Stan Iliev637ba5e2019-08-16 13:43:08 -04008613/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008614 * HWUI stats for a given app.
8615 */
8616message GraphicsStats {
8617 // The package name of the app
8618 optional string package_name = 1;
8619
8620 // The version code of the app
8621 optional int64 version_code = 2;
8622
8623 // The start & end timestamps in UTC as
8624 // milliseconds since January 1, 1970
8625 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008626 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008627
Stan Ilievb6517192020-02-18 10:12:42 -05008628 optional int64 end_millis = 4;
8629
8630 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8631 enum PipelineType {
8632 UNKNOWN = 0;
8633 GL = 1;
8634 VULKAN = 2;
8635 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008636
8637 // HWUI renders pipeline type: GL or Vulkan.
8638 optional PipelineType pipeline = 5;
8639
8640 // Distinct frame count.
8641 optional int32 total_frames = 6;
8642
8643 // Number of "missed vsync" events.
8644 optional int32 missed_vsync_count = 7;
8645
8646 // Number of frames in triple-buffering scenario (high input latency)
8647 optional int32 high_input_latency_count = 8;
8648
8649 // Number of "slow UI thread" events.
8650 optional int32 slow_ui_thread_count = 9;
8651
8652 // Number of "slow bitmap upload" events.
8653 optional int32 slow_bitmap_upload_count = 10;
8654
8655 // Number of "slow draw" events.
8656 optional int32 slow_draw_count = 11;
8657
8658 // Number of frames that missed their deadline (aka, visibly janked)
8659 optional int32 missed_deadline_count = 12;
8660
8661 // The frame time histogram for the package
8662 optional FrameTimingHistogram cpu_histogram = 13
8663 [(android.os.statsd.log_mode) = MODE_BYTES];
8664
8665 // The gpu frame time histogram for the package
8666 optional FrameTimingHistogram gpu_histogram = 14
8667 [(android.os.statsd.log_mode) = MODE_BYTES];
8668
8669 // UI mainline module version.
8670 optional int64 version_ui_module = 15;
8671
8672 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8673 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8674 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8675 // more apps are running / rendering.
8676 optional bool is_today = 16;
8677}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008678
8679/**
8680 * Message related to dangerous (runtime) app ops access
8681 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008682message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008683 // Uid of the package accessing app op
8684 optional int32 uid = 1 [(is_uid) = true];
8685
8686 // Name of the package accessing app op
8687 optional string package_name = 2;
8688
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008689 // operation string id per OPSTR_ constants in AppOpsManager.java
8690 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008691
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008692 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
8693 // API.
8694 // Attributions must be provided through manifest using <attribution> tag available in R and
8695 // above.
8696 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008697
8698 // message related to app op access, limited to 600 chars by API
8699 optional string message = 5;
8700
8701 enum SamplingStrategy {
8702 DEFAULT = 0;
8703 UNIFORM = 1;
8704 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008705 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008706 }
8707
8708 // sampling strategy used to collect this message
8709 optional SamplingStrategy sampling_strategy = 6;
8710}
8711
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008712/*
8713 * Logs userspace reboot outcome and duration.
8714 *
8715 * Logged from:
8716 * frameworks/base/core/java/com/android/server/BootReceiver.java
8717 */
8718message UserspaceRebootReported {
8719 // Possible outcomes of userspace reboot.
8720 enum Outcome {
8721 // Default value in case platform failed to determine the outcome.
8722 OUTCOME_UNKNOWN = 0;
8723 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8724 SUCCESS = 1;
8725 // Userspace reboot shutdown sequence was aborted.
8726 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8727 // Remounting userdata into checkpointing mode failed.
8728 FAILED_USERDATA_REMOUNT = 3;
8729 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8730 // reboot.
8731 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8732 }
8733 // Outcome of userspace reboot. Always set.
8734 optional Outcome outcome = 1;
8735 // Duration of userspace reboot in case it has a successful outcome.
8736 // Duration is measured as time between userspace reboot was initiated and until boot completed
8737 // (e.g. sys.boot_completed=1).
8738 optional int64 duration_millis = 2;
8739 // State of primary user's (user0) credential encryption storage.
8740 enum UserEncryptionState {
8741 // Default value.
8742 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8743 // Credential encrypted storage is unlocked.
8744 UNLOCKED = 1;
8745 // Credential encrypted storage is locked.
8746 LOCKED = 2;
8747 }
8748 // State of primary user's encryption storage at the moment boot completed. Always set.
8749 optional UserEncryptionState user_encryption_state = 3;
8750}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008751
8752/*
8753 * Logs integrity check information during each install.
8754 *
8755 * Logged from:
8756 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8757 */
8758message IntegrityCheckResultReported {
8759 optional string package_name = 1;
8760 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008761 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008762 optional string installer_package_name = 4;
8763 enum Response {
8764 UNKNOWN = 0;
8765 ALLOWED = 1;
8766 REJECTED = 2;
8767 FORCE_ALLOWED = 3;
8768 }
8769 optional Response response = 5;
8770 // An estimate on the cause of the response. This will only be populated for
8771 // REJECTED and FORCE_ALLOWED
8772 optional bool caused_by_app_cert_rule = 6;
8773 optional bool caused_by_installer_rule = 7;
8774}
8775
8776/**
8777 * Logs the information about the rules and the provider whenever rules are
8778 * pushed into AppIntegrityManager.
8779 *
8780 * Logged from:
8781 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8782 */
8783message IntegrityRulesPushed {
8784 optional bool success = 1;
8785 // Package name of the app that pushed the rules.
8786 optional string rule_provider = 2;
8787 // Version string of arbitrary format provided by the rule provider to
8788 // identify the rules.
8789 optional string rule_version = 3;
8790}
Jordan Liubedfa702019-12-20 15:08:45 -08008791
8792/**
8793 * Logs when a cell broadcast message is received on the device.
8794 *
8795 * Logged from CellBroadcastService module:
8796 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8797 */
8798message CellBroadcastMessageReported {
8799 // The type of Cell Broadcast message
8800 enum CbType {
8801 UNKNOWN_TYPE = 0;
8802 GSM = 1;
8803 CDMA = 2;
8804 CDMA_SPC = 3;
8805 }
8806
8807 // GSM, CDMA, CDMA-SCP
8808 optional CbType type = 1;
8809}
8810
8811/**
8812 * Logs when an error occurs while handling a cell broadcast message;
8813 *
8814 * Logged from CellBroadcastService module:
8815 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8816 */
8817message CellBroadcastMessageError {
8818 // The type of error raised when trying to handle a cell broadcast message
8819 enum ErrorType {
8820 UNKNOWN_TYPE = 0;
8821 CDMA_DECODING_ERROR = 1;
8822 CDMA_SCP_EMPTY = 2;
8823 CDMA_SCP_HANDLING_ERROR = 3;
8824 GSM_INVALID_HEADER_LENGTH = 4;
8825 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8826 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8827 GSM_INVALID_PDU = 7;
8828 GSM_INVALID_GEO_FENCING_DATA = 8;
8829 GSM_UMTS_INVALID_WAC = 9;
8830 FAILED_TO_INSERT_TO_DB = 10;
8831 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8832 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8833 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8834 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8835 }
8836
8837 // What kind of error occurred
8838 optional ErrorType type = 1;
8839
8840 // Exception message (or log message) associated with the error (max 1000 chars)
8841 optional string exception_message = 2;
8842}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008843
8844/**
8845 * Logs when the SDK Extensions test app has polled the current version.
8846 * This is atom ID 354.
8847 *
8848 * Logged from:
8849 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8850 */
8851message SdkExtensionStatus {
8852 enum ApiCallStatus {
8853 CALL_NOT_ATTEMPTED = 0;
8854 CALL_SUCCESSFUL = 1;
8855 CALL_FAILED = 2;
8856 }
8857
8858 optional ApiCallStatus result = 1;
8859
8860 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8861 optional int32 r_extension_version = 2;
8862
8863 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8864 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8865 optional int32 failed_call_symbol = 3;
8866}
Marco Ballesio497aff42020-01-24 08:39:42 -08008867
8868/**
8869 * Logs when an app is frozen or unfrozen.
8870 *
8871 * Logged from:
8872 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8873 */
8874message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008875 // The type of event.
8876 enum Action {
8877 UNKNOWN = 0;
8878 FREEZE_APP = 1;
8879 UNFREEZE_APP = 2;
8880 }
8881 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008882
Blake Kragten6ce382a2020-01-16 20:20:46 -08008883 // Pid of the process being frozen.
8884 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008885
Blake Kragten6ce382a2020-01-16 20:20:46 -08008886 // Name of the process being frozen.
8887 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008888
Blake Kragten6ce382a2020-01-16 20:20:46 -08008889 // Time since last unfrozen.
8890 optional int64 time_unfrozen_millis = 4;
8891}
8892
8893/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008894 * Pulls information for a single voice call.
8895 *
8896 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8897 *
8898 * Pulled from:
8899 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8900 */
8901message VoiceCallSession {
8902 // Bearer (IMS or CS) when the call started.
8903 optional android.telephony.CallBearerEnum bearer_at_start = 1;
8904
8905 // Bearer (IMS or CS) when the call ended.
8906 // The bearer may change during the call, e.g. due to SRVCC.
8907 optional android.telephony.CallBearerEnum bearer_at_end = 2;
8908
8909 // Direction of the call (incoming or outgoing).
8910 optional android.telephony.CallDirectionEnum direction = 3;
8911
8912 // Time spent setting up the call.
8913 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
8914
8915 // Whether the call ended before the setup was completed.
8916 optional bool setup_failed = 5;
8917
8918 // IMS reason code or CS disconnect cause.
8919 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
8920 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
8921 optional int32 disconnect_reason_code = 6;
8922
8923 // IMS extra code or CS precise disconnect cause.
8924 // For IMS, this code is vendor-specific
8925 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
8926 optional int32 disconnect_extra_code = 7;
8927
8928 // IMS extra message or CS vendor cause.
8929 optional string disconnect_extra_message = 8;
8930
8931 // Radio access technology (RAT) used when call started.
8932 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
8933
8934 // Radio access technology (RAT) used when call terminated.
8935 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
8936
8937 // Number of times RAT changed during the call.
8938 optional int64 rat_switch_count = 11;
8939
8940 // A bitmask of all codecs used during the call.
8941 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
8942 optional int64 codec_bitmask = 12;
8943
8944 // Number of other calls going on during call setup, for the same SIM slot.
8945 optional int32 concurrent_call_count_at_start = 13;
8946
8947 // Number of other calls going on during call termination, for the same SIM slot.
8948 optional int32 concurrent_call_count_at_end = 14;
8949
8950 // Index of the SIM is used, 0 for single-SIM devices.
8951 optional int32 sim_slot_index = 15;
8952
8953 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
8954 optional bool is_multi_sim = 16;
8955
8956 // Whether the call was made with an eSIM profile.
8957 optional bool is_esim = 17;
8958
8959 // Carrier ID of the SIM card.
8960 // See https://source.android.com/devices/tech/config/carrierid.
8961 optional int32 carrier_id = 18;
8962
8963 // Whether an SRVCC has been completed successfully.
8964 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
8965 // events once the call is switched to CS.
8966 optional bool srvcc_completed = 19;
8967
8968 // Number of SRVCC failures.
8969 optional int64 srvcc_failure_count = 20;
8970
8971 // Number of SRVCC cancellations.
8972 optional int64 srvcc_cancellation_count = 21;
8973
8974 // Whether the Real-Time Text (RTT) was ever used in the call.
8975 optional bool rtt_enabled = 22;
8976
8977 // Whether this was an emergency call.
8978 optional bool is_emergency = 23;
8979
8980 // Whether the call was performed while roaming.
8981 optional bool is_roaming = 24;
8982}
8983
8984/**
8985 * Pulls voice call radio access technology (RAT) usage.
8986 *
8987 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
8988 * time. The atom will be skipped if not enough data is available.
8989 *
8990 * Pulled from:
8991 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8992 */
8993message VoiceCallRatUsage {
8994 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
8995 optional int32 carrier_id = 1;
8996
8997 // Radio access technology.
8998 optional android.telephony.NetworkTypeEnum rat = 2;
8999
9000 // Total duration that voice calls spent on this carrier and RAT.
9001 optional int64 total_duration_seconds = 3;
9002
9003 // Total number of calls using this carrier and RAT.
9004 // A call is counted once even if it used the RAT multiple times.
9005 optional int64 call_count = 4;
9006}
9007
9008/**
9009 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9010 *
9011 * Pulled from:
9012 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
9013 */
9014message SimSlotState {
9015 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9016 optional int32 active_slot_count = 1;
9017
9018 // Number of SIM cards (both physical and active eSIM profiles).
9019 // This number is always equal to or less than the number of active SIM slots.
9020 optional int32 sim_count = 2;
9021
9022 // Number of active eSIM profiles.
9023 // This number is always equal to or less than the number of SIMs.
9024 optional int32 esim_count = 3;
9025}
9026
9027/**
9028 * Pulls supported cellular radio access technologies.
9029 *
9030 * This atom reports the capabilities of the device, rather than the network it has access to.
9031 *
9032 * Pulled from:
9033 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
9034 */
9035message SupportedRadioAccessFamily {
9036 // A bitmask of supported radio technologies.
9037 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9038 optional int64 network_type_bitmask = 1;
9039}
9040
9041/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009042 * Logs gnss stats from location service provider
9043 *
9044 * Pulled from:
9045 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9046 */
9047
9048message GnssStats {
9049 // Number of location reports since boot
9050 optional int64 location_reports = 1;
9051
9052 // Total pulled reports of Location failures since boot
9053 optional int64 location_failure_reports = 2;
9054
9055 // Number of time to first fix reports since boot
9056 optional int64 time_to_first_fix_reports = 3;
9057
9058 // Total pulled reported time to first fix (in milli-seconds) since boot
9059 optional int64 time_to_first_fix_milli_s = 4;
9060
9061 // Number of position accuracy reports since boot
9062 optional int64 position_accuracy_reports = 5;
9063
9064 // Total pulled reported position accuracy (in meters) since boot
9065 optional int64 position_accuracy_meters = 6;
9066
9067 // Number of top 4 average CN0 reports since boot
9068 optional int64 top_four_average_cn0_reports = 7;
9069
9070 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9071 optional int64 top_four_average_cn0_db_mhz = 8;
9072
9073 // Number of l5 top 4 average CN0 reports since boot
9074 optional int64 l5_top_four_average_cn0_reports = 9;
9075
9076 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9077 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9078
9079 // Total number of sv status messages reports since boot
9080 optional int64 sv_status_reports = 11;
9081
9082 // Total number of sv status messages reports, where sv is used in fix since boot
9083 optional int64 sv_status_reports_used_in_fix = 12;
9084
9085 // Total number of L5 sv status messages reports since boot
9086 optional int64 l5_sv_status_reports = 13;
9087
9088 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9089 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009090}
Kweku Adams12752132020-02-18 15:36:48 -08009091
9092/**
9093 * Logs when an app is moved to a different standby bucket.
9094 *
9095 * Logged from:
9096 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9097 */
9098message AppStandbyBucketChanged {
9099 optional string package_name = 1;
9100
9101 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9102 optional int32 user_id = 2;
9103
9104 // These enum values match the constants defined in UsageStatsManager.java.
9105 enum Bucket {
9106 BUCKET_UNKNOWN = 0;
9107 BUCKET_EXEMPTED = 5;
9108 BUCKET_ACTIVE = 10;
9109 BUCKET_WORKING_SET = 20;
9110 BUCKET_FREQUENT = 30;
9111 BUCKET_RARE = 40;
9112 BUCKET_RESTRICTED = 45;
9113 BUCKET_NEVER = 50;
9114 }
9115 optional Bucket bucket = 3;
9116
9117 enum MainReason {
9118 MAIN_UNKNOWN = 0;
9119 MAIN_DEFAULT = 0x0100;
9120 MAIN_TIMEOUT = 0x0200;
9121 MAIN_USAGE = 0x0300;
9122 MAIN_FORCED_BY_USER = 0x0400;
9123 MAIN_PREDICTED = 0x0500;
9124 MAIN_FORCED_BY_SYSTEM = 0x0600;
9125 }
9126 optional MainReason main_reason = 4;
9127
9128 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9129 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9130 // UsageStatsManager.java.
9131 optional int32 sub_reason = 5;
9132}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009133
9134/**
9135* Reports a started sharesheet transaction.
9136*
9137* Logged from:
9138* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9139*/
9140message SharesheetStarted {
9141 // The event_id (as for UiEventReported).
9142 optional int32 event_id = 1;
9143 // The calling app's package name.
9144 optional string package_name = 2;
9145 // An identifier to tie together multiple logs relating to the same share event
9146 optional int32 instance_id = 3;
9147 // The mime type of the share
9148 optional string mime_type = 4;
9149 // The number of direct targets the calling app is providing that will be shown.
9150 optional int32 num_app_provided_direct_targets = 5;
9151 // The number of app targets the calling app is providing that will be shown.
9152 optional int32 num_app_provided_app_targets = 6;
9153 // True if the share originates from the workprofile
9154 optional bool is_workprofile = 7;
9155
9156 enum SharesheetPreviewType { // Constants from ChooserActivity.java
9157 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9158 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9159 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9160 }
9161 // How the sharesheet preview is presented.
9162 optional SharesheetPreviewType previewType = 8;
9163
9164 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9165 INTENT_DEFAULT = 0;
9166 INTENT_ACTION_VIEW = 1;
9167 INTENT_ACTION_EDIT = 2;
9168 INTENT_ACTION_SEND = 3;
9169 INTENT_ACTION_SENDTO = 4;
9170 INTENT_ACTION_SEND_MULTIPLE = 5;
9171 INTENT_ACTION_IMAGE_CAPTURE = 6;
9172 INTENT_ACTION_MAIN = 7;
9173 }
9174 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
9175 optional ResolverActivityIntent intentType = 9;
9176}
9177
9178/**
9179 * Reports a ranking selection event.
9180 *
9181 * Logged from:
9182 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9183 */
9184message RankingSelected {
9185 // The event_id (as for UiEventReported).
9186 optional int32 event_id = 1;
9187 // The relevant app's package name (can be source or picked package).
9188 optional string package_name = 2;
9189 // An identifier to tie together multiple logs relating to the same share event.
9190 optional int32 instance_id = 3;
9191 // Which of the ranked targets got picked, default starting position 0.
9192 optional int32 position_picked = 4;
9193}
Raff Tsaiea4db182020-03-06 07:45:43 +08009194
9195/**
9196 * Logs settings provider values.
9197 *
9198 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9199 * then write the value to proto.
9200 *
9201 */
9202message SettingSnapshot {
9203
9204 // Setting key
9205 optional string name = 1;
9206
9207 enum SettingsValueType {
9208 NOTASSIGNED = 0;
9209 ASSIGNED_BOOL_TYPE = 1;
9210 ASSIGNED_INT_TYPE = 2;
9211 ASSIGNED_FLOAT_TYPE = 3;
9212 ASSIGNED_STRING_TYPE = 4;
9213 };
9214 // Setting value type
9215 optional SettingsValueType type = 2;
9216
9217 optional bool bool_value = 3;
9218
9219 optional int32 int_value = 4;
9220
9221 optional float float_value = 5;
9222
9223 optional string str_value = 6;
9224
9225 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9226 optional int32 user_id = 7;
9227}