blob: 57e54557d9f5472ab9b98f49d0ea21aab57b061b [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"];
97 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12 [(module) = "framework"];
98 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
99 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
100 14 [(module) = "framework"];
101 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
102 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
103 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
104 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800105 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700106 BatterySaverModeStateChanged battery_saver_mode_state_changed =
107 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800108 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
109 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
110 AudioStateChanged audio_state_changed = 23 [(module) = "framework"];
111 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
112 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
113 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700114 UidProcessStateChanged uid_process_state_changed =
115 27 [(module) = "framework", (module) = "statsdtest"];
116 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
117 28 [(module) = "framework", (module) = "statsdtest"];
118 ScreenStateChanged screen_state_changed =
119 29 [(module) = "framework", (module) = "statsdtest"];
120 BatteryLevelChanged battery_level_changed =
121 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800122 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
123 PluggedStateChanged plugged_state_changed = 32 [(module) = "framework"];
124 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800125 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800126 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
127 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800128 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
129 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
130 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800131 PhoneSignalStrengthChanged phone_signal_strength_changed = 40 [(module) = "framework"];
132 SettingChanged setting_changed = 41 [(module) = "framework"];
133 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700134 42 [(module) = "framework", (module) = "statsdtest"];
135 IsolatedUidChanged isolated_uid_changed =
136 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800137 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
138 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800139 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800140 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800141 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700142 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800143 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
144 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800145 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800146 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800147 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800148 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800149 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
150 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800151 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800152 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700153 OverlayStateChanged overlay_state_changed =
154 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800155 ForegroundServiceStateChanged foreground_service_state_changed
156 = 60 [(module) = "framework"];
Muhammad Qureshidbe9e812020-01-25 07:41:39 -0800157 CallStateChanged call_state_changed = 61 [(module) = "telecom"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800158 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
159 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
160 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800161 AppDied app_died = 65 [(module) = "framework"];
162 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
163 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800164 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
165 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800166 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
167 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800168 SpeakerImpedanceReported speaker_impedance_reported = 71;
169 HardwareFailed hardware_failed = 72;
170 PhysicalDropDetected physical_drop_detected = 73;
171 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800172 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
173 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800174 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700175 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800176 ANROccurred anr_occurred = 79 [(module) = "framework"];
177 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
178 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700179 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800180 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800181 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800182 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
183 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700184 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800185 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
186 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
187 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
188 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700189 BatteryHealthSnapshot battery_health_snapshot = 91;
190 SlowIo slow_io = 92;
191 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800192 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
193 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100194 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800195 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800196 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700197 // TODO: service state change is very noisy shortly after boot, as well
198 // as at other transitions - coming out of doze, device plugged in, etc.
199 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800200 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
201 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
202 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800203 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800205 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
206 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
207 105 [(module) = "docsui"];
208 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
209 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
210 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
211 108 [(module) = "docsui"];
212 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
213 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
214 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
215 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800216 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800217 WifiRunningStateChanged wifi_running_state_changed = 114
218 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800219 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800220 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800221 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800222 117 [(module) = "docsui"];
223 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
224 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
225 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
226 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800227 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
228 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
229 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800230 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
231 125 [(module) = "bluetooth"];
232 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
233 126 [(module) = "bluetooth"];
234 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
235 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800236 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000237 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800238 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
239 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
240 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800241 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800242 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
243 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
244 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
245 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
246 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
247 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800248 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
249 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800250 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
251 142 [(module) = "framework"];
252 AttentionManagerServiceResultReported attention_manager_service_result_reported =
253 143 [(module) = "framework"];
254 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800255 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800256 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800257 WatchdogRollbackOccurred watchdog_rollback_occurred =
258 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800259 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
260 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800261 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800262 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
263 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800264 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
265 151 [(module) = "bluetooth"];
266 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
267 152 [(module) = "bluetooth"];
268 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
269 153 [(module) = "bluetooth"];
270 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
271 154 [(module) = "bluetooth"];
272 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
273 155 [(module) = "bluetooth"];
274 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
275 156 [(module) = "bluetooth"];
276 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
277 157 [(module) = "bluetooth"];
278 BluetoothDeviceFailedContactCounterReported
279 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
280 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
281 159 [(module) = "bluetooth"];
282 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
283 160 [(module) = "bluetooth"];
284 BluetoothQualityReportReported bluetooth_quality_report_reported =
285 161 [(module) = "bluetooth"];
286 BluetoothDeviceInfoReported bluetooth_device_info_reported =
287 162 [(module) = "bluetooth"];
288 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
289 163 [(module) = "bluetooth"];
290 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
291 164 [(module) = "bluetooth"];
292 BluetoothBondStateChanged bluetooth_bond_state_changed =
293 165 [(module) = "bluetooth"];
294 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
295 166 [(module) = "bluetooth"];
296 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
297 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800298 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
299 168 [(module) = "framework"];
300 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700301 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800302 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800303 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800304 DeviceIdentifierAccessDenied device_identifier_access_denied =
305 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800306 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800307 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
308 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
309 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800310 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
311 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800312 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700313 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800314 180 [(module) = "permissioncontroller"];
315 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
316 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800317 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800318 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
319 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
320 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
321 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800322 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
323 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700324 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800325 188 [(module) = "intelligence"];
326 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
327 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800328 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800329 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800330 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
331 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
332 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
333 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
334 MediametricsCodecReported mediametrics_codec_reported = 195;
335 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
336 MediametricsExtractorReported mediametrics_extractor_reported = 197;
337 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
338 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
339 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700340 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800341 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
342 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800343 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800344 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
345 206 [(module) = "framework"];
346 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
347 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
348 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
349 LocationManagerApiUsageReported location_manager_api_usage_reported =
350 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100351 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800352 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100353 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800354 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100355 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800356 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100357 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800358 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100359 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800360 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100361 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100363 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100365 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800366 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800367 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
368 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
369 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
370 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800371 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800372 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700373 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
374 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800375 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100376 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800377 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800378 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800379 VmsClientConnectionStateChanged vms_client_connection_state_changed =
380 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800381 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
382 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700383 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800384 235 [(module) = "mediaprovider"];
385 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700386 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800387 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800388 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
389 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
390 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
391 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800392 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800393 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000394 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800395 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500396 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
397 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800398 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
399 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800400 CellBroadcastMessageReported cb_message_reported =
401 249 [(module) = "cellbroadcast"];
402 CellBroadcastMessageError cb_message_error =
403 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700404 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
405 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
406 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800407 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000408 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800409 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
410 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800411 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800412 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500413 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
414 RankingSelected ranking_selected = 260 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000415 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000416 }
David Chenc8a43242017-10-17 16:23:28 -0700417
David Chen6e3e6cb2018-01-03 16:14:06 -0800418 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700419 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700420 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800421 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
422 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
423 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
424 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
425 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
426 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700427 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800428 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700429 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800430 CpuTimePerUidFreq cpu_time_per_uid_freq =
431 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800432 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
433 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
434 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
435 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
436 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700437 SystemUptime system_uptime = 10015 [(module) = "framework", (module) = "statsdtest"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700438 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700439 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework", (module) = "statsdtest"];
440 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800441 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
442 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700443 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800444 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800445 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800446 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800447 DiskStats disk_stats = 10025 [(module) = "framework"];
448 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
449 AppSize app_size = 10027 [(module) = "framework"];
450 CategorySize category_size = 10028 [(module) = "framework"];
451 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800452 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800453 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
454 DiskIo disk_io = 10032 [(module) = "framework"];
455 PowerProfile power_profile = 10033 [(module) = "framework"];
456 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
457 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
458 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700459 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800460 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
461 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
462 10040 [(module) = "framework"];
463 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
464 10041 [(module) = "framework"];
465 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800466 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800467 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800468 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800469 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
470 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
471 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
472 RoleHolder role_holder = 10049 [(module) = "framework"];
473 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800474 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800475 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
476 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800477 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
478 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800479 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
480 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
481 FaceSettings face_settings = 10058 [(module) = "framework"];
482 CoolingDevice cooling_device = 10059 [(module) = "framework"];
483 AppOps app_ops = 10060 [(module) = "framework"];
484 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700485 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
486 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800487 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800488 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800489 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
490 DangerousPermissionStateSampled dangerous_permission_state_sampled =
491 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400492 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000493 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000494 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200495 PackageNotificationPreferences package_notification_preferences =
496 10071 [(module) = "framework"];
497 PackageNotificationChannelPreferences package_notification_channel_preferences =
498 10072 [(module) = "framework"];
499 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
500 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800501 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800502 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700503 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
504 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
505 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
506 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
David Chenc8a43242017-10-17 16:23:28 -0700507 }
yroa1fe77c2018-02-26 14:22:54 -0800508
Bookatz76aafcf2018-09-17 16:17:10 -0700509 // DO NOT USE field numbers above 100,000 in AOSP.
510 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
511 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100512
513 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700514}
515
Yao Chend54f9dd2017-10-17 17:37:48 +0000516/**
Yangster-mac20877162017-12-22 17:19:39 -0800517 * This proto represents a node of an attribution chain.
518 * Note: All attribution chains are represented as a repeated field of type
519 * AttributionNode. It is understood that in such arrays, the order is that
520 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000521 */
Yangster-mac20877162017-12-22 17:19:39 -0800522message AttributionNode {
523 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800524 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800525
Yangster-mac20877162017-12-22 17:19:39 -0800526 // The (optional) string tag for an element in the attribution chain. If the
527 // element has no tag, it is encoded as an empty string.
528 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700529}
530
Yangster-mac48b3d622018-08-18 12:38:11 -0700531message KeyValuePair {
532 optional int32 key = 1;
533 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700534 int32 value_int = 2;
535 int64 value_long = 3;
536 string value_str = 4;
537 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700538 }
539}
540
541message KeyValuePairsAtom {
542 optional int32 uid = 1;
543 repeated KeyValuePair pairs = 2;
544}
545
Yao Chend54f9dd2017-10-17 17:37:48 +0000546/*
547 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800548 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000549 *
550 * RULES:
551 * - The field ids for each atom must start at 1, and count upwards by 1.
552 * Skipping field ids is not allowed.
553 * - These form an API, so renaming, renumbering or removing fields is
554 * not allowed between android releases. (This is not currently enforced,
555 * but there will be a tool to enforce this restriction).
556 * - The types must be built-in protocol buffer types, namely, no sub-messages
557 * are allowed (yet). The bytes type is also not allowed.
558 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800559 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000560 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800561 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000562 * - A field that is a uid should be a string field, tagged with the [xxx]
563 * annotation. The generated code on android will be represented by UIDs,
564 * and those UIDs will be translated in xxx to those strings.
565 *
566 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700567 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000568 * - If there is a UID, it goes first. Think in an object-oriented fashion.
569 * *****************************************************************************
570 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700571
Yao Chend54f9dd2017-10-17 17:37:48 +0000572/**
Tej Singha72344992019-04-17 18:55:08 -0700573 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700574 * Logs when the Thermal service HAL notifies the throttling start/stop events.
575 *
576 * Logged from:
577 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
578 */
579message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700580 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700581 optional android.os.TemperatureTypeEnum sensor_type = 1;
582
Maggie White442b6312019-04-05 16:26:44 -0700583 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700584 enum State {
585 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700586 START = 1; // START indicated that throttling was triggered.
587 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700588 }
Yangster-mace16189a2018-08-26 12:20:16 -0700589 optional State state = 2;
590
591 optional float temperature = 3;
592}
593
594/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000595 * Logs when the screen state changes.
596 *
597 * Logged from:
598 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
599 */
600message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800601 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800602 optional android.view.DisplayStateEnum state = 1
603 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700604}
Yao Chend54f9dd2017-10-17 17:37:48 +0000605
606/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700607 * Logs that the process state of the uid, as determined by ActivityManager
608 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000609 *
610 * Logged from:
611 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
612 */
Bookatzc1a050a2017-10-10 15:49:28 -0700613message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800614 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000615
Bookatzdb026a22018-01-10 19:01:56 -0800616 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800617 optional android.app.ProcessStateEnum state = 2
618 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000619}
620
621/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700622 * Logs process state change of a process, as per the activity manager.
623 *
624 * Logged from:
625 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
626 */
627message ProcessStateChanged {
628 optional int32 uid = 1;
629 optional string process_name = 2;
630 optional string package_name = 3;
631 // TODO: remove this when validation is done
632 optional int64 version = 5;
633 // The state, from frameworks/base/core/proto/android/app/enums.proto.
634 optional android.app.ProcessStateEnum state = 4;
635}
636
637/**
638 * Logs when ActivityManagerService sleep state is changed.
639 *
640 * Logged from:
641 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
642 */
643message ActivityManagerSleepStateChanged {
644 // TODO: import frameworks proto
645 enum State {
646 UNKNOWN = 0;
647 ASLEEP = 1;
648 AWAKE = 2;
649 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800650 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700651}
652
653/**
654 * Logs when system memory state changes.
655 *
656 * Logged from:
657 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
658 */
659message MemoryFactorStateChanged {
660 // TODO: import frameworks proto
661 enum State {
662 MEMORY_UNKNOWN = 0;
663 NORMAL = 1; // normal.
664 MODERATE = 2; // moderate memory pressure.
665 LOW = 3; // low memory.
666 CRITICAL = 4; // critical memory.
667
668 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800669 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700670}
671
672/**
673 * Logs when app is using too much cpu, according to ActivityManagerService.
674 *
675 * Logged from:
676 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
677 */
678message ExcessiveCpuUsageReported {
679 optional int32 uid = 1;
680 optional string process_name = 2;
681 optional string package_name = 3;
682 // package version. TODO: remove this when validation is done
683 optional int64 version = 4;
684}
685
686/**
687 * Logs when a cached process is killed, along with its pss.
688 *
689 * Logged from:
690 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
691 */
692message CachedKillReported {
693 optional int32 uid = 1;
694 optional string process_name = 2;
695 optional string package_name = 3;
696 // TODO: remove this when validation is done
697 optional int64 version = 5;
698 optional int64 pss = 4;
699}
700
701/**
xshu2c3d9e42019-09-26 17:54:02 -0700702 * Logs the change in wifi health.
703 *
704 * Logged from:
705 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
706 */
707message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800708 enum Band {
709 UNKNOWN = 0;
710 // All of 2.4GHz band
711 BAND_2G = 1;
712 // Frequencies in the range of [5150, 5250) GHz
713 BAND_5G_LOW = 2;
714 // Frequencies in the range of [5250, 5725) GHz
715 BAND_5G_MIDDLE = 3;
716 // Frequencies in the range of [5725, 5850) GHz
717 BAND_5G_HIGH = 4;
718 // Frequencies in the range of [5925, 6425) GHz
719 BAND_6G_LOW = 5;
720 // Frequencies in the range of [6425, 6875) GHz
721 BAND_6G_MIDDLE = 6;
722 // Frequencies in the range of [6875, 7125) GHz
723 BAND_6G_HIGH = 7;
724 }
xshu2c3d9e42019-09-26 17:54:02 -0700725 // duration this stat is obtained over in milliseconds
726 optional int32 duration_millis = 1;
727 // whether wifi is classified as sufficient for the user's data traffic, determined
728 // by whether the calculated throughput exceeds the average demand within |duration_millis|
729 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700730 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800731 optional bool is_cell_data_available = 3;
732 // the Band bucket the connected network is on
733 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700734}
735
736/**
737 * Logged when wifi detects a significant change in connection failure rate.
738 *
739 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
740 *
741 */
742message WifiFailureStatReported {
743 enum AbnormalityType {
744 UNKNOWN = 0;
745 SIGNIFICANT_INCREASE = 1;
746 SIGNIFICANT_DECREASE = 2;
747 SIMPLY_HIGH = 3;
748 }
749 enum FailureType {
750 FAILURE_UNKNOWN = 0;
751 FAILURE_CONNECTION = 1;
752 FAILURE_ASSOCIATION_REJECTION = 2;
753 FAILURE_ASSOCIATION_TIMEOUT = 3;
754 FAILURE_AUTHENTICATION = 4;
755 FAILURE_NON_LOCAL_DISCONNECTION = 5;
756 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
757 }
758 // Reason for uploading this stat
759 optional AbnormalityType abnormality_type = 1;
760 // The particular type of failure
761 optional FailureType failure_type = 2;
762 // How many times we have encountered this combination of AbnormalityType and FailureType
763 optional int32 failure_count = 3;
764}
765
766/**
767 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
768 *
769 * Logged from:
770 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
771 */
772message WifiConnectionResultReported {
773 enum FailureCode {
774 FAILURE_UNKNOWN = 0;
775 FAILURE_ASSOCIATION_TIMEOUT = 1;
776 FAILURE_ASSOCIATION_REJECTION = 2;
777 FAILURE_AUTHENTICATION_GENERAL = 3;
778 FAILURE_AUTHENTICATION_EAP = 4;
779 FAILURE_DHCP = 5;
780 FAILURE_NETWORK_DISCONNECTION = 6;
781 FAILURE_ROAM_TIMEOUT = 7;
782 }
783 // true represents a successful connection
784 optional bool connection_result = 1;
785 // reason for the connection failure
786 optional FailureCode failure_code = 2;
787 // scan rssi before the connection attempt
788 optional int32 rssi = 3;
789}
790
791/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700792 * Logs when memory stats of a process is reported.
793 *
794 * Logged from:
795 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
796 */
797message ProcessMemoryStatReported {
798 optional int32 uid = 1;
799 optional string process_name = 2;
800 optional string package_name = 3;
801 //TODO: remove this when validation is done
802 optional int64 version = 9;
803 optional int64 pss = 4;
804 optional int64 uss = 5;
805 optional int64 rss = 6;
806 enum Type {
807 ADD_PSS_INTERNAL_SINGLE = 0;
808 ADD_PSS_INTERNAL_ALL_MEM = 1;
809 ADD_PSS_INTERNAL_ALL_POLL = 2;
810 ADD_PSS_EXTERNAL = 3;
811 ADD_PSS_EXTERNAL_SLOW = 4;
812 }
813 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800814 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700815}
816
817/**
Bookatzc1a050a2017-10-10 15:49:28 -0700818 * Logs that a process started, finished, crashed, or ANRed.
819 *
820 * Logged from:
821 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
822 */
823message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700824 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700825
David Chen0b5c90c2018-01-25 16:51:49 -0800826 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800827 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700828
Bookatzddccf0a2017-11-28 16:48:14 -0800829 // What lifecycle state the process changed to.
830 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800831 enum State {
832 FINISHED = 0;
833 STARTED = 1;
834 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800835 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800836 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700837}
838
Bookatzc1a050a2017-10-10 15:49:28 -0700839/**
840 * Logs when the ble scan state changes.
841 *
842 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700843 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700844 */
845message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800846 repeated AttributionNode attribution_node = 1
847 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700848
849 enum State {
850 OFF = 0;
851 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700852 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
853 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700854 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800855 optional State state = 2 [
856 (state_field_option).option = EXCLUSIVE_STATE,
857 (state_field_option).default_state_value = 0 /* State.OFF */,
858 (state_field_option).reset_state_value = 2 /* State.RESET */,
859 (state_field_option).nested = true
860 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700861
Bookatze5ec0b42018-03-26 13:34:56 -0700862 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800863 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700864 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800865 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700866 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800867 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700868}
869
870/**
871 * Logs reporting of a ble scan finding results.
872 *
873 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700874 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700875 */
Bookatzae6738e2018-09-13 11:38:56 -0700876// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700877message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800878 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700879
880 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800881 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700882}
883
884/**
885 * Logs when a sensor state changes.
886 *
887 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700888 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700889 */
890message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800891 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700892
Bookatzc1a050a2017-10-10 15:49:28 -0700893 // The id (int) of the sensor.
894 optional int32 sensor_id = 2;
895
896 enum State {
897 OFF = 0;
898 ON = 1;
899 }
900 optional State state = 3;
901}
902
Bookatzc1a050a2017-10-10 15:49:28 -0700903/**
904 * Logs when GPS state changes.
905 *
906 * Logged from:
907 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
908 */
909message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800910 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700911
912 enum State {
913 OFF = 0;
914 ON = 1;
915 }
916 optional State state = 2;
917}
918
Bookatz48d362e2018-11-06 15:49:08 -0800919/**
920 * Logs when GPS signal quality.
921 *
922 * Logged from:
923 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
924 */
925message GpsSignalQualityChanged {
926 optional android.server.location.GpsSignalQualityEnum level = 1;
927}
928
Bookatzc1a050a2017-10-10 15:49:28 -0700929
930/**
931 * Logs when a sync manager sync state changes.
932 *
933 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700934 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700935 */
936message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800937 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700938
David Chen0b5c90c2018-01-25 16:51:49 -0800939 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800940 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700941
942 enum State {
943 OFF = 0;
944 ON = 1;
945 }
946 optional State state = 3;
947}
948
Yangster-mac96353002018-09-05 11:18:55 -0700949/*
950 * Deferred job stats.
951 *
952 * Logged from:
953 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
954*/
955message DeferredJobStatsReported {
956 repeated AttributionNode attribution_node = 1;
957
958 // Number of jobs deferred.
959 optional int32 num_jobs_deferred = 2;
960
961 // Time since the last job runs.
962 optional int64 time_since_last_job_millis = 3;
963}
964
Bookatzc1a050a2017-10-10 15:49:28 -0700965/**
966 * Logs when a job scheduler job state changes.
967 *
968 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700969 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700970 */
971message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800972 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700973
974 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800975 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700976
977 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800978 FINISHED = 0;
979 STARTED = 1;
980 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700981 }
982 optional State state = 3;
983
Tej Singh33a412b2018-03-16 18:43:59 -0700984 // The reason a job has stopped.
985 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700986 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700987 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100988
989 // The standby bucket of the app that scheduled the job. These match the framework constants
990 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
991 // already assigned 0.
992 enum Bucket {
993 UNKNOWN = -1;
994 ACTIVE = 0;
995 WORKING_SET = 1;
996 FREQUENT = 2;
997 RARE = 3;
998 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800999 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001000 }
1001 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1002
1003 // The job id (as assigned by the app).
1004 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001005
1006 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1007 // constraints as they are always assumed to be set.
1008 optional bool has_charging_constraint = 7;
1009 optional bool has_battery_not_low_constraint = 8;
1010 optional bool has_storage_not_low_constraint = 9;
1011 optional bool has_timing_delay_constraint = 10;
1012 optional bool has_deadline_constraint = 11;
1013 optional bool has_idle_constraint = 12;
1014 optional bool has_connectivity_constraint = 13;
1015 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001016}
1017
1018/**
1019 * Logs when the audio state changes.
1020 *
1021 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001022 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001023 */
1024message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001025 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001026
1027 enum State {
1028 OFF = 0;
1029 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001030 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1031 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001032 }
1033 optional State state = 2;
1034}
1035
1036/**
1037 * Logs when the video codec state changes.
1038 *
1039 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001040 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001041 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001042message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001043 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001044
1045 enum State {
1046 OFF = 0;
1047 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001048 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1049 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001050 }
1051 optional State state = 2;
1052}
1053
1054/**
1055 * Logs when the flashlight state changes.
1056 *
1057 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001058 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001059 */
1060message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001061 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001062
1063 enum State {
1064 OFF = 0;
1065 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001066 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1067 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001068 }
1069 optional State state = 2;
1070}
1071
1072/**
1073 * Logs when the camera state changes.
1074 *
1075 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001076 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001077 */
1078message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001079 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001080
1081 enum State {
1082 OFF = 0;
1083 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001084 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1085 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001086 }
1087 optional State state = 2;
1088}
1089
1090/**
1091 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001092 *
1093 * Logged from:
1094 * TODO
1095 */
Bookatzd6746242017-10-24 18:39:35 -07001096message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001097 repeated AttributionNode attribution_node = 1
1098 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001099
Bookatz1a1b0462018-01-12 11:47:03 -08001100 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1101 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001102 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001103 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001104
1105 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001106 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001107
1108 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001109 RELEASE = 0;
1110 ACQUIRE = 1;
1111 CHANGE_RELEASE = 2;
1112 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001113 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001114 optional State state = 4 [
1115 (state_field_option).option = EXCLUSIVE_STATE,
1116 (state_field_option).default_state_value = 0,
1117 (state_field_option).nested = true
1118 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001119}
1120
1121/**
Bookatzc1a050a2017-10-10 15:49:28 -07001122 * Logs when a partial wakelock is considered 'long' (over 1 min).
1123 *
1124 * Logged from:
1125 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1126 */
1127message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001128 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001129
Yao Chend54f9dd2017-10-17 17:37:48 +00001130 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1131 optional string tag = 2;
1132
Bookatzc1a050a2017-10-10 15:49:28 -07001133 // TODO: I have no idea what this is.
1134 optional string history_tag = 3;
1135
1136 enum State {
1137 OFF = 0;
1138 ON = 1;
1139 }
1140 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001141}
1142
Bookatzc1a050a2017-10-10 15:49:28 -07001143/**
Bookatza66083f2018-09-20 17:24:00 -07001144 * Logs when the device is interactive, according to the PowerManager Notifier.
1145 *
1146 * Logged from:
1147 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1148 */
1149message InteractiveStateChanged {
1150 enum State {
1151 OFF = 0;
1152 ON = 1;
1153 }
1154 optional State state = 1;
1155}
1156
1157/**
Bookatzc1a050a2017-10-10 15:49:28 -07001158 * Logs Battery Saver state change.
1159 *
1160 * Logged from:
1161 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1162 */
1163message BatterySaverModeStateChanged {
1164 enum State {
1165 OFF = 0;
1166 ON = 1;
1167 }
1168 optional State state = 1;
1169}
1170
1171/**
1172 * Logs Doze mode state change.
1173 *
1174 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001175 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001176 */
1177message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001178 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001179}
1180
1181
1182/**
1183 * Logs state change of Doze mode including maintenance windows.
1184 *
1185 * Logged from:
1186 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1187 */
1188message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001189 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001190}
1191
1192/**
1193 * Logs screen brightness level.
1194 *
1195 * Logged from:
1196 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1197 */
1198message ScreenBrightnessChanged {
1199 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1200 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001201}
1202
1203/**
1204 * Logs battery level (percent full, from 0 to 100).
1205 *
1206 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001207 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001208 */
1209message BatteryLevelChanged {
1210 // Battery level. Should be in [0, 100].
1211 optional int32 battery_level = 1;
1212}
1213
1214/**
1215 * Logs change in charging status of the device.
1216 *
1217 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001218 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001219 */
1220message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001221 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1222 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001223}
1224
1225/**
1226 * Logs whether the device is plugged in, and what power source it is using.
1227 *
1228 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001229 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001230 */
1231message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001232 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1233 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001234}
1235
Bookatz8c6571b2017-10-24 15:04:41 -07001236/**
1237 * Logs when an app's wakeup alarm fires.
1238 *
1239 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001240 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001241 */
1242message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001243 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001244
1245 // Name of the wakeup alarm.
1246 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001247
1248 // Name of source package (for historical reasons, since BatteryStats tracked it).
1249 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001250
Ben Murdoch3389f1522019-05-21 15:05:34 +01001251 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001252 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001253}
1254
1255/**
1256 * Logs when an an app causes the mobile radio to change state.
1257 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1258 *
1259 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001260 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001261 */
1262message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001263 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001264
Bookatz1a1b0462018-01-12 11:47:03 -08001265 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1266 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001267}
1268
1269/**
1270 * Logs when an an app causes the wifi radio to change state.
1271 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1272 *
1273 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001274 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001275 */
1276message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001277 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001278
Bookatz1a1b0462018-01-12 11:47:03 -08001279 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1280 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001281}
1282
1283/**
1284 * Logs kernel wakeup reasons and aborts.
1285 *
1286 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001287 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001288 */
1289message KernelWakeupReported {
1290 // Name of the kernel wakeup reason (or abort).
1291 optional string wakeup_reason_name = 1;
1292
1293 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001294 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001295}
1296
1297/**
Bookatzda1798c2018-12-13 14:16:00 -08001298 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001299 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001300 *
1301 * Logged from:
1302 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1303 */
1304message WifiEnabledStateChanged {
1305 enum State {
1306 OFF = 0;
1307 ON = 1;
1308 }
1309 optional State state = 1;
1310}
1311
1312/**
tsaichristinececebdc2020-02-04 14:05:56 -08001313 * This atom is deprecated starting in R.
1314 *
Bookatzda1798c2018-12-13 14:16:00 -08001315 * 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 -08001316 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1317 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001318 *
1319 * Logged from:
1320 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1321 */
1322message WifiRunningStateChanged {
1323 repeated AttributionNode attribution_node = 1;
1324
1325 enum State {
1326 OFF = 0;
1327 ON = 1;
1328 }
1329 optional State state = 2;
1330}
1331
1332/**
Bookatze5885242017-10-24 20:10:31 -07001333 * Logs wifi locks held by an app.
1334 *
1335 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001336 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001337 */
1338message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001339 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001340
1341 enum State {
1342 OFF = 0;
1343 ON = 1;
1344 }
1345 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001346
1347 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1348 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001349}
1350
1351/**
1352 * Logs wifi signal strength changes.
1353 *
1354 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001355 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001356 */
1357message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001358 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1359 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001360}
1361
1362/**
1363 * Logs wifi scans performed by an app.
1364 *
1365 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001366 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001367 */
1368message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001369 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001370
1371 enum State {
1372 OFF = 0;
1373 ON = 1;
1374 }
1375 optional State state = 2;
1376}
1377
1378/**
Tej Singh4503e102018-01-04 14:35:01 -08001379 * Logs wifi multicast locks held by an app
1380 *
1381 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001382 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001383 */
1384message WifiMulticastLockStateChanged {
1385 repeated AttributionNode attribution_node = 1;
1386
1387 enum State {
1388 OFF = 0;
1389 ON = 1;
1390 }
1391 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001392
1393 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001394}
1395
1396/**
Tej Singh1ea42892018-01-19 09:27:00 -08001397 * Logs shutdown reason and duration on next boot.
1398 *
1399 * Logged from:
1400 * frameworks/base/core/java/com/android/server/BootReceiver.java
1401 */
1402message ShutdownSequenceReported {
1403 // True if shutdown is for a reboot. Default: false if we do not know.
1404 optional bool reboot = 1;
1405
1406 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1407 optional string reason = 2;
1408
1409 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1410 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001411 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001412
1413 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001414 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001415}
1416
Tej Singh6483ea42018-01-25 17:45:49 -08001417
1418/**
1419 * Logs boot reason and duration.
1420 *
1421 * Logged from:
1422 * system/core/bootstat/bootstat.cpp
1423 */
1424message BootSequenceReported {
1425 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1426 // Default: "<EMPTY>" if not available.
1427 optional string bootloader_reason = 1;
1428
1429 // Reason for system boot. Eg. bootloader, reboot,userrequested
1430 // Default: "<EMPTY>" if not available.
1431 optional string system_reason = 2;
1432
1433 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001434 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001435
1436 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001437 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001438
1439 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001440 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001441
1442 // Time since last boot in ms. Default: 0 if not available.
1443 optional int64 time_since_last_boot = 6;
1444}
1445
Tej Singhc477d9c2018-02-05 18:31:39 -08001446
1447/**
1448 * Logs call state and disconnect cause (if applicable).
1449 *
1450 * Logged from:
1451 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1452 */
1453message CallStateChanged {
1454 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1455 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1456 optional android.telecom.CallStateEnum call_state = 1;
1457
1458 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1459 // This value is only applicable when the call_state is DISCONNECTED, and
1460 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1461 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1462 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1463
1464 // True if the call is self-managed, which are apps that use the
1465 // telecom infrastructure to make their own calls.
1466 optional bool self_managed = 3;
1467
1468 // True if call is external. External calls are calls on connected Wear
1469 // devices but show up in Telecom so the user can pull them onto the device.
1470 optional bool external_call = 4;
1471}
1472
Tej Singh1ea42892018-01-19 09:27:00 -08001473/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001474 * Logs keyguard state. The keyguard is the lock screen.
1475 *
1476 * Logged from:
1477 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1478 */
1479message KeyguardStateChanged {
1480 enum State {
1481 UNKNOWN = 0;
1482 // The keyguard is hidden when the phone is unlocked.
1483 HIDDEN = 1;
1484 // The keyguard is shown when the phone is locked (screen turns off).
1485 SHOWN= 2;
1486 // The keyguard is occluded when something is overlaying the keyguard.
1487 // Eg. Opening the camera while on the lock screen.
1488 OCCLUDED = 3;
1489 }
1490 optional State state = 1;
1491}
1492
1493/**
1494 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1495 * prompts the user to enter a password (pattern, pin, etc).
1496 *
1497 * Logged from:
1498 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1499 */
1500
1501message KeyguardBouncerStateChanged {
1502 enum State {
1503 UNKNOWN = 0;
1504 // Bouncer is hidden, either as a result of successfully entering the
1505 // password, screen timing out, or user going back to lock screen.
1506 HIDDEN = 1;
1507 // This is when the user is being prompted to enter the password.
1508 SHOWN = 2;
1509 }
1510 optional State state = 1;
1511}
1512
1513/**
1514 * Logs the result of entering a password into the keyguard bouncer.
1515 *
1516 * Logged from:
1517 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1518 */
1519message KeyguardBouncerPasswordEntered {
1520 enum BouncerResult {
1521 UNKNOWN = 0;
1522 // The password entered was incorrect.
1523 FAILURE = 1;
1524 // The password entered was correct.
1525 SUCCESS = 2;
1526 }
1527 optional BouncerResult result = 1;
1528}
1529
Tej Singha883b372018-02-15 11:30:01 -08001530/*
1531 * Logs changes to the configuration of the device. The configuration is defined
1532 * in frameworks/base/core/java/android/content/res/Configuration.java
1533 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1534 * Please go there to interpret the possible values each field can be.
1535 *
1536 * Logged from:
1537 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1538 */
1539message ResourceConfigurationChanged {
1540 // Bit mask of color capabilities of the screen.
1541 // Contains information about the color gamut and hdr mode of the screen.
1542 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001543 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001544
1545 // The target screen density being rendered to.
1546 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001547 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001548
1549 // Current user preference for the scaling factor for fonts,
1550 // relative to the base density scaling.
1551 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001552 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001553
1554 // Flag indicating whether the hard keyboard is hidden.
1555 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001556 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001557
1558 // The type of keyboard attached to the device.
1559 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1560 optional int32 keyboard = 5;
1561
1562 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1563 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001564 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001565
1566 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1567 // 0 if undefined.
1568 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1569 optional int32 mcc = 7;
1570
1571 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1572 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1573 // MNC_ZERO symbol defined in Configuration.java.
1574 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1575 optional int32 mnc = 8;
1576
1577 // The kind of navigation available on the device.
1578 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1579 optional int32 navigation = 9;
1580
1581 // Flag indicating whether the navigation is available.
1582 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001583 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001584
1585 // Overall orientation of the screen.
1586 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1587 optional int32 orientation = 11;
1588
1589 // The current height of the available screen space, in dp units.
1590 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001591 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001592
1593 // Bit mask of overall layout of the screen.
1594 // Contains information about screen size, whether the screen is wider/taller
1595 // than normal, whether the screen layout is right-tl-left or left-to-right,
1596 // and whether the screen has a rounded shape.
1597 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001598 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001599
1600 // Current width of the available screen space, in dp units.
1601 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001602 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001603
1604 // The smallest screen size an application will see in normal operation.
1605 // This is the smallest value of both screenWidthDp and screenHeightDp
1606 // in portrait and landscape.
1607 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001608 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001609
1610 // The type of touch screen attached to the device.
1611 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1612 optional int32 touchscreen = 16;
1613
1614 // Bit mask of the ui mode.
1615 // Contains information about the overall ui mode of the device.
1616 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1617 // Also contains information about whether the device is in night mode.
1618 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001619 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001620}
1621
Tej Singheee317b2018-03-07 19:28:05 -08001622
1623/**
1624 * Logs changes in the connection state of the mobile radio.
1625 *
1626 * Logged from:
1627 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1628 */
1629message MobileConnectionStateChanged {
1630 // States are from the state machine DataConnection.java.
1631 enum State {
1632 UNKNOWN = 0;
1633 // The connection is inactive, or disconnected.
1634 INACTIVE = 1;
1635 // The connection is being activated, or connecting.
1636 ACTIVATING = 2;
1637 // The connection is active, or connected.
1638 ACTIVE = 3;
1639 // The connection is disconnecting.
1640 DISCONNECTING = 4;
1641 // The connection is disconnecting after creating a connection.
1642 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1643 }
1644 optional State state = 1;
1645 // For multi-sim phones, this distinguishes between the sim cards.
1646 optional int32 sim_slot_index = 2;
1647 // Used to identify the connection. Starts at 0 and increments by 1 for
1648 // every new network created. Resets whenever the device reboots.
1649 optional int32 data_connection_id = 3;
1650 // A bitmask for the capabilities of this connection.
1651 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1652 // Default value (if we have no information): 0
1653 optional int64 capabilities = 4;
1654 // If this connection has internet.
1655 // This just checks if the DEFAULT bit of capabilities is set.
1656 optional bool has_internet = 5;
1657}
1658
1659/**
1660 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1661 *
1662 * Logged from:
1663 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1664 */
1665message MobileRadioTechnologyChanged {
1666 optional android.telephony.NetworkTypeEnum state = 1;
1667 // For multi-sim phones, this distinguishes between the sim cards.
1668 optional int32 sim_slot_index = 2;
1669}
1670
Andrew Chantb56388b2018-03-22 21:07:33 -07001671/**
1672 * Logs the VID and PID of any connected USB devices.
1673 *
1674 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1675 *
1676 * Logged by Vendor.
1677 */
1678message UsbDeviceAttached {
1679 optional int32 vid = 1;
1680 optional int32 pid = 2;
1681 optional bool has_audio = 3;
1682 optional bool has_hid = 4;
1683 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001684 enum State {
1685 STATE_DISCONNECTED = 0;
1686 STATE_CONNECTED = 1;
1687 }
1688 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001689 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001690}
1691
Tej Singheee317b2018-03-07 19:28:05 -08001692
Tej Singhdd7bd352018-02-09 19:33:15 -08001693/**
Tej Singh5d991e12018-03-09 19:48:11 -08001694 * Logs when Bluetooth is enabled and disabled.
1695 *
1696 * Logged from:
1697 * services/core/java/com/android/server/BluetoothManagerService.java
1698 */
1699message BluetoothEnabledStateChanged {
1700 repeated AttributionNode attribution_node = 1;
1701 // Whether or not bluetooth is enabled on the device.
1702 enum State {
1703 UNKNOWN = 0;
1704 ENABLED = 1;
1705 DISABLED = 2;
1706 }
1707 optional State state = 2;
1708 // The reason for being enabled/disabled.
1709 // Eg. Airplane mode, crash, application request.
1710 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1711 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001712 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001713}
1714
1715/**
Jack Hed9837c82019-01-09 01:19:13 -08001716 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001717 *
1718 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001719 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1720 *
1721 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001722 */
1723message BluetoothConnectionStateChanged {
1724 // The state of the connection.
1725 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1726 optional android.bluetooth.ConnectionStateEnum state = 1;
1727 // An identifier that can be used to match connect and disconnect events.
1728 // Currently is last two bytes of a hash of a device level ID and
1729 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001730 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001731 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001732 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1733 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001734 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001735 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001736 // An identifier that can be used to match events for this device.
1737 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1738 // Salt: Randomly generated 256 bit value
1739 // Hash algorithm: HMAC-SHA256
1740 // Size: 32 byte
1741 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001742 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001743}
1744
1745/**
1746 * Logs when a Bluetooth device connects and disconnects over ACL
1747 *
1748 * Logged from:
1749 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1750 *
1751 * Next Tag: 3
1752 */
1753message BluetoothAclConnectionStateChanged {
1754 // An identifier that can be used to match events for this device.
1755 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1756 // Salt: Randomly generated 256 bit value
1757 // Hash algorithm: HMAC-SHA256
1758 // Size: 32 byte
1759 // Default: null or empty if the device identifier is not known
1760 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1761 // The state of the connection.
1762 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1763 optional android.bluetooth.ConnectionStateEnum state = 2;
1764}
1765
1766/**
1767 * Logs when a Bluetooth device connects and disconnects over SCO
1768 *
1769 * Logged from:
1770 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1771 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1772 *
1773 * Next Tag: 4
1774 */
1775message BluetoothScoConnectionStateChanged {
1776 // An identifier that can be used to match events for this device.
1777 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1778 // Salt: Randomly generated 256 bit value
1779 // Hash algorithm: HMAC-SHA256
1780 // Size: 32 byte
1781 // Default: null or empty if the device identifier is not known
1782 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1783 // The state of the connection.
1784 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1785 optional android.bluetooth.ConnectionStateEnum state = 2;
1786 // Codec used for this SCO connection
1787 // Default: UNKNOWN
1788 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001789}
1790
Jack Hec27040a2019-01-09 20:54:41 -08001791/**
1792 * Logged when active device of a profile changes
1793 *
1794 * Logged from:
1795 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1796 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1797 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1798 */
1799message BluetoothActiveDeviceChanged {
1800 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1801 // From android.bluetooth.BluetoothProfile
1802 optional int32 bt_profile = 1;
1803 // An identifier that can be used to match events for this new active device.
1804 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1805 // Salt: Randomly generated 256 bit value
1806 // Hash algorithm: HMAC-SHA256
1807 // Size: 32 byte
1808 // Default: null or empty if there is no active device for this profile
1809 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1810}
1811
Jack Heab86dbd22018-12-18 15:43:27 -08001812// Logs when there is an event affecting Bluetooth device's link layer connection.
1813// - This event is triggered when there is a related HCI command or event
1814// - Users of this metrics can deduce Bluetooth device's connection state from these events
1815// - HCI commands are logged before the command is sent, after receiving command status, and after
1816// receiving command complete
1817// - HCI events are logged when they arrive
1818//
1819// Low level log from system/bt
1820//
1821// Bluetooth classic commands:
1822// - CMD_CREATE_CONNECTION
1823// - CMD_DISCONNECT
1824// - CMD_CREATE_CONNECTION_CANCEL
1825// - CMD_ACCEPT_CONNECTION_REQUEST
1826// - CMD_REJECT_CONNECTION_REQUEST
1827// - CMD_SETUP_ESCO_CONNECTION
1828// - CMD_ACCEPT_ESCO_CONNECTION
1829// - CMD_REJECT_ESCO_CONNECTION
1830// - CMD_ENH_SETUP_ESCO_CONNECTION
1831// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1832//
1833// Bluetooth low energy commands:
1834// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1835// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1836// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1837// - CMD_BLE_CLEAR_WHITE_LIST
1838// - CMD_BLE_ADD_WHITE_LIST
1839// - CMD_BLE_REMOVE_WHITE_LIST
1840//
1841// Bluetooth classic events:
1842// - EVT_CONNECTION_COMP
1843// - EVT_CONNECTION_REQUEST
1844// - EVT_DISCONNECTION_COMP
1845// - EVT_ESCO_CONNECTION_COMP
1846// - EVT_ESCO_CONNECTION_CHANGED
1847//
1848// Bluetooth low energy meta events:
1849// - BLE_EVT_CONN_COMPLETE_EVT
1850// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1851//
1852// Next tag: 10
1853message BluetoothLinkLayerConnectionEvent {
1854 // An identifier that can be used to match events for this device.
1855 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1856 // Salt: Randomly generated 256 bit value
1857 // Hash algorithm: HMAC-SHA256
1858 // Size: 32 byte
1859 // Default: null or empty if the device identifier is not known
1860 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1861 // Connection handle of this connection if available
1862 // Range: 0x0000 - 0x0EFF (12 bits)
1863 // Default: 0xFFFF if the handle is unknown
1864 optional int32 connection_handle = 2;
1865 // Direction of the link
1866 // Default: DIRECTION_UNKNOWN
1867 optional android.bluetooth.DirectionEnum direction = 3;
1868 // Type of this link
1869 // Default: LINK_TYPE_UNKNOWN
1870 optional android.bluetooth.LinkTypeEnum type = 4;
1871
1872 // Reason metadata for this link layer connection event, rules for interpretation:
1873 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1874 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1875 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1876 // set and valid, ignore hci_ble_event
1877
1878 // HCI command associated with this event
1879 // Default: CMD_UNKNOWN
1880 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1881 // HCI event associated with this event
1882 // Default: EVT_UNKNOWN
1883 optional android.bluetooth.hci.EventEnum hci_event = 6;
1884 // HCI BLE meta event associated with this event
1885 // Default: BLE_EVT_UNKNOWN
1886 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1887 // HCI command status code if this is triggerred by hci_cmd
1888 // Default: STATUS_UNKNOWN
1889 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1890 // HCI reason code associated with this event
1891 // Default: STATUS_UNKNOWN
1892 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1893}
1894
Howard Roe103fe22019-01-17 16:52:16 -08001895/**
1896 * Logs when a module is rolled back by Watchdog.
1897 *
1898 * Logged from: Rollback Manager
1899 */
1900message WatchdogRollbackOccurred {
1901 enum RollbackType {
1902 UNKNOWN = 0;
1903 ROLLBACK_INITIATE = 1;
1904 ROLLBACK_SUCCESS = 2;
1905 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001906 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001907 }
1908 optional RollbackType rollback_type = 1;
1909
1910 optional string package_name = 2;
1911
1912 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001913
1914 enum RollbackReasonType {
1915 REASON_UNKNOWN = 0;
1916 REASON_NATIVE_CRASH = 1;
1917 REASON_EXPLICIT_HEALTH_CHECK = 2;
1918 REASON_APP_CRASH = 3;
1919 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001920 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001921 }
1922 optional RollbackReasonType rollback_reason = 4;
1923
1924 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1925 // is initiated. Empty if the package is unknown.
1926 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001927
1928 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001929}
1930
Jack Hec27040a2019-01-09 20:54:41 -08001931/**
1932 * Logs when there is a change in Bluetooth A2DP playback state
1933 *
1934 * Logged from:
1935 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1936 */
1937message BluetoothA2dpPlaybackStateChanged {
1938 // An identifier that can be used to match events for this device.
1939 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1940 // Salt: Randomly generated 256 bit value
1941 // Hash algorithm: HMAC-SHA256
1942 // Size: 32 byte
1943 // Default: null or empty if the device identifier is not known
1944 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1945 // Current playback state
1946 // Default: PLAYBACK_STATE_UNKNOWN
1947 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1948 // Current audio coding mode
1949 // Default: AUDIO_CODING_MODE_UNKNOWN
1950 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1951}
1952
1953/**
1954 * Logs when there is a change in A2DP codec config for a particular remote device
1955 *
1956 * Logged from:
1957 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1958 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1959 */
1960message BluetoothA2dpCodecConfigChanged {
1961 // An identifier that can be used to match events for this device.
1962 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1963 // Salt: Randomly generated 256 bit value
1964 // Hash algorithm: HMAC-SHA256
1965 // Size: 32 byte
1966 // Default: null or empty if the device identifier is not known
1967 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1968 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1969 // Default SOURCE_CODEC_TYPE_INVALID
1970 optional int32 codec_type = 2;
1971 // Codec priroity, the higher the more preferred, -1 for disabled
1972 // Default: CODEC_PRIORITY_DEFAULT
1973 optional int32 codec_priority = 3;
1974 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1975 // Default: SAMPLE_RATE_NONE
1976 optional int32 sample_rate = 4;
1977 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1978 // Default: BITS_PER_SAMPLE_NONE
1979 optional int32 bits_per_sample = 5;
1980 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1981 // Default: CHANNEL_MODE_NONE
1982 optional int32 channel_mode = 6;
1983 // Codec specific values
1984 // Default 0
1985 optional int64 codec_specific_1 = 7;
1986 optional int64 codec_specific_2 = 8;
1987 optional int64 codec_specific_3 = 9;
1988 optional int64 codec_specific_4 = 10;
1989}
1990
1991/**
1992 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1993 * Each codec's capability is logged separately due to statsd restriction
1994 *
1995 * Logged from:
1996 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1997 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1998 */
1999message BluetoothA2dpCodecCapabilityChanged {
2000 // An identifier that can be used to match events for this device.
2001 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2002 // Salt: Randomly generated 256 bit value
2003 // Hash algorithm: HMAC-SHA256
2004 // Size: 32 byte
2005 // Default: null or empty if the device identifier is not known
2006 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2007 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2008 // Default SOURCE_CODEC_TYPE_INVALID
2009 optional int32 codec_type = 2;
2010 // Codec priroity, the higher the more preferred, -1 for disabled
2011 // Default: CODEC_PRIORITY_DEFAULT
2012 optional int32 codec_priority = 3;
2013 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2014 // in BluetoothCodecConfig
2015 // Default: empty and SAMPLE_RATE_NONE for individual item
2016 optional int32 sample_rate = 4;
2017 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2018 // in BluetoothCodecConfig
2019 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2020 optional int32 bits_per_sample = 5;
2021 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2022 // BluetoothCodecConfig
2023 // Default: empty and CHANNEL_MODE_NONE for individual item
2024 optional int32 channel_mode = 6;
2025 // Codec specific values
2026 // Default 0
2027 optional int64 codec_specific_1 = 7;
2028 optional int64 codec_specific_2 = 8;
2029 optional int64 codec_specific_3 = 9;
2030 optional int64 codec_specific_4 = 10;
2031}
2032
2033/**
2034 * Logs when A2DP failed to read from PCM source.
2035 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2036 *
2037 * Logged from:
2038 * system/bt
2039 */
2040message BluetoothA2dpAudioUnderrunReported {
2041 // An identifier that can be used to match events for this device.
2042 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2043 // Salt: Randomly generated 256 bit value
2044 // Hash algorithm: HMAC-SHA256
2045 // Size: 32 byte
2046 // Default: null or empty if the device identifier is not known
2047 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2048 // Encoding interval in nanoseconds
2049 // Default: 0
2050 optional int64 encoding_interval_nanos = 2;
2051 // Number of bytes of PCM data that could not be read from the source
2052 // Default: 0
2053 optional int32 num_missing_pcm_bytes = 3;
2054}
2055
2056/**
2057 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2058 * buffer queue is full and we have to drop data
2059 *
2060 * Logged from:
2061 * system/bt
2062 */
2063message BluetoothA2dpAudioOverrunReported {
2064 // An identifier that can be used to match events for this device.
2065 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2066 // Salt: Randomly generated 256 bit value
2067 // Hash algorithm: HMAC-SHA256
2068 // Size: 32 byte
2069 // Default: null or empty if the device identifier is not known
2070 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2071 // Encoding interval in nanoseconds
2072 // Default: 0
2073 optional int64 encoding_interval_nanos = 2;
2074 // Number of buffers dropped in this event
2075 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2076 // Default: 0
2077 optional int32 num_dropped_buffers = 3;
2078 // Number of encoded buffers dropped in this event
2079 // Default 0
2080 optional int32 num_dropped_encoded_frames = 4;
2081 // Number of encoded bytes dropped in this event
2082 // Default: 0
2083 optional int32 num_dropped_encoded_bytes = 5;
2084}
2085
2086/**
2087 * Logs when we receive reports regarding a device's RSSI value
2088 *
2089 * Logged from:
2090 * system/bt
2091 */
2092message BluetoothDeviceRssiReported {
2093 // An identifier that can be used to match events for this device.
2094 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2095 // Salt: Randomly generated 256 bit value
2096 // Hash algorithm: HMAC-SHA256
2097 // Size: 32 byte
2098 // Default: null or empty if the device identifier is not known
2099 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2100 // Connection handle of this connection if available
2101 // Range: 0x0000 - 0x0EFF (12 bits)
2102 // Default: 0xFFFF if the handle is unknown
2103 optional int32 connection_handle = 2;
2104 // HCI command status code if this is triggerred by hci_cmd
2105 // Default: STATUS_UNKNOWN
2106 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2107 // BR/EDR
2108 // Range: -128 ≤ N ≤ 127 (signed integer)
2109 // Units: dB
2110 // LE:
2111 // Range: -127 to 20, 127 (signed integer)
2112 // Units: dBm
2113 // Invalid when an out of range value is reported
2114 optional int32 rssi = 4;
2115}
2116
2117/**
2118 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2119 *
2120 * Logged from:
2121 * system/bt
2122 */
2123message BluetoothDeviceFailedContactCounterReported {
2124 // An identifier that can be used to match events for this device.
2125 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2126 // Salt: Randomly generated 256 bit value
2127 // Hash algorithm: HMAC-SHA256
2128 // Size: 32 byte
2129 // Default: null or empty if the device identifier is not known
2130 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2131 // Connection handle of this connection if available
2132 // Range: 0x0000 - 0x0EFF (12 bits)
2133 // Default: 0xFFFF if the handle is unknown
2134 optional int32 connection_handle = 2;
2135 // HCI command status code if this is triggerred by hci_cmd
2136 // Default: STATUS_UNKNOWN
2137 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2138 // Number of consecutive failed contacts for a connection corresponding to the Handle
2139 // Range: uint16_t, 0-0xFFFF
2140 // Default: 0xFFFFF
2141 optional int32 failed_contact_counter = 4;
2142}
2143
2144/**
2145 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2146 *
2147 * Logged from:
2148 * system/bt
2149 */
2150message BluetoothDeviceTxPowerLevelReported {
2151 // An identifier that can be used to match events for this device.
2152 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2153 // Salt: Randomly generated 256 bit value
2154 // Hash algorithm: HMAC-SHA256
2155 // Size: 32 byte
2156 // Default: null or empty if the device identifier is not known
2157 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2158 // Connection handle of this connection if available
2159 // Range: 0x0000 - 0x0EFF (12 bits)
2160 // Default: 0xFFFF if the handle is unknown
2161 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002162 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002163 // Default: STATUS_UNKNOWN
2164 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2165 // Range: -30 ≤ N ≤ 20
2166 // Units: dBm
2167 // Invalid when an out of range value is reported
2168 optional int32 transmit_power_level = 4;
2169}
Jack Heab86dbd22018-12-18 15:43:27 -08002170
Tej Singh5d991e12018-03-09 19:48:11 -08002171/**
Jack He1021a612019-01-20 21:22:46 -08002172 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2173 * receiving an HCI command from the host
2174 *
2175 * Logged from: system/bt
2176 */
2177message BluetoothHciTimeoutReported {
2178 // HCI command associated with this event
2179 // Default: CMD_UNKNOWN
2180 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2181}
2182
2183/**
2184 * Logs when we receive Bluetooth Link Quality Report event from the controller
2185 * See Android Bluetooth HCI specification for more details
2186 *
2187 * Note: all count and bytes field are counted since last event
2188 *
2189 * Logged from: system/bt
2190 */
2191message BluetoothQualityReportReported {
2192 // Quality report ID
2193 // Original type: uint8_t
2194 // Default: BQR_ID_UNKNOWN
2195 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2196 // Packet type of the connection
2197 // Original type: uint8_t
2198 // Default: BQR_PACKET_TYPE_UNKNOWN
2199 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2200 // Connection handle of the connection
2201 // Original type: uint16_t
2202 optional int32 connection_handle = 3;
2203 // Performing Role for the connection
2204 // Original type: uint8_t
2205 optional int32 connection_role = 4;
2206 // Current Transmit Power Level for the connection. This value is the same as the controller's
2207 // response to the HCI_Read_Transmit_Power_Level HCI command
2208 // Original type: uint8_t
2209 optional int32 tx_power_level = 5;
2210 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2211 // absolute receiver signal strength value
2212 // Original type: int8_t
2213 optional int32 rssi = 6;
2214 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2215 // channels used by the link currently
2216 // Original type: uint8_t
2217 optional int32 snr = 7;
2218 // Indicates the number of unused channels in AFH_channel_map
2219 // Original type: uint8_t
2220 optional int32 unused_afh_channel_count = 8;
2221 // Indicates the number of the channels which are interfered and quality is bad but are still
2222 // selected for AFH
2223 // Original type: uint8_t
2224 optional int32 afh_select_unideal_channel_count = 9;
2225 // Current Link Supervision Timeout Setting
2226 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2227 // Original type: uint16_t
2228 optional int32 lsto = 10;
2229 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2230 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2231 // 0x01 (Piconet Clock)
2232 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2233 // Original type: uint32_t
2234 optional int64 connection_piconet_clock = 11;
2235 // The count of retransmission
2236 // Original type: uint32_t
2237 optional int64 retransmission_count = 12;
2238 // The count of no RX
2239 // Original type: uint32_t
2240 optional int64 no_rx_count = 13;
2241 // The count of NAK (Negative Acknowledge)
2242 // Original type: uint32_t
2243 optional int64 nak_count = 14;
2244 // Controller timestamp of last TX ACK
2245 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2246 // Original type: uint32_t
2247 optional int64 last_tx_ack_timestamp = 15;
2248 // The count of Flow-off (STOP)
2249 // Original type: uint32_t
2250 optional int64 flow_off_count = 16;
2251 // Controller timestamp of last Flow-on (GO)
2252 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2253 // Original type: uint32_t
2254 optional int64 last_flow_on_timestamp = 17;
2255 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2256 // Original type: uint32_t
2257 optional int64 buffer_overflow_bytes = 18;
2258 // Buffer underflow count (in byte) since last event
2259 // Original type: uint32_t
2260 optional int64 buffer_underflow_bytes = 19;
2261}
2262
2263/**
2264 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2265 *
2266 * Notes:
2267 * - Each event can be partially filled as we might learn different pieces of device
2268 * information at different time
2269 * - Multiple device info events can be combined to give more complete picture
2270 * - When multiple device info events tries to describe the same information, the
2271 * later one wins
2272 *
2273 * Logged from:
2274 * packages/apps/Bluetooth
2275 */
Jack Heaea26982019-04-04 11:19:48 -07002276message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002277 // An identifier that can be used to match events for this device.
2278 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2279 // Salt: Randomly generated 256 bit value
2280 // Hash algorithm: HMAC-SHA256
2281 // Size: 32 byte
2282 // Default: null or empty if the device identifier is not known
2283 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2284 // Where is this device info obtained from
2285 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2286 // Name of the data source
2287 // For EXTERNAL: package name of the data source
2288 // For INTERNAL: null for general case, component name otherwise
2289 optional string source_name = 3;
2290 // Name of the manufacturer of this device
2291 optional string manufacturer = 4;
2292 // Model of this device
2293 optional string model = 5;
2294 // Hardware version of this device
2295 optional string hardware_version = 6;
2296 // Software version of this device
2297 optional string software_version = 7;
2298}
2299
2300/**
2301 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2302 * device, as documented by the Bluetooth Core HCI specification
2303 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2304 * Vol 2, Part E, Page 1118
2305 *
2306 * Logged from:
2307 * system/bt
2308 */
2309message BluetoothRemoteVersionInfoReported {
2310 // Connection handle of the connection
2311 // Original type: uint16_t
2312 optional int32 connection_handle = 1;
2313 // HCI command status code
2314 // Default: STATUS_UNKNOWN
2315 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2316 // 1 byte Version of current LMP in the remote controller
2317 optional int32 lmp_version = 3;
2318 // 2 bytes LMP manufacturer code of the remote controller
2319 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2320 optional int32 lmp_manufacturer_code = 4;
2321 // 4 bytes subversion of the LMP in the remote controller
2322 optional int32 lmp_subversion = 5;
2323}
2324
2325/**
2326 * Logs when certain Bluetooth SDP attributes are discovered
2327 * Constant definitions are from:
2328 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2329 *
2330 * Current logged attributes:
2331 * - BluetoothProfileDescriptorList
2332 * - Supported Features Bitmask
2333 *
2334 * Logged from:
2335 * system/bt
2336 */
2337message BluetoothSdpAttributeReported {
2338 // An identifier that can be used to match events for this device.
2339 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2340 // Salt: Randomly generated 256 bit value
2341 // Hash algorithm: HMAC-SHA256
2342 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2343 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2344 // Original type: uint16_t
2345 optional int32 protocol_uuid = 2;
2346 // Short form UUIDs used to identify Bluetooth SDP attribute types
2347 // Original type: uint16_t
2348 optional int32 attribute_id = 3;
2349 // Attribute value for the particular attribute
2350 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2351}
2352
2353/**
2354 * Logs when bond state of a Bluetooth device changes
2355 *
2356 * Logged from:
2357 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2358 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2359 */
2360message BluetoothBondStateChanged {
2361 // An identifier that can be used to match events for this device.
2362 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2363 // Salt: Randomly generated 256 bit value
2364 // Hash algorithm: HMAC-SHA256
2365 // Size: 32 byte
2366 // Default: null or empty if the device identifier is not known
2367 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2368 // Preferred transport type to remote dual mode device
2369 // Default: TRANSPORT_AUTO means no preference
2370 optional android.bluetooth.TransportTypeEnum transport = 2;
2371 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2372 // Default: UNKNOWN
2373 optional android.bluetooth.DeviceTypeEnum type = 3;
2374 // Current bond state (NONE, BONDING, BONDED)
2375 // Default: BOND_STATE_UNKNOWN
2376 optional android.bluetooth.BondStateEnum bond_state = 4;
2377 // Bonding sub state
2378 // Default: BOND_SUB_STATE_UNKNOWN
2379 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2380 // Unbond Reason
2381 // Default: UNBOND_REASON_UNKNOWN
2382 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2383}
2384
2385/**
2386 * Logs there is an event related Bluetooth classic pairing
2387 *
2388 * Logged from:
2389 * system/bt
2390 */
2391message BluetoothClassicPairingEventReported {
2392 // An identifier that can be used to match events for this device.
2393 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2394 // Salt: Randomly generated 256 bit value
2395 // Hash algorithm: HMAC-SHA256
2396 // Size: 32 byte
2397 // Default: null or empty if the device identifier is not known
2398 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2399 // Connection handle of this connection if available
2400 // Range: 0x0000 - 0x0EFF (12 bits)
2401 // Default: 0xFFFF if the handle is unknown
2402 optional int32 connection_handle = 2;
2403 // HCI command associated with this event
2404 // Default: CMD_UNKNOWN
2405 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2406 // HCI event associated with this event
2407 // Default: EVT_UNKNOWN
2408 optional android.bluetooth.hci.EventEnum hci_event = 4;
2409 // HCI command status code if this is triggerred by hci_cmd
2410 // Default: STATUS_UNKNOWN
2411 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2412 // HCI reason code associated with this event
2413 // Default: STATUS_UNKNOWN
2414 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002415 // A status value related to this specific event
2416 // Default: 0
2417 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002418}
2419
2420/**
2421 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2422 *
2423 * Logged from:
2424 * system/bt
2425 */
2426message BluetoothSmpPairingEventReported {
2427 // An identifier that can be used to match events for this device.
2428 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2429 // Salt: Randomly generated 256 bit value
2430 // Hash algorithm: HMAC-SHA256
2431 // Size: 32 byte
2432 // Default: null or empty if the device identifier is not known
2433 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2434 // SMP command sent or received over L2CAP
2435 // Default: CMD_UNKNOWN
2436 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2437 // Whether this command is sent or received
2438 // Default: DIRECTION_UNKNOWN
2439 optional android.bluetooth.DirectionEnum direction = 3;
2440 // SMP failure reason code
2441 // Default: PAIRING_FAIL_REASON_DEFAULT
2442 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2443}
2444
2445/**
Jack He815cdba2019-01-30 17:24:55 -08002446 * Logs when a Bluetooth socket’s connection state changed
2447 *
2448 * Logged from:
2449 * system/bt
2450 */
2451message BluetoothSocketConnectionStateChanged {
2452 // An identifier that can be used to match events for this device.
2453 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2454 // Salt: Randomly generated 256 bit value
2455 // Hash algorithm: HMAC-SHA256
2456 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002457 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002458 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002459 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002460 // Default 0 when unknown or don't care
2461 optional int32 port = 2;
2462 // Socket type as mentioned in
2463 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2464 // Default: SOCKET_TYPE_UNKNOWN
2465 optional android.bluetooth.SocketTypeEnum type = 3;
2466 // Socket connection state
2467 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2468 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2469 // Number of bytes sent to remote device during this connection
2470 optional int64 tx_bytes = 5;
2471 // Number of bytes received from remote device during this connection
2472 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002473 // Socket owner's UID
2474 optional int32 uid = 7 [(is_uid) = true];
2475 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2476 // |port| must be spawned by |server_port|
2477 // Default 0 when unknown or don't care
2478 optional int32 server_port = 8;
2479 // Whether this is a server listener socket
2480 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002481}
2482
2483/**
Jack He71426802019-04-02 13:32:52 -07002484 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2485 *
2486 * Logged from:
2487 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2488 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2489 *
2490 */
2491message BluetoothClassOfDeviceReported {
2492 // An identifier that can be used to match events for this device.
2493 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2494 // Salt: Randomly generated 256 bit value
2495 // Hash algorithm: HMAC-SHA256
2496 // Size: 32 byte
2497 // Default: null or empty if this is a server listener socket
2498 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2499 // Class of Device (CoD) value including both Major, Minor device class and service class
2500 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2501 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2502 // Default: 0
2503 optional int32 class_of_device = 2;
2504}
2505
2506/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002507 * Logs when something is plugged into or removed from the USB-C connector.
2508 *
2509 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002510 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002511 */
2512message UsbConnectorStateChanged {
2513 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002514 STATE_DISCONNECTED = 0;
2515 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002516 }
2517 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002518 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002519 // Last active session in ms.
2520 // 0 when the port is in connected state.
2521 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002522}
2523
2524/**
2525 * Logs the reported speaker impedance.
2526 *
2527 * Logged from:
2528 * Vendor audio implementation.
2529 */
2530message SpeakerImpedanceReported {
2531 optional int32 speaker_location = 1;
2532 optional int32 impedance = 2;
2533}
2534
2535/**
2536 * Logs the report of a failed hardware.
2537 *
2538 * Logged from:
2539 * Vendor HALs.
2540 *
2541 */
2542message HardwareFailed {
2543 enum HardwareType {
2544 HARDWARE_FAILED_UNKNOWN = 0;
2545 HARDWARE_FAILED_MICROPHONE = 1;
2546 HARDWARE_FAILED_CODEC = 2;
2547 HARDWARE_FAILED_SPEAKER = 3;
2548 HARDWARE_FAILED_FINGERPRINT = 4;
2549 }
2550 optional HardwareType hardware_type = 1;
2551
Maggie White6dcd8572019-01-31 14:11:50 -08002552 /**
2553 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002554 * the same hardware_type. The specific locations are vendor defined integers,
2555 * referring to board-specific numbering schemes.
2556 */
2557 optional int32 hardware_location = 2;
2558
Maggie White6dcd8572019-01-31 14:11:50 -08002559 /**
2560 * failure_code is specific to the HardwareType of the failed hardware.
2561 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002562 */
Maggie White6dcd8572019-01-31 14:11:50 -08002563 enum HardwareErrorCode {
2564 UNKNOWN = 0;
2565 COMPLETE = 1;
2566 SPEAKER_HIGH_Z = 2;
2567 SPEAKER_SHORT = 3;
2568 FINGERPRINT_SENSOR_BROKEN = 4;
2569 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002570 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002571 }
2572 optional int32 failure_code = 3;
2573}
2574
2575/**
2576 * Log an event when the device has been physically dropped.
2577 * Reported from the /vendor partition.
2578 */
2579message PhysicalDropDetected {
2580 // Confidence that the event was actually a drop, 0 -> 100
2581 optional int32 confidence_pctg = 1;
2582 // Peak acceleration of the drop, in 1/1000s of a g.
2583 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002584 // Duration of freefall in ms
2585 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002586}
2587
2588/**
2589 * Log bucketed battery charge cycles.
2590 *
2591 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002592 * a given charge point. For example, if 10 cycle buckets are
2593 * initialized, bucket 1 is the lowest 1/10th of the battery,
2594 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002595 *
2596 * Logged from:
2597 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2598 */
2599message ChargeCyclesReported {
2600 optional int32 cycle_bucket_1 = 1;
2601 optional int32 cycle_bucket_2 = 2;
2602 optional int32 cycle_bucket_3 = 3;
2603 optional int32 cycle_bucket_4 = 4;
2604 optional int32 cycle_bucket_5 = 5;
2605 optional int32 cycle_bucket_6 = 6;
2606 optional int32 cycle_bucket_7 = 7;
2607 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002608 optional int32 cycle_bucket_9 = 9;
2609 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002610}
2611
2612/**
Howard Roa46b6582018-09-18 16:45:02 -07002613 * Log battery health snapshot.
2614 *
2615 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2616 * are snapshotted periodically over 24hrs.
2617 */
2618message BatteryHealthSnapshot {
2619 enum BatterySnapshotType {
2620 UNKNOWN = 0;
2621 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2622 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2623 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2624 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2625 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2626 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2627 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2628 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2629 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2630 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2631 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2632 }
2633 optional BatterySnapshotType type = 1;
2634 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002635 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002636 // Voltage Battery Voltage, in microVolts.
2637 optional int32 voltage_micro_volt = 3;
2638 // Current Battery current, in microAmps.
2639 optional int32 current_micro_amps = 4;
2640 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2641 optional int32 open_circuit_micro_volt = 5;
2642 // Resistance Battery Resistance, in microOhms.
2643 optional int32 resistance_micro_ohm = 6;
2644 // Level Battery Level, as % of full.
2645 optional int32 level_percent = 7;
2646}
2647
2648/**
2649 * Log slow I/O operations on the primary storage.
2650 */
2651message SlowIo {
2652 // Classifications of IO Operations.
2653 enum IoOperation {
2654 UNKNOWN = 0;
2655 READ = 1;
2656 WRITE = 2;
2657 UNMAP = 3;
2658 SYNC = 4;
2659 }
2660 optional IoOperation operation = 1;
2661
2662 // The number of slow IO operations of this type over 24 hours.
2663 optional int32 count = 2;
2664}
2665
2666/**
2667 * Log battery caused shutdown with the last recorded voltage.
2668 */
2669message BatteryCausedShutdown {
2670 // The last recorded battery voltage prior to shutdown.
2671 optional int32 last_recorded_micro_volt = 1;
2672}
2673
2674/**
Tej Singha72344992019-04-17 18:55:08 -07002675 * Logs when ThermalService receives throttling events.
2676 *
2677 * Logged from:
2678 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2679 */
2680message ThermalThrottlingSeverityStateChanged {
2681 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2682 optional android.os.TemperatureTypeEnum sensor_type = 1;
2683
2684 // The name of the temperature source. Eg. CPU0
2685 optional string sensor_name = 2;
2686
2687 // Temperature in tenths of a degree C.
2688 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2689 optional int32 temperature_deci_celsius = 3;
2690
2691 // Relative severity of the throttling, see enum definition.
2692 optional android.os.ThrottlingSeverityEnum severity = 4;
2693}
2694
2695/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002696 * Logs the duration of a davey (jank of >=700ms) when it occurs
2697 *
2698 * Logged from:
2699 * frameworks/base/libs/hwui/JankTracker.cpp
2700 */
2701message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002702 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002703 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002704
Tej Singhbb8554a2018-01-26 11:59:14 -08002705 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002706 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002707}
2708
2709/**
Bookatze5885242017-10-24 20:10:31 -07002710 * Logs phone signal strength changes.
2711 *
2712 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002713 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002714 */
2715message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002716 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2717 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002718}
2719
Yangster4ccebea2018-10-09 17:09:02 -07002720
2721/**
2722 * Logs when the phone state, sim state or signal strength changes
2723 *
2724 * Logged from:
2725 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2726 */
2727message PhoneServiceStateChanged {
2728 optional android.telephony.ServiceStateEnum state = 1;
2729 optional android.telephony.SimStateEnum sim_state = 2;
2730 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2731}
2732
2733/**
2734 * Logs when the phone becomes on or off.
2735 *
2736 * Logged from:
2737 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2738 */
2739message PhoneStateChanged {
2740 enum State {
2741 OFF = 0;
2742 ON = 1;
2743 }
2744 optional State state = 1;
2745}
2746
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002747message BackGesture {
2748 enum BackType {
2749 DEFAULT_BACK_TYPE = 0;
2750 COMPLETED = 1;
2751 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2752 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2753 INCOMPLETE = 4;
2754 }
2755 optional BackType type = 1;
2756
2757 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2758 enum WindowHorizontalLocation {
2759 DEFAULT_LOCATION = 0;
2760 LEFT = 1;
2761 RIGHT = 2;
2762 }
2763 optional WindowHorizontalLocation x_location = 3;
2764}
2765
2766message ExclusionRectStateChanged {
2767 optional string component_name = 1; // if not available, simply packageName
2768 optional int32 requested_height = 2; // px
2769 optional int32 rejected_height = 3; // px
2770
2771 enum WindowHorizontalLocation {
2772 DEFAULT_LOCATION = 0;
2773 LEFT = 1;
2774 RIGHT = 2;
2775 }
2776 optional WindowHorizontalLocation x_location = 4;
2777 optional bool landscape = 5;
2778 optional bool splitscreen = 6;
2779 optional int32 duration_millis = 7;
2780}
2781
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002782message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002783 optional android.stats.launcher.LauncherAction action = 1;
2784 optional android.stats.launcher.LauncherState src_state = 2;
2785 optional android.stats.launcher.LauncherState dst_state = 3;
2786 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002787 optional bool is_swipe_up_enabled = 5;
2788}
2789
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002790message StyleUIChanged {
2791 optional android.stats.style.Action action = 1;
2792 optional int32 color_package_hash = 2;
2793 optional int32 font_package_hash = 3;
2794 optional int32 shape_package_hash = 4;
2795 optional int32 clock_package_hash = 5;
2796 optional int32 launcher_grid = 6;
2797 optional int32 wallpaper_category_hash = 7;
2798 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002799 optional int32 color_preference = 9;
2800 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002801}
2802
David Chenc28b2bb2017-10-24 12:52:52 -07002803/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002804 * Logs when Settings UI has changed.
2805 *
2806 * Logged from:
2807 * packages/apps/Settings
2808 */
2809message SettingsUIChanged {
2810 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002811 * Where this SettingsUIChange event comes from. For example, if
2812 * it's a PAGE_VISIBLE event, where the page is opened from.
2813 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002814 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002815
2816 /**
2817 * What the UI action is.
2818 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002819 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002820
2821 /**
2822 * Where the action is happening
2823 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002824 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002825
2826 /**
2827 * What preference changed in this event.
2828 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002829 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002830
2831 /**
2832 * The new value of the changed preference.
2833 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002834 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002835}
2836
2837/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002838 * Logs basic timing information about touch events.
2839 * Reported at most every 5 minutes while device is being interacted with.
2840 *
2841 * Logged from:
2842 * frameworks/native/services/inputflinger
2843 */
2844message TouchEventReported {
2845 /**
2846 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002847 * and the standard deviation of the time spent processing touchscreen events
2848 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002849 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002850 * On supported devices, the starting point is taken during the hard interrupt inside the
2851 * kernel touch driver. On all other devices, the starting point is taken inside
2852 * the kernel's input event subsystem upon receipt of the input event.
2853 * The ending point is taken inside InputDispatcher, just after the input event
2854 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002855 */
2856 // Minimum value
2857 optional float latency_min_micros = 1;
2858 // Maximum value
2859 optional float latency_max_micros = 2;
2860 // Average value
2861 optional float latency_mean_micros = 3;
2862 // Standard deviation
2863 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002864 // Number of touch events (input_event) in this report
2865 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002866}
2867
2868/**
Philip Quinn0eded622019-01-29 12:46:28 -08002869 * Logs gesture classification and timing information for touch events.
2870 *
2871 * Logged from:
2872 * frameworks/base/core/java/android/view/GestureDetector.java
2873 * frameworks/base/core/java/android/view/View.java
2874 */
2875message TouchGestureClassified {
2876 // The source of the classification (e.g. Java class name).
2877 optional string source = 1;
2878
2879 enum Classification {
2880 UNKNOWN_CLASSIFICATION = 0;
2881 SINGLE_TAP = 1;
2882 DOUBLE_TAP = 2;
2883 LONG_PRESS = 3;
2884 DEEP_PRESS = 4;
2885 SCROLL = 5;
2886 }
2887 // The classification of the gesture.
2888 optional Classification classification = 2;
2889
2890 // The interval from the start of a touch event stream until the
2891 // classification was made.
2892 optional int32 latency_millis = 3;
2893
2894 // The distance from the location of the first touch event to the
2895 // location of the touch event when the classification was made.
2896 optional float displacement_px = 4;
2897}
2898
2899/**
David Chenc28b2bb2017-10-24 12:52:52 -07002900 * Logs that a setting was updated.
2901 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002902 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002903 * The tag and is_default allow resetting of settings to default values based on the specified
2904 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2905 */
2906message SettingChanged {
2907 // The name of the setting.
2908 optional string setting = 1;
2909
2910 // The change being imposed on this setting. May represent a number, eg "3".
2911 optional string value = 2;
2912
2913 // The new value of this setting. For most settings, this is same as value. For some settings,
2914 // value is +X or -X where X represents an element in a set. For example, if the previous value
2915 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2916 // The +/- feature is currently only used for location_providers_allowed.
2917 optional string new_value = 3;
2918
2919 // The previous value of this setting.
2920 optional string prev_value = 4;
2921
2922 // The tag used with the is_default for resetting sets of settings. This is generally null.
2923 optional string tag = 5;
2924
Bookatz90867622018-01-31 15:05:57 -08002925 // True if this setting with tag should be resettable.
2926 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002927
David Chenbd789912018-03-16 17:19:55 -07002928 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002929 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002930
2931 enum ChangeReason {
2932 UPDATED = 1; // Updated can be an insertion or an update.
2933 DELETED = 2;
2934 }
2935 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002936}
Chenjie Yub3dda412017-10-24 13:41:59 -07002937
Chenjie Yu05013b32017-11-21 10:21:41 -08002938/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002939 * Logs activity going to foreground or background
2940 *
2941 * Logged from:
2942 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2943 */
2944message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002945 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002946 optional string pkg_name = 2;
2947 optional string class_name = 3;
2948
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002949 enum State {
2950 BACKGROUND = 0;
2951 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002952 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002953 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002954}
David Chenc8a43242017-10-17 16:23:28 -07002955
2956/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002957 * Logs when a volume entered low Storage state.
2958 * Logged from:
2959 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2960 */
2961message LowStorageStateChanged {
2962 // Volume that ran out of storage.
2963 optional string volume_description = 1;
2964
2965 enum State {
2966 UNKNOWN = 0;
2967 OFF = 1;
2968 ON = 2;
2969 }
2970 optional State state = 2;
2971}
2972
2973/**
2974 * Logs when an app is downgraded.
2975 * Logged from:
2976 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2977 */
2978message AppDowngraded {
2979 optional string package_name = 1;
2980 // Size of the package (all data) before being downgraded.
2981 optional int64 size_in_bytes_before = 2;
2982 // Size of the package (all data) after being downgraded.
2983 optional int64 size_in_bytes_after = 3;
2984
2985 optional bool aggressive = 4;
2986}
2987
2988/**
2989 * Logs when an app is optimized after being downgraded.
2990 * Logged from:
2991 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2992 */
2993message AppOptimizedAfterDowngraded {
2994 optional string package_name = 1;
2995}
2996
2997/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002998 * Logs whenever an app is installed on external storage.
2999 * Logged from:
3000 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3001 */
3002message AppInstallOnExternalStorageReported {
3003 // The type of external storage.
3004 optional android.stats.storage.ExternalStorageType storage_type = 1;
3005 // The name of the package that is installed on the sd card.
3006 optional string package_name = 2;
3007}
3008
3009/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003010 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003011 * Logged from:
3012 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3013 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003014message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003015 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003016
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003017 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003018
3019 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003020 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003021 optional string process_name = 3;
3022
3023 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003024 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003025
3026 optional string package_name = 5;
3027
3028 enum InstantApp {
3029 UNAVAILABLE = 0;
3030 FALSE = 1;
3031 TRUE = 2;
3032 }
3033 optional InstantApp is_instant_app = 6;
3034
3035 enum ForegroundState {
3036 UNKNOWN = 0;
3037 BACKGROUND = 1;
3038 FOREGROUND = 2;
3039 }
3040 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003041
3042 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003043}
David Chen9e3808c2017-11-20 17:25:34 -08003044
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003045/**
3046 * Logs when a WTF (What a Terrible Failure) happened.
3047 * Logged from:
3048 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3049 */
3050message WTFOccurred {
3051 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003052
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003053 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003054
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003055 // The name of the process.
3056 // system_server if it is not by an app
3057 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003058
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003059 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003060 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003061
3062 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003063}
3064
3065/**
3066 * Logs when system server reports low memory.
3067 * Logged from:
3068 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3069 */
3070message LowMemReported {
3071}
3072
3073/**
3074 * Logs when an app ANR (App Not Responding) occurs.
3075 * Logged from:
3076 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3077 */
3078message ANROccurred {
3079 optional int32 uid = 1 [(is_uid) = true];
3080
3081 optional string process_name = 2;
3082
3083 optional string short_component_name = 3;
3084
3085 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003086
3087 enum InstantApp {
3088 UNAVAILABLE = 0;
3089 FALSE = 1;
3090 TRUE = 2;
3091 }
3092 optional InstantApp is_instant_app = 5;
3093
3094 enum ForegroundState {
3095 UNKNOWN = 0;
3096 BACKGROUND = 1;
3097 FOREGROUND = 2;
3098 }
3099 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003100
3101 optional android.server.ErrorSource error_source = 7;
3102
3103 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003104}
3105
Bookatza7020bd2018-08-28 16:29:35 -07003106/**
3107 * Logs when the vibrator state changes.
3108 * Logged from:
3109 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3110 */
3111message VibratorStateChanged {
3112 repeated AttributionNode attribution_node = 1;
3113
3114 enum State {
3115 OFF = 0;
3116 ON = 1;
3117 }
3118 optional State state = 2;
3119
3120 // Duration (in milliseconds) requested to keep the vibrator on.
3121 // Only applicable for State == ON.
3122 optional int64 duration_millis = 3;
3123}
3124
David Chen0a368b22017-12-06 16:28:16 -08003125/*
3126 * Allows other apps to push events into statsd.
3127 * Logged from:
3128 * frameworks/base/core/java/android/util/StatsLog.java
3129 */
David Chen0b5c90c2018-01-25 16:51:49 -08003130message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003131 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003132 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003133
3134 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3135 optional int32 label = 2;
3136
3137 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3138 // predicates for the metrics).
3139 enum State {
3140 UNKNOWN = 0;
3141 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3142 STOP = 2;
3143 START = 3;
3144 }
3145 optional State state = 3;
3146}
3147
David Chen9e3808c2017-11-20 17:25:34 -08003148/**
Bookatz7948c872018-09-04 12:58:33 -07003149 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3150 * For example, this could be due to the user manually changing the time.
3151 *
3152 * Logged from:
3153 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3154 */
3155message WallClockTimeShifted {
3156 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3157 optional int64 wall_clock_timestamp_millis = 1;
3158}
3159
3160/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003161 * Logs when statsd detects an anomaly.
3162 *
3163 * Logged from:
3164 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3165 */
3166message AnomalyDetected {
3167 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003168 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003169
Yangster-mac94e197c2018-01-02 16:03:03 -08003170 // Id of the config whose anomaly detection alert fired.
3171 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003172
Yangster-mac94e197c2018-01-02 16:03:03 -08003173 // Id of the alert (i.e. name of the anomaly that was detected).
3174 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003175}
3176
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003177message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003178 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003179 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003180
3181 // The app package name.
3182 optional string pkg_name = 2;
3183
3184 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003185 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003186 WARM = 1;
3187 HOT = 2;
3188 COLD = 3;
3189 }
3190 // The transition type.
3191 optional TransitionType type = 3;
3192
3193 // The activity name.
3194 optional string activity_name = 4;
3195
3196 // The name of the calling app. Empty if not set.
3197 optional string calling_pkg_name = 5;
3198
3199 // Whether the app is an instant app.
3200 optional bool is_instant_app = 6;
3201
3202 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003203 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003204
Bookatz80d11a02018-01-16 10:46:35 -08003205 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003206
David Chen0b5c90c2018-01-25 16:51:49 -08003207 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003208 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003209 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003210 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003211 optional int32 bind_application_delay_millis = 11;
3212 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003213
3214 // Empty if not set.
3215 optional string launch_token = 13;
3216
Calin Juravle759fbda2018-02-20 19:52:30 +00003217 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003218 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003219
3220 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003221 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003222}
3223
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003224message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003225 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003226 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003227
3228 // The app package name.
3229 optional string pkg_name = 2;
3230
3231 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003232 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003233 WARM = 1;
3234 HOT = 2;
3235 COLD = 3;
3236 }
3237 // The transition type.
3238 optional TransitionType type = 3;
3239
3240 // The activity name.
3241 optional string activity_name = 4;
3242}
3243
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003244message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003245 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003246 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003247
3248 // The app package name.
3249 optional string pkg_name = 2;
3250
3251 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003252 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003253 WITH_BUNDLE = 1;
3254 WITHOUT_BUNDLE = 2;
3255 }
3256 // The transition type.
3257 optional TransitionType type = 3;
3258
3259 // The activity name.
3260 optional string activity_name = 4;
3261
3262 optional bool transition_process_running = 5;
3263
3264 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003265 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003266}
3267
Bookatz8fcd09a2017-12-18 13:01:10 -08003268/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003269 * Logs a picture-in-picture action
3270 * Logged from:
3271 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3272 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3273 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3274 */
3275message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003276 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003277 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003278
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003279 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003280
Chenjie Yu52cacc62017-12-08 18:11:45 -08003281 enum State {
3282 ENTERED = 1;
3283 EXPANDED_TO_FULL_SCREEN = 2;
3284 MINIMIZED = 3;
3285 DISMISSED = 4;
3286 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003287 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003288}
3289
3290/**
Chenjie Yue8904192017-12-08 19:12:57 -08003291 * Logs overlay action
3292 * Logged from:
3293 * services/core/java/com/android/server/wm/Session.java
3294 */
3295message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003296 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003297
tsaichristine5adc7e02020-01-14 17:07:39 -08003298 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003299
3300 optional bool using_alert_window = 3;
3301
3302 enum State {
3303 ENTERED = 1;
3304 EXITED = 2;
3305 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003306 optional State state = 4 [
3307 (state_field_option).option = EXCLUSIVE_STATE,
3308 (state_field_option).nested = false,
3309 (state_field_option).default_state_value = 2
3310 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003311}
3312
Adam Bookatz38767932020-02-05 12:13:40 -08003313/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003314 * Logs foreground service starts and stops.
3315 * Note that this is not when a service starts or stops, but when it is
3316 * considered foreground.
3317 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003318 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003319 */
3320message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003321 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003322 // package_name + "/" + class_name
3323 optional string short_name = 2;
3324
3325 enum State {
3326 ENTER = 1;
3327 EXIT = 2;
3328 }
3329 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003330
3331 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3332 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3333 optional bool allow_while_in_use_permission = 4;
3334}
3335
3336/**
3337 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3338 * A foreground service session is any continuous period during which the uid holds at least one
3339 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3340 * Accesses initiated while the uid is in the TOP state are ignored.
3341 * Sessions with no attempted accesses are not logged.
3342 * Logged from
3343 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3344 */
3345message ForegroundServiceAppOpSessionEnded {
3346 optional int32 uid = 1 [(is_uid) = true];
3347
3348 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003349 // Only following four ops are logged
3350 // COARSE_LOCATION = 0
3351 // FINE_LOCATION = 1
3352 // CAMERA = 26
3353 // RECORD_AUDIO = 27
3354 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003355
3356 // The uid's permission mode for accessing the AppOp during this fgs session.
3357 enum Mode {
3358 MODE_UNKNOWN = 0;
3359 MODE_ALLOWED = 1; // Always allowed
3360 MODE_IGNORED = 2; // Denied
3361 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3362 }
3363 optional Mode app_op_mode = 3;
3364
3365 // Number of times this AppOp was requested and allowed.
3366 optional int32 count_ops_accepted = 4;
3367 // Number of times this AppOp was requested but denied.
3368 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003369}
3370
Chenjie Yue8904192017-12-08 19:12:57 -08003371/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003372 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3373 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3374 * attributed back to the parent (host) uid. One example is Chrome.
3375 *
3376 * Logged from:
3377 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3378 */
3379message IsolatedUidChanged {
3380 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003381 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003382 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003383 optional int32 parent_uid = 1;
3384
3385 optional int32 isolated_uid = 2;
3386
3387 // We expect an isolated uid to be removed before if it's used for another parent uid.
3388 enum Event {
3389 REMOVED = 0;
3390 CREATED = 1;
3391 }
3392 optional Event event = 3;
3393}
3394
3395/*
3396 * Logs the reception of an incoming network packet causing the main system to wake up for
3397 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3398 * and processed by WakeupController.cpp.
3399 */
3400message PacketWakeupOccurred {
3401 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3402 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003403 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003404 // The interface name on which the packet was received.
3405 optional string iface = 2;
3406 // The ethertype value of the packet.
3407 optional int32 ethertype = 3;
3408 // String representation of the destination MAC address of the packet.
3409 optional string destination_hardware_address = 4;
3410 // String representation of the source address of the packet if this was an IP packet.
3411 optional string source_ip = 5;
3412 // String representation of the destination address of the packet if this was an IP packet.
3413 optional string destination_ip = 6;
3414 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3415 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3416 // families.
3417 optional int32 ip_next_header = 7;
3418 // The source port if this was a TCP or UDP packet.
3419 optional int32 source_port = 8;
3420 // The destination port if this was a TCP or UDP packet.
3421 optional int32 destination_port = 9;
3422}
3423
3424/*
3425 * Logs the memory stats for an app on startup.
3426 * Logged from:
3427 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3428 */
3429message AppStartMemoryStateCaptured {
3430 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003431 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003432
3433 // The process name.
3434 optional string process_name = 2;
3435
3436 // The activity name.
3437 optional string activity_name = 3;
3438
3439 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003440 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003441
3442 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003443 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003444
3445 // RSS
3446 optional int64 rss_in_bytes = 6;
3447
3448 // CACHE
3449 optional int64 cache_in_bytes = 7;
3450
3451 // SWAP
3452 optional int64 swap_in_bytes = 8;
3453}
3454
3455/*
3456 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3457 * for LMK event.
3458 * Logged from:
3459 * system/core/lmkd/lmkd.c
3460 */
3461message LmkStateChanged {
3462 enum State {
3463 UNKNOWN = 0;
3464 START = 1;
3465 STOP = 2;
3466 }
3467 optional State state = 1;
3468}
3469
3470/*
3471 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3472 * Logged from:
3473 * system/core/lmkd/lmkd.c
3474 */
3475message LmkKillOccurred {
3476 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003477 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003478
3479 // The process name.
3480 optional string process_name = 2;
3481
3482 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003483 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003484
3485 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003486 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003487
3488 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003489 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003490
3491 // RSS
3492 optional int64 rss_in_bytes = 6;
3493
3494 // CACHE
3495 optional int64 cache_in_bytes = 7;
3496
3497 // SWAP
3498 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003499
3500 // The elapsed real time of start of the process.
3501 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003502
3503 // Min oom adj score considered by lmkd.
3504 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003505}
3506
Rajeev Kumar51b54602018-03-01 12:18:26 -08003507/*
3508 * Logs when the ActivityManagerService detects that an app died.
3509 *
3510 * Logged from:
3511 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3512 */
3513message AppDied {
3514 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003515 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003516}
3517
Howard Ro21a039c2018-08-06 14:55:47 -07003518/**
3519 * An atom for generic metrics logging. Available from Android Q.
3520 */
3521message GenericAtom {
3522 // The uid of the application that sent this custom atom.
3523 optional int32 uid = 1 [(is_uid) = true];
3524
3525 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003526 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003527}
3528
Tej Singhd6d6d772018-09-05 17:41:25 -07003529/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003530 * Atom for simple logging of user interaction and impression events, such as "the user touched
3531 * this button" or "this dialog was displayed".
3532 * Keep the UI event stream clean: don't use for system or background events.
3533 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003534 *
3535 * Logged from:
3536 * frameworks/base/services/core/java/com/android/server/
3537 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003538 */
3539message UiEventReported {
3540 // The event_id.
3541 optional int32 event_id = 1;
3542 // The event's source or target uid and package, if applicable.
3543 // For example, the package posting a notification, or the destination package of a share.
3544 optional int32 uid = 2 [(is_uid) = true];
3545 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003546 // An identifier used to disambiguate which logs refer to a particular instance of some
3547 // UI element. Useful when there might be multiple instances simultaneously active.
3548 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003549}
3550
3551/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003552 * Reports a notification was created or updated.
3553 *
3554 * Logged from:
3555 * frameworks/base/services/core/java/com/android/server/notification/
3556 */
3557message NotificationReported {
3558 // The event_id (as for UiEventReported).
3559 optional int32 event_id = 1;
3560 // The notifying app's uid and package.
3561 optional int32 uid = 2 [(is_uid) = true];
3562 optional string package_name = 3;
3563 // A small system-assigned identifier for the notification.
3564 // Locally probably-unique, but expect collisions across users and/or days.
3565 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003566 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3567 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003568
3569 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003570 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3571 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3572 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003573
3574 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003575 optional string category = 10; // App-assigned notification category (API-defined strings)
3576 optional int32 style = 11; // App-assigned notification style
3577 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003578
3579 // Ordering, importance and interruptiveness
3580
Will Brockman7614f6962020-02-10 19:43:03 -05003581 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003582
Will Brockman7614f6962020-02-10 19:43:03 -05003583 optional android.stats.sysui.NotificationImportance importance = 14;
3584 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003585
3586 enum NotificationImportanceExplanation {
3587 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3588 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3589 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3590 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3591 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3592 // Like _APP, but based on pre-channels priority signal.
3593 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3594 }
3595
Will Brockman7614f6962020-02-10 19:43:03 -05003596 optional NotificationImportanceExplanation importance_source = 16;
3597 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3598 optional NotificationImportanceExplanation importance_initial_source = 18;
3599 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3600 optional int32 assistant_hash = 20;
3601 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003602}
3603
3604message Notification {
3605 // The notifying app's uid and package.
3606 optional int32 uid = 1 [(is_uid) = true];
3607 optional string package_name = 2;
3608 // A small system-assigned identifier for the notification.
3609 optional int32 instance_id = 3;
3610
3611 // Grouping information.
3612 optional int32 group_instance_id = 4;
3613 optional bool is_group_summary = 5;
3614
3615 // The section of the shade that the notification is in.
3616 // See NotificationSectionsManager.PriorityBucket.
3617 enum NotificationSection {
3618 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003619 SECTION_HEADS_UP = 1;
3620 SECTION_PEOPLE = 2;
3621 SECTION_ALERTING = 3;
3622 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003623 }
3624 optional NotificationSection section = 6;
3625}
3626
3627message NotificationList {
3628 repeated Notification notifications = 1; // An ordered sequence of notifications.
3629}
3630
3631/**
3632 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3633 *
3634 * Logged from:
3635 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3636 */
3637message NotificationPanelReported {
3638 // The event_id (as for UiEventReported).
3639 optional int32 event_id = 1;
3640 optional int32 num_notifications = 2;
3641 // The notifications in the panel, in the order that they appear there.
3642 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3643}
3644
3645/**
3646 * Reports a notification channel, or channel group, was created, updated, or deleted.
3647 *
3648 * Logged from:
3649 * frameworks/base/services/core/java/com/android/server/notification/
3650 */
3651message NotificationChannelModified {
3652 // The event_id (as for UiEventReported).
3653 optional int32 event_id = 1;
3654 // The notifying app's uid and package.
3655 optional int32 uid = 2 [(is_uid) = true];
3656 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003657 // Hash of app-assigned notification channel ID or channel-group ID
3658 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003659 // Previous importance setting, if applicable
3660 optional android.stats.sysui.NotificationImportance old_importance = 5;
3661 // New importance setting
3662 optional android.stats.sysui.NotificationImportance importance = 6;
3663}
3664
3665
3666/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003667 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003668 *
3669 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003670 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003671 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003672message BiometricAcquired {
3673 // Biometric modality that was acquired.
3674 optional android.hardware.biometrics.ModalityEnum modality = 1;
3675 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3676 optional int32 user = 2;
3677 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3678 optional bool is_crypto = 3;
3679 // Action that the device is performing. Acquired messages are only expected for enroll and
3680 // authenticate. Other actions may indicate an error.
3681 optional android.hardware.biometrics.ActionEnum action = 4;
3682 // The client that this acquisition was received for.
3683 optional android.hardware.biometrics.ClientEnum client = 5;
3684 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3685 optional int32 acquire_info = 6;
3686 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3687 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003688 // Dictates if this message should trigger additional debugging.
3689 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003690}
3691
3692/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003693 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003694 *
3695 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003696 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003697 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003698message BiometricAuthenticated {
3699 // Biometric modality that was used.
3700 optional android.hardware.biometrics.ModalityEnum modality = 1;
3701 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3702 optional int32 user = 2;
3703 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3704 // storage.
3705 optional bool is_crypto = 3;
3706 // The client that this acquisition was received for.
3707 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003708 // If authentication requires user confirmation. See BiometricPrompt's
3709 // setRequireConfirmation(bool) method.
3710 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003711
Kevin Chyn1741a072019-01-17 11:54:40 -08003712 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003713 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003714 REJECTED = 1;
3715 PENDING_CONFIRMATION = 2;
3716 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003717 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003718
3719 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003720 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003721 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3722 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3723 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3724 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003725 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003726 // Dictates if this message should trigger additional debugging.
3727 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003728}
3729
3730/**
3731 * Logs when a biometric error occurs.
3732 *
3733 * Logged from:
3734 * frameworks/base/services/core/java/com/android/server/biometrics
3735 */
3736message BiometricErrorOccurred {
3737 // Biometric modality that was used.
3738 optional android.hardware.biometrics.ModalityEnum modality = 1;
3739 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3740 optional int32 user = 2;
3741 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3742 optional bool is_crypto = 3;
3743 // Action that the device is performing.
3744 optional android.hardware.biometrics.ActionEnum action = 4;
3745 // The client that this acquisition was received for.
3746 optional android.hardware.biometrics.ClientEnum client = 5;
3747 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3748 // are unique to modality.
3749 optional int32 error_info = 6;
3750 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3751 // by the vendor and not specified by the HIDL interface.
3752 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003753 // Dictates if this message should trigger additional debugging.
3754 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003755 // Time spent during the authentication attempt.
3756 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003757}
3758
3759/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003760 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003761 * Logged from:
3762 * frameworks/base/services/core/java/com/android/server/biometrics
3763 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003764message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003765 // Biometric modality.
3766 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003767 // Type of issue detected.
3768 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003769 // Dictates if this message should trigger additional debugging.
3770 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003771}
Howard Ro688ae182018-09-25 00:09:36 -07003772
joshmccloskey6f952b22019-03-25 20:59:35 -07003773/**
3774 * Logs when a biometric enrollment occurs.
3775 *
3776 * Logged from:
3777 * frameworks/base/services/core/java/com/android/server/biometrics
3778 */
3779message BiometricEnrolled {
3780 // Biometric modality that was used.
3781 optional android.hardware.biometrics.ModalityEnum modality = 1;
3782 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3783 optional int32 user = 2;
3784 // The amount of time the enrollment took in milliseconds.
3785 optional int64 latency_millis = 3;
3786 // Whether or not the enrollment was successful.
3787 optional bool success = 4;
3788}
3789
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003790/*
Tej Singh0d176952019-01-16 19:10:54 -08003791 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003792 */
Tej Singh0d176952019-01-16 19:10:54 -08003793message FlagFlipUpdateOccurred {
3794 // If the event is from a flag config package, specify the package name.
3795 optional string flag_flip_package_name = 1;
3796
3797 // The order id of the package
3798 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003799}
3800
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003801/**
3802 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003803 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003804 */
3805message TrainExperimentIds {
3806 repeated int64 experiment_id = 1;
3807}
3808
Yangster-macb89807e2018-11-15 21:10:57 -08003809/*
3810 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003811 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003812 */
3813message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003814 // Name of the train.
3815 optional string train_name = 1;
3816 // Version code for a "train" of packages that need to be installed atomically
3817 optional int64 train_version_code = 2;
3818 // After installation of this package, device requires a restart.
3819 optional bool requires_staging = 3;
3820 // Rollback should be enabled for this install.
3821 optional bool rollback_enabled = 4;
3822 // Requires low latency monitoring if possible.
3823 optional bool requires_low_latency_monitor = 5;
3824
Yangster-macb89807e2018-11-15 21:10:57 -08003825 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003826 UNKNOWN = 0;
3827 INSTALL_REQUESTED = 1;
3828 INSTALL_STARTED = 2;
3829 INSTALL_STAGED_NOT_READY = 3;
3830 INSTALL_STAGED_READY = 4;
3831 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003832 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3833 // and INSTALL_FAILURE_COMMIT.
3834 INSTALL_FAILURE = 6 [deprecated = true];
3835 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003836 INSTALL_CANCELLED = 7;
3837 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003838 INSTALLER_ROLLBACK_INITIATED = 9;
3839 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3840 INSTALLER_ROLLBACK_STAGED = 11;
3841 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3842 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3843 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3844 INSTALLER_ROLLBACK_SUCCESS = 15;
3845 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003846 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3847 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3848 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3849 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3850 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3851 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003852 INSTALL_FAILURE_DOWNLOAD = 23;
3853 INSTALL_FAILURE_STATE_MISMATCH = 24;
3854 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003855 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003856 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003857 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003858 // Possible experiment ids for monitoring this push.
3859 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3860 // user id
3861 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003862 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003863 // Whether or not this is a rollback event
3864 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003865}
3866
Tej Singhc9203082019-05-03 13:42:23 -07003867/* Test atom, is not logged anywhere */
3868message TestAtomReported {
3869 repeated AttributionNode attribution_node = 1;
3870 optional int32 int_field = 2;
3871 optional int64 long_field = 3;
3872 optional float float_field = 4;
3873 optional string string_field = 5;
3874 optional bool boolean_field = 6;
3875 enum State {
3876 UNKNOWN = 0;
3877 OFF = 1;
3878 ON = 2;
3879 }
3880 optional State state = 7;
3881 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3882}
3883
Maggie Whitefc1aa592018-11-28 21:55:23 -08003884/** Represents USB port overheat event. */
3885message UsbPortOverheatEvent {
3886 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3887 optional int32 plug_temperature_deci_c = 1;
3888
3889 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3890 optional int32 max_temperature_deci_c = 2;
3891
3892 /* Time between USB plug event and overheat threshold trip, in seconds. */
3893 optional int32 time_to_overheat_secs = 3;
3894
3895 /* Time between overheat threshold trip and hysteresis, in seconds. */
3896 optional int32 time_to_hysteresis_secs = 4;
3897
3898 /* Time between hysteresis and active mitigation ending, in seconds. */
3899 optional int32 time_to_inactive_secs = 5;
3900};
3901
Maggie White8735b852019-01-18 11:40:49 -08003902/**
3903 * Logs total effective full charge and discharge cycles on a battery.
3904 * Here are some examples of one effective cycle:
3905 * 1) the battery charges from 0% to 100% and drains back to 0%,
3906 * 2) charging from 50% to 100% and draining back to 50% twice.
3907 * Pulled from:
3908 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3909 */
3910message BatteryCycleCount {
3911 /* Number of total charge and discharge cycles on the system battery. */
3912 optional int32 cycle_count = 1;
3913}
3914
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003915/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003916 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3917 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003918 * Pulled from:
3919 * StatsCompanionService
3920 */
3921
Carmen Agimof12dec122019-03-06 16:14:38 +00003922message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003923
Carmen Agimof12dec122019-03-06 16:14:38 +00003924 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003925 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003926 PUBLIC = 1;
3927 PRIVATE = 2;
3928 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003929 }
3930
Carmen Agimof12dec122019-03-06 16:14:38 +00003931 // The type of external storage.
3932 optional android.stats.storage.ExternalStorageType storage_type = 1;
3933 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3934 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003935 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003936 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003937}
3938
Yangster-macb89807e2018-11-15 21:10:57 -08003939/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003940 * Logs when a connection becomes available and lost.
3941 * Logged in StatsCompanionService.java
3942 */
3943message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003944 // Id of the network.
3945 optional int32 net_id = 1;
3946
3947 enum State {
3948 UNKNOWN = 0;
3949 CONNECTED = 1;
3950 DISCONNECTED = 2;
3951 }
3952 // Connected state of a network.
3953 optional State state = 2;
3954}
3955
3956/**
3957 * Logs when a service starts and stops.
3958 * Logged from:
3959 * services/core/java/com/android/server/am/ActiveServices.java
3960 */
3961message ServiceStateChanged {
3962
3963 optional int32 uid = 1 [(is_uid) = true];
3964
3965 optional string package_name = 2;
3966
3967 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003968
3969 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003970 START = 1;
3971 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003972 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003973
3974 optional State state = 4;
3975}
3976
3977/**
3978 * Logs when a service is launched.
3979 * Logged from:
3980 * services/core/java/com/android/server/am/ActiveServices.java
3981 */
3982message ServiceLaunchReported {
3983
3984 optional int32 uid = 1 [(is_uid) = true];
3985
3986 optional string package_name = 2;
3987
3988 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003989}
Howard Ro688ae182018-09-25 00:09:36 -07003990
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003991/**
3992 * Logs when a hidden API is used.
3993 *
3994 * Logged from:
3995 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3996 */
3997message HiddenApiUsed {
3998 // The uid of the app making the hidden access.
3999 optional int32 uid = 1 [(is_uid) = true];
4000
4001 // Signature of the method or field accessed.
4002 optional string signature = 2;
4003
4004 enum AccessMethod {
4005 NONE = 0;
4006 REFLECTION = 1;
4007 JNI = 2;
4008 LINKING = 3;
4009 }
4010
4011 // Type of access.
4012 optional AccessMethod access_method = 3;
4013
4014 // Whether the access was prevented or not.
4015 optional bool access_denied = 4;
4016}
4017
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004018/**
4019 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4020 * - When user sees privacy chip
4021 * - When user clicks privacy chip
4022 * - How does the user exit the Privacy Dialog
4023 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004024 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4025 */
4026message PrivacyIndicatorsInteracted {
4027
4028 enum Type {
4029 UNKNOWN = 0;
4030 CHIP_VIEWED = 1;
4031 CHIP_CLICKED = 2;
4032 DIALOG_PRIVACY_SETTINGS = 3;
4033 DIALOG_DISMISS = 4;
4034 DIALOG_LINE_ITEM = 5;
4035 }
4036
tsaichristine5adc7e02020-01-14 17:07:39 -08004037 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004038
4039 // Used if the type is LINE_ITEM
4040 optional string package_name = 2;
4041}
4042
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004043/**
4044 * Logs information about a package that is moved from the internal to external storage and vice
4045 * versa.
4046 * It logs the package name, the type of the external storage where the package is installed
4047 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4048 * and the move type: if it's from internal to external or the other way around.
4049 *
4050 * Logged from:
4051 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4052 */
4053message AppMovedStorageReported {
4054 enum MoveType {
4055 UNKNOWN = 0;
4056 TO_EXTERNAL = 1;
4057 TO_INTERNAL = 2;
4058 }
4059 // The type of the external storage.
4060 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4061 // The type of move.
4062 optional MoveType move_type = 2;
4063 // The name of the package that was moved.
4064 optional string package_name = 3;
4065}
4066
jianjin8f2dee02019-03-29 14:03:08 -07004067/**
4068 * Logs when system server watchdog occurs.
4069 * Logged from:
4070 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4071 */
4072message SystemServerWatchdogOccurred {
4073 optional string subject = 1;
4074}
4075
4076/**
4077 * Logs when new file added to tombstones.
4078 * Logged from:
4079 * frameworks/base/core/java/com/android/server/BootReceiver.java
4080 */
4081message TombStoneOccurred {
4082}
4083
Hai Zhang5d3328d2019-04-13 21:25:06 +08004084/*
4085 * Information about a role request
4086 *
4087 * Logged from:
4088 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4089 */
4090message RoleRequestResultReported {
4091 // UID of application requesting the role
4092 optional int32 requesting_uid = 1;
4093
4094 // Package name of application requesting the role
4095 optional string requesting_package_name = 2;
4096
4097 // The role to be granted
4098 optional string role_name = 3;
4099
4100 // The count of applications qualifying for the role
4101 optional int32 qualifying_count = 4;
4102
4103 // UID of application current granted the role
4104 optional int32 current_uid = 5;
4105
4106 // Package name of application current granted the role
4107 optional string current_package_name = 6;
4108
4109 // UID of another application that user chose to grant the role to, instead of the requesting
4110 // application
4111 optional int32 granted_another_uid = 7;
4112
4113 // Package name of another application that user chose to grant the role to, instead of the
4114 // requesting application
4115 optional string granted_another_package_name = 8;
4116
4117 enum Result {
4118 UNDEFINED = 0;
4119 // role request was ignored
4120 IGNORED = 1;
4121 // role request was ignored because it's already granted
4122 IGNORED_ALREADY_GRANTED = 2;
4123 // role request was ignored because the application isn't qualified
4124 IGNORED_NOT_QUALIFIED = 3;
4125 // role request was ignored because user said it should be always denied
4126 IGNORED_USER_ALWAYS_DENIED = 4;
4127 // role was granted by user action
4128 USER_GRANTED = 5;
4129 // role was denied by user action
4130 USER_DENIED = 6;
4131 // role was denied by user granting another application the role
4132 USER_DENIED_GRANTED_ANOTHER = 7;
4133 // role was denied and set to be always denied by the user
4134 USER_DENIED_WITH_ALWAYS = 8;
4135 }
4136 // The result of the role request
4137 optional Result result = 9;
4138}
4139
Mark Tabrya824a642019-11-05 12:26:12 -08004140/**
4141 * Logs when a Vehicle Maps Service client's connection state has changed
4142 *
4143 * Logged from:
4144 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4145 */
4146message VmsClientConnectionStateChanged {
4147 // The UID of the VMS client app
4148 optional int32 uid = 1 [(is_uid) = true];
4149
4150 enum State {
4151 UNKNOWN = 0;
4152 // Attempting to connect to the client
4153 CONNECTING = 1;
4154 // Client connection established
4155 CONNECTED = 2;
4156 // Client connection closed unexpectedly
4157 DISCONNECTED = 3;
4158 // Client connection closed by VMS
4159 TERMINATED = 4;
4160 // Error establishing the client connection
4161 CONNECTION_ERROR = 5;
4162 }
4163
4164 optional State state = 2;
4165}
4166
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004167/**
4168 * Logs when MediaProvider has successfully finished scanning a storage volume.
4169 *
4170 * Logged from:
4171 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4172 */
4173message MediaProviderScanEvent {
4174 enum Reason {
4175 // Scan triggered due to unknown reason
4176 UNKNOWN = 0;
4177 // Scan triggered due to storage volume being mounted
4178 MOUNTED = 1;
4179 // Scan triggered due to explicit user action or app request
4180 DEMAND = 2;
4181 // Scan triggered due to idle maintenance
4182 IDLE = 3;
4183 }
4184
4185 // Volume type that this event pertains to
4186 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4187 // Reason why this scan was triggered
4188 optional Reason reason = 2;
4189 // Total number of files scanned
4190 optional int64 item_count = 3;
4191 // Duration of scan, normalized per file
4192 optional float normalized_duration_millis = 4;
4193 // Number of database inserts, normalized per file
4194 optional float normalized_insert_count = 5;
4195 // Number of database updates, normalized per file
4196 optional float normalized_update_count = 6;
4197 // Number of database deletes, normalized per file
4198 optional float normalized_delete_count = 7;
4199}
4200
4201/**
4202 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4203 *
4204 * Logged from:
4205 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4206 */
4207message MediaProviderDeletionEvent {
4208 // Volume type that this event pertains to
4209 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4210 // Device timestamp when this deletion event occurred
4211 optional int64 timestamp_millis = 2;
4212 // App that requested deletion
4213 optional string package_name = 3;
4214 // Number of items that were deleted
4215 optional int32 item_count = 4;
4216}
4217
4218/**
4219 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4220 *
4221 * Logged from:
4222 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4223 */
4224message MediaProviderPermissionEvent {
4225 enum Result {
4226 UNKNOWN = 0;
4227 USER_GRANTED = 1;
4228 AUTO_GRANTED = 2;
4229 USER_DENIED = 3;
4230 USER_DENIED_WITH_PREJUDICE = 4;
4231 AUTO_DENIED = 5;
4232 }
4233
4234 // Volume type that this event pertains to
4235 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4236 // Device timestamp when this permission event occurred
4237 optional int64 timestamp_millis = 2;
4238 // App that requested permission
4239 optional string package_name = 3;
4240 // Number of items that were requested
4241 optional int32 item_count = 4;
4242 // Result of this request
4243 optional Result result = 5;
4244}
4245
4246/**
4247 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4248 *
4249 * Logged from:
4250 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4251 */
4252message MediaProviderSchemaChange {
4253 // Volume type that this event pertains to
4254 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4255 // Old database version code
4256 optional int32 version_from = 2;
4257 // New database version code
4258 optional int32 version_to = 3;
4259 // Total number of files in database
4260 optional int64 item_count = 4;
4261 // Duration of schema change, normalized per file
4262 optional float normalized_duration_millis = 5;
4263}
4264
4265/**
4266 * Logs when MediaProvider has finished an idle maintenance job.
4267 *
4268 * Logged from:
4269 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4270 */
4271message MediaProviderIdleMaintenance {
4272 // Volume type that this event pertains to
4273 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4274
4275 // Total number of files in database
4276 optional int64 item_count = 2;
4277 // Duration of idle maintenance, normalized per file
4278 optional float normalized_duration_millis = 3;
4279 // Number of thumbnails found to be stale, normalized per file
4280 optional float normalized_stale_thumbnails = 4;
4281 // Number of items found to be expired, normalized per file
4282 optional float normalized_expired_media = 5;
4283}
4284
Keun young Park3e033cb2019-12-18 11:27:35 -08004285/**
4286 * Represents boot time event with duration in ms.
4287 *
4288 * Logged from: bootstat and various system server components. Check each enums for details.
4289 */
4290message BootTimeEventDuration {
4291 enum DurationEvent {
4292 UNKNOWN = 0;
4293 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4294 ABSOLUTE_BOOT_TIME = 1;
4295 // Bootloader's 1st stage execution time.
4296 // Logged from bootstat.
4297 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4298 // Bootloader's 1st stage loading time.
4299 // Logged from bootstat.
4300 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4301 // Bootloader's kernel loading time.
4302 // Logged from bootstat.
4303 BOOTLOADER_KERNEL_LOAD = 4;
4304 // Bootloader's 2nd stage execution time.
4305 // Logged from bootstat.
4306 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4307 // Bootloader's 2nd stage loading time.
4308 // Logged from bootstat.
4309 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4310 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4311 // for locked device.
4312 // Logged from bootstat.
4313 BOOTLOADER_UI_WAIT = 7;
4314 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4315 // Logged from bootstat.
4316 BOOTLOADER_TOTAL = 8;
4317 // Shutdown duration inside init for the reboot before the current boot up.
4318 // Logged from f/b/services/.../BootReceiver.java.
4319 SHUTDOWN_DURATION = 9;
4320 // Total time for mounting of disk devices during bootup.
4321 // Logged from f/b/services/.../BootReceiver.java.
4322 MOUNT_DEFAULT_DURATION = 10;
4323 // Total time for early stage mounting of disk devices during bootup.
4324 // Logged from f/b/services/.../BootReceiver.java.
4325 MOUNT_EARLY_DURATION = 11;
4326 // Total time for late stage mounting of disk devices during bootup.
4327 // Logged from f/b/services/.../BootReceiver.java.
4328 MOUNT_LATE_DURATION = 12;
4329 // Average time to scan non-system app after OTA
4330 // Logged from f/b/services/.../PackageManagerService.java
4331 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4332 // Time to initialize Package manager after OTA
4333 // Logged from f/b/services/.../PackageManagerService.java
4334 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4335 // Time to scan all system app from Package manager after OTA
4336 // Logged from f/b/services/.../PackageManagerService.java
4337 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4338 // Init's total time for cold boot stage.
4339 // Logged from bootstat.
4340 COLDBOOT_WAIT = 16;
4341 // Init's total time for initializing selinux.
4342 // Logged from bootstat.
4343 SELINUX_INIT = 17;
4344 // Time since last factory reset.
4345 // Logged from bootstat.
4346 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004347 // Init's total time spent for completing the 1st stage.
4348 // Logged from bootstat.
4349 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004350 }
4351
4352 // Type of the event.
4353 optional DurationEvent event = 1;
4354 // Duration of the event in ms.
4355 optional int64 duration_millis = 2;
4356}
4357
4358/**
4359 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4360 * since boot-up.
4361 *
4362 * Logged from: bootstat and various system server components. Check each enums for details.
4363 */
4364message BootTimeEventElapsedTime {
4365 enum ElapsedTimeEvent {
4366 UNKNOWN = 0;
4367 // Time when init starts 1st stage. Logged from bootstat.
4368 ANDROID_INIT_STAGE_1 = 1;
4369 // Time when sys.boot_completed prop is set.
4370 // Logged from bootstat.
4371 BOOT_COMPLETE = 2;
4372 // BOOT_COMPLETE for encrypted device.
4373 BOOT_COMPLETE_ENCRYPTION = 3;
4374 // BOOT_COMPLETE for device with no encryption.
4375 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4376 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004377 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004378 // BOOT_COMPLETE after factory reset.
4379 FACTORY_RESET_BOOT_COMPLETE = 6;
4380 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4381 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004382 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4383 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004384 // BOOT_COMPLETE after OTA.
4385 OTA_BOOT_COMPLETE = 9;
4386 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4387 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004388 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4389 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004390 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4391 // Logged from f/b/services/.../UserController.java
4392 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4393 // Time when the system starts sending BOOT_COMPLETED broadcast.
4394 // Logged from f/b/services/.../UserController.java
4395 FRAMEWORK_BOOT_COMPLETED = 13;
4396 // Time when the package manager starts init.
4397 // Logged from f/b/services/.../SystemServer.java
4398 PACKAGE_MANAGER_INIT_START = 14;
4399 // Time when package manager is ready
4400 // Logged from f/b/services/.../SystemServer.java
4401 PACKAGE_MANAGER_INIT_READY = 15;
4402 // Represents the time when user has entered unlock credential for system with user pin.
4403 // Logged from bootstat.
4404 POST_DECRYPT = 16;
4405 // Represents the start of zygote's init.
4406 // Logged from zygote itself.
4407 ZYGOTE_INIT_START = 17;
4408 // Represents the start of secondary zygote's init.
4409 // TODO: add logging to zygote
4410 SECONDARY_ZYGOTE_INIT_START = 18;
4411 // Represents the start of system server's init.
4412 // Logged from f/b/services/.../SystemServer.java
4413 SYSTEM_SERVER_INIT_START = 19;
4414 // Represents the completion of system server's init.
4415 // Logged from f/b/services/.../SystemServer.java
4416 SYSTEM_SERVER_READY = 20;
4417 // Represents the start of launcher during boot-up.
4418 // TODO: add logging
4419 LAUNCHER_START = 21;
4420 // Represents the completion of launcher's initial rendering. User can use other apps from
4421 // launcher from this point.
4422 // TODO: add logging
4423 LAUNCHER_SHOWN = 22;
4424 }
4425
4426 // Type of the event.
4427 optional ElapsedTimeEvent event = 1;
4428 // Time since bootup for the event.
4429 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4430 optional int64 time_millis = 2;
4431}
4432
4433/**
4434 * Boot time events with UTC time.
4435 *
4436 * Logged from: bootstat and various system server components. Check each enums for details.
4437 */
4438message BootTimeEventUtcTime {
4439 enum UtcTimeEvent {
4440 UNKNOWN = 0;
4441 // Time of the bootstat's marking of 1st boot after the last factory reset.
4442 // Logged from bootstat.
4443 FACTORY_RESET_RESET_TIME = 1;
4444 // The time when bootstat records FACTORY_RESET_* events. This is close to
4445 // BOOT_COMPLETE time for the current bootup.
4446 // Logged from bootstat.
4447 FACTORY_RESET_CURRENT_TIME = 2;
4448 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4449 // Logged from bootstat.
4450 FACTORY_RESET_RECORD_VALUE = 3;
4451 }
4452
4453 // Type of the event.
4454 optional UtcTimeEvent event = 1;
4455 // UTC time for the event.
4456 optional int64 utc_time_secs = 2;
4457}
4458
4459/**
4460 * Boot time events representing specific error code during bootup.
4461 * Meaning of error code can be different per each event type.
4462 *
4463 * Logged from: bootstat and various system server components. Check each enums for details.
4464 */
4465message BootTimeEventErrorCode {
4466 enum ErrorCodeEvent {
4467 UNKNOWN = 0;
4468 // Linux error code for time() call to get the current UTC time.
4469 // Logged from bootstat.
4470 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4471 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4472 // as UMOUNT_STAT_* from init/reboot.cpp.
4473 // Logged from f/b/services/.../BootReceiver.java.
4474 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004475 // Reprepsents fie system mounting error code of /data partition for the current boot.
4476 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004477 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004478 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004479 }
4480
4481 // Type of the event.
4482 optional ErrorCodeEvent event = 1;
4483 // error code defined per each event type.
4484 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4485 // FS_MGR_FS_STAT.
4486 optional int32 error_code = 2;
4487}
4488
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004489/**
4490 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4491 * after an OTA.
4492 *
4493 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004494 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004495 */
4496message SnapshotMergeReported {
4497 // Keep in sync with
4498 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4499 enum UpdateState {
4500 // No update or merge is in progress.
4501 NONE = 0;
4502 // An update is applying; snapshots may already exist.
4503 INITIATED = 1;
4504 // An update is pending, but has not been successfully booted yet.
4505 UNVERIFIED = 2;
4506 // The kernel is merging in the background.
4507 MERGING = 3;
4508 // Post-merge cleanup steps could not be completed due to a transient
4509 // error, but the next reboot will finish any pending operations.
4510 MERGE_NEEDS_REBOOT = 4;
4511 // Merging is complete, and needs to be acknowledged.
4512 MERGE_COMPLETED = 5;
4513 // Merging failed due to an unrecoverable error.
4514 MERGE_FAILED = 6;
4515 // The update was implicitly cancelled, either by a rollback or a flash
4516 // operation via fastboot. This state can only be returned by WaitForMerge.
4517 CANCELLED = 7;
4518 };
4519
4520 // Status of the update after the merge attempts.
4521 optional UpdateState final_state = 1;
4522
4523 // Time to complete a merge operation in milliseconds.
4524 // A negative value corresponds to the case in which the merge operation
4525 // was interrupted and resumed (e.g. in case of a system reboot during the
4526 // merge).
4527 optional int64 duration_millis = 2;
4528
4529 // Number of reboots that occurred after issuing and before completing the
4530 // merge of all the snapshot devices.
4531 optional int32 intermediate_reboots = 3;
4532}
4533
Chenjie Yubbcbc602018-02-05 16:51:52 -08004534//////////////////////////////////////////////////////////////////////
4535// Pulled atoms below this line //
4536//////////////////////////////////////////////////////////////////////
4537
4538/**
David Chenc8a43242017-10-17 16:23:28 -07004539 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4540 *
4541 * Pulled from:
4542 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4543 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004544message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004545 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004546
4547 optional int64 rx_bytes = 2;
4548
4549 optional int64 rx_packets = 3;
4550
4551 optional int64 tx_bytes = 4;
4552
4553 optional int64 tx_packets = 5;
4554}
4555
4556/**
4557 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4558 *
4559 * Pulled from:
4560 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4561 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004562message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004563 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004564
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004565 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4566 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004567
4568 optional int64 rx_bytes = 3;
4569
4570 optional int64 rx_packets = 4;
4571
4572 optional int64 tx_bytes = 5;
4573
4574 optional int64 tx_packets = 6;
4575}
4576
4577/**
4578 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4579 *
4580 * Pulled from:
4581 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4582 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004583message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004584 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004585
4586 optional int64 rx_bytes = 2;
4587
4588 optional int64 rx_packets = 3;
4589
4590 optional int64 tx_bytes = 4;
4591
4592 optional int64 tx_packets = 5;
4593}
4594
4595/**
4596 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4597 *
4598 * Pulled from:
4599 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4600 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004601message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004602 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004603
Yao Chenc40a19d2018-03-15 16:48:25 -07004604 // 1 denotes foreground and 0 denotes background. This is called Set in
4605 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004606 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004607
4608 optional int64 rx_bytes = 3;
4609
4610 optional int64 rx_packets = 4;
4611
4612 optional int64 tx_bytes = 5;
4613
4614 optional int64 tx_packets = 6;
4615}
4616
4617/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004618 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4619 *
4620 * Pulled from:
4621 * StatsCompanionService
4622 */
4623message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004624 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004625
4626 optional int64 rx_bytes = 2;
4627
4628 optional int64 tx_bytes = 3;
4629}
4630
4631/**
David Chenc8a43242017-10-17 16:23:28 -07004632 * Pulls the kernel wakelock durations. This atom is adapted from
4633 * android/internal/os/KernelWakelockStats.java
4634 *
4635 * Pulled from:
4636 * StatsCompanionService using KernelWakelockReader.
4637 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004638message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004639 optional string name = 1;
4640
4641 optional int32 count = 2;
4642
4643 optional int32 version = 3;
4644
Yangster-maca8a30442018-10-13 23:46:34 -07004645 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004646}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004647
Chenjie Yu05013b32017-11-21 10:21:41 -08004648/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004649 * Pulls low power state information. If power.stats HAL is not available, this
4650 * includes platform and subsystem sleep state information,
4651 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4652 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004653 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004654 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004655 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4656 * as defined in:
4657 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004658 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004659message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004660 // Subsystem name
4661 optional string subsystem_name = 1;
4662 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4663 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004664 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4665 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004666 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004667 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004668 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004669 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004670 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004671}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004672
Chenjie Yu05013b32017-11-21 10:21:41 -08004673/**
Bookatz92da2832018-11-01 18:10:03 -07004674 * Pulls on-device power measurement information.
4675 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4676 * Pulled from:
4677 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4678 */
4679message OnDevicePowerMeasurement {
4680 // Name of the subsystem (to which the rail belongs).
4681 optional string subsystem_name = 1;
4682
4683 // Rail name. The rail lies within the subsystem.
4684 optional string rail_name = 2;
4685
4686 // Time (in ms since boot) at which the rail energy value was measured.
4687 // This may differ slightly from the time that statsd logs this information.
4688 optional uint64 measurement_timestamp_millis = 3;
4689
4690 // Accumulated energy used via the rail since device boot in uWs.
4691 optional uint64 energy_microwatt_secs = 4;
4692}
4693
4694/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004695 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004696 * Pulls the time the cpu spend on the frequency index. Frequency index
4697 * starts from highest to lowest. The value should be monotonically
4698 * increasing since boot. However, if there is a cpu
4699 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004700 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004701message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004702 optional uint32 cluster = 1;
4703 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004704 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004705}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004706
Chenjie Yu05013b32017-11-21 10:21:41 -08004707/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004708 * Pulls Cpu Time Per Uid.
4709 * Note that isolated process uid time should be attributed to host uids.
4710 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004711message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004712 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004713 optional uint64 user_time_micros = 2;
4714 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004715}
4716
4717/**
4718 * Pulls Cpu Time Per Uid per frequency.
4719 * Note that isolated process uid time should be attributed to host uids.
4720 * For each uid, we order the time by descending frequencies.
4721 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004722message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004723 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004724 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004725 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004726}
Hugo Benichi884970e2017-11-14 22:42:46 +09004727
Chenjie Yu05013b32017-11-21 10:21:41 -08004728/**
4729 * Pulls Wifi Controller Activity Energy Info
4730 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004731message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004732 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004733 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004734 // stack reported state
4735 // TODO: replace this with proto enum
4736 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004737 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004738 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004739 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004740 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004741 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004742 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004743 // product of current(mA), voltage(V) and time(ms)
4744 optional uint64 controller_energy_used = 6;
4745}
4746
4747/**
4748 * Pulls Modem Activity Energy Info
4749 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004750message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004751 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004752 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004753 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004754 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004755 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004756 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004757 /**
4758 * Tx power index
4759 * index 0 = tx_power < 0dBm
4760 * index 1 = 0dBm < tx_power < 5dBm
4761 * index 2 = 5dBm < tx_power < 15dBm
4762 * index 3 = 15dBm < tx_power < 20dBm
4763 * index 4 = tx_power > 20dBm
4764 */
4765 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004766 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004767 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004768 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004769 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004770 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004771 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004772 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004773 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004774 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004775 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004776 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004777 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004778 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004779}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004780
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004781/**
4782 * Pulls Bluetooth Activity Energy Info
4783 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4784 */
4785message BluetoothActivityInfo {
4786 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004787 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004788 // bluetooth stack state
4789 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004790 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004791 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004792 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004793 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004794 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004795 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004796 // product of current(mA), voltage(V) and time(ms)
4797 optional uint64 energy_used = 6;
4798}
4799
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004800/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004801 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004802 *
4803 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004804 */
4805message ProcessMemoryState {
4806 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004807 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004808
4809 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004810 // Usually package name, "system" for system server.
4811 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004812 optional string process_name = 2;
4813
Rafal Slawikda51b932018-12-13 16:31:33 +00004814 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004815 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004816
4817 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004818 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004819
4820 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004821 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004822
Rajeev Kumar90235992018-01-29 11:06:48 -08004823 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004824 // Value is read from memory.stat, field total_rss if per-app memory
4825 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004826 optional int64 rss_in_bytes = 6;
4827
4828 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004829 // Value is read from memory.stat, field total_cache if per-app memory
4830 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004831 optional int64 cache_in_bytes = 7;
4832
4833 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004834 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004835 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004836 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004837
Rafal Slawik203c3db2019-09-25 19:53:01 +01004838 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004839 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004840
Rafal Slawik203c3db2019-09-25 19:53:01 +01004841 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4842 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004843
Rafal Slawik203c3db2019-09-25 19:53:01 +01004844 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4845 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004846}
4847
4848/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004849 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004850 *
4851 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4852 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004853 *
4854 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004855 */
4856message ProcessMemoryHighWaterMark {
4857 // The uid if available. -1 means not available.
4858 optional int32 uid = 1 [(is_uid) = true];
4859
Rafal Slawikda51b932018-12-13 16:31:33 +00004860 // The process name.
4861 // Usually package name or process cmdline.
4862 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004863 optional string process_name = 2;
4864
Rafal Slawik239b6802019-09-09 18:46:01 +01004865 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4866 // computed by converting kilobytes to bytes.
4867 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4868
Rafal Slawik3bea8952018-11-15 12:39:33 +00004869 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4870 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004871 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004872}
4873
4874/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004875 * Logs the memory stats for a process.
4876 *
4877 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4878 * and for selected native processes.
4879 */
4880message ProcessMemorySnapshot {
4881 // The uid if available. -1 means not available.
4882 optional int32 uid = 1 [(is_uid) = true];
4883
4884 // The process name.
4885 // Usually package name or process cmdline.
4886 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4887 optional string process_name = 2;
4888
4889 // The pid of the process.
4890 // Allows to disambiguate instances of the process.
4891 optional int32 pid = 3;
4892
4893 // The current OOM score adjustment value.
4894 // Read from ProcessRecord for managed processes.
4895 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4896 optional int32 oom_score_adj = 4;
4897
4898 // The current RSS of the process.
4899 // VmRSS from /proc/pid/status.
4900 optional int32 rss_in_kilobytes = 5;
4901
4902 // The current anon RSS of the process.
4903 // RssAnon from /proc/pid/status.
4904 optional int32 anon_rss_in_kilobytes = 6;
4905
4906 // The current swap size of the process.
4907 // VmSwap from /proc/pid/status.
4908 optional int32 swap_in_kilobytes = 7;
4909
4910 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4911 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4912}
4913
4914/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004915 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004916 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004917message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004918 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004919}
4920
4921/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004922 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004923 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004924message SystemUptime {
4925 // Milliseconds since the system was booted.
4926 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4927 // for external input).
4928 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004929 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004930}
4931
4932/*
4933 * Reads from /proc/uid_concurrent_active_time which has the format:
4934 * active: X (X is # cores)
4935 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4936 * [uid1]: [time-0] [time-1] [time-2] ... ...
4937 * ...
4938 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4939 * The file contains a monotonically increasing count of time for a single boot.
4940 */
4941message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004942 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004943 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004944}
4945
4946/**
4947 * Reads from /proc/uid_concurrent_policy_time which has the format:
4948 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4949 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4950 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4951 * ...
4952 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4953 * The file contains a monotonically increasing count of time for a single boot.
4954 */
4955message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004956 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004957 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004958 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004959}
4960
4961/*
4962 * Pulls free disk space, for data, system partition and temporary directory.
4963 */
4964message DiskSpace {
4965 // available bytes in data partition
4966 optional uint64 data_available_bytes = 1;
4967 // available bytes in system partition
4968 optional uint64 system_available_bytes = 2;
4969 // available bytes in download cache or temp directories
4970 optional uint64 temp_available_bytes = 3;
4971}
Tej Singhbf972d92018-01-10 20:51:13 -08004972
4973/**
4974 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004975 *
4976 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004977 */
4978message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004979 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004980}
4981
4982/**
4983 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004984 * Pulled from:
4985 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004986 */
4987message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004988 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004989}
4990
4991/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004992 * Pulls battery voltage.
4993 * Pulled from:
4994 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4995 */
4996message BatteryVoltage {
4997 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004998 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004999}
5000
5001/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005002 * Pulls battery level (percent full, from 0 to 100).
5003 *
5004 * Pulled from:
5005 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5006 */
5007message BatteryLevel {
5008 // Battery level. Should be in [0, 100].
5009 optional int32 battery_level = 1;
5010}
5011
5012/**
Tej Singhd89137e2018-03-26 14:51:40 -07005013 * Pulls the temperature of various parts of the device.
5014 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005015 *
Maggie White442b6312019-04-05 16:26:44 -07005016 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005017 */
5018message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005019 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005020 optional android.os.TemperatureTypeEnum sensor_location = 1;
5021
5022 // The name of the temperature source. Eg. CPU0
5023 optional string sensor_name = 2;
5024
Tej Singhd89137e2018-03-26 14:51:40 -07005025 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005026 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005027 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005028
5029 // Relative severity of the throttling, see enum definition.
5030 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005031}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005032
5033/**
5034 * Pulls the statistics of calls to Binder.
5035 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005036 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5037 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005038 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005039 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005040 */
5041message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005042 // UID of the process responsible for the binder transaction. It will be set if the process
5043 // executing the binder transaction attribute the transaction to another uid using
5044 // Binder.setThreadWorkSource().
5045 //
5046 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005047 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005048 // UID of the process executing the binder transaction.
5049 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005050 // Fully qualified class name of the API call.
5051 //
5052 // This is a system server class name.
5053 //
5054 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5055 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5056 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5057 // commonly used APIs.
5058 optional string service_class_name = 2;
5059 // Method name of the API call. It can also be a transaction code if we cannot
5060 // resolve it to a name. See Binder#getTransactionName.
5061 //
5062 // This is a system server method name.
5063 optional string service_method_name = 3;
5064 // Total number of API calls.
5065 optional int64 call_count = 4;
5066 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5067 optional bool screen_interactive = 13;
5068 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5069 // call_count will be equal to recorded_call_count.
5070 //
5071 // If recorded_call_count is different than call_count, it means data collection has been
5072 // sampled. All the fields below will be sampled in this case.
5073 optional int64 recorded_call_count = 12;
5074 // Number of exceptions thrown by the API.
5075 optional int64 recorded_exception_count = 5;
5076 // Total latency of all API calls.
5077 // Average can be computed using total_latency_micros / recorded_call_count.
5078 optional int64 recorded_total_latency_micros = 6;
5079 // Maximum latency of one API call.
5080 optional int64 recorded_max_latency_micros = 7;
5081 // Total CPU usage of all API calls.
5082 // Average can be computed using total_cpu_micros / recorded_call_count.
5083 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5084 optional int64 recorded_total_cpu_micros = 8;
5085 // Maximum CPU usage of one API call.
5086 optional int64 recorded_max_cpu_micros = 9;
5087 // Maximum parcel reply size of one API call.
5088 optional int64 recorded_max_reply_size_bytes = 10;
5089 // Maximum parcel request size of one API call.
5090 optional int64 recorded_max_request_size_bytes = 11;
5091}
5092
5093/**
5094 * Pulls the statistics of exceptions during calls to Binder.
5095 *
5096 * Binder stats are cumulative from boot unless somebody reset the data using
5097 * > adb shell dumpsys binder_calls_stats --reset
5098 */
5099message BinderCallsExceptions {
5100 // Exception class name, e.g. java.lang.IllegalArgumentException.
5101 //
5102 // This is an exception class name thrown by the system server.
5103 optional string exception_class_name = 1;
5104 // Total number of exceptions.
5105 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005106}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005107
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005108/**
5109 * Pulls the statistics of message dispatching on HandlerThreads.
5110 *
5111 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5112 * config on the device.
5113 *
5114 * Next tag: 11
5115 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005116message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005117 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005118 optional int32 uid = 1 [(is_uid) = true];
5119
5120 // Fully qualified class name of the handler target class.
5121 //
5122 // This field does not contain PII. This is a system server class name.
5123 optional string handler_class_name = 2;
5124
5125 // The name of the thread that runs the Looper.
5126 //
5127 // This field does not contain PII. This is a system server thread name.
5128 optional string looper_thread_name = 3;
5129
5130 // The name of the dispatched message.
5131 //
5132 // This field does not contain PII. This is a system server constant or class
5133 // name.
5134 optional string message_name = 4;
5135
5136 // Total number of successfully dispatched messages.
5137 optional int64 message_count = 5;
5138
5139 // Total number of messages that failed dispatching.
5140 optional int64 exception_count = 6;
5141
5142 // Total number of processed messages we have data recorded for. If we
5143 // collected data for all the messages, message_count will be equal to
5144 // recorded_message_count.
5145 //
5146 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005147 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005148 optional int64 recorded_message_count = 7;
5149
5150 // Total latency of all processed messages.
5151 // Average can be computed using recorded_total_latency_micros /
5152 // recorded_message_count.
5153 optional int64 recorded_total_latency_micros = 8;
5154
5155 // Total CPU usage of all processed message.
5156 // Average can be computed using recorded_total_cpu_micros /
5157 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005158 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005159 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005160
5161 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5162 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005163
5164 // Max recorded CPU usage of all processed messages.
5165 optional int64 recorded_max_cpu_micros = 11;
5166
5167 // Max recorded latency of all processed messages.
5168 optional int64 recorded_max_latency_micros = 12;
5169
5170 // Total number of messages we tracked the dispatching delay for. If we
5171 // collected data for all the messages, message_count will be equal to
5172 // recorded_delay_message_count.
5173 //
5174 // If recorded_delay_message_count is different than message_count, it means data
5175 // collection has been sampled or/and not all messages specified the target dispatch time.
5176 // The fields below will be sampled in this case.
5177 optional int64 recorded_delay_message_count = 13;
5178
5179 // Total dispatching delay of all processed messages.
5180 // Calculated as a difference between the target dispatching time (Message.when)
5181 // and the actual dispatching time.
5182 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5183 optional int64 recorded_total_delay_millis = 14;
5184
5185 // Max dispatching delay of all processed messages.
5186 // Calculated as a difference between the target dispatching time (Message.when)
5187 // and the actual dispatching time.
5188 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005189}
Tej Singh86dc9db2018-09-06 00:39:57 +00005190
5191/**
5192 * Pulls disk information, such as write speed and latency.
5193 */
5194message DiskStats {
5195 // Time taken to open, write 512B to, and close a file.
5196 // -1 if error performing the check.
5197 optional int64 data_write_latency_millis = 1;
5198
5199 optional bool file_based_encryption = 2;
5200
5201 // Recent disk write speed in kB/s.
5202 // -1 if error querying storageed.
5203 // 0 if data is unavailable.
5204 optional int32 recent_disk_write_speed = 3;
5205}
5206
5207
5208/**
5209 * Free and total bytes of the Data, Cache, and System partition.
5210 */
5211message DirectoryUsage {
5212 enum Directory {
5213 UNKNOWN = 0;
5214 DATA = 1;
5215 CACHE = 2;
5216 SYSTEM = 3;
5217 }
5218 optional Directory directory = 1;
5219 optional int64 free_bytes = 2;
5220 optional int64 total_bytes = 3;
5221}
5222
5223
5224/**
5225 * Size of an application: apk size, data size, and cache size.
5226 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5227 * Information is only reported for apps with the primary user (user 0).
5228 * Sizes are aggregated by package name.
5229 */
5230message AppSize {
5231 // Including uids will involve modifying diskstats logic.
5232 optional string package_name = 1;
5233 // App size in bytes. -1 if unavailable.
5234 optional int64 app_size_bytes = 2;
5235 // App data size in bytes. -1 if unavailable.
5236 optional int64 app_data_size_bytes = 3;
5237 // App cache size in bytes. -1 if unavailable.
5238 optional int64 app_cache_size_bytes = 4;
5239 // Time that the cache file was produced.
5240 // Uses System.currentTimeMillis(), which is wall clock time.
5241 optional int64 cache_time_millis = 5;
5242}
5243
5244
5245/**
5246 * Size of a particular category. Eg: photos, videos.
5247 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5248 */
5249message CategorySize {
5250 enum Category {
5251 UNKNOWN = 0;
5252 APP_SIZE = 1;
5253 APP_DATA_SIZE = 2;
5254 APP_CACHE_SIZE = 3;
5255 PHOTOS = 4;
5256 VIDEOS = 5;
5257 AUDIO = 6;
5258 DOWNLOADS = 7;
5259 SYSTEM = 8;
5260 OTHER = 9;
5261 }
5262 optional Category category = 1;
5263 // Category size in bytes.
5264 optional int64 size_bytes = 2;
5265 // Time that the cache file was produced.
5266 // Uses System.currentTimeMillis(), which is wall clock time.
5267 optional int64 cache_time_millis = 3;
5268}
Tej Singhd6d6d772018-09-05 17:41:25 -07005269
5270/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005271 * Pulls per uid I/O stats. The stats are cumulative since boot.
5272 *
5273 * Read/write bytes are I/O events from a storage device
5274 * Read/write chars are data requested by read/write syscalls, and can be
5275 * satisfied by caching.
5276 *
5277 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5278 */
5279message DiskIo {
5280 optional int32 uid = 1 [(is_uid) = true];
5281 optional int64 fg_chars_read = 2;
5282 optional int64 fg_chars_write = 3;
5283 optional int64 fg_bytes_read = 4;
5284 optional int64 fg_bytes_write = 5;
5285 optional int64 bg_chars_read = 6;
5286 optional int64 bg_chars_write = 7;
5287 optional int64 bg_bytes_read = 8;
5288 optional int64 bg_bytes_write = 9;
5289 optional int64 fg_fsync = 10;
5290 optional int64 bg_fsync= 11;
5291}
5292
5293
5294/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005295 * Pulls the number of fingerprints for each user.
5296 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005297 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005298 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005299message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005300 // The associated user. Eg: 0 for owners, 10+ for others.
5301 // Defined in android/os/UserHandle.java
5302 optional int32 user = 1;
5303 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005304 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005305}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005306
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005307/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005308 * Pulls the number of faces for each user.
5309 *
5310 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5311 */
5312message NumFacesEnrolled {
5313 // The associated user. Eg: 0 for owners, 10+ for others.
5314 // Defined in android/os/UserHandle.java
5315 optional int32 user = 1;
5316 // Number of faces registered to that user.
5317 optional int32 num_faces_enrolled = 2;
5318}
5319/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005320 * A mapping of role holder -> role
5321 */
5322message RoleHolder {
5323 // uid of the role holder
5324 optional int32 uid = 1 [(is_uid) = true];
5325
5326 // package name of the role holder
5327 optional string package_name = 2;
5328
5329 // the role held
5330 optional string role = 3;
5331}
5332
Yangsteraf9aee72018-10-12 09:26:16 -07005333message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005334 // These are all in byte resolution.
5335 optional int64 min = 1 [deprecated = true];
5336 optional int64 average = 2 [deprecated = true];
5337 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005338
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005339 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5340 // int64 fields.
5341 optional int32 mean_kb = 4;
5342 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005343}
5344
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005345// A reduced subset of process states; reducing the number of possible states allows more
5346// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5347enum ProcessStateAggregated {
5348 PROCESS_STATE_UNKNOWN = 0;
5349 // Persistent system process.
5350 PROCESS_STATE_PERSISTENT = 1;
5351 // Top activity; actually any visible activity.
5352 PROCESS_STATE_TOP = 2;
5353 // Process binding to top or a foreground service.
5354 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5355 // Processing running a foreground service.
5356 PROCESS_STATE_FGS = 4;
5357 // Important foreground process (ime, wallpaper, etc).
5358 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5359 // Important background process.
5360 PROCESS_STATE_BACKGROUND = 6;
5361 // Process running a receiver.
5362 PROCESS_STATE_RECEIVER = 7;
5363 // All kinds of cached processes.
5364 PROCESS_STATE_CACHED = 8;
5365}
5366
5367// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005368message ProcessStatsStateProto {
5369 optional android.service.procstats.ScreenState screen_state = 1;
5370
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005371 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005372
5373 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5374 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005375 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5376
5377 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005378
5379 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005380 optional int64 duration_millis = 4 [deprecated = true];
5381 // Same as above, but with minute resolution so it fits into an int32.
5382 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005383
5384 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005385 optional int64 realtime_duration_millis = 9 [deprecated = true];
5386 // Same as above, but with minute resolution so it fits into an int32.
5387 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005388
5389 // # of samples taken
5390 optional int32 sample_size = 5;
5391
5392 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005393 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005394
5395 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005396 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005397
5398 // RSS is memory resident for this process
5399 optional AggStats rss = 8;
5400}
5401
5402// Next Tag: 7
5403message ProcessStatsProto {
5404 // Name of process.
5405 optional string process = 1;
5406
5407 // Uid of the process.
5408 optional int32 uid = 2;
5409
5410 // Information about how often kills occurred
5411 message Kill {
5412 // Count of excessive CPU kills
5413 optional int32 cpu = 1;
5414
5415 // Count of kills when cached
5416 optional int32 cached = 2;
5417
5418 // PSS stats during cached kill
5419 optional AggStats cached_pss = 3;
5420 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005421 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005422
5423 // Time and memory spent in various states.
5424 repeated ProcessStatsStateProto states = 5;
5425
5426 // Total time process has been running... screen_state, memory_state, and process_state
5427 // will not be set.
5428 optional ProcessStatsStateProto total_running_state = 6;
5429}
5430
5431message PackageServiceOperationStatsProto {
5432 // Operate enum: Started, Foreground, Bound, Executing
5433 optional android.service.procstats.ServiceOperationState operation = 1;
5434
5435 // Number of times the service was in this operation.
5436 optional int32 count = 2;
5437
5438 // Information about a state the service can be in.
5439 message StateStats {
5440 // Screen state enum.
5441 optional android.service.procstats.ScreenState screen_state = 1;
5442 // Memory state enum.
5443 optional android.service.procstats.MemoryState memory_state = 2;
5444
5445 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005446 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005447 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005448 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005449 }
5450 repeated StateStats state_stats = 3;
5451}
5452
5453message PackageServiceStatsProto {
5454 // Name of service component.
5455 optional string service_name = 1;
5456
5457 // The operation stats.
5458 // The package_name, package_uid, package_version, service_name will not be set to save space.
5459 repeated PackageServiceOperationStatsProto operation_stats = 2;
5460}
5461
5462message PackageAssociationSourceProcessStatsProto {
5463 // Uid of the process.
5464 optional int32 process_uid = 1;
5465 // Process name.
5466 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005467 // Package name.
5468 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005469 // Total count of the times this association appeared.
5470 optional int32 total_count = 3;
5471
5472 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005473 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005474
5475 // Total count of the times this association became actively impacting its target process.
5476 optional int32 active_count = 5;
5477
5478 // Information on one source in this association.
5479 message StateStats {
5480 // Process state enum.
5481 optional android.service.procstats.ProcessState process_state = 1;
5482 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005483 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005484 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005485 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005486 }
5487 repeated StateStats active_state_stats = 6;
5488}
5489
5490message PackageAssociationProcessStatsProto {
5491 // Name of the target component.
5492 optional string component_name = 1;
5493 // Information on one source in this association.
5494 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5495}
5496
5497
5498message ProcessStatsPackageProto {
5499 // Name of package.
5500 optional string package = 1;
5501
5502 // Uid of the package.
5503 optional int32 uid = 2;
5504
5505 // Version of the package.
5506 optional int64 version = 3;
5507
5508 // Stats for each process running with the package loaded in to it.
5509 repeated ProcessStatsProto process_stats = 4;
5510
5511 // Stats for each of the package's services.
5512 repeated PackageServiceStatsProto service_stats = 5;
5513
5514 // Stats for each association with the package.
5515 repeated PackageAssociationProcessStatsProto association_stats = 6;
5516}
5517
5518message ProcessStatsSectionProto {
5519 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005520 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005521
5522 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005523 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005524
5525 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005526 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005527
5528 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005529 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005530
5531 // System runtime library. e.g. "libdvm.so", "libart.so".
5532 optional string runtime = 5;
5533
5534 // whether kernel reports swapped pss.
5535 optional bool has_swapped_pss = 6;
5536
5537 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5538 enum Status {
5539 STATUS_UNKNOWN = 0;
5540 STATUS_COMPLETE = 1;
5541 STATUS_PARTIAL = 2;
5542 STATUS_SHUTDOWN = 3;
5543 STATUS_SYSPROPS = 4;
5544 }
5545 repeated Status status = 7;
5546
Chenjie Yub2ecc792019-01-17 10:27:26 -08005547 // Number of pages available of various types and sizes, representation fragmentation.
5548 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5549
Yangsteraf9aee72018-10-12 09:26:16 -07005550 // Stats for each process.
5551 repeated ProcessStatsProto process_stats = 8;
5552
5553 // Stats for each package.
5554 repeated ProcessStatsPackageProto package_stats = 9;
5555}
5556
Chenjie Yub2ecc792019-01-17 10:27:26 -08005557message ProcessStatsAvailablePagesProto {
5558 // Node these pages are in (as per /proc/pagetypeinfo)
5559 optional int32 node = 1;
5560
5561 // Zone these pages are in (as per /proc/pagetypeinfo)
5562 optional string zone = 2;
5563
5564 // Label for the type of these pages (as per /proc/pagetypeinfo)
5565 optional string label = 3;
5566
5567 // Distribution of number of pages available by order size. First entry in array is
5568 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5569 repeated int32 pages_per_order = 4;
5570}
5571
Chenjie Yu12e5e672018-09-14 15:54:59 -07005572/**
5573 * Pulled from ProcessStatsService.java
5574 */
5575message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005576 optional ProcessStatsSectionProto proc_stats_section = 1;
5577}
5578
Chenjie Yuf910b7802019-01-11 16:08:20 -08005579/**
5580 * Pulled from ProcessStatsService.java
5581 */
5582message ProcStatsPkgProc {
5583 optional ProcessStatsSectionProto proc_stats_section = 1;
5584}
5585
Chris Wrencdea3b72019-11-22 16:58:17 -05005586// Next Tag: 2
5587message PackageRemoteViewInfoProto {
5588 optional string package_name = 1;
5589 // add per-package additional info here (like channels)
5590}
5591
5592// Next Tag: 2
5593message NotificationRemoteViewsProto {
5594 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5595}
5596
5597/**
5598 * Pulled from NotificationManagerService.java
5599 */
5600message NotificationRemoteViews {
5601 optional NotificationRemoteViewsProto notification_remote_views = 1;
5602}
5603
Yotam Aron74299972020-01-16 16:20:58 +02005604/**
5605 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5606 */
5607message PackageNotificationPreferences {
5608 // Uid under which the package is installed.
5609 optional int32 uid = 1;
5610 // Notification importance, which specifies when and how a notification is displayed.
5611 // Specified under core/java/android/app/NotificationManager.java.
5612 optional int32 importance = 2;
5613 // Lockscreen visibility as set by the user.
5614 optional int32 visibility = 3;
5615 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5616 // PreferencesHelper.java)
5617 optional int32 user_locked_fields = 4;
5618}
5619
5620/**
5621 * Atom that contains a list of a package's channel preferences, pulled from
5622 * NotificationManagerService.java.
5623 */
5624message PackageNotificationChannelPreferences {
5625 // Uid under which the package is installed.
5626 optional int32 uid = 1;
5627 // Channel's ID. Should always be available.
5628 optional string channel_id = 2;
5629 // Channel's name. Should always be available.
5630 optional string channel_name = 3;
5631 // Channel's description. Optionally set by the channel creator.
5632 optional string description = 4;
5633 // Notification importance, which specifies when and how a notification is displayed. Specified
5634 // under core/java/android/app/NotificationManager.java.
5635 optional int32 importance = 5;
5636 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5637 // at core/java/android/app/NotificationChannel.java
5638 optional int32 user_locked_fields = 6;
5639 // Indicates if the channel was deleted by the app.
5640 optional bool is_deleted = 7;
5641}
5642
5643/**
5644 * Atom that contains a list of a package's channel group preferences, pulled from
5645 * NotificationManagerService.java.
5646 */
5647message PackageNotificationChannelGroupPreferences {
5648 // Uid under which the package is installed.
5649 optional int32 uid = 1;
5650 // Channel Group's ID. Should always be available.
5651 optional string group_id = 2;
5652 // Channel Group's name. Should always be available.
5653 optional string group_name = 3;
5654 // Channel Group's description. Optionally set by group creator.
5655 optional string description = 4;
5656 // Indicates if notifications from this channel group are blocked.
5657 optional bool is_blocked = 5;
5658 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5659 // at core/java/android/app/NotificationChannelGroup.java
5660 optional int32 user_locked_fields = 6;
5661}
5662
Yangsteraf9aee72018-10-12 09:26:16 -07005663message PowerProfileProto {
5664 optional double cpu_suspend = 1;
5665
5666 optional double cpu_idle = 2;
5667
5668 optional double cpu_active = 3;
5669
5670 message CpuCluster {
5671 optional int32 id = 1;
5672 optional double cluster_power = 2;
5673 optional int32 cores = 3;
5674 repeated int64 speed = 4;
5675 repeated double core_power = 5;
5676 }
5677
5678 repeated CpuCluster cpu_cluster = 40;
5679
5680 optional double wifi_scan = 4;
5681
5682 optional double wifi_on = 5;
5683
5684 optional double wifi_active = 6;
5685
5686 optional double wifi_controller_idle = 7;
5687
5688 optional double wifi_controller_rx = 8;
5689
5690 optional double wifi_controller_tx = 9;
5691
5692 repeated double wifi_controller_tx_levels = 10;
5693
5694 optional double wifi_controller_operating_voltage = 11;
5695
5696 optional double bluetooth_controller_idle = 12;
5697
5698 optional double bluetooth_controller_rx = 13;
5699
5700 optional double bluetooth_controller_tx = 14;
5701
5702 optional double bluetooth_controller_operating_voltage = 15;
5703
5704 optional double modem_controller_sleep = 16;
5705
5706 optional double modem_controller_idle = 17;
5707
5708 optional double modem_controller_rx = 18;
5709
5710 repeated double modem_controller_tx = 19;
5711
5712 optional double modem_controller_operating_voltage = 20;
5713
5714 optional double gps_on = 21;
5715
5716 repeated double gps_signal_quality_based = 22;
5717
5718 optional double gps_operating_voltage = 23;
5719
5720 optional double bluetooth_on = 24;
5721
5722 optional double bluetooth_active = 25;
5723
5724 optional double bluetooth_at_cmd = 26;
5725
5726 optional double ambient_display = 27;
5727
5728 optional double screen_on = 28;
5729
5730 optional double radio_on = 29;
5731
5732 optional double radio_scanning = 30;
5733
5734 optional double radio_active = 31;
5735
5736 optional double screen_full = 32;
5737
5738 optional double audio = 33;
5739
5740 optional double video = 34;
5741
5742 optional double flashlight = 35;
5743
5744 optional double memory = 36;
5745
5746 optional double camera = 37;
5747
5748 optional double wifi_batched_scan = 38;
5749
5750 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005751}
Chenjie Yuab530202018-09-26 12:39:20 -07005752
5753/**
5754 * power_profile.xml and other constants for power model calculations.
5755 * Pulled from PowerProfile.java
5756 */
5757message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005758 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005759}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005760
5761/**
arangelovd5db50e2018-10-12 20:24:39 +01005762 * Logs when a user restriction was added or removed.
5763 *
5764 * Logged from:
5765 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5766 */
5767message UserRestrictionChanged {
5768 // The raw string of the user restriction as defined in UserManager.
5769 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5770 optional string restriction = 1;
5771 // Whether the restriction is enabled or disabled.
5772 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005773}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005774
5775/**
5776 * Pulls process user time and system time. Puller takes a snapshot of all pids
5777 * in the system and returns cpu stats for those that are working at the time.
5778 * Dead pids will be dropped. Kernel processes are excluded.
5779 * Min cool-down is 5 sec.
5780 */
5781message ProcessCpuTime {
5782 optional int32 uid = 1 [(is_uid) = true];
5783
5784 optional string process_name = 2;
5785 // Process cpu time in user space, cumulative from boot/process start
5786 optional int64 user_time_millis = 3;
5787 // Process cpu time in system space, cumulative from boot/process start
5788 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005789}
Misha Wagner5a51e002018-10-03 15:04:09 +01005790
5791/**
5792 * Pulls the CPU usage for each thread.
5793 *
5794 * Read from /proc/$PID/task/$TID/time_in_state files.
5795 *
5796 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5797 * time_in_state files not being present on some phones, have not been addressed. These should be
5798 * considered before a public release.
5799 */
5800message CpuTimePerThreadFreq {
5801 // UID that owns the process.
5802 optional int32 uid = 1 [(is_uid) = true];
5803 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005804 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005805 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005806 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005807 // Name of the process taken from `/proc/$PID/cmdline`.
5808 optional string process_name = 4;
5809 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5810 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005811
5812 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5813 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5814 // frequencies are given here as the alternative is sending eight separate atoms. This method
5815 // significantly reduces the amount of data created
5816 optional int32 frequency1_khz = 6;
5817 optional int32 time1_millis = 7;
5818 optional int32 frequency2_khz = 8;
5819 optional int32 time2_millis = 9;
5820 optional int32 frequency3_khz = 10;
5821 optional int32 time3_millis = 11;
5822 optional int32 frequency4_khz = 12;
5823 optional int32 time4_millis = 13;
5824 optional int32 frequency5_khz = 14;
5825 optional int32 time5_millis = 15;
5826 optional int32 frequency6_khz = 16;
5827 optional int32 time6_millis = 17;
5828 optional int32 frequency7_khz = 18;
5829 optional int32 time7_millis = 19;
5830 optional int32 frequency8_khz = 20;
5831 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005832}
Bookatz75ee60422018-11-09 12:27:37 -08005833
5834/**
Bookatz366a4432018-11-20 09:42:33 -08005835 * Pulls information about the device's build.
5836 */
5837message BuildInformation {
5838 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5839 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5840 optional string fingerprint = 1;
5841
5842 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5843 optional string brand = 2;
5844
5845 // Build.PRODUCT. The name of the overall product.
5846 optional string product = 3;
5847
5848 // Build.DEVICE. The name of the industrial design.
5849 optional string device = 4;
5850
5851 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5852 optional string version_release = 5;
5853
5854 // Build.ID. E.g. a label like "M4-rc20".
5855 optional string id = 6;
5856
5857 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5858 // represent this build.
5859 optional string version_incremental = 7;
5860
5861 // Build.TYPE. The type of build, like "user" or "eng".
5862 optional string type = 8;
5863
5864 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5865 optional string tags = 9;
5866}
5867
5868/**
Adam He420947c2019-01-23 15:59:09 -08005869 * Logs information about mismatched caller for content capture.
5870 *
5871 * Logged from:
5872 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5873 */
5874message ContentCaptureCallerMismatchReported {
5875 optional string intended_package = 1;
5876 optional string calling_package = 2;
5877}
5878
5879/**
5880 * Logs information about content capture service events.
5881 *
5882 * Logged from:
5883 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5884 */
5885message ContentCaptureServiceEvents {
5886 // The type of event.
5887 enum Event {
5888 UNKNOWN = 0;
5889 ON_CONNECTED = 1;
5890 ON_DISCONNECTED = 2;
5891 SET_WHITELIST = 3;
5892 SET_DISABLED = 4;
5893 ON_USER_DATA_REMOVED = 5;
5894 }
5895 optional Event event = 1;
5896 // component/package of content capture service.
5897 optional string service_info = 2;
5898 // component/package of target.
5899 // it's a concatenated list of component/package for SET_WHITELIST event
5900 // separated by " ".
5901 optional string target_info = 3;
5902}
5903
5904/**
5905 * Logs information about content capture session events.
5906 *
5907 * Logged from:
5908 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5909 */
5910message ContentCaptureSessionEvents {
5911 // The type of event.
5912 enum Event {
5913 UNKNOWN = 0;
5914 ON_SESSION_STARTED = 1;
5915 ON_SESSION_FINISHED = 2;
5916 SESSION_NOT_CREATED = 3;
5917 }
5918 optional int32 session_id = 1;
5919 optional Event event = 2;
5920 // (n/a on session finished)
5921 optional int32 state_flags = 3;
5922 // component/package of content capture service.
5923 optional string service_info = 4;
5924 // component/package of app.
5925 // (n/a on session finished)
5926 optional string app_info = 5;
5927 optional bool is_child_session = 6;
5928}
5929
5930/**
5931 * Logs information about session being flushed.
5932 *
5933 * Logged from:
5934 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5935 */
5936message ContentCaptureFlushed {
5937 optional int32 session_id = 1;
5938 // component/package of content capture service.
5939 optional string service_info = 2;
5940 // component/package of app.
5941 optional string app_info = 3;
5942 // session start/finish events
5943 optional int32 child_session_started = 4;
5944 optional int32 child_session_finished = 5;
5945 // count of view events.
5946 optional int32 view_appeared_count = 6;
5947 optional int32 view_disappeared_count = 7;
5948 optional int32 view_text_changed_count = 8;
5949
5950 // Flush stats.
5951 optional int32 max_events = 9;
5952 optional int32 idle_flush_freq = 10;
5953 optional int32 text_flush_freq = 11;
5954 optional int32 flush_reason = 12;
5955}
5956
5957/**
Bookatz75ee60422018-11-09 12:27:37 -08005958 * Pulls on-device BatteryStats power use calculations for the overall device.
5959 */
5960message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005961 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5962 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5963 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5964 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005965}
5966
5967/**
5968 * Pulls on-device BatteryStats power use calculations broken down by uid.
5969 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5970 * that is attributed to non-uid items. They must all be included to get the total power use.
5971 */
5972message DeviceCalculatedPowerBlameUid {
5973 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5974 optional int32 uid = 1 [(is_uid) = true];
5975
Bookatz3dbc13a2018-12-21 12:16:51 -08005976 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5977 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5978 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005979}
5980
5981/**
5982 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5983 * drain type.
5984 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5985 * is attributed uids. They must all be included to get the total power use.
5986 */
5987message DeviceCalculatedPowerBlameOther {
5988 // The type of item whose power use is being reported.
5989 enum DrainType {
5990 AMBIENT_DISPLAY = 0;
5991 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5992 BLUETOOTH = 2;
5993 CAMERA = 3;
5994 // Cell-standby
5995 CELL = 4;
5996 FLASHLIGHT = 5;
5997 IDLE = 6;
5998 MEMORY = 7;
5999 // Amount that total computed drain exceeded the drain estimated using the
6000 // battery level changes and capacity.
6001 OVERCOUNTED = 8;
6002 PHONE = 9;
6003 SCREEN = 10;
6004 // Amount that total computed drain was below the drain estimated using the
6005 // battery level changes and capacity.
6006 UNACCOUNTED = 11;
6007 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6008 WIFI = 13;
6009 }
6010 optional DrainType drain_type = 1;
6011
Bookatz3dbc13a2018-12-21 12:16:51 -08006012 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6013 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6014 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006015}
arangelov4e994062018-11-13 16:12:38 +00006016
6017/**
6018 * Logs device policy features.
6019 *
6020 * Logged from:
6021 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6022 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6023 */
6024message DevicePolicyEvent {
6025 // The event id - unique for each event.
6026 optional android.stats.devicepolicy.EventId event_id = 1;
6027 // The admin package name.
6028 optional string admin_package_name = 2;
6029 // A generic integer parameter.
6030 optional int32 integer_value = 3;
6031 // A generic boolean parameter.
6032 optional bool boolean_value = 4;
6033 // A parameter specifying a time period in milliseconds.
6034 optional uint64 time_period_millis = 5;
6035 // A parameter specifying a list of package names, bundle extras or string parameters.
6036 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6037}
shawnlinea5b66b2018-11-13 15:05:29 +08006038
6039/**
6040 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6041 *
6042 * Logged from:
6043 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6044 */
6045message DocsUILaunchReported {
6046 optional android.stats.docsui.LaunchAction launch_action = 1;
6047 optional bool has_initial_uri = 2;
6048 optional android.stats.docsui.MimeType mime_type = 3;
6049 optional android.stats.docsui.Root initial_root = 4;
6050}
6051
6052/**
6053 * Logs root/app visited event in file managers/picker. Call this when the user
6054 * taps on root/app in hamburger menu.
6055 *
6056 * Logged from:
6057 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6058 */
6059message DocsUIRootVisitedReported {
6060 optional android.stats.docsui.ContextScope scope = 1;
6061 optional android.stats.docsui.Root root = 2;
6062}
6063
6064/**
6065 * Logs file operation stats. Call this when a file operation has completed.
6066 *
6067 * Logged from:
6068 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6069 */
6070message DocsUIFileOperationReported {
6071 optional android.stats.docsui.Provider provider = 1;
6072 optional android.stats.docsui.FileOperation file_op = 2;
6073}
6074
6075/**
6076 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6077 * mode.
6078 *
6079 * Logged from:
6080 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6081 */
6082message DocsUIFileOperationCopyMoveModeReported {
6083 optional android.stats.docsui.FileOperation file_op = 1;
6084 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6085}
6086
6087
6088/**
6089 * Logs file sub operation stats. Call this when a file operation has failed.
6090 *
6091 * Logged from:
6092 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6093 */
6094message DocsUIFileOperationFailureReported {
6095 optional android.stats.docsui.Authority authority = 1;
6096 optional android.stats.docsui.SubFileOperation sub_op = 2;
6097}
6098
6099/**
6100* Logs the cancellation of a file operation. Call this when a job is canceled
6101*
6102* Logged from:
6103* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6104*/
6105message DocsUIFileOperationCanceledReported {
6106 optional android.stats.docsui.FileOperation file_op = 1;
6107}
6108
6109/**
6110 * Logs startup time in milliseconds.
6111 *
6112 * Logged from:
6113 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6114 */
6115message DocsUIStartupMsReported {
6116 optional int32 startup_millis = 1;
6117}
6118
6119/**
6120 * Logs the action that was started by user.
6121 *
6122 * Logged from:
6123 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6124 */
6125message DocsUIUserActionReported {
6126 optional android.stats.docsui.UserAction action = 1;
6127}
6128
6129/**
6130 * Logs the invalid type when invalid scoped access is requested.
6131 *
6132 * Logged from:
6133 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6134 */
6135message DocsUIInvalidScopedAccessRequestReported {
6136 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006137}
Ben Murdochbab399f62018-12-06 11:01:38 +00006138
6139/**
shawnlina75e82d2019-01-07 10:31:12 +08006140 * Logs the package name that launches docsui picker mode.
6141 *
6142 * Logged from:
6143 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6144 */
6145message DocsUIPickerLaunchedFromReported {
6146 optional string package_name = 1;
6147}
6148
6149/**
6150 * Logs the search type.
6151 *
6152 * Logged from:
6153 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6154 */
6155message DocsUISearchTypeReported {
6156 optional android.stats.docsui.SearchType search_type = 1;
6157}
6158
6159/**
6160 * Logs the search mode.
6161 *
6162 * Logged from:
6163 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6164 */
6165message DocsUISearchModeReported {
6166 optional android.stats.docsui.SearchMode search_mode = 1;
6167}
6168
6169/**
6170 * Logs the pick result information.
6171 *
6172 * Logged from:
6173 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6174 */
6175message DocsUIPickResultReported {
6176 optional int32 total_action_count = 1;
6177 optional int64 duration_millis = 2;
6178 optional int32 file_count= 3;
6179 optional bool is_searching = 4;
6180 optional android.stats.docsui.Root picked_from = 5;
6181 optional android.stats.docsui.MimeType mime_type = 6;
6182 optional int32 repeatedly_pick_times = 7;
6183}
6184
6185/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006186 * Logs when an app's memory is compacted.
6187 *
6188 * Logged from:
6189 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6190 */
6191message AppCompacted {
6192 // The pid of the process being compacted.
6193 optional int32 pid = 1;
6194
6195 // The name of the process being compacted.
6196 optional string process_name = 2;
6197
6198 // The type of compaction.
6199 enum Action {
6200 UNKNOWN = 0;
6201 SOME = 1;
6202 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006203 PERSISTENT = 3;
6204 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006205 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006206 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006207
6208 // Total RSS in kilobytes consumed by the process prior to compaction.
6209 optional int64 before_rss_total_kilobytes = 4;
6210
6211 // File RSS in kilobytes consumed by the process prior to compaction.
6212 optional int64 before_rss_file_kilobytes = 5;
6213
6214 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6215 optional int64 before_rss_anon_kilobytes = 6;
6216
6217 // Swap in kilobytes consumed by the process prior to compaction.
6218 optional int64 before_swap_kilobytes = 7;
6219
6220 // Total RSS in kilobytes consumed by the process after compaction.
6221 optional int64 after_rss_total_kilobytes = 8;
6222
6223 // File RSS in kilobytes consumed by the process after compaction.
6224 optional int64 after_rss_file_kilobytes = 9;
6225
6226 // Anonymous RSS in kilobytes consumed by the process after compaction.
6227 optional int64 after_rss_anon_kilobytes = 10;
6228
6229 // Swap in kilobytes consumed by the process after compaction.
6230 optional int64 after_swap_kilobytes = 11;
6231
6232 // The time taken to perform compaction in milliseconds.
6233 optional int64 time_to_compact_millis = 12;
6234
6235 // The last compaction action performed for this app.
6236 optional Action last_action = 13;
6237
Ben Murdoch01720b82018-12-19 18:03:44 +00006238 // The last time that compaction was attempted on this process in milliseconds
6239 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6240 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006241
Ben Murdoch885c21b2019-03-15 18:02:04 +00006242 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006243 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006244
6245 // The process state at the time of compaction.
6246 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006247
6248 // Free ZRAM in kilobytes before compaction.
6249 optional int64 before_zram_free_kilobytes = 17;
6250
6251 // Free ZRAM in kilobytes after compaction.
6252 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006253}
lifr157fc552018-12-12 16:38:04 +08006254
6255/**
lifrb6b90b62019-03-29 00:40:17 +08006256 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6257 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6258 *
lifr1f74b052019-04-16 22:16:30 +08006259 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6260 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6261 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6262 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006263 */
6264message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006265 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006266
lifr1f74b052019-04-16 22:16:30 +08006267 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006268
6269 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006270 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006271
lifr1f74b052019-04-16 22:16:30 +08006272 // Only valid for event_type = EVENT_GETADDRINFO.
6273 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006274
lifr1f74b052019-04-16 22:16:30 +08006275 // Flags passed to android_res_nsend() defined in multinetwork.h
6276 // Only valid for event_type = EVENT_RESNSEND.
6277 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006278
lifrad9becc2019-05-20 11:04:41 +08006279 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006280
6281 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006282 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006283
6284 // Additional pass-through fields opaque to statsd.
6285 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006286 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006287
6288 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6289 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006290}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006291
6292/**
6293 * Logs when a data stall event occurs.
6294 *
6295 * Log from:
6296 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6297 */
6298message DataStallEvent {
6299 // Data stall evaluation type.
6300 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6301 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6302 optional int32 evaluation_type = 1;
6303 // See definition in data_stall_event.proto.
6304 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6305 // See definition in data_stall_event.proto.
6306 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6307 // See definition in data_stall_event.proto.
6308 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6309 // See definition in data_stall_event.proto.
6310 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6311 // See definition in data_stall_event.proto.
6312 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6313}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006314
6315/*
6316 * Logs when RescueParty resets some set of experiment flags.
6317 *
6318 * Logged from:
6319 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6320 */
6321message RescuePartyResetReported {
6322 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6323 optional int32 rescue_level = 1;
6324}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006325
6326/**
6327 * Logs when signed config is received from an APK, and if that config was applied successfully.
6328 * Logged from:
6329 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6330 */
6331message SignedConfigReported {
6332 enum Type {
6333 UNKNOWN_TYPE = 0;
6334 GLOBAL_SETTINGS = 1;
6335 }
6336 optional Type type = 1;
6337
6338 // The final status of the signed config received.
6339 enum Status {
6340 UNKNOWN_STATUS = 0;
6341 APPLIED = 1;
6342 BASE64_FAILURE_CONFIG = 2;
6343 BASE64_FAILURE_SIGNATURE = 3;
6344 SECURITY_EXCEPTION = 4;
6345 INVALID_CONFIG = 5;
6346 OLD_CONFIG = 6;
6347 SIGNATURE_CHECK_FAILED = 7;
6348 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006349 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006350 }
6351 optional Status status = 2;
6352
6353 // The version of the signed config processed.
6354 optional int32 version = 3;
6355
6356 // The package name that the config was extracted from.
6357 optional string from_package = 4;
6358
6359 enum Key {
6360 NO_KEY = 0;
6361 DEBUG = 1;
6362 PRODUCTION = 2;
6363 }
6364 // Which key was used to verify the config.
6365 optional Key verified_with = 5;
6366}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006367
6368/*
6369 * Logs GNSS Network-Initiated (NI) location events.
6370 *
6371 * Logged from:
6372 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6373 */
6374message GnssNiEventReported {
6375 // The type of GnssNiEvent.
6376 enum EventType {
6377 UNKNOWN = 0;
6378 NI_REQUEST = 1;
6379 NI_RESPONSE = 2;
6380 }
6381 optional EventType event_type = 1;
6382
6383 // An ID generated by HAL to associate NI notifications and UI responses.
6384 optional int32 notification_id = 2;
6385
6386 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006387 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006388
6389 // NI requires notification.
6390 optional bool need_notify = 4;
6391
6392 // NI requires verification.
6393 optional bool need_verify = 5;
6394
6395 // NI requires privacy override, no notification/minimal trace.
6396 optional bool privacy_override = 6;
6397
6398 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6399 // seconds.
6400 optional int32 timeout = 7;
6401
6402 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006403 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006404
6405 // String representing the requester of the network inititated location request.
6406 optional string requestor_id = 9;
6407
6408 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6409 // network initiated location request.
6410 optional string text = 10;
6411
6412 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006413 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006414
6415 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006416 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006417
6418 // True if SUPL ES is enabled.
6419 optional bool is_supl_es_enabled = 13;
6420
6421 // True if GNSS location is enabled.
6422 optional bool is_location_enabled = 14;
6423
6424 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006425 optional android.server.location.GnssUserResponseType user_response = 15;
6426}
6427
6428/**
6429 * Logs GNSS non-framework (NFW) location notification.
6430 *
6431 * Logged from:
6432 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6433 */
6434message GnssNfwNotificationReported {
6435 // Package name of the Android proxy application representing the non-framework entity that
6436 // requested location. Set to empty string if unknown.
6437 optional string proxy_app_package_name = 1;
6438
6439 // Protocol stack that initiated the non-framework location request.
6440 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6441
6442 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6443 // set to empty string. This field is opaque to the framework and used for logging purposes.
6444 optional string other_protocol_stack_name = 3;
6445
6446 // Source initiating/receiving the location information.
6447 optional android.server.location.NfwRequestor requestor = 4;
6448
6449 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6450 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6451 // and used for logging purposes.
6452 optional string requestor_id = 5;
6453
6454 // Indicates whether location information was provided for this request.
6455 optional android.server.location.NfwResponseType response_type = 6;
6456
6457 // True if the device is in user initiated emergency session.
6458 optional bool in_emergency_mode = 7;
6459
6460 // True if cached location is provided.
6461 optional bool is_cached_location = 8;
6462
6463 // True if proxy app permission mismatch between framework and GNSS HAL.
6464 optional bool is_permission_mismatched = 9;
6465}
6466
6467/**
6468 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6469 *
6470 * Logged from:
6471 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6472 */
6473message GnssConfigurationReported {
6474 // SUPL host name.
6475 optional string supl_host = 1;
6476
6477 // SUPL port number.
6478 optional int32 supl_port = 2;
6479
6480 // C2K host name.
6481 optional string c2k_host = 3;
6482
6483 // C2K port number.
6484 optional int32 c2k_port = 4;
6485
6486 // The SUPL version requested by Carrier.
6487 optional int32 supl_ver = 5;
6488
6489 // The SUPL mode.
6490 optional android.server.location.SuplMode supl_mode = 6;
6491
6492 // True if NI emergency SUPL restrictions is enabled.
6493 optional bool supl_es = 7;
6494
6495 // LTE Positioning Profile settings
6496 optional android.server.location.LppProfile lpp_profile = 8;
6497
6498 // Positioning protocol on A-Glonass system.
6499 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6500
6501 // True if emergency PDN is used. Otherwise, regular PDN is used.
6502 optional bool use_emergency_pdn_for_emergency_supl= 10;
6503
6504 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6505 optional android.server.location.GpsLock gps_lock = 11;
6506
6507 // Number of seconds to extend the emergency session duration post emergency call.
6508 optional int32 es_extension_sec = 12;
6509
6510 // The full list of package names of proxy Android applications representing the non-framework
6511 // location access entities (on/off the device) for which the framework user has granted
6512 // non-framework location access permission. The package names are concatenated in one string
6513 // with spaces as separators.
6514 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006515}
Jack Yu95b64f32018-12-13 18:26:11 +08006516
6517/**
6518 * Logs when a NFC device's error occurred.
6519 * Logged from:
6520 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6521 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6522 */
6523message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006524 enum Type {
6525 UNKNOWN = 0;
6526 CMD_TIMEOUT = 1;
6527 ERROR_NOTIFICATION = 2;
6528 AID_OVERFLOW = 3;
6529 }
6530 optional Type type = 1;
6531 // If it's nci cmd timeout, log the timeout command.
6532 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006533
Alex Salod7c3eef2019-01-25 14:43:27 -08006534 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006535}
6536
6537/**
6538 * Logs when a NFC device's state changed event
6539 * Logged from:
6540 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6541 */
6542message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006543 enum State {
6544 UNKNOWN = 0;
6545 OFF = 1;
6546 ON = 2;
6547 ON_LOCKED = 3; // Secure Nfc enabled.
6548 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6549 }
6550 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006551}
6552
6553/**
6554 * Logs when a NFC Beam Transaction occurred.
6555 * Logged from:
6556 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6557 */
6558message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006559 enum Operation {
6560 UNKNOWN = 0;
6561 SEND = 1;
6562 RECEIVE = 2;
6563 }
6564 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006565}
6566
6567/**
6568 * Logs when a NFC Card Emulation Transaction occurred.
6569 * Logged from:
6570 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6571 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6572 */
6573message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006574 enum Category {
6575 UNKNOWN = 0;
6576 HCE_PAYMENT = 1;
6577 HCE_OTHER = 2;
6578 OFFHOST = 3;
6579 }
6580 // Transaction belongs to HCE payment or HCE other category, or offhost.
6581 optional Category category = 1;
6582 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6583 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006584}
6585
6586/**
6587 * Logs when a NFC Tag event occurred.
6588 * Logged from:
6589 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6590 */
6591message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006592 enum Type {
6593 UNKNOWN = 0;
6594 URL = 1;
6595 BT_PAIRING = 2;
6596 PROVISION = 3;
6597 WIFI_CONNECT = 4;
6598 APP_LAUNCH = 5;
6599 OTHERS = 6;
6600 }
6601 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006602}
6603
6604/**
6605 * Logs when Hce transaction triggered
6606 * Logged from:
6607 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6608 */
6609message NfcHceTransactionOccurred {
6610 // The latency period(in microseconds) it took for the first HCE data
6611 // exchange.
6612 optional uint32 latency_micros = 1;
6613}
6614
6615/**
6616 * Logs when SecureElement state event changed
6617 * Logged from:
6618 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6619 */
6620message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006621 enum State {
6622 UNKNOWN = 0;
6623 INITIALIZED = 1;
6624 DISCONNECTED = 2;
6625 CONNECTED = 3;
6626 HALCRASH = 4;
6627 }
6628 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006629
Alex Salod7c3eef2019-01-25 14:43:27 -08006630 optional string state_change_reason = 2;
6631 // SIMx or eSEx.
6632 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006633}
6634
6635/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006636 * Information about a permission grant request
6637 */
6638message PermissionGrantRequestResultReported {
6639 // unique value identifying an API call. A API call might result in multiple of these atoms
6640 optional int64 request_id = 1;
6641
6642 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006643 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006644
6645 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006646 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006647
6648 // The permission to be granted
6649 optional string permission_name = 4;
6650
6651 // If the permission was explicitly requested via the API or added by the system
6652 optional bool is_implicit = 5;
6653
6654 enum Result {
6655 UNDEFINED = 0;
6656 // permission request was ignored
6657 IGNORED = 1;
6658 // permission request was ignored because it was user fixed
6659 IGNORED_USER_FIXED = 2;
6660 // permission request was ignored because it was policy fixed
6661 IGNORED_POLICY_FIXED = 3;
6662 // permission was granted by user action
6663 USER_GRANTED = 4;
6664 // permission was automatically granted
6665 AUTO_GRANTED = 5;
6666 // permission was denied by user action
6667 USER_DENIED = 6;
6668 // permission was denied with prejudice by the user
6669 USER_DENIED_WITH_PREJUDICE = 7;
6670 // permission was automatically denied
6671 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006672 // permission request was ignored because permission is restricted
6673 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006674 // one time permission was granted by user action
6675 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006676 // user ignored request by leaving the request screen without choosing any option
6677 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006678 // user granted the permission after being linked to settings
6679 USER_GRANTED_IN_SETTINGS = 12;
6680 // user denied the permission after being linked to settings
6681 USER_DENIED_IN_SETTINGS = 13;
6682 // user denied the permission with prejudice after being linked to settings
6683 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6684 // permission was automatically revoked after one-time permission expired
6685 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006686 // permission was automatically revoked for unused app
6687 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006688 }
6689 // The result of the permission grant
6690 optional Result result = 6;
6691}
6692
6693/**
Jack Yu95b64f32018-12-13 18:26:11 +08006694 * Logs when Omapi API used
6695 * Logged from:
6696 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6697 */
6698message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006699 enum Operation {
6700 UNKNOWN = 0;
6701 OPEN_CHANNEL = 1;
6702 }
6703 optional Operation operation = 1;
6704 // SIMx or eSEx.
6705 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006706
Alex Salod7c3eef2019-01-25 14:43:27 -08006707 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006708}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006709
6710/**
Alex Saloa060aee2019-01-21 14:36:41 -08006711 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6712 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006713 * Logged from:
6714 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6715 */
6716message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006717 optional int64 dispatch_latency_millis = 1;
6718}
6719
6720/**
6721 * Logs AttentionManagerService attention check result.
6722 *
6723 * Logged from:
6724 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6725 */
6726message AttentionManagerServiceResultReported {
6727 // See core/java/android/service/attention/AttentionService.java
6728 enum AttentionCheckResult {
6729 UNKNOWN = 20;
6730 ATTENTION_SUCCESS_ABSENT = 0;
6731 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006732 ATTENTION_FAILURE_UNKNOWN = 2;
6733 ATTENTION_FAILURE_CANCELLED = 3;
6734 ATTENTION_FAILURE_PREEMPTED = 4;
6735 ATTENTION_FAILURE_TIMED_OUT = 5;
6736 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006737 }
6738 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006739}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006740
6741/**
6742 * Logs when an adb connection changes state.
6743 *
6744 * Logged from:
6745 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6746 */
6747message AdbConnectionChanged {
6748 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6749 // previously selected for this system.
6750 optional int64 last_connection_time_millis = 1;
6751
6752 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6753 // to reconnect via adb without user interaction.
6754 optional int64 auth_window_millis = 2;
6755
6756 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6757 optional android.debug.AdbConnectionStateEnum state = 3;
6758
6759 // True if the 'always allow' option was selected for this system.
6760 optional bool always_allow = 4;
6761}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006762
6763/*
6764 * Logs the reported speech DSP status.
6765 *
6766 * Logged from:
6767 * Vendor audio implementation.
6768 */
6769message SpeechDspStatReported {
6770 // The total Speech DSP uptime in milliseconds.
6771 optional int32 total_uptime_millis = 1;
6772 // The total Speech DSP downtime in milliseconds.
6773 optional int32 total_downtime_millis = 2;
6774 optional int32 total_crash_count = 3;
6775 optional int32 total_recover_count = 4;
6776}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006777
6778/**
6779 * Logs USB connector contaminant status.
6780 *
6781 * Logged from: USB Service.
6782 */
6783message UsbContaminantReported {
6784 optional string id = 1;
6785 optional android.service.usb.ContaminantPresenceStatus status = 2;
6786}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006787
6788/**
6789 * This atom is for debugging purpose.
6790 */
6791message DebugElapsedClock {
6792 // Monotically increasing value for each pull.
6793 optional int64 pull_count = 1;
6794 // Time from System.elapsedRealtime.
6795 optional int64 elapsed_clock_millis = 2;
6796 // Time from System.elapsedRealtime.
6797 optional int64 same_elapsed_clock_millis = 3;
6798 // Diff between current elapsed time and elapsed time from previous pull.
6799 optional int64 elapsed_clock_diff_millis = 4;
6800
6801 enum Type {
6802 TYPE_UNKNOWN = 0;
6803 ALWAYS_PRESENT = 1;
6804 PRESENT_ON_ODD_PULLS = 2;
6805 }
6806 // Type of behavior for the pulled data.
6807 optional Type type = 5;
6808}
6809
6810/**
6811 * This atom is for debugging purpose.
6812 */
6813message DebugFailingElapsedClock {
6814 // Monotically increasing value for each pull.
6815 optional int64 pull_count = 1;
6816 // Time from System.elapsedRealtime.
6817 optional int64 elapsed_clock_millis = 2;
6818 // Time from System.elapsedRealtime.
6819 optional int64 same_elapsed_clock_millis = 3;
6820 // Diff between current elapsed time and elapsed time from previous pull.
6821 optional int64 elapsed_clock_diff_millis = 4;
6822}
Steven Wuacef6bb2019-01-23 14:21:17 -05006823
6824/** Logs System UI bubbles event changed.
6825 *
6826 * Logged from:
6827 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6828 */
6829message BubbleUIChanged {
6830
6831 // The app package that is posting the bubble.
6832 optional string package_name = 1;
6833
6834 // The notification channel that is posting the bubble.
6835 optional string notification_channel = 2;
6836
6837 // The notification id associated with the posted bubble.
6838 optional int32 notification_id = 3;
6839
6840 // The position of the bubble within the bubble stack.
6841 optional int32 position = 4;
6842
6843 // The total number of bubbles within the bubble stack.
6844 optional int32 total_number = 5;
6845
6846 // User interactions with the bubble.
6847 enum Action {
6848 UNKNOWN = 0;
6849 POSTED = 1;
6850 UPDATED = 2;
6851 EXPANDED = 3;
6852 COLLAPSED = 4;
6853 DISMISSED = 5;
6854 STACK_DISMISSED = 6;
6855 STACK_MOVED = 7;
6856 HEADER_GO_TO_APP = 8;
6857 HEADER_GO_TO_SETTINGS = 9;
6858 PERMISSION_OPT_IN = 10;
6859 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006860 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006861 SWIPE_LEFT = 13;
6862 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006863 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006864 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006865 }
6866 optional Action action = 6;
6867
6868 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6869 optional float normalized_x_position = 7;
6870 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006871
6872 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6873 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006874
6875 // Whether the bubble is an on-going one.
6876 optional bool is_ongoing = 10;
6877
6878 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006879 // This is deprecated and the value should be ignored.
6880 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006881}
Kweku Adams8845d012018-12-11 20:06:45 -08006882
6883/**
Steven Wu552f63f2019-02-05 13:41:36 -05006884 * Logs System UI bubbles developer errors.
6885 *
6886 * Logged from:
6887 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6888 */
6889message BubbleDeveloperErrorReported {
6890
6891 // The app package that is posting the bubble.
6892 optional string package_name = 1;
6893
6894 // Bubble developer error type enums.
6895 enum Error {
6896 UNKNOWN = 0;
6897 ACTIVITY_INFO_MISSING = 1;
6898 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6899 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6900 }
6901 optional Error error = 2 [default = UNKNOWN];
6902}
6903
6904/**
Kweku Adams8845d012018-12-11 20:06:45 -08006905 * Logs that a constraint for a scheduled job has changed.
6906 *
6907 * Logged from:
6908 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6909 */
6910message ScheduledJobConstraintChanged {
6911 repeated AttributionNode attribution_node = 1;
6912
6913 // Name of the job.
6914 optional string job_name = 2;
6915
6916 optional com.android.server.job.ConstraintEnum constraint = 3;
6917
6918 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006919 UNKNOWN = 0;
6920 UNSATISFIED = 1;
6921 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006922 }
6923 optional State state = 4;
6924}
Alex Salod7c3eef2019-01-25 14:43:27 -08006925
6926/**
6927 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6928 * returns true.
6929 *
6930 * Logged from:
6931 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6932 */
6933message ScreenTimeoutExtensionReported {
6934 // Describes how many times in a row did the power manager reset the screen off timeout.
6935 optional uint32 consecutive_timeout_extended_count = 1;
6936}
Hui Yu885aca12019-01-10 17:11:34 -08006937
6938/*
6939* Logs number of milliseconds it takes to start a process.
6940* The definition of app process start time is from the app launch time to
6941* the time that Zygote finished forking the app process and loaded the
6942* application package's java classes.
6943
6944* This metric is different from AppStartOccurred which is for foreground
6945* activity only.
6946
6947* ProcessStartTime can report all processes (both foreground and background)
6948* start time.
6949*
6950* Logged from:
6951* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6952*/
6953message ProcessStartTime {
6954 // The uid of the ProcessRecord.
6955 optional int32 uid = 1 [(is_uid) = true];
6956
6957 // The process pid.
6958 optional int32 pid = 2;
6959
6960 // The process name.
6961 // Usually package name, "system" for system server.
6962 // Provided by ActivityManagerService.
6963 optional string process_name = 3;
6964
6965 enum StartType {
6966 UNKNOWN = 0;
6967 WARM = 1;
6968 HOT = 2;
6969 COLD = 3;
6970 }
6971
6972 // The start type.
6973 optional StartType type = 4;
6974
6975 // The elapsed realtime at the start of the process.
6976 optional int64 process_start_time_millis = 5;
6977
6978 // Number of milliseconds it takes to reach bind application.
6979 optional int32 bind_application_delay_millis = 6;
6980
6981 // Number of milliseconds it takes to finish start of the process.
6982 optional int32 process_start_delay_millis = 7;
6983
6984 // hostingType field in ProcessRecord, the component type such as "activity",
6985 // "service", "content provider", "broadcast" or other strings.
6986 optional string hosting_type = 8;
6987
6988 // hostingNameStr field in ProcessRecord. The component class name that runs
6989 // in this process.
6990 optional string hosting_name = 9;
6991}
6992
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006993/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006994 * Track Media Codec usage
6995 * Logged from:
6996 * frameworks/av/media/libstagefright/MediaCodec.cpp
6997 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6998 */
6999message MediametricsCodecReported {
7000 optional int64 timestamp_nanos = 1;
7001 optional string package_name = 2;
7002 optional int64 package_version_code = 3;
7003 optional int64 media_apex_version = 4;
7004
7005 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7006}
7007
7008/**
7009 * Track Media Extractor (pulling video/audio streams out of containers) usage
7010 * Logged from:
7011 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7012 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7013 */
7014message MediametricsExtractorReported {
7015 optional int64 timestamp_nanos = 1;
7016 optional string package_name = 2;
7017 optional int64 package_version_code = 3;
7018 optional int64 media_apex_version = 4;
7019
7020 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7021}
7022
7023/**
7024 * Track how we arbitrate between microphone/input requests.
7025 * Logged from
7026 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7027 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7028 */
7029message MediametricsAudiopolicyReported {
7030 optional int64 timestamp_nanos = 1;
7031 optional string package_name = 2;
7032 optional int64 package_version_code = 3;
7033 optional int64 media_apex_version = 4;
7034
7035 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7036}
7037
7038/**
7039 * Track how we arbitrate between microphone requests.
7040 * Logged from
7041 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7042 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7043 */
7044message MediametricsAudiorecordReported {
7045 optional int64 timestamp_nanos = 1;
7046 optional string package_name = 2;
7047 optional int64 package_version_code = 3;
7048 optional int64 media_apex_version = 4;
7049
7050 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7051}
7052
7053/**
7054 * Track how we arbitrate between microphone/input requests.
7055 * Logged from
7056 * frameworks/av/media/libnblog/ReportPerformance.cpp
7057 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7058 */
7059message MediametricsAudiothreadReported {
7060 optional int64 timestamp_nanos = 1;
7061 optional string package_name = 2;
7062 optional int64 package_version_code = 3;
7063 optional int64 media_apex_version = 4;
7064
7065 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7066}
7067
7068/**
7069 * Track how we arbitrate between microphone/input requests.
7070 * Logged from
7071 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7072 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7073 */
7074message MediametricsAudiotrackReported {
7075 optional int64 timestamp_nanos = 1;
7076 optional string package_name = 2;
7077 optional int64 package_version_code = 3;
7078 optional int64 media_apex_version = 4;
7079
7080 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7081}
7082
7083/**
7084 * Track information about DRM framework performance
7085 * Logged from
7086 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7087 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7088 */
7089message MediametricsMediadrmReported {
7090 optional int64 timestamp_nanos = 1;
7091 optional string package_name = 2;
7092 optional int64 package_version_code = 3;
7093 optional int64 media_apex_version = 4;
7094
7095 // vendor+description tell about which DRM plugin is in use on this device
7096 optional string vendor = 5;
7097 optional string description = 6;
7098 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7099 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7100}
7101
7102/**
7103 * Track information about the widevine DRM plugin performance
7104 * Logged from
7105 * vendor/widevine/libwvdrmengine/cdm/metrics
7106 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7107 */
7108message MediametricsDrmWidevineReported {
7109 optional int64 timestamp_nanos = 1;
7110 optional string package_name = 2;
7111 optional int64 package_version_code = 3;
7112 optional int64 media_apex_version = 4;
7113
7114 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7115}
7116
7117/**
7118 * Track information about recordings (e.g. camcorder)
7119 * Logged from
7120 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7121 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7122 */
7123message MediametricsRecorderReported {
7124 optional int64 timestamp_nanos = 1;
7125 optional string package_name = 2;
7126 optional int64 package_version_code = 3;
7127 optional int64 media_apex_version = 4;
7128
7129 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7130}
7131
7132/**
7133 * Track Media Player usage
7134 * Logged from:
7135 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7136 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7137 */
7138message MediametricsNuPlayerReported {
7139 optional int64 timestamp_nanos = 1;
7140 optional string package_name = 2;
7141 optional int64 package_version_code = 3;
7142 optional int64 media_apex_version = 4;
7143
7144 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7145}
7146
7147/**
Robert Shiha4beed32019-08-19 14:15:23 -07007148 * Track Legacy DRM usage
7149 * Logged from
7150 * frameworks/av/drm/drmserver/DrmManager.cpp
7151 */
7152message MediametricsDrmManagerReported {
7153 optional int64 timestamp_nanos = 1;
7154 optional string package_name = 2;
7155 optional int64 package_version_code = 3;
7156 optional int64 media_apex_version = 4;
7157
7158 enum Method {
7159 METHOD_NOT_FOUND = -1;
7160 GET_CONSTRAINTS = 0;
7161 GET_METADATA = 1;
7162 CAN_HANDLE = 2;
7163 PROCESS_DRM_INFO = 3;
7164 ACQUIRE_DRM_INFO = 4;
7165 SAVE_RIGHTS = 5;
7166 GET_ORIGINAL_MIME_TYPE = 6;
7167 GET_DRM_OBJECT_TYPE = 7;
7168 CHECK_RIGHTS_STATUS = 8;
7169 REMOVE_RIGHTS = 9;
7170 REMOVE_ALL_RIGHTS = 10;
7171 OPEN_CONVERT_SESSION = 11;
7172 OPEN_DECRYPT_SESSION = 12;
7173 }
7174
7175 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7176 optional string plugin_id = 5;
7177 optional string description = 6;
7178 optional Method method = 7;
7179 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007180
7181 optional int64 get_constraints_count = 9;
7182 optional int64 get_metadata_count = 10;
7183 optional int64 can_handle_count = 11;
7184 optional int64 process_drm_info_count = 12;
7185 optional int64 acquire_drm_info_count = 13;
7186 optional int64 save_rights_count = 14;
7187 optional int64 get_original_mime_type_count = 15;
7188 optional int64 get_drm_object_type_count = 16;
7189 optional int64 check_rights_status_count = 17;
7190 optional int64 remove_rights_count = 18;
7191 optional int64 remove_all_rights_count = 19;
7192 optional int64 open_convert_session_count = 20;
7193 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007194}
7195
7196/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007197 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007198 * Pulled from: StatsCompanionService
7199*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007200message DangerousPermissionState {
7201 // Name of the permission
7202 optional string permission_name = 1;
7203
7204 // Uid of the package
7205 optional int32 uid = 2 [(is_uid) = true];
7206
7207 // Package requesting the permission
7208 optional string package_name = 3;
7209
7210 // If the permission is granted to the uid
7211 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007212
7213 // Permission flags as per android.content.pm.PermissionFlags
7214 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007215}
7216
Michael Groover4a0ca942019-01-24 17:41:25 -08007217/**
7218 * Logs when a package is denied access to a device identifier based on the new access requirements.
7219 *
7220 * Logged from:
7221 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7222 */
7223message DeviceIdentifierAccessDenied {
7224 // The name of the package denied access to the requested device identifier.
7225 optional string package_name = 1;
7226
7227 // The name of the device identifier method the package attempted to invoke.
7228 optional string method_name = 2;
7229
7230 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007231 // Starting from Android 11, this boolean is not set and will always be false.
7232 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007233
7234 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007235 // Starting from Android 11, this boolean is not set and will always be false.
7236 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007237}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007238
7239/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007240 * Pulls the ongoing mainline install train version code.
7241 * Pulled from StatsCompanionService
7242 */
7243message TrainInfo {
7244 optional int64 train_version_code = 1;
7245
7246 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007247
7248 optional string train_name = 3;
7249
7250 enum Status {
7251 UNKNOWN = 0;
7252 INSTALL_REQUESTED = 1;
7253 INSTALL_STARTED = 2;
7254 INSTALL_STAGED_NOT_READY = 3;
7255 INSTALL_STAGED_READY = 4;
7256 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007257 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7258 // and INSTALL_FAILURE_COMMIT.
7259 INSTALL_FAILURE = 6 [deprecated = true];
7260 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007261 INSTALL_CANCELLED = 7;
7262 INSTALLER_ROLLBACK_REQUESTED = 8;
7263 INSTALLER_ROLLBACK_INITIATED = 9;
7264 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7265 INSTALLER_ROLLBACK_STAGED = 11;
7266 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7267 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7268 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7269 INSTALLER_ROLLBACK_SUCCESS = 15;
7270 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007271 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7272 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7273 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7274 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7275 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7276 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007277 INSTALL_FAILURE_DOWNLOAD = 23;
7278 INSTALL_FAILURE_STATE_MISMATCH = 24;
7279 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007280 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007281 }
7282 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007283}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007284
7285/**
7286 * Logs the gesture stage changed event.
7287 *
7288 * Logged from:
7289 * frameworks/base/packages/SystemUI/
7290 */
7291message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007292 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007293}
7294
7295/**
7296 * Logs the feedback type.
7297 *
7298 * Logged from:
7299 * frameworks/base/packages/SystemUI/
7300 */
7301message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007302 // Whether or not the gesture was used.
7303 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007304}
7305
7306/**
7307 * Logs the progress.
7308 *
7309 * Logged from:
7310 * frameworks/base/packages/SystemUI/
7311 */
7312message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007313 // [0,100] progress for the assist gesture.
7314 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007315}
Neil Fullerdb14b482019-02-05 19:44:44 +00007316
7317/*
7318 * Information about the time zone data on a device.
7319 */
7320message TimeZoneDataInfo {
7321 // A version identifier for the data set on device. e.g. "2018i"
7322 optional string tzdb_version = 1;
7323}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007324
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007325/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007326 * Logs the GPU stats global health information.
7327 *
7328 * Logged from:
7329 * frameworks/native/services/gpuservice/gpustats/
7330 */
7331message GpuStatsGlobalInfo {
7332 // Package name of the gpu driver.
7333 optional string driver_package_name = 1;
7334
7335 // Version name of the gpu driver.
7336 optional string driver_version_name = 2;
7337
7338 // Version code of the gpu driver.
7339 optional int64 driver_version_code = 3;
7340
7341 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7342 optional int64 driver_build_time = 4;
7343
7344 // Total count of the gl driver gets loaded.
7345 optional int64 gl_loading_count = 5;
7346
7347 // Total count of the gl driver fails to be loaded.
7348 optional int64 gl_loading_failure_count = 6;
7349
7350 // Total count of the Vulkan driver gets loaded.
7351 optional int64 vk_loading_count = 7;
7352
7353 // Total count of the Vulkan driver fails to be loaded.
7354 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007355
7356 // Api version of the system Vulkan driver.
7357 optional int32 vulkan_version = 9;
7358
7359 // Api version of the system CPU Vulkan driver.
7360 optional int32 cpu_vulkan_version = 10;
7361
7362 // Api version of the system GLES driver.
7363 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007364
7365 // Total count of the angle driver gets loaded.
7366 optional int64 angle_loading_count = 12;
7367
7368 // Total count of the angle driver fails to be loaded.
7369 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007370}
7371
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007372/**
7373 * GPU driver loading time info.
7374 */
7375message GpuDriverLoadingTime {
7376 // List of all the driver loading times for this app. The list size is
7377 // capped at 50.
7378 repeated int64 driver_loading_time = 1;
7379}
7380
7381/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007382 * Logs the GPU stats per app health information.
7383 *
7384 * Logged from:
7385 * frameworks/native/services/gpuservice/gpustats/
7386 */
7387message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007388 // Package name of the application that loads the gpu driver. Total number
7389 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007390 optional string app_package_name = 1;
7391
7392 // Version code of the gpu driver this app loads.
7393 optional int64 driver_version_code = 2;
7394
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007395 // gl driver loading time info.
7396 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7397 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007398
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007399 // Vulkan driver loading time info.
7400 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7401 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007402
7403 // Angle driver loading time info.
7404 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7405 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007406
7407 // CPU Vulkan implementation is in use.
7408 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007409
7410 // App is not doing pre-rotation correctly.
7411 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007412
7413 // App creates GLESv1 context.
7414 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007415}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007416
7417/*
7418 * Logs the size of the system ion heap.
7419 *
7420 * Pulled from StatsCompanionService.
7421 */
7422message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007423 // Deprecated due to limited support of ion stats in debugfs.
7424 // Use `IonHeapSize` instead.
7425 option deprecated = true;
7426
Rafal Slawikd4e87572019-03-12 13:08:38 +00007427 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007428 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007429 optional int64 size_in_bytes = 1;
7430}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007431
Rafal Slawik77987ed2019-06-17 12:28:23 +01007432/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007433 * Logs the total size of the ion heap.
7434 *
7435 * Pulled from StatsCompanionService.
7436 */
7437message IonHeapSize {
7438 // Total size of all ion heaps in kilobytes.
7439 // Read from: /sys/kernel/ion/total_heaps_kb.
7440 optional int32 total_size_kb = 1;
7441}
7442
7443/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007444 * Logs the per-process size of the system ion heap.
7445 *
7446 * Pulled from StatsCompanionService.
7447 */
7448message ProcessSystemIonHeapSize {
7449 // The uid if available. -1 means not available.
7450 optional int32 uid = 1 [(is_uid) = true];
7451
7452 // The process name (from /proc/PID/cmdline).
7453 optional string process_name = 2;
7454
7455 // Sum of sizes of all allocations.
7456 optional int32 total_size_in_kilobytes = 3;
7457
7458 // Number of allocations.
7459 optional int32 allocation_count = 4;
7460
7461 // Size of the largest allocation.
7462 optional int32 max_size_in_kilobytes = 5;
7463}
7464
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007465/**
7466 * Push network stack events.
7467 *
7468 * Log from:
7469 * frameworks/base/packages/NetworkStack/
7470 */
7471message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007472 // The id that indicates the event reported from NetworkStack.
7473 optional int32 event_id = 1;
7474 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007475 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7476}
Carmen Agimofa769c152019-03-04 14:39:14 +00007477
7478/**
7479 * Logs the apps that are installed on the external storage.
7480 * Pulled from:
7481 * StatsCompanionService
7482 */
7483message AppsOnExternalStorageInfo {
7484 // The type of the external storage.
7485 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7486 // The name of the package that is installed on the external storage.
7487 optional string package_name = 2;
7488}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007489
7490/**
7491 * Logs the settings related to Face.
7492 * Logged from:
7493 * frameworks/base/services/core/java/com/android/server/stats
7494 */
7495message FaceSettings {
7496 // Whether or not face unlock is allowed on Keyguard.
7497 optional bool unlock_keyguard_enabled = 1;
7498 // Whether or not face unlock dismisses the Keyguard.
7499 optional bool unlock_dismisses_keyguard = 2;
7500 // Whether or not face unlock requires attention.
7501 optional bool unlock_attention_required = 3;
7502 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7503 optional bool unlock_app_enabled = 4;
7504 // Whether or not face unlock always requires user confirmation.
7505 optional bool unlock_always_require_confirmation = 5;
7506 // Whether or not a diverse set of poses are required during enrollment.
7507 optional bool unlock_diversity_required = 6;
7508}
Maggie White442b6312019-04-05 16:26:44 -07007509
7510/**
7511 * Logs cooling devices maintained by the kernel.
7512 *
7513 * Pulled from StatsCompanionService.java
7514 */
7515message CoolingDevice {
7516 // The type of cooling device being reported. Eg. CPU, GPU...
7517 optional android.os.CoolingTypeEnum device_location = 1;
7518 // The name of the cooling device source. Eg. CPU0
7519 optional string device_name = 2;
7520 // Current throttle state of the cooling device. The value can any unsigned
7521 // integer between 0 and max_state defined in its driver. 0 means device is
7522 // not in throttling, higher value means deeper throttling.
7523 optional int32 state = 3;
7524}
Ben Blount763a5d52019-04-10 11:48:58 -07007525
7526/**
7527 * Intelligence has several counter-type events that don't warrant a
7528 * full separate atom. These are primarily API call counters but also include
7529 * counters for feature usage and specific failure modes.
7530 *
7531 * Logged from the Intelligence mainline module.
7532 */
7533message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007534 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007535 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007536 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007537 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007538 // How many times the event occured (to report a batch of high frequency events).
7539 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007540 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007541 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007542}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007543
7544/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007545 * Logs when Car Power state changed.
7546 *
7547 * Logged from:
7548 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7549 */
7550message CarPowerStateChanged {
7551 // States come from CpmsState in CarPowerManagementService.java.
7552 enum State {
7553 WAIT_FOR_VHAL = 0;
7554 ON = 1;
7555 SHUTDOWN_PREPARE = 2;
7556 WAIT_FOR_FINISH = 3;
7557 SUSPEND = 4;
7558 SIMULATE_SLEEP = 5;
7559 }
7560 optional State state = 1;
7561}
7562
7563/**
7564 * Logs whether GarageMode is entered.
7565 *
7566 * Logged from:
7567 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7568 */
7569message GarageModeInfo {
7570 // Whether GarageMode is entered.
7571 optional bool is_garage_mode = 1;
7572}
Martijn Coenencd95d462019-04-25 17:09:45 +02007573
7574/**
7575 * Historical app ops data per package.
7576 */
7577message AppOps {
7578 // Uid of the package requesting the op
7579 optional int32 uid = 1 [(is_uid) = true];
7580
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007581 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007582 optional string package_name = 2;
7583
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007584 // operation id
7585 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007586
7587 // The number of times the op was granted while the app was in the
7588 // foreground (only for trusted requests)
7589 optional int64 trusted_foreground_granted_count = 4;
7590
7591 // The number of times the op was granted while the app was in the
7592 // background (only for trusted requests)
7593 optional int64 trusted_background_granted_count = 5;
7594
7595 // The number of times the op was rejected while the app was in the
7596 // foreground (only for trusted requests)
7597 optional int64 trusted_foreground_rejected_count = 6;
7598
7599 // The number of times the op was rejected while the app was in the
7600 // background (only for trusted requests)
7601 optional int64 trusted_background_rejected_count = 7;
7602
7603 // For long-running operations, total duration of the operation
7604 // while the app was in the foreground (only for trusted requests)
7605 optional int64 trusted_foreground_duration_millis = 8;
7606
7607 // For long-running operations, total duration of the operation
7608 // while the app was in the background (only for trusted requests)
7609 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007610
7611 // Whether AppOps is guarded by Runtime permission
7612 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007613}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007614
7615/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007616 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007617 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007618message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007619 // Uid of the package requesting the op
7620 optional int32 uid = 1 [(is_uid) = true];
7621
7622 // Name of the package performing the op
7623 optional string package_name = 2;
7624
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007625 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7626 // Attributions must be provided through manifest using <attribution> tag available in R and
7627 // above.
7628 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007629
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007630 // operation id
7631 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007632
7633 // The number of times the op was granted while the app was in the
7634 // foreground (only for trusted requests)
7635 optional int64 trusted_foreground_granted_count = 5;
7636
7637 // The number of times the op was granted while the app was in the
7638 // background (only for trusted requests)
7639 optional int64 trusted_background_granted_count = 6;
7640
7641 // The number of times the op was rejected while the app was in the
7642 // foreground (only for trusted requests)
7643 optional int64 trusted_foreground_rejected_count = 7;
7644
7645 // The number of times the op was rejected while the app was in the
7646 // background (only for trusted requests)
7647 optional int64 trusted_background_rejected_count = 8;
7648
7649 // For long-running operations, total duration of the operation
7650 // while the app was in the foreground (only for trusted requests)
7651 optional int64 trusted_foreground_duration_millis = 9;
7652
7653 // For long-running operations, total duration of the operation
7654 // while the app was in the background (only for trusted requests)
7655 optional int64 trusted_background_duration_millis = 10;
7656
7657 // Whether AppOps is guarded by Runtime permission
7658 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007659
7660 // Sampling rate used on device, from 0 to 100
7661 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007662}
7663
7664/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007665 * Location Manager API Usage information(e.g. API under usage,
7666 * API call's parameters).
7667 * Logged from:
7668 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7669 */
7670message LocationManagerApiUsageReported {
7671
7672 // Indicating if usage starts or usage ends.
7673 optional android.stats.location.UsageState state = 1;
7674
7675 // LocationManagerService's API in use.
7676 // We can identify which API from LocationManager is
7677 // invoking current LMS API by the combination of
7678 // API parameter(e.g. is_listener_null, is_intent_null,
7679 // is_location_request_null)
7680 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7681
7682 // Name of the package calling the API.
7683 optional string calling_package_name = 3;
7684
7685 // Type of the location provider.
7686 optional android.stats.location.ProviderType provider = 4;
7687
7688 // Quality of the location request
7689 optional android.stats.location.LocationRequestQuality quality = 5;
7690
7691 // The desired interval for active location updates, in milliseconds.
7692 // Bucketized to reduce cardinality.
7693 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7694
7695 // Minimum distance between location updates, in meters.
7696 // Bucketized to reduce cardinality.
7697 optional android.stats.location.SmallestDisplacementBucket
7698 bucketized_smallest_displacement = 7;
7699
7700 // The number of location updates.
7701 optional int64 num_updates = 8;
7702
7703 // The request expiration time, in millisecond since boot.
7704 // Bucketized to reduce cardinality.
7705 optional android.stats.location.ExpirationBucket
7706 bucketized_expire_in = 9;
7707
7708 // Type of Callback passed in for this API.
7709 optional android.stats.location.CallbackType callback_type = 10;
7710
7711 // The radius of the central point of the alert
7712 // region, in meters. Only for API REQUEST_GEOFENCE.
7713 // Bucketized to reduce cardinality.
7714 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7715
7716 // Activity Importance of API caller.
7717 // Categorized to 3 types that are interesting from location's perspective.
7718 optional android.stats.location.ActivityImportance activiy_importance = 12;
7719}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007720
7721/**
7722 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7723 */
7724message ReviewPermissionsFragmentResultReported {
7725 // unique value identifying a permission group change. A permission group change might result
7726 // in multiple of these atoms
7727 optional int64 change_id = 1;
7728
7729 // UID of package the permission belongs to
7730 optional int32 uid = 2 [(is_uid) = true];
7731
7732 // Name of package the permission belongs to
7733 optional string package_name = 3;
7734
7735 // The permission to be granted
7736 optional string permission_name = 4;
7737
7738 // The result of the permission grant
7739 optional bool permission_granted = 5;
7740}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007741
7742/**
7743* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7744* Logged from: RuntimePermissionUpdgradeController
7745*/
7746message RuntimePermissionsUpgradeResult {
7747 // Permission granted as result of upgrade
7748 optional string permission_name = 1;
7749
7750 // UID of package granted permission
7751 optional int32 uid = 2 [(is_uid) = true];
7752
7753 // Name of package granted permission
7754 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007755}
7756
7757/**
7758* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7759*/
7760message GrantPermissionsActivityButtonActions {
7761 // Permission granted as result of upgrade
7762 optional string permission_group_name = 1;
7763
7764 // UID of package granted permission
7765 optional int32 uid = 2 [(is_uid) = true];
7766
7767 // Name of package requesting permission
7768 optional string package_name = 3;
7769
7770 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7771 // LABEL_ constants in GrantPermissionActivity.java
7772 optional int32 buttons_presented = 4;
7773
7774 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7775 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007776
7777 // id which identifies single session of user interacting with permission controller
7778 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007779}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007780
7781/**
7782 * Information about LocationAccessCheck notification presented to user
7783 */
7784message LocationAccessCheckNotificationAction {
7785
7786 // id which identifies single session of user interacting with permission controller
7787 optional int64 session_id = 1;
7788
7789 // Uid of package for which location access check is presented
7790 optional int32 package_uid = 2;
7791
7792 // Name of package for which location access check is presented
7793 optional string package_name = 3;
7794
7795 enum Result {
7796 UNDEFINED = 0;
7797 // notification was presented to the user
7798 NOTIFICATION_PRESENTED = 1;
7799 // notification was declined by the user
7800 NOTIFICATION_DECLINED = 2;
7801 // notification was clicked by the user
7802 NOTIFICATION_CLICKED = 3;
7803 }
7804
7805 // View / interaction recorded
7806 optional Result result = 4;
7807}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007808
7809/**
7810 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7811 */
7812message AppPermissionFragmentActionReported {
7813 // id which identifies single session of user interacting with permission controller
7814 optional int64 session_id = 1;
7815
7816 // unique value identifying a permission group change. A permission group change might result
7817 // in multiple of these atoms
7818 optional int64 change_id = 2;
7819
7820 // UID of package the permission belongs to
7821 optional int32 uid = 3 [(is_uid) = true];
7822
7823 // Name of package the permission belongs to
7824 optional string package_name = 4;
7825
7826 // The permission to be granted
7827 optional string permission_name = 5;
7828
7829 // The result of the permission grant
7830 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007831
7832 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7833 optional int32 permission_flags = 7;
7834
7835 enum Button {
7836 UNDEFINED = 0;
7837 // Allow button
7838 ALLOW = 1;
7839 // Deny button
7840 DENY = 2;
7841 // Ask every time button
7842 ASK_EVERY_TIME = 3;
7843 // Allow all the time button
7844 ALLOW_ALWAYS = 4;
7845 // Allow only while using the app button
7846 ALLOW_FOREGROUND = 5;
7847 // Same is Deny button but shown in while in use dialog
7848 DENY_FOREGROUND = 6;
7849 }
7850
7851 // Button pressed in the dialog
7852 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007853}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007854
7855/**
7856* Information about a AppPermissionFragment viewed by user
7857*/
7858message AppPermissionFragmentViewed {
7859 // id which identifies single session of user interacting with permission controller
7860 optional int64 session_id = 1;
7861
7862 // UID of package for which permissions are viewed
7863 optional int32 uid = 2 [(is_uid) = true];
7864
7865 // Name of package for which permissions are viewed
7866 optional string package_name = 3;
7867
7868 // Permission group viewed
7869 optional string permission_group_name = 4;
7870}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007871
7872/**
7873* Information about a AppPermissionsFragment viewed by user
7874*/
7875message AppPermissionsFragmentViewed {
7876 // id which identifies single session of user interacting with permission controller
7877 optional int64 session_id = 1;
7878
7879 // id which identifies single view as every view might have several logging records
7880 // with different package information attached
7881 optional int64 view_id = 2;
7882
7883 // Permission group viewed
7884 optional string permission_group_name = 3;
7885
7886 // UID of package for which permissions are viewed
7887 optional int32 uid = 4 [(is_uid) = true];
7888
7889 // Name of package for which permissions are viewed
7890 optional string package_name = 5;
7891
7892 // Category in which permission is included
7893 enum Category {
7894 UNDEFINED = 0;
7895 ALLOWED = 1;
7896 ALLOWED_FOREGROUND = 2;
7897 DENIED = 3;
7898 }
7899 optional Category category = 6;
7900}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007901
7902/**
7903* Information about a PermissionAppsFragment viewed by user.
7904* Logged from ui/handheld/PermissionAppsFragment.java
7905*/
7906message PermissionAppsFragmentViewed {
7907 // id which identifies single session of user interacting with permission controller
7908 optional int64 session_id = 1;
7909
7910 // id which identifies single view as every view might have several logging records
7911 // with different package information attached
7912 optional int64 view_id = 2;
7913
7914 // Permission group viewed
7915 optional string permission_group_name = 3;
7916
7917 // UID of package for which permissions are viewed
7918 optional int32 uid = 4 [(is_uid) = true];
7919
7920 // Name of package for which permissions are viewed
7921 optional string package_name = 5;
7922
7923 // Category in which app is included
7924 enum Category {
7925 UNDEFINED = 0;
7926 ALLOWED = 1;
7927 ALLOWED_FOREGROUND = 2;
7928 DENIED = 3;
7929 }
7930 optional Category category = 6;
7931}
Tony Make2b1b672019-07-29 16:59:47 +01007932
7933/**
7934 * Logs when there is a smart selection related event.
7935 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7936 * Logged from: TextClassifierEventLogger.java
7937 */
7938message TextSelectionEvent {
7939 // A session ID.
7940 optional string session_id = 1;
7941
7942 // Event type of this event.
7943 optional android.stats.textclassifier.EventType event_type = 2;
7944
Tony Mak9c84bd22019-12-09 07:27:25 +00007945 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007946 optional string model_name = 3;
7947
7948 // Type of widget that was involved in triggering this event.
7949 optional android.stats.textclassifier.WidgetType widget_type = 4;
7950
7951 // Index of this event in a session.
7952 optional int32 event_index = 5;
7953
7954 // Entity type that is involved.
7955 optional string entity_type = 6;
7956
7957 // Relative word index of the start of the selection.
7958 optional int32 relative_word_start_index = 7;
7959
7960 // Relative word (exclusive) index of the end of the selection.
7961 optional int32 relative_word_end_index = 8;
7962
7963 // Relative word index of the start of the smart selection.
7964 optional int32 relative_suggested_word_start_index = 9;
7965
7966 // Relative word (exclusive) index of the end of the smart selection.
7967 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007968
7969 // Name of source package.
7970 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007971}
7972
7973/**
7974 * Logs when there is a smart linkify related event.
7975 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7976 * Logged from: TextClassifierEventLogger.java
7977 */
7978message TextLinkifyEvent {
7979 // A session ID.
7980 optional string session_id = 1;
7981
7982 // Event type of this event.
7983 optional android.stats.textclassifier.EventType event_type = 2;
7984
Tony Mak9c84bd22019-12-09 07:27:25 +00007985 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007986 optional string model_name = 3;
7987
7988 // Type of widget that was involved in triggering this event.
7989 optional android.stats.textclassifier.WidgetType widget_type = 4;
7990
7991 // Index of this event in a session.
7992 optional int32 event_index = 5;
7993
7994 // Entity type that is involved.
7995 optional string entity_type = 6;
7996
7997 // Number of links detected.
7998 optional int32 num_links = 7;
7999
8000 // The total length of all links.
8001 optional int32 linked_text_length = 8;
8002
8003 // Length of input text.
8004 optional int32 text_length = 9;
8005
8006 // Time spent on generating links in ms.
8007 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008008
8009 // Name of source package.
8010 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008011}
8012
8013/**
8014 * Logs when there is a conversation actions related event.
8015 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8016 * Logged from: TextClassifierEventLogger.java
8017 */
8018message ConversationActionsEvent {
8019 // A session ID.
8020 optional string session_id = 1;
8021
8022 // Event type of this event.
8023 optional android.stats.textclassifier.EventType event_type = 2;
8024
Tony Mak9c84bd22019-12-09 07:27:25 +00008025 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008026 optional string model_name = 3;
8027
8028 // Type of widget that was involved in triggering this event.
8029 optional android.stats.textclassifier.WidgetType widget_type = 4;
8030
8031 // The first entity type that is involved.
8032 optional string first_entity_type = 5;
8033
8034 // The second entity type that is involved.
8035 optional string second_entity_type = 6;
8036
8037 // The third entity type that is involved.
8038 optional string third_entity_type = 7;
8039
8040 // The score of the first entity type.
8041 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008042
8043 // Name of source package.
8044 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008045
8046 // Name of the annotator model that is involved in this event.
8047 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008048}
8049
8050/**
8051 * Logs when there is a language detection related event.
8052 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8053 * Logged from: TextClassifierEventLogger.java
8054 */
8055message LanguageDetectionEvent {
8056 // A session ID.
8057 optional string session_id = 1;
8058
8059 // Event type of this event.
8060 optional android.stats.textclassifier.EventType event_type = 2;
8061
Tony Mak9c84bd22019-12-09 07:27:25 +00008062 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008063 optional string model_name = 3;
8064
8065 // Type of widget that was involved in triggering this event.
8066 optional android.stats.textclassifier.WidgetType widget_type = 4;
8067
8068 // Detected language.
8069 optional string language_tag = 5;
8070
8071 // Score of the detected language.
8072 optional float score = 6;
8073
8074 // Position of this action.
8075 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008076
8077 // Name of source package.
8078 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008079}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008080
8081/**
8082 * Information about an OTA update attempt by update_engine.
8083 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8084 */
8085message UpdateEngineUpdateAttemptReported {
8086 // The number of attempts for the update engine to apply a given payload.
8087 optional int32 attempt_number = 1;
8088
8089 optional android.stats.otaupdate.PayloadType payload_type = 2;
8090
8091 // The total time in minutes for the update engine to apply a given payload.
8092 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8093 // it's increased when the system is sleeping.
8094 optional int32 duration_boottime_in_minutes = 3;
8095
8096 // The total time in minutes for the update engine to apply a given payload.
8097 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8098 // and it's not increased when the system is sleeping.
8099 optional int32 duration_monotonic_in_minutes = 4;
8100
8101 // The size of the payload in MiBs.
8102 optional int32 payload_size_mib = 5;
8103
8104 // The attempt result reported by the update engine for an OTA update.
8105 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8106
8107 // The error code reported by the update engine after an OTA update attempt
8108 // on A/B devices.
8109 optional android.stats.otaupdate.ErrorCode error_code = 7;
8110
8111 // The build fingerprint of the source system. The value is read from a
8112 // system property when the device takes the update. e.g.
8113 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8114 optional string source_fingerprint = 8;
8115}
8116
8117/**
8118 * Information about all the attempts the device make before finishing the
8119 * successful update.
8120 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8121 */
8122message UpdateEngineSuccessfulUpdateReported {
8123 // The number of attempts for the update engine to apply the payload for a
8124 // successful update.
8125 optional int32 attempt_count = 1;
8126
8127 optional android.stats.otaupdate.PayloadType payload_type = 2;
8128
8129 optional int32 payload_size_mib = 3;
8130
8131 // The total number of bytes downloaded by update_engine since the last
8132 // successful update.
8133 optional int32 total_bytes_downloaded_mib = 4;
8134
8135 // The ratio in percentage of the over-downloaded bytes compared to the
8136 // total bytes needed to successfully install the update. e.g. 200 if we
8137 // download 200MiB in total for a 100MiB package.
8138 optional int32 download_overhead_percentage = 5;
8139
8140 // The total time in minutes for the update engine to apply the payload for a
8141 // successful update.
8142 optional int32 total_duration_minutes = 6;
8143
8144 // The number of reboot of the device during a successful update.
8145 optional int32 reboot_count = 7;
8146}
Alec Mourie088e762019-07-02 13:10:55 -07008147
8148/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008149 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8150 * key to indicate whether it was successful or not.
8151 *
8152 * Logged from:
8153 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8154 */
8155message RebootEscrowRecoveryReported {
8156 optional bool successful = 1;
8157}
8158
8159/**
Alec Mourie088e762019-07-02 13:10:55 -07008160 * Global display pipeline metrics reported by SurfaceFlinger.
8161 * Pulled from:
8162 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8163 */
8164message SurfaceflingerStatsGlobalInfo {
8165 // Total number of frames presented during the tracing period
8166 optional int64 total_frames = 1;
8167 // Total number of frames missed
8168 optional int64 missed_frames = 2;
8169 // Total number of frames that fell back to client composition
8170 optional int64 client_composition_frames = 3;
8171 // Total time the display was turned on
8172 optional int64 display_on_millis = 4;
8173 // Total time that was spent performing animations.
8174 // This is derived from the present-to-present layer histogram
8175 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008176 // Total number of event connections tracked by SurfaceFlinger at the time
8177 // of this pull. If this number grows prohibitively large, then this can
8178 // cause jank due to resource contention.
8179 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008180 // Set of timings measured from when SurfaceFlinger began compositing a
8181 // frame, until the frame was requested to be presented to the display. This
8182 // measures SurfaceFlinger's total CPU walltime on the critical path per
8183 // frame.
8184 optional FrameTimingHistogram frame_duration = 7
8185 [(android.os.statsd.log_mode) = MODE_BYTES];
8186 // Set of timings measured from when SurfaceFlinger first began using the
8187 // GPU to composite a frame, until the GPU has finished compositing that
8188 // frame. This measures the total additional time SurfaceFlinger needed to
8189 // perform due to falling back into GPU composition.
8190 optional FrameTimingHistogram render_engine_timing = 8
8191 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008192}
8193
8194/**
8195 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8196 * The number of layers uploaded will be restricted due to size limitations.
8197 * Pulled from:
8198 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8199 */
8200message SurfaceflingerStatsLayerInfo {
8201 // The layer for this set of metrics
8202 // For now we can infer that the package name is included in the layer
8203 // name.
8204 optional string layer_name = 1;
8205 // Total number of frames presented
8206 optional int64 total_frames = 2;
8207 // Total number of dropped frames while latching a buffer for this layer.
8208 optional int64 dropped_frames = 3;
8209 // Set of timings measured between successive presentation timestamps.
8210 optional FrameTimingHistogram present_to_present = 4
8211 [(android.os.statsd.log_mode) = MODE_BYTES];
8212 // Set of timings measured from when an app queued a buffer for
8213 // presentation, until the buffer was actually presented to the
8214 // display.
8215 optional FrameTimingHistogram post_to_present = 5
8216 [(android.os.statsd.log_mode) = MODE_BYTES];
8217 // Set of timings measured from when a buffer is ready to be presented,
8218 // until the buffer was actually presented to the display.
8219 optional FrameTimingHistogram acquire_to_present = 6
8220 [(android.os.statsd.log_mode) = MODE_BYTES];
8221 // Set of timings measured from when a buffer was latched by
8222 // SurfaceFlinger, until the buffer was presented to the display
8223 optional FrameTimingHistogram latch_to_present = 7
8224 [(android.os.statsd.log_mode) = MODE_BYTES];
8225 // Set of timings measured from the desired presentation to the actual
8226 // presentation time
8227 optional FrameTimingHistogram desired_to_present = 8
8228 [(android.os.statsd.log_mode) = MODE_BYTES];
8229 // Set of timings measured from when an app queued a buffer for
8230 // presentation, until the buffer was ready to be presented.
8231 optional FrameTimingHistogram post_to_acquire = 9
8232 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008233 // Frames missed latch because the acquire fence didn't fire
8234 optional int64 late_acquire_frames = 10;
8235 // Frames latched early because the desired present time was bad
8236 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008237}
8238
8239/**
8240 * Histogram of frame counts bucketed by time in milliseconds.
8241 * Because of size limitations, we hard-cap the number of buckets, with
8242 * buckets for corresponding to larger milliseconds being less precise.
8243 */
8244message FrameTimingHistogram {
8245 // Timings in milliseconds that describes a set of histogram buckets
8246 repeated int32 time_millis_buckets = 1;
8247 // Number of frames that match to each time_millis, i.e. the bucket
8248 // contents
8249 // It's required that len(time_millis) == len(frame_count)
8250 repeated int64 frame_counts = 2;
8251}
Emilian Peev6729f372019-08-29 09:14:09 -07008252
Emilian Peev6729f372019-08-29 09:14:09 -07008253/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008254 * Janky event as reported by SurfaceFlinger.
8255 * This event is intended to be consumed by a Perfetto subscriber for
8256 * automated trace collection.
8257 *
8258 * Logged from:
8259 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8260 */
8261message DisplayJankReported {
8262 // Informational field for how long the janky event lasted in milliseconds
8263 optional int64 event_duration_millis = 1;
8264 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8265 // the display on time.
8266 optional int32 present_deadlines_missed = 2;
8267}
8268
8269/**
Emilian Peev6729f372019-08-29 09:14:09 -07008270 * Information about camera facing and API level usage.
8271 * Logged from:
8272 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8273 */
8274message CameraActionEvent {
8275 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008276 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008277
8278 // Camera API level used
8279 optional int32 api_level = 2;
8280
8281 // Name of client package
8282 optional string package_name = 3;
8283
8284 // Camera facing
8285 enum Facing {
8286 UNKNOWN = 0;
8287 BACK = 1;
8288 FRONT = 2;
8289 EXTERNAL = 3;
8290 }
8291 optional Facing facing = 4;
8292}
atrost01a20932019-08-28 15:40:37 +01008293
8294/**
8295 * Logs when a compatibility change is affecting an app.
8296 *
8297 * Logged from:
8298 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8299 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8300 */
8301message AppCompatibilityChangeReported {
8302 // The UID of the app being affected by the compatibilty change.
8303 optional int32 uid = 1 [(is_uid) = true];
8304
8305 // The ID of the change affecting the app.
8306 optional int64 change_id = 2;
8307
8308 enum State {
8309 UNKNOWN_STATE = 0;
8310 ENABLED = 1;
8311 DISABLED = 2;
8312 LOGGED = 3;
8313 }
8314
8315 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8316 // logged otherwise.
8317 optional State state = 3;
8318
8319 enum Source {
8320 UNKNOWN_SOURCE = 0;
8321 APP_PROCESS = 1;
8322 SYSTEM_SERVER = 2;
8323 }
8324
8325 // Where it was logged from.
8326 optional Source source = 4;
8327
8328}
Hector Dearman40579f62019-11-01 13:19:30 +00008329
8330/**
8331 * Logged from
8332 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8333 */
8334message PerfettoUploaded {
8335 enum Event {
8336 PERFETTO_UNDEFINED = 0;
8337 PERFETTO_TRACE_BEGIN = 1;
8338 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8339 PERFETTO_ON_CONNECT = 3;
8340 PERFETTO_ON_TRACING_DISABLED = 4;
8341 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8342 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8343 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8344 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8345 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8346 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8347 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8348 PERFETTO_TRIGGER_BEGIN = 12;
8349 PERFETTO_TRIGGER_SUCCESS = 13;
8350 PERFETTO_TRIGGER_FAILURE = 14;
8351 PERFETTO_HIT_GUARDRAILS = 15;
8352 PERFETTO_ON_TIMEOUT = 16;
8353 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8354 }
8355
8356 // Which stage of the pipeline we are reporting from.
8357 optional Event event = 1;
8358
8359 // UUID matching the one set inside the SystemInfo trace packet.
8360 optional int64 trace_uuid_lsb = 2;
8361 optional int64 trace_uuid_msb = 3;
8362}
Mark Tabrya824a642019-11-05 12:26:12 -08008363
8364/**
8365 * Pulls client metrics on data transferred via Vehicle Maps Service.
8366 * Metrics are keyed by uid + layer.
8367 *
8368 * Pulled from:
8369 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8370 */
8371message VmsClientStats {
8372 // UID of the VMS client app
8373 optional int32 uid = 1 [(is_uid) = true];
8374
8375 // VMS layer definition
8376 optional int32 layer_type = 2;
8377 optional int32 layer_channel = 3;
8378 optional int32 layer_version = 4;
8379
8380 // Bytes and packets sent by the client for the layer
8381 optional int64 tx_bytes = 5;
8382 optional int64 tx_packets = 6;
8383
8384 // Bytes and packets received by the client for the layer
8385 optional int64 rx_bytes = 7;
8386 optional int64 rx_packets = 8;
8387
8388 // Bytes and packets dropped due to client error
8389 optional int64 dropped_bytes = 9;
8390 optional int64 dropped_packets = 10;
8391}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008392
8393/**
8394 * State of a dangerous permission requested by a package - sampled
8395 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8396*/
8397message DangerousPermissionStateSampled {
8398 // Name of the permission
8399 optional string permission_name = 1;
8400
8401 // Uid of the package
8402 optional int32 uid = 2 [(is_uid) = true];
8403
8404 // If the permission is granted to the uid
8405 optional bool is_granted = 3;
8406
8407 // Permission flags as per android.content.pm.PermissionFlags
8408 optional int32 permission_flags = 4;
8409}
8410
Stan Iliev637ba5e2019-08-16 13:43:08 -04008411/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008412 * HWUI stats for a given app.
8413 */
8414message GraphicsStats {
8415 // The package name of the app
8416 optional string package_name = 1;
8417
8418 // The version code of the app
8419 optional int64 version_code = 2;
8420
8421 // The start & end timestamps in UTC as
8422 // milliseconds since January 1, 1970
8423 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008424 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008425
Stan Ilievb6517192020-02-18 10:12:42 -05008426 optional int64 end_millis = 4;
8427
8428 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8429 enum PipelineType {
8430 UNKNOWN = 0;
8431 GL = 1;
8432 VULKAN = 2;
8433 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008434
8435 // HWUI renders pipeline type: GL or Vulkan.
8436 optional PipelineType pipeline = 5;
8437
8438 // Distinct frame count.
8439 optional int32 total_frames = 6;
8440
8441 // Number of "missed vsync" events.
8442 optional int32 missed_vsync_count = 7;
8443
8444 // Number of frames in triple-buffering scenario (high input latency)
8445 optional int32 high_input_latency_count = 8;
8446
8447 // Number of "slow UI thread" events.
8448 optional int32 slow_ui_thread_count = 9;
8449
8450 // Number of "slow bitmap upload" events.
8451 optional int32 slow_bitmap_upload_count = 10;
8452
8453 // Number of "slow draw" events.
8454 optional int32 slow_draw_count = 11;
8455
8456 // Number of frames that missed their deadline (aka, visibly janked)
8457 optional int32 missed_deadline_count = 12;
8458
8459 // The frame time histogram for the package
8460 optional FrameTimingHistogram cpu_histogram = 13
8461 [(android.os.statsd.log_mode) = MODE_BYTES];
8462
8463 // The gpu frame time histogram for the package
8464 optional FrameTimingHistogram gpu_histogram = 14
8465 [(android.os.statsd.log_mode) = MODE_BYTES];
8466
8467 // UI mainline module version.
8468 optional int64 version_ui_module = 15;
8469
8470 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8471 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8472 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8473 // more apps are running / rendering.
8474 optional bool is_today = 16;
8475}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008476
8477/**
8478 * Message related to dangerous (runtime) app ops access
8479 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008480message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008481 // Uid of the package accessing app op
8482 optional int32 uid = 1 [(is_uid) = true];
8483
8484 // Name of the package accessing app op
8485 optional string package_name = 2;
8486
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008487 // operation string id per OPSTR_ constants in AppOpsManager.java
8488 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008489
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008490 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
8491 // API.
8492 // Attributions must be provided through manifest using <attribution> tag available in R and
8493 // above.
8494 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008495
8496 // message related to app op access, limited to 600 chars by API
8497 optional string message = 5;
8498
8499 enum SamplingStrategy {
8500 DEFAULT = 0;
8501 UNIFORM = 1;
8502 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008503 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008504 }
8505
8506 // sampling strategy used to collect this message
8507 optional SamplingStrategy sampling_strategy = 6;
8508}
8509
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008510/*
8511 * Logs userspace reboot outcome and duration.
8512 *
8513 * Logged from:
8514 * frameworks/base/core/java/com/android/server/BootReceiver.java
8515 */
8516message UserspaceRebootReported {
8517 // Possible outcomes of userspace reboot.
8518 enum Outcome {
8519 // Default value in case platform failed to determine the outcome.
8520 OUTCOME_UNKNOWN = 0;
8521 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8522 SUCCESS = 1;
8523 // Userspace reboot shutdown sequence was aborted.
8524 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8525 // Remounting userdata into checkpointing mode failed.
8526 FAILED_USERDATA_REMOUNT = 3;
8527 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8528 // reboot.
8529 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8530 }
8531 // Outcome of userspace reboot. Always set.
8532 optional Outcome outcome = 1;
8533 // Duration of userspace reboot in case it has a successful outcome.
8534 // Duration is measured as time between userspace reboot was initiated and until boot completed
8535 // (e.g. sys.boot_completed=1).
8536 optional int64 duration_millis = 2;
8537 // State of primary user's (user0) credential encryption storage.
8538 enum UserEncryptionState {
8539 // Default value.
8540 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8541 // Credential encrypted storage is unlocked.
8542 UNLOCKED = 1;
8543 // Credential encrypted storage is locked.
8544 LOCKED = 2;
8545 }
8546 // State of primary user's encryption storage at the moment boot completed. Always set.
8547 optional UserEncryptionState user_encryption_state = 3;
8548}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008549
8550/*
8551 * Logs integrity check information during each install.
8552 *
8553 * Logged from:
8554 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8555 */
8556message IntegrityCheckResultReported {
8557 optional string package_name = 1;
8558 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008559 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008560 optional string installer_package_name = 4;
8561 enum Response {
8562 UNKNOWN = 0;
8563 ALLOWED = 1;
8564 REJECTED = 2;
8565 FORCE_ALLOWED = 3;
8566 }
8567 optional Response response = 5;
8568 // An estimate on the cause of the response. This will only be populated for
8569 // REJECTED and FORCE_ALLOWED
8570 optional bool caused_by_app_cert_rule = 6;
8571 optional bool caused_by_installer_rule = 7;
8572}
8573
8574/**
8575 * Logs the information about the rules and the provider whenever rules are
8576 * pushed into AppIntegrityManager.
8577 *
8578 * Logged from:
8579 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8580 */
8581message IntegrityRulesPushed {
8582 optional bool success = 1;
8583 // Package name of the app that pushed the rules.
8584 optional string rule_provider = 2;
8585 // Version string of arbitrary format provided by the rule provider to
8586 // identify the rules.
8587 optional string rule_version = 3;
8588}
Jordan Liubedfa702019-12-20 15:08:45 -08008589
8590/**
8591 * Logs when a cell broadcast message is received on the device.
8592 *
8593 * Logged from CellBroadcastService module:
8594 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8595 */
8596message CellBroadcastMessageReported {
8597 // The type of Cell Broadcast message
8598 enum CbType {
8599 UNKNOWN_TYPE = 0;
8600 GSM = 1;
8601 CDMA = 2;
8602 CDMA_SPC = 3;
8603 }
8604
8605 // GSM, CDMA, CDMA-SCP
8606 optional CbType type = 1;
8607}
8608
8609/**
8610 * Logs when an error occurs while handling a cell broadcast message;
8611 *
8612 * Logged from CellBroadcastService module:
8613 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8614 */
8615message CellBroadcastMessageError {
8616 // The type of error raised when trying to handle a cell broadcast message
8617 enum ErrorType {
8618 UNKNOWN_TYPE = 0;
8619 CDMA_DECODING_ERROR = 1;
8620 CDMA_SCP_EMPTY = 2;
8621 CDMA_SCP_HANDLING_ERROR = 3;
8622 GSM_INVALID_HEADER_LENGTH = 4;
8623 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8624 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8625 GSM_INVALID_PDU = 7;
8626 GSM_INVALID_GEO_FENCING_DATA = 8;
8627 GSM_UMTS_INVALID_WAC = 9;
8628 FAILED_TO_INSERT_TO_DB = 10;
8629 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8630 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8631 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8632 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8633 }
8634
8635 // What kind of error occurred
8636 optional ErrorType type = 1;
8637
8638 // Exception message (or log message) associated with the error (max 1000 chars)
8639 optional string exception_message = 2;
8640}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008641
8642/**
8643 * Logs when the SDK Extensions test app has polled the current version.
8644 * This is atom ID 354.
8645 *
8646 * Logged from:
8647 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8648 */
8649message SdkExtensionStatus {
8650 enum ApiCallStatus {
8651 CALL_NOT_ATTEMPTED = 0;
8652 CALL_SUCCESSFUL = 1;
8653 CALL_FAILED = 2;
8654 }
8655
8656 optional ApiCallStatus result = 1;
8657
8658 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8659 optional int32 r_extension_version = 2;
8660
8661 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8662 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8663 optional int32 failed_call_symbol = 3;
8664}
Marco Ballesio497aff42020-01-24 08:39:42 -08008665
8666/**
8667 * Logs when an app is frozen or unfrozen.
8668 *
8669 * Logged from:
8670 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8671 */
8672message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008673 // The type of event.
8674 enum Action {
8675 UNKNOWN = 0;
8676 FREEZE_APP = 1;
8677 UNFREEZE_APP = 2;
8678 }
8679 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008680
Blake Kragten6ce382a2020-01-16 20:20:46 -08008681 // Pid of the process being frozen.
8682 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008683
Blake Kragten6ce382a2020-01-16 20:20:46 -08008684 // Name of the process being frozen.
8685 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008686
Blake Kragten6ce382a2020-01-16 20:20:46 -08008687 // Time since last unfrozen.
8688 optional int64 time_unfrozen_millis = 4;
8689}
8690
8691/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008692 * Pulls information for a single voice call.
8693 *
8694 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8695 *
8696 * Pulled from:
8697 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8698 */
8699message VoiceCallSession {
8700 // Bearer (IMS or CS) when the call started.
8701 optional android.telephony.CallBearerEnum bearer_at_start = 1;
8702
8703 // Bearer (IMS or CS) when the call ended.
8704 // The bearer may change during the call, e.g. due to SRVCC.
8705 optional android.telephony.CallBearerEnum bearer_at_end = 2;
8706
8707 // Direction of the call (incoming or outgoing).
8708 optional android.telephony.CallDirectionEnum direction = 3;
8709
8710 // Time spent setting up the call.
8711 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
8712
8713 // Whether the call ended before the setup was completed.
8714 optional bool setup_failed = 5;
8715
8716 // IMS reason code or CS disconnect cause.
8717 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
8718 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
8719 optional int32 disconnect_reason_code = 6;
8720
8721 // IMS extra code or CS precise disconnect cause.
8722 // For IMS, this code is vendor-specific
8723 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
8724 optional int32 disconnect_extra_code = 7;
8725
8726 // IMS extra message or CS vendor cause.
8727 optional string disconnect_extra_message = 8;
8728
8729 // Radio access technology (RAT) used when call started.
8730 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
8731
8732 // Radio access technology (RAT) used when call terminated.
8733 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
8734
8735 // Number of times RAT changed during the call.
8736 optional int64 rat_switch_count = 11;
8737
8738 // A bitmask of all codecs used during the call.
8739 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
8740 optional int64 codec_bitmask = 12;
8741
8742 // Number of other calls going on during call setup, for the same SIM slot.
8743 optional int32 concurrent_call_count_at_start = 13;
8744
8745 // Number of other calls going on during call termination, for the same SIM slot.
8746 optional int32 concurrent_call_count_at_end = 14;
8747
8748 // Index of the SIM is used, 0 for single-SIM devices.
8749 optional int32 sim_slot_index = 15;
8750
8751 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
8752 optional bool is_multi_sim = 16;
8753
8754 // Whether the call was made with an eSIM profile.
8755 optional bool is_esim = 17;
8756
8757 // Carrier ID of the SIM card.
8758 // See https://source.android.com/devices/tech/config/carrierid.
8759 optional int32 carrier_id = 18;
8760
8761 // Whether an SRVCC has been completed successfully.
8762 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
8763 // events once the call is switched to CS.
8764 optional bool srvcc_completed = 19;
8765
8766 // Number of SRVCC failures.
8767 optional int64 srvcc_failure_count = 20;
8768
8769 // Number of SRVCC cancellations.
8770 optional int64 srvcc_cancellation_count = 21;
8771
8772 // Whether the Real-Time Text (RTT) was ever used in the call.
8773 optional bool rtt_enabled = 22;
8774
8775 // Whether this was an emergency call.
8776 optional bool is_emergency = 23;
8777
8778 // Whether the call was performed while roaming.
8779 optional bool is_roaming = 24;
8780}
8781
8782/**
8783 * Pulls voice call radio access technology (RAT) usage.
8784 *
8785 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
8786 * time. The atom will be skipped if not enough data is available.
8787 *
8788 * Pulled from:
8789 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8790 */
8791message VoiceCallRatUsage {
8792 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
8793 optional int32 carrier_id = 1;
8794
8795 // Radio access technology.
8796 optional android.telephony.NetworkTypeEnum rat = 2;
8797
8798 // Total duration that voice calls spent on this carrier and RAT.
8799 optional int64 total_duration_seconds = 3;
8800
8801 // Total number of calls using this carrier and RAT.
8802 // A call is counted once even if it used the RAT multiple times.
8803 optional int64 call_count = 4;
8804}
8805
8806/**
8807 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
8808 *
8809 * Pulled from:
8810 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8811 */
8812message SimSlotState {
8813 // Number of active SIM slots (both physical and eSIM profiles) in the device.
8814 optional int32 active_slot_count = 1;
8815
8816 // Number of SIM cards (both physical and active eSIM profiles).
8817 // This number is always equal to or less than the number of active SIM slots.
8818 optional int32 sim_count = 2;
8819
8820 // Number of active eSIM profiles.
8821 // This number is always equal to or less than the number of SIMs.
8822 optional int32 esim_count = 3;
8823}
8824
8825/**
8826 * Pulls supported cellular radio access technologies.
8827 *
8828 * This atom reports the capabilities of the device, rather than the network it has access to.
8829 *
8830 * Pulled from:
8831 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8832 */
8833message SupportedRadioAccessFamily {
8834 // A bitmask of supported radio technologies.
8835 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
8836 optional int64 network_type_bitmask = 1;
8837}
8838
8839/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08008840 * Logs gnss stats from location service provider
8841 *
8842 * Pulled from:
8843 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8844 */
8845
8846message GnssStats {
8847 // Number of location reports since boot
8848 optional int64 location_reports = 1;
8849
8850 // Total pulled reports of Location failures since boot
8851 optional int64 location_failure_reports = 2;
8852
8853 // Number of time to first fix reports since boot
8854 optional int64 time_to_first_fix_reports = 3;
8855
8856 // Total pulled reported time to first fix (in milli-seconds) since boot
8857 optional int64 time_to_first_fix_milli_s = 4;
8858
8859 // Number of position accuracy reports since boot
8860 optional int64 position_accuracy_reports = 5;
8861
8862 // Total pulled reported position accuracy (in meters) since boot
8863 optional int64 position_accuracy_meters = 6;
8864
8865 // Number of top 4 average CN0 reports since boot
8866 optional int64 top_four_average_cn0_reports = 7;
8867
8868 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8869 optional int64 top_four_average_cn0_db_mhz = 8;
8870
8871 // Number of l5 top 4 average CN0 reports since boot
8872 optional int64 l5_top_four_average_cn0_reports = 9;
8873
8874 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8875 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8876
8877 // Total number of sv status messages reports since boot
8878 optional int64 sv_status_reports = 11;
8879
8880 // Total number of sv status messages reports, where sv is used in fix since boot
8881 optional int64 sv_status_reports_used_in_fix = 12;
8882
8883 // Total number of L5 sv status messages reports since boot
8884 optional int64 l5_sv_status_reports = 13;
8885
8886 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8887 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008888}
Kweku Adams12752132020-02-18 15:36:48 -08008889
8890/**
8891 * Logs when an app is moved to a different standby bucket.
8892 *
8893 * Logged from:
8894 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
8895 */
8896message AppStandbyBucketChanged {
8897 optional string package_name = 1;
8898
8899 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
8900 optional int32 user_id = 2;
8901
8902 // These enum values match the constants defined in UsageStatsManager.java.
8903 enum Bucket {
8904 BUCKET_UNKNOWN = 0;
8905 BUCKET_EXEMPTED = 5;
8906 BUCKET_ACTIVE = 10;
8907 BUCKET_WORKING_SET = 20;
8908 BUCKET_FREQUENT = 30;
8909 BUCKET_RARE = 40;
8910 BUCKET_RESTRICTED = 45;
8911 BUCKET_NEVER = 50;
8912 }
8913 optional Bucket bucket = 3;
8914
8915 enum MainReason {
8916 MAIN_UNKNOWN = 0;
8917 MAIN_DEFAULT = 0x0100;
8918 MAIN_TIMEOUT = 0x0200;
8919 MAIN_USAGE = 0x0300;
8920 MAIN_FORCED_BY_USER = 0x0400;
8921 MAIN_PREDICTED = 0x0500;
8922 MAIN_FORCED_BY_SYSTEM = 0x0600;
8923 }
8924 optional MainReason main_reason = 4;
8925
8926 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
8927 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
8928 // UsageStatsManager.java.
8929 optional int32 sub_reason = 5;
8930}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05008931
8932/**
8933* Reports a started sharesheet transaction.
8934*
8935* Logged from:
8936* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
8937*/
8938message SharesheetStarted {
8939 // The event_id (as for UiEventReported).
8940 optional int32 event_id = 1;
8941 // The calling app's package name.
8942 optional string package_name = 2;
8943 // An identifier to tie together multiple logs relating to the same share event
8944 optional int32 instance_id = 3;
8945 // The mime type of the share
8946 optional string mime_type = 4;
8947 // The number of direct targets the calling app is providing that will be shown.
8948 optional int32 num_app_provided_direct_targets = 5;
8949 // The number of app targets the calling app is providing that will be shown.
8950 optional int32 num_app_provided_app_targets = 6;
8951 // True if the share originates from the workprofile
8952 optional bool is_workprofile = 7;
8953
8954 enum SharesheetPreviewType { // Constants from ChooserActivity.java
8955 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
8956 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
8957 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
8958 }
8959 // How the sharesheet preview is presented.
8960 optional SharesheetPreviewType previewType = 8;
8961
8962 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
8963 INTENT_DEFAULT = 0;
8964 INTENT_ACTION_VIEW = 1;
8965 INTENT_ACTION_EDIT = 2;
8966 INTENT_ACTION_SEND = 3;
8967 INTENT_ACTION_SENDTO = 4;
8968 INTENT_ACTION_SEND_MULTIPLE = 5;
8969 INTENT_ACTION_IMAGE_CAPTURE = 6;
8970 INTENT_ACTION_MAIN = 7;
8971 }
8972 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
8973 optional ResolverActivityIntent intentType = 9;
8974}
8975
8976/**
8977 * Reports a ranking selection event.
8978 *
8979 * Logged from:
8980 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
8981 */
8982message RankingSelected {
8983 // The event_id (as for UiEventReported).
8984 optional int32 event_id = 1;
8985 // The relevant app's package name (can be source or picked package).
8986 optional string package_name = 2;
8987 // An identifier to tie together multiple logs relating to the same share event.
8988 optional int32 instance_id = 3;
8989 // Which of the ranked targets got picked, default starting position 0.
8990 optional int32 position_picked = 4;
8991}