xref: /aosp_15_r20/frameworks/proto_logging/stats/atoms.proto (revision 64c55175f22a2714b5ba1250098ad9bbc12ec7cd)
1/*
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";
18
19package android.os.statsd;
20
21option optimize_for = CODE_SIZE;
22option java_package = "com.android.os";
23option java_outer_classname = "AtomsProto";
24
25import "frameworks/proto_logging/stats/attribution_node.proto";
26import "frameworks/proto_logging/stats/atoms/adpf/adpf_atoms.proto";
27import "frameworks/proto_logging/stats/atoms/agif/agif_atoms.proto";
28import "frameworks/proto_logging/stats/atoms/corenetworking/connectivity/connectivity_atoms.proto";
29import "frameworks/proto_logging/stats/atoms/display/display_atoms.proto";
30import "frameworks/proto_logging/stats/atoms/dnd/dnd_atoms.proto";
31import "frameworks/proto_logging/stats/atoms/gps/gps_atoms.proto";
32import "frameworks/proto_logging/stats/atoms/hardware/biometrics/biometrics_atoms.proto";
33import "frameworks/proto_logging/stats/atoms/hotword/hotword_atoms.proto";
34import "frameworks/proto_logging/stats/atoms/input/input_atoms.proto";
35import "frameworks/proto_logging/stats/atoms/kernel/kernel_atoms.proto";
36import "frameworks/proto_logging/stats/atoms/locale/locale_atoms.proto";
37import "frameworks/proto_logging/stats/atoms/location/location_atoms.proto";
38import "frameworks/proto_logging/stats/atoms/media/media_drm_atoms.proto";
39import "frameworks/proto_logging/stats/atoms/wearsysui/wearsysui_atoms.proto";
40import "frameworks/proto_logging/stats/atoms/providers/mediaprovider/media_provider_atoms.proto";
41import "frameworks/proto_logging/stats/atoms/sysui/sysui_atoms.proto";
42import "frameworks/proto_logging/stats/atoms/usb/usb_atoms.proto";
43import "frameworks/proto_logging/stats/atoms/view/inputmethod/inputmethod_atoms.proto";
44import "frameworks/proto_logging/stats/atom_field_options.proto";
45import "frameworks/proto_logging/stats/enums/anr/enums.proto";
46import "frameworks/proto_logging/stats/enums/app_shared/app_enums.proto";
47import "frameworks/proto_logging/stats/enums/app_shared/app_op_enums.proto";
48import "frameworks/proto_logging/stats/enums/app/job/job_enums.proto";
49import "frameworks/proto_logging/stats/enums/app/remoteprovisioner_enums.proto";
50import "frameworks/proto_logging/stats/enums/app/settings_enums.proto";
51import "frameworks/proto_logging/stats/enums/app/wearservices/wearservices_enums.proto";
52import "frameworks/proto_logging/stats/enums/app/tvsettings_enums.proto";
53import "frameworks/proto_logging/stats/enums/app/wearsettings_enums.proto";
54import "frameworks/proto_logging/stats/enums/autofill/enums.proto";
55import "frameworks/proto_logging/stats/enums/bluetooth/a2dp/enums.proto";
56import "frameworks/proto_logging/stats/enums/bluetooth/enums.proto";
57import "frameworks/proto_logging/stats/enums/bluetooth/hci/enums.proto";
58import "frameworks/proto_logging/stats/enums/bluetooth/hfp/enums.proto";
59import "frameworks/proto_logging/stats/enums/bluetooth/leaudio/enums.proto";
60import "frameworks/proto_logging/stats/enums/bluetooth/smp/enums.proto";
61import "frameworks/proto_logging/stats/enums/contexthub/enums.proto";
62import "frameworks/proto_logging/stats/enums/debug/enums.proto";
63import "frameworks/proto_logging/stats/enums/display/display_enums.proto";
64import "frameworks/proto_logging/stats/enums/hardware/biometrics/enums.proto";
65import "frameworks/proto_logging/stats/enums/jank/enums.proto";
66import "frameworks/proto_logging/stats/enums/media/audio/enums.proto";
67import "frameworks/proto_logging/stats/enums/media/midi/enums.proto";
68import "frameworks/proto_logging/stats/enums/media/outputswitcher/enums.proto";
69import "frameworks/proto_logging/stats/enums/media/enums.proto";
70import "frameworks/proto_logging/stats/enums/mms/enums.proto";
71import "frameworks/proto_logging/stats/enums/nearby/enums.proto";
72import "frameworks/proto_logging/stats/enums/net/enums.proto";
73import "frameworks/proto_logging/stats/enums/neuralnetworks/enums.proto";
74import "frameworks/proto_logging/stats/enums/nfc/enums.proto";
75import "frameworks/proto_logging/stats/enums/os/enums.proto";
76import "frameworks/proto_logging/stats/enums/server/connectivity/data_stall_event.proto";
77import "frameworks/proto_logging/stats/enums/server/display/enums.proto";
78import "frameworks/proto_logging/stats/enums/server/enums.proto";
79import "frameworks/proto_logging/stats/enums/server/job/enums.proto";
80import "frameworks/proto_logging/stats/enums/server/location/enums.proto";
81import "frameworks/proto_logging/stats/enums/service/enums.proto";
82import "frameworks/proto_logging/stats/enums/service/procstats_enum.proto";
83import "frameworks/proto_logging/stats/enums/stats/connectivity/connectivity_service.proto";
84import "frameworks/proto_logging/stats/enums/stats/connectivity/network_stack.proto";
85import "frameworks/proto_logging/stats/enums/stats/connectivity/tethering.proto";
86import "frameworks/proto_logging/stats/enums/stats/dnsresolver/dns_resolver.proto";
87import "frameworks/proto_logging/stats/enums/stats/devicepolicy/device_policy.proto";
88import "frameworks/proto_logging/stats/enums/stats/devicepolicy/device_policy_enums.proto";
89import "frameworks/proto_logging/stats/enums/stats/docsui/docsui_enums.proto";
90import "frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto";
91import "frameworks/proto_logging/stats/enums/stats/enums.proto";
92import "frameworks/proto_logging/stats/enums/stats/hdmi/enums.proto";
93import "frameworks/proto_logging/stats/enums/stats/intelligence/enums.proto";
94import "frameworks/proto_logging/stats/enums/stats/location/location_enums.proto";
95import "frameworks/proto_logging/stats/enums/stats/mediametrics/mediametrics.proto";
96import "frameworks/proto_logging/stats/enums/stats/mediaprovider/mediaprovider_enums.proto";
97import "frameworks/proto_logging/stats/enums/stats/privacysignals/enums.proto";
98import "frameworks/proto_logging/stats/enums/stats/safetycenter/enums.proto";
99import "frameworks/proto_logging/stats/enums/stats/storage/storage_enums.proto";
100import "frameworks/proto_logging/stats/enums/stats/style/style_enums.proto";
101import "frameworks/proto_logging/stats/enums/stats/sysui/notification_enums.proto";
102import "frameworks/proto_logging/stats/enums/stats/tls/enums.proto";
103import "frameworks/proto_logging/stats/enums/stats/tv/tif_enums.proto";
104import "frameworks/proto_logging/stats/enums/stats/wm/enums.proto";
105import "frameworks/proto_logging/stats/enums/system/security/keystore2/enums.proto";
106import "frameworks/proto_logging/stats/enums/telecomm/enums.proto";
107import "frameworks/proto_logging/stats/enums/telephony/enums.proto";
108import "frameworks/proto_logging/stats/enums/transparency/enums.proto";
109import "frameworks/proto_logging/stats/enums/uwb/enums.proto";
110import "frameworks/proto_logging/stats/enums/view/enums.proto";
111import "frameworks/proto_logging/stats/enums/wifi/enums.proto";
112import "frameworks/proto_logging/stats/enums/stats/textclassifier/textclassifier_enums.proto";
113import "frameworks/proto_logging/stats/enums/stats/otaupdate/updateengine_enums.proto";
114import "frameworks/proto_logging/stats/message/mediametrics_message.proto";
115import "frameworks/proto_logging/stats/atoms/devicelogs/device_logs_atoms.proto";
116import "frameworks/proto_logging/stats/atoms/wearservices/wearservices_atoms.proto";
117import "frameworks/proto_logging/stats/atoms/wear/media/wear_media_atoms.proto";
118
119/**
120 * The primary atom class. This message defines all of the available
121 * raw stats log events from the Android system, also known as "atoms."
122 *
123 * This field contains a single oneof with all of the available messages.
124 * The stats-log-api-gen tool runs as part of the Android build and
125 * generates the android.util.StatsLog class, which contains the constants
126 * and methods that Android uses to log.
127 *
128 * This Atom class is not actually built into the Android system.
129 * Instead, statsd on Android constructs these messages synthetically,
130 * in the format defined here and in stats_log.proto.
131 */
132message Atom {
133    // Pushed atoms start at 2.
134    oneof pushed {
135        // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
136        BleScanStateChanged ble_scan_state_changed = 2
137                [(module) = "bluetooth", (module) = "statsdtest"];
138        ProcessStateChanged process_state_changed = 3 [(module) = "framework", deprecated = true];
139        BleScanResultReceived ble_scan_result_received = 4
140            [(module) = "bluetooth", (module) = "statsdtest"];
141        SensorStateChanged sensor_state_changed =
142                5 [(module) = "framework", (module) = "statsdtest"];
143        gps.GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
144        SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
145        ScheduledJobStateChanged scheduled_job_state_changed =
146                8 [(module) = "framework", (module) = "statsdtest"];
147        ScreenBrightnessChanged screen_brightness_changed =
148                9 [(module) = "framework", (module) = "statsdtest"];
149        WakelockStateChanged wakelock_state_changed =
150                10 [(module) = "framework", (module) = "statsdtest"];
151        LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
152                11 [(module) = "framework"];
153        MobileRadioPowerStateChanged mobile_radio_power_state_changed =
154                12 [(module) = "framework", (truncate_timestamp) = true];
155        WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
156        ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
157                14 [(module) = "framework"];
158        MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
159        ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
160        CachedKillReported cached_kill_reported = 17 [(module) = "framework", deprecated = true];
161        ProcessMemoryStatReported process_memory_stat_reported =
162                18 [(module) = "framework", deprecated = true];
163        sysui.LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
164        BatterySaverModeStateChanged battery_saver_mode_state_changed =
165                20 [(module) = "framework", (module) = "statsdtest"];
166        DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
167        DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
168        AudioStateChanged audio_state_changed =
169                23 [(module) = "framework", (truncate_timestamp) = true];
170        MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
171        CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
172        FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
173        UidProcessStateChanged uid_process_state_changed =
174                27 [(module) = "framework", (module) = "statsdtest"];
175        ProcessLifeCycleStateChanged process_life_cycle_state_changed =
176                28 [(module) = "framework", (module) = "statsdtest"];
177        ScreenStateChanged screen_state_changed =
178                29 [(module) = "framework", (module) = "statsdtest"];
179        BatteryLevelChanged battery_level_changed =
180                30 [(module) = "framework", (module) = "statsdtest"];
181        ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
182        PluggedStateChanged plugged_state_changed = 32
183                [(module) = "framework", (module) = "statsdtest"];
184        InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
185        input.TouchEventReported touch_event_reported = 34;
186        WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
187        KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
188        WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
189        WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
190        WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
191        PhoneSignalStrengthChanged phone_signal_strength_changed =
192                40 [(module) = "framework", (module) = "statsdtest", (truncate_timestamp) = true];
193        SettingChanged setting_changed = 41 [(module) = "framework"];
194        ActivityForegroundStateChanged activity_foreground_state_changed =
195                42 [(module) = "framework", (module) = "statsdtest"];
196        IsolatedUidChanged isolated_uid_changed =
197                43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
198        PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
199        WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
200        AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
201        AppBreadcrumbReported app_breadcrumb_reported = 47
202            [(module) = "statsd", (module) = "statsdtest"];
203        AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
204        AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
205        AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
206        LmkKillOccurred lmk_kill_occurred = 51 [(module) = "framework"];
207        PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
208        WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
209        AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
210        ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
211        BootSequenceReported boot_sequence_reported = 57;
212        OverlayStateChanged overlay_state_changed =
213                59 [(module) = "framework", (module) = "statsdtest"];
214        ForegroundServiceStateChanged foreground_service_state_changed
215                = 60 [(module) = "framework"];
216        CallStateChanged call_state_changed =
217                61 [(module) = "telecom", (truncate_timestamp) = true];
218        sysui.KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
219        sysui.KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
220        sysui.KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered =
221                64 [(module) = "sysui"];
222        AppDied app_died = 65 [(module) = "framework"];
223        ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
224        BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "bluetooth"];
225        BluetoothConnectionStateChanged bluetooth_connection_state_changed =
226                68 [(module) = "bluetooth"];
227        GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
228        UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
229        SpeakerImpedanceReported speaker_impedance_reported = 71;
230        HardwareFailed hardware_failed = 72;
231        PhysicalDropDetected physical_drop_detected = 73;
232        ChargeCyclesReported charge_cycles_reported = 74;
233        MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
234        MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
235        UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
236        AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
237        ANROccurred anr_occurred = 79 [(module) = "framework"];
238        WTFOccurred wtf_occurred = 80 [(module) = "framework"];
239        LowMemReported low_mem_reported = 81 [(module) = "framework"];
240        GenericAtom generic_atom = 82;
241        VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
242        DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
243        ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
244        BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
245        BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
246        BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
247        UiEventReported ui_event_reported = 90 [
248            (module) = "framework",
249            (module) = "sysui",
250            (module) = "mediaprovider"
251        ];
252        BatteryHealthSnapshot battery_health_snapshot = 91;
253        SlowIo slow_io = 92;
254        BatteryCausedShutdown battery_caused_shutdown = 93;
255        PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
256        PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
257        UserRestrictionChanged user_restriction_changed = 96;
258        SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
259        ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
260        // TODO: service state change is very noisy shortly after boot, as well
261        // as at other transitions - coming out of doze, device plugged in, etc.
262        // Consider removing this if it becomes a problem
263        ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
264        ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
265        FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
266        BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
267        DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
268        DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
269        DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
270            105 [(module) = "docsui"];
271        DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
272        DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
273        DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
274            108 [(module) = "docsui"];
275        DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
276        DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
277        DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
278        DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
279        WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
280        WifiRunningStateChanged wifi_running_state_changed = 114
281                [(module) = "framework", deprecated = true];
282        AppCompacted app_compacted = 115 [(module) = "framework", deprecated = true];
283        NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
284        DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
285            117 [(module) = "docsui"];
286        DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
287        DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
288        DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
289        DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
290        RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "crashrecovery", (module) = "framework"];
291        SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
292        GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
293        BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
294                125 [(module) = "bluetooth"];
295        BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
296                126 [(module) = "bluetooth"];
297        BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
298                127 [(module) = "bluetooth"];
299        AppDowngraded app_downgraded = 128 [(module) = "framework"];
300        AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
301        LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
302        GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
303        GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
304        UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
305        NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
306        NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
307        NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
308        NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
309        NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
310        NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
311        SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
312        SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
313        BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
314                142 [(module) = "framework"];
315        AttentionManagerServiceResultReported attention_manager_service_result_reported =
316                143 [(module) = "framework"];
317        AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
318        SpeechDspStatReported speech_dsp_stat_reported = 145;
319        UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
320        WatchdogRollbackOccurred watchdog_rollback_occurred =
321                147 [(module) = "framework", (module) = "crashrecovery", (module) = "statsd"];
322        BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
323                148 [(module) = "framework"];
324        BubbleUIChanged bubble_ui_changed = 149 [(module) = "framework"];
325        ScheduledJobConstraintChanged scheduled_job_constraint_changed =
326                150 [(module) = "framework"];
327        BluetoothActiveDeviceChanged bluetooth_active_device_changed =
328                151 [(module) = "bluetooth"];
329        BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
330                152 [(module) = "bluetooth"];
331        BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
332                153 [(module) = "bluetooth"];
333        BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
334                154 [(module) = "bluetooth"];
335        BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
336                155 [(module) = "bluetooth"];
337        BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
338                156 [(module) = "bluetooth"];
339        BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
340                157 [(module) = "bluetooth"];
341        BluetoothDeviceFailedContactCounterReported
342                bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
343        BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
344                159 [(module) = "bluetooth"];
345        BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
346                160 [(module) = "bluetooth"];
347        BluetoothQualityReportReported bluetooth_quality_report_reported =
348                161 [(module) = "bluetooth"];
349        BluetoothDeviceInfoReported bluetooth_device_info_reported =
350                162 [(module) = "bluetooth"];
351        BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
352                163 [(module) = "bluetooth"];
353        BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
354                164 [(module) = "bluetooth"];
355        BluetoothBondStateChanged bluetooth_bond_state_changed =
356                165 [(module) = "bluetooth"];
357        BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
358                166 [(module) = "bluetooth"];
359        BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
360                167 [(module) = "bluetooth"];
361        ScreenTimeoutExtensionReported screen_timeout_extension_reported =
362                168 [(module) = "framework"];
363        ProcessStartTime process_start_time = 169 [(module) = "framework"];
364        PermissionGrantRequestResultReported permission_grant_request_result_reported =
365                170 [(module) = "permissioncontroller"];
366        BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed =
367                171 [(module) = "bluetooth"];
368        DeviceIdentifierAccessDenied device_identifier_access_denied =
369                172 [(module) = "telephony_common"];
370        BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
371        sysui.AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
372        sysui.AssistGestureFeedbackReported assist_gesture_feedback_reported =
373                175 [(module) = "sysui"];
374        sysui.AssistGestureProgressReported assist_gesture_progress_reported =
375                176 [(module) = "sysui"];
376        input.TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
377        HiddenApiUsed hidden_api_used = 178 [(module) = "framework"];
378        StyleUIChanged style_ui_changed = 179 [(module) = "sysui", (module) = "wallpaper"];
379        PrivacyIndicatorsInteracted privacy_indicators_interacted =
380                180 [(module) = "permissioncontroller"];
381        AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
382                181 [(module) = "framework"];
383        NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
384        AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
385        BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
386        SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
387        TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
388        BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
389                187 [(module) = "bluetooth"];
390        IntelligenceEventReported intelligence_event_reported =
391                188 [(module) = "intelligence"];
392        ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
393                189 [(module) = "framework"];
394        RoleRequestResultReported role_request_result_reported =
395                190 [(module) = "permissioncontroller"];
396        MediametricsAudiopolicyReported mediametrics_audiopolicy_reported =
397                191 [(module) = "media_metrics"];
398        MediametricsAudiorecordReported mediametrics_audiorecord_reported =
399                192[(module) = "media_metrics"];
400        MediametricsAudiothreadReported mediametrics_audiothread_reported =
401                193 [(module) = "media_metrics"];
402        MediametricsAudiotrackReported mediametrics_audiotrack_reported =
403                194 [(module) = "media_metrics"];
404        MediametricsCodecReported mediametrics_codec_reported =
405                195 [(module) = "media_metrics"];
406        MediametricsDrmWidevineReported mediametrics_drm_widevine_reported =
407                196 [(module) = "media_metrics"];
408        MediametricsExtractorReported mediametrics_extractor_reported =
409                197 [(module) = "media_metrics"];
410        MediametricsMediadrmReported mediametrics_mediadrm_reported =
411                198 [(module) = "media_metrics"];
412        MediametricsNuPlayerReported mediametrics_nuplayer_reported =
413                199 [(module) = "media_metrics"];
414        MediametricsRecorderReported mediametrics_recorder_reported =
415                200 [(module) = "media_metrics"];
416        MediametricsDrmManagerReported mediametrics_drmmanager_reported =
417                201 [(module) = "media_metrics"];
418        CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
419        GarageModeInfo garage_mode_info = 204 [(module) = "car"];
420        TestAtomReported test_atom_reported = 205
421            [(module) = "cts", (module) = "statsdtest"];
422        ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
423                206 [(module) = "framework"];
424        ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
425        ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
426        ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
427        LocationManagerApiUsageReported location_manager_api_usage_reported =
428                210 [(module) = "framework"];
429        ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
430                211 [(module) = "permissioncontroller"];
431        RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
432                212 [(module) = "permissioncontroller"];
433        GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
434                213 [(module) = "permissioncontroller"];
435        LocationAccessCheckNotificationAction location_access_check_notification_action =
436                214 [(module) = "permissioncontroller"];
437        AppPermissionFragmentActionReported app_permission_fragment_action_reported =
438                215 [(module) = "permissioncontroller"];
439        AppPermissionFragmentViewed app_permission_fragment_viewed =
440                216 [(module) = "permissioncontroller"];
441        AppPermissionsFragmentViewed app_permissions_fragment_viewed =
442                217 [(module) = "permissioncontroller"];
443        PermissionAppsFragmentViewed permission_apps_fragment_viewed =
444                218  [(module) = "permissioncontroller"];
445        TextSelectionEvent text_selection_event = 219  [(module) = "textclassifier"];
446        TextLinkifyEvent text_linkify_event = 220  [(module) = "textclassifier"];
447        ConversationActionsEvent conversation_actions_event = 221  [(module) = "textclassifier"];
448        LanguageDetectionEvent language_detection_event = 222  [(module) = "textclassifier"];
449        ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
450        sysui.BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
451        UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported =
452                225 [(module) = "update_engine"];
453        UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported =
454                226 [(module) = "update_engine"];
455        CameraActionEvent camera_action_event = 227 [(module) = "framework"];
456        AppCompatibilityChangeReported app_compatibility_change_reported =
457                228 [(module) = "framework"];
458        PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
459        VmsClientConnectionStateChanged vms_client_connection_state_changed =
460                230 [(module) = "car"];
461        MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
462        MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
463        MediaProviderPermissionRequested media_provider_permission_requested =
464            235 [(module) = "mediaprovider"];
465        MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
466        MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
467            237 [(module) = "mediaprovider"];
468        RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
469        BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
470        BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
471                240 [(module) = "framework"];
472        BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
473        BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
474        UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
475        NotificationReported notification_reported = 244 [(module) = "framework"];
476        sysui.NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
477        NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
478        IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
479        IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
480        CellBroadcastMessageReported cb_message_reported =
481            249 [(module) = "cellbroadcast"];
482        CellBroadcastMessageError cb_message_error =
483            250 [(module) = "cellbroadcast"];
484        WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
485        WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
486        WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
487        AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
488        SnapshotMergeReported snapshot_merge_reported =
489            255 [(module) = "update_engine"];
490        ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
491            256  [(module) = "framework"];
492        // DisplayJankReported was deprecated in Android 12+
493        DisplayJankReported display_jank_reported = 257 [deprecated = true];
494        AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
495        SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
496        RankingSelected ranking_selected = 260 [
497            (module) = "framework",
498            (module) = "sysui",
499            (module) = "mediaprovider"
500        ];
501        TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
502        sysui.LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
503        PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
504        UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
505        UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
506        AccessibilityShortcutReported accessibility_shortcut_reported =
507            266 [(module) = "framework"];
508        AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
509        DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
510        AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
511        AutoRevokeNotificationClicked auto_revoke_notification_clicked =
512            270 [(module) = "permissioncontroller"];
513        AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
514            271 [(module) = "permissioncontroller"];
515        AutoRevokedAppInteraction auto_revoked_app_interaction =
516            272 [(module) = "permissioncontroller", (module) = "settings"];
517        AppPermissionGroupsFragmentAutoRevokeAction
518            app_permission_groups_fragment_auto_revoke_action =
519            273 [(module) = "permissioncontroller"];
520        EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
521        AudioPowerUsageDataReported audio_power_usage_data_reported =
522            275 [(module) = "media_metrics"];
523        TvTunerStateChanged tv_tuner_state_changed = 276 [(module) = "framework"];
524        sysui.MediaOutputOpSwitchReported mediaoutput_op_switch_reported =
525            277 [(module) = "sysui"];
526        CellBroadcastMessageFiltered cb_message_filtered =
527            278 [(module) = "cellbroadcast"];
528        TvTunerDvrStatus tv_tuner_dvr_status = 279 [(module) = "framework"];
529        TvCasSessionOpenStatus tv_cas_session_open_status =
530            280 [(module) = "framework"];
531        AssistantInvocationReported assistant_invocation_reported = 281 [(module) = "framework"];
532        DisplayWakeReported display_wake_reported = 282 [(module) = "framework"];
533        CarUserHalModifyUserRequestReported car_user_hal_modify_user_request_reported =
534            283 [(module) = "car"];
535        CarUserHalModifyUserResponseReported car_user_hal_modify_user_response_reported =
536            284 [(module) = "car"];
537        CarUserHalPostSwitchResponseReported car_user_hal_post_switch_response_reported =
538            285 [(module) = "car"];
539        CarUserHalInitialUserInfoRequestReported car_user_hal_initial_user_info_request_reported =
540            286 [(module) = "car"];
541        CarUserHalInitialUserInfoResponseReported car_user_hal_initial_user_info_response_reported =
542            287 [(module) = "car"];
543        CarUserHalUserAssociationRequestReported car_user_hal_user_association_request_reported =
544            288 [(module) = "car"];
545        CarUserHalSetUserAssociationResponseReported car_user_hal_set_user_association_response_reported =
546            289 [(module) = "car"];
547        NetworkIpProvisioningReported network_ip_provisioning_reported =
548            290 [(module) = "network_stack"];
549        NetworkDhcpRenewReported network_dhcp_renew_reported = 291 [(module) = "network_stack"];
550        NetworkValidationReported network_validation_reported = 292 [(module) = "network_stack"];
551        NetworkStackQuirkReported network_stack_quirk_reported = 293 [(module) = "network_stack"];
552        MediametricsAudioRecordDeviceUsageReported mediametrics_audiorecorddeviceusage_reported =
553            294 [(module) = "media_metrics"];
554        MediametricsAudioThreadDeviceUsageReported mediametrics_audiothreaddeviceusage_reported =
555            295 [(module) = "media_metrics"];
556        MediametricsAudioTrackDeviceUsageReported mediametrics_audiotrackdeviceusage_reported =
557            296 [(module) = "media_metrics"];
558        MediametricsAudioDeviceConnectionReported mediametrics_audiodeviceconnection_reported =
559            297 [(module) = "media_metrics"];
560        BlobCommitted blob_committed = 298 [(module) = "framework"];
561        BlobLeased blob_leased = 299 [(module) = "framework"];
562        BlobOpened blob_opened = 300 [(module) = "framework"];
563        ContactsProviderStatusReported contacts_provider_status_reported = 301;
564        KeystoreKeyEventReported keystore_key_event_reported = 302;
565        NetworkTetheringReported  network_tethering_reported =
566            303 [(module) = "network_tethering"];
567        sysui.ImeTouchReported ime_touch_reported = 304 [(module) = "sysui"];
568        UIInteractionFrameInfoReported ui_interaction_frame_info_reported =
569            305 [(module) = "framework"];
570        UIActionLatencyReported ui_action_latency_reported = 306 [(module) = "framework"];
571        WifiDisconnectReported wifi_disconnect_reported = 307 [(module) = "wifi"];
572        WifiConnectionStateChanged wifi_connection_state_changed = 308 [(module) = "wifi"];
573        HdmiCecActiveSourceChanged hdmi_cec_active_source_changed = 309 [(module) = "framework"];
574        HdmiCecMessageReported hdmi_cec_message_reported = 310 [(module) = "framework"];
575        AirplaneMode airplane_mode = 311 [(module) = "telephony"];
576        ModemRestart modem_restart = 312 [(module) = "telephony"];
577        CarrierIdMismatchReported carrier_id_mismatch_reported = 313 [(module) = "telephony"];
578        CarrierIdTableUpdated carrier_id_table_updated = 314 [(module) = "telephony"];
579        DataStallRecoveryReported data_stall_recovery_reported = 315 [(module) = "telephony"];
580        MediametricsMediaParserReported mediametrics_mediaparser_reported =
581                316 [(module) = "media_metrics"];
582        TlsHandshakeReported tls_handshake_reported = 317 [(module) = "conscrypt"];
583        TextClassifierApiUsageReported text_classifier_api_usage_reported = 318  [(module) = "textclassifier"];
584        CarWatchdogKillStatsReported car_watchdog_kill_stats_reported = 319 [(module) = "car"];
585        MediametricsPlaybackReported mediametrics_playback_reported = 320 [(module) = "media_metrics"];
586        MediaNetworkInfoChanged media_network_info_changed = 321 [(module) = "media_metrics"];
587        MediaPlaybackStateChanged media_playback_state_changed = 322 [(module) = "media_metrics"];
588        MediaPlaybackErrorReported media_playback_error_reported = 323 [(module) = "media_metrics"];
589        MediaPlaybackTrackChanged media_playback_track_changed = 324 [(module) = "media_metrics"];
590        WifiScanReported wifi_scan_reported = 325 [(module) = "wifi"];
591        WifiPnoScanReported wifi_pno_scan_reported = 326  [(module) = "wifi"];
592        TifTuneStateChanged tif_tune_changed = 327 [(module) = "framework"];
593        AutoRotateReported auto_rotate_reported = 328 [(module) = "framework"];
594        PerfettoTrigger perfetto_trigger = 329 [(module) = "perfetto"];
595        TranscodingData transcoding_data = 330 [(module) = "mediaprovider"];
596        ImsServiceEntitlementUpdated ims_service_entitlement_updated = 331 [(module) = "imsentitlement"];
597        DeviceRotated device_rotated = 333 [(module) = "framework"];
598        SimSpecificSettingsRestored sim_specific_settings_restored = 334
599            [(module) = "telephony"];
600        TextClassifierDownloadReported text_classifier_download_reported = 335 [(module) = "textclassifier"];
601        PinStorageEvent pin_storage_event = 336 [(module) = "telephony"];
602        FaceDownReported face_down_reported = 337 [(module) = "framework"];
603        BluetoothHALCrashReasonReported bluetooth_hal_crash_reason_reported =
604            338 [(module) = "bluetooth"];
605        RebootEscrowPreparationReported reboot_escrow_preparation_reported =
606            339 [(module) = "framework"];
607        RebootEscrowLskfCaptureReported reboot_escrow_lskf_capture_reported =
608            340 [(module) = "framework"];
609        RebootEscrowRebootReported reboot_escrow_reboot_reported = 341 [(module) = "framework"];
610        BinderLatencyReported binder_latency_reported = 342 [(module) = "framework"];
611        MediametricsAAudioStreamReported mediametrics_aaudiostream_reported =
612            343 [(module) = "media_metrics"];
613        MediaTranscodingSessionEnded media_transcoding_session_ended = 344
614            [(module) = "media"];
615        MagnificationUsageReported magnification_usage_reported =
616            345 [(module) = "framework"];
617        MagnificationModeWithImeOnReported magnification_mode_with_ime_on_reported =
618            346 [(module) = "framework"];
619        AppSearchCallStatsReported app_search_call_stats_reported = 347 [(module) = "appsearch"];
620        AppSearchPutDocumentStatsReported app_search_put_document_stats_reported = 348 [(module) = "appsearch"];
621        sysui.DeviceControlChanged device_control_changed = 349 [(module) = "sysui"];
622        DeviceStateChanged device_state_changed = 350 [(module) = "framework"];
623        input.InputDeviceRegistered inputdevice_registered = 351 [(module) = "framework"];
624        sysui.SmartSpaceCardReported smartspace_card_reported = 352 [(module) = "sysui"];
625        AuthPromptAuthenticateInvoked auth_prompt_authenticate_invoked = 353 [(module) = "framework"];
626        AuthManagerCanAuthenticateInvoked auth_manager_can_authenticate_invoked = 354 [(module) = "framework"];
627        AuthEnrollActionInvoked auth_enroll_action_invoked = 355 [(module) = "framework"];
628        AuthDeprecatedAPIUsed auth_deprecated_api_used = 356 [(module) = "framework"];
629        UnattendedRebootOccurred unattended_reboot_occurred = 357 [(module) = "scheduling"];
630        LongRebootBlockingReported long_reboot_blocking_reported = 358 [(module) = "scheduling"];
631        LocationTimeZoneProviderStateChanged location_time_zone_provider_state_changed =
632            359 [(module) = "framework"];
633        // 360-363 are reserved.
634        FdtrackEventOccurred fdtrack_event_occurred = 364 [(module) = "framework"];
635        TimeoutAutoExtendedReported timeout_auto_extended_reported = 365
636            [(module) = "framework"];
637        AlarmBatchDelivered alarm_batch_delivered = 367 [(module) = "framework"];
638        AlarmScheduled alarm_scheduled = 368 [(module) = "framework"];
639        CarWatchdogIoOveruseStatsReported car_watchdog_io_overuse_stats_reported = 369 [(module) = "car"];
640        UserLevelHibernationStateChanged user_level_hibernation_state_changed = 370 [(module) = "framework"];
641        AppSearchInitializeStatsReported app_search_initialize_stats_reported = 371 [(module) = "appsearch"];
642        AppSearchQueryStatsReported app_search_query_stats_reported = 372 [(module) = "appsearch"];
643        AppProcessDied app_process_died = 373 [(module) = "framework"];
644        NetworkIpReachabilityMonitorReported network_ip_reachability_monitor_reported =
645            374 [(module) = "network_stack"];
646        input.SlowInputEventReported slow_input_event_reported = 375 [(module) = "input"];
647        ANROccurredProcessingStarted anr_occurred_processing_started = 376 [(module) = "framework"];
648        AppSearchRemoveStatsReported app_search_remove_stats_reported = 377 [(module) = "appsearch"];
649        MediaCodecReported media_codec_reported =
650            378 [(module) = "framework", (module) = "media_metrics"];
651        PermissionUsageFragmentInteraction permission_usage_fragment_interaction = 379 [(module) = "permissioncontroller"];
652        PermissionDetailsInteraction permission_details_interaction = 380 [(module) = "permissioncontroller"];
653        PrivacySensorToggleInteraction privacy_sensor_toggle_interaction = 381 [(module) = "framework"];
654        PrivacyToggleDialogInteraction privacy_toggle_dialog_interaction = 382 [(module) = "framework"];
655        AppSearchOptimizeStatsReported app_search_optimize_stats_reported = 383 [(module) = "appsearch"];
656        NonA11yToolServiceWarningReported non_a11y_tool_service_warning_report = 384 [(module) = "framework"];
657        AppCompatStateChanged app_compat_state_changed = 386 [(module) = "framework"];
658        SizeCompatRestartButtonEventReported size_compat_restart_button_event_reported = 387 [(module) = "framework"];
659        SplitscreenUIChanged splitscreen_ui_changed = 388 [(module) = "framework"];
660        NetworkDnsHandshakeReported network_dns_handshake_reported = 389 [(module) = "resolv"];
661        BluetoothCodePathCounter bluetooth_code_path_counter =
662            390 [(module) = "bluetooth"];
663        BluetoothLeBatchScanReportDelay bluetooth_le_batch_scan_report_delay =
664            392 [(module) = "bluetooth"];
665        sysui.AccessibilityFloatingMenuUIChanged accessibility_floating_menu_ui_changed =
666            393 [(module) = "sysui"];
667        NeuralNetworksCompilationCompleted neuralnetworks_compilation_completed = 394
668            [(module) = "neuralnetworks"];
669        NeuralNetworksExecutionCompleted neuralnetworks_execution_completed = 395
670            [(module) = "neuralnetworks"];
671        NeuralNetworksCompilationFailed neuralnetworks_compilation_failed = 396
672            [(module) = "neuralnetworks"];
673        NeuralNetworksExecutionFailed neuralnetworks_execution_failed = 397
674            [(module) = "neuralnetworks"];
675        ContextHubBooted context_hub_booted = 398 [(module) = "contexthub"];
676        ContextHubRestarted context_hub_restarted = 399 [(module) = "contexthub"];
677        ContextHubLoadedNanoappSnapshotReported context_hub_loaded_nanoapp_snapshot_reported = 400
678            [(module) = "contexthub"];
679        ChreCodeDownloadTransacted chre_code_download_transacted = 401 [(module) = "contexthub"];
680        UwbSessionInitiated uwb_session_inited = 402 [(module) = "uwb"];
681        UwbSessionClosed uwb_session_closed = 403 [(module) = "uwb"];
682        UwbFirstRangingReceived uwb_first_ranging_received = 404 [(module) = "uwb"];
683        UwbRangingMeasurementReceived uwb_ranging_measurement_received = 405 [(module) = "uwb"];
684        TextClassifierDownloadWorkScheduled text_classifier_download_work_scheduled = 406 [(module) = "textclassifier"];
685        TextClassifierDownloadWorkCompleted text_classifier_download_work_completed = 407 [(module) = "textclassifier"];
686        ClipboardCleared clipboard_cleared = 408 [(module) = "framework"];
687        VmCreationRequested vm_creation_requested = 409 [(module) = "virtualizationservice"];
688        NearbyDeviceScanStateChanged nearby_device_scan_state_changed = 410 [(module) = "nearby"];
689        // reserved 411 for a deprecated CameraCompatControlEventReported.
690        ApplicationLocalesChanged application_locales_changed = 412 [(module) = "framework"];
691        MediametricsAudioTrackStatusReported mediametrics_audiotrackstatus_reported =
692            413 [(module) = "media_metrics"];
693        FoldStateDurationReported fold_state_duration_reported = 414 [(module) = "framework"];
694        LocationTimeZoneProviderControllerStateChanged location_time_zone_provider_controller_state_changed =
695            415 [(module) = "framework"];
696        DisplayHbmStateChanged display_hbm_state_changed = 416 [(module) = "framework"];
697        DisplayHbmBrightnessChanged display_hbm_brightness_changed = 417 [(module) = "framework"];
698        PersistentUriPermissionsFlushed persistent_uri_permissions_flushed =
699            418 [(module) = "framework"];
700        EarlyBootCompOsArtifactsCheckReported early_boot_comp_os_artifacts_check_reported = 419 [(module) = "art"];
701        VBMetaDigestReported vbmeta_digest_reported = 420 [(module) = "framework"];
702        ApexInfoGathered apex_info_gathered = 421 [(module) = "framework"];
703        PvmInfoGathered pvm_info_gathered = 422 [(module) = "framework"];
704        WearSettingsUIInteracted wear_settings_ui_interacted = 423 [(module) = "wear_settings"];
705        TracingServiceReportEvent tracing_service_report_event = 424 [(module) = "framework"];
706        MediametricsAudioRecordStatusReported mediametrics_audiorecordstatus_reported =
707            425 [(module) = "media_metrics"];
708        sysui.LauncherLatency launcher_latency = 426 [(module) = "sysui"];
709        DropboxEntryDropped dropbox_entry_dropped = 427 [(module) = "framework"];
710        WifiP2pConnectionReported wifi_p2p_connection_reported = 428 [(module) = "wifi"];
711        GameStateChanged game_state_changed = 429 [(module) = "framework"];
712        hotword.HotwordDetectorCreateRequested hotword_detector_create_requested = 430
713            [(module) = "framework"];
714        hotword.HotwordDetectionServiceInitResultReported hotword_detection_service_init_result_reported = 431
715            [(module) = "framework"];
716        hotword.HotwordDetectionServiceRestarted hotword_detection_service_restarted = 432
717            [(module) = "framework"];
718        hotword.HotwordDetectorKeyphraseTriggered hotword_detector_keyphrase_triggered = 433
719            [(module) = "framework"];
720        hotword.HotwordDetectorEvents hotword_detector_events = 434
721            [(module) = "framework"];
722        BootCompletedBroadcastCompletionLatencyReported boot_completed_broadcast_completion_latency_reported =
723                437 [(module) = "framework"];
724        ContactsIndexerUpdateStatsReported contacts_indexer_update_stats_reported = 440
725            [(module) = "appsearch"];
726        AppBackgroundRestrictionsInfo app_background_restrictions_info =
727            441 [(module) = "framework"];
728        MmsSmsProviderGetThreadIdFailed mms_sms_provider_get_thread_id_failed = 442 [(module) = "telephony"];
729        MmsSmsDatabaseHelperOnUpgradeFailed mms_sms_database_helper_on_upgrade_failed = 443 [(module) = "telephony"];
730        PermissionReminderNotificationInteracted permission_reminder_notification_interacted =
731            444 [(module) = "permissioncontroller"];
732        RecentPermissionDecisionsInteracted recent_permission_decisions_interacted =
733            445 [(module) = "permissioncontroller"];
734        GnssPsdsDownloadReported gnss_psds_download_reported = 446 [(module) = "framework"];
735        LeAudioConnectionSessionReported le_audio_connection_session_reported = 447 [(module) = "bluetooth"];
736        LeAudioBroadcastSessionReported le_audio_broadcast_session_reported = 448 [(module) = "bluetooth"];
737        DreamUiEventReported dream_ui_event_reported = 449 [(module) = "framework"];
738        sysui.TaskManagerEventReported task_manager_event_reported = 450 [(module) = "sysui"];
739        CdmAssociationAction cdm_association_action = 451 [(module) = "framework"];
740        MagnificationTripleTapAndHoldActivatedSessionReported magnification_triple_tap_and_hold_activated_session_reported =
741            452 [(module) = "framework"];
742        MagnificationFollowTypingFocusActivatedSessionReported magnification_follow_typing_focus_activated_session_reported =
743            453 [(module) = "framework"];
744        AccessibilityTextReadingOptionsChanged accessibility_text_reading_options_changed = 454 [(module) = "settings"];
745        WifiSetupFailureCrashReported wifi_setup_failure_crash_reported = 455 [(module) = "wifi"];
746        UwbDeviceErrorReported uwb_device_error_reported = 456 [(module) = "uwb"];
747        IsolatedCompilationScheduled isolated_compilation_scheduled = 457 [(module) = "art"];
748        IsolatedCompilationEnded isolated_compilation_ended = 458 [(module) = "art"];
749        OnsOpportunisticEsimProvisioningComplete ons_opportunistic_esim_provisioning_complete = 459 [(module) = "ons"];
750        SystemServerPreWatchdogOccurred system_server_pre_watchdog_occurred = 460 [(module) = "framework"];
751        TelephonyAnomalyDetected telephony_anomaly_detected = 461 [(module) = "telephony"];
752        LetterboxPositionChanged letterbox_position_changed = 462 [(module) = "framework"];
753        RemoteKeyProvisioningAttempt remote_key_provisioning_attempt = 463 [(module) = "rkpd"];
754        RemoteKeyProvisioningNetworkInfo remote_key_provisioning_network_info = 464 [(module) = "rkpd"];
755        RemoteKeyProvisioningTiming remote_key_provisioning_timing = 465 [(module) = "rkpd"];
756        sysui.MediaOutputOpInteractionReported mediaoutput_op_interaction_report =
757            466 [(module) = "sysui"];
758        SyncExemptionOccurred sync_exemption_occurred = 468 [(module) = "framework"];
759        AutofillPresentationEventReported autofill_presentation_event_reported = 469 [(module) = "framework"];
760        DockStateChanged dock_state_changed = 470 [(module) = "framework"];
761        SafetySourceStateCollected safety_source_state_collected = 471 [(module) = "permissioncontroller"];
762        SafetyCenterSystemEventReported safety_center_system_event_reported = 472 [(module) = "permissioncontroller"];
763        SafetyCenterInteractionReported safety_center_interaction_reported = 473 [(module) = "permissioncontroller"];
764        SettingsProviderSettingChanged settings_provider_setting_changed = 474 [(module) = "framework"];
765        BroadcastDeliveryEventReported broadcast_delivery_event_reported =
766                475 [(module) = "framework"];
767        ServiceRequestEventReported service_request_event_reported = 476 [(module) = "framework"];
768        ProviderAcquisitionEventReported provider_acquisition_event_reported =
769                477 [(module) = "framework"];
770        BluetoothDeviceNameReported bluetooth_device_name_reported = 478 [(module) = "bluetooth"];
771        CellBroadcastConfigUpdated cb_config_updated = 479 [(module) = "cellbroadcast"];
772        CellBroadcastModuleErrorReported cb_module_error_reported = 480 [(module) = "cellbroadcast"];
773        CellBroadcastServiceFeatureChanged cb_service_feature_changed = 481 [(module) = "cellbroadcast"];
774        CellBroadcastReceiverFeatureChanged cb_receiver_feature_changed = 482 [(module) = "cellbroadcast"];
775        PrivacySignalNotificationInteraction privacy_signal_notification_interaction = 484 [(module) = "permissioncontroller"];
776        PrivacySignalIssueCardInteraction privacy_signal_issue_card_interaction = 485 [(module) = "permissioncontroller"];
777        PrivacySignalsJobFailure privacy_signals_job_failure = 486 [(module) = "permissioncontroller"];
778        VibrationReported vibration_reported = 487 [(module) = "framework"];
779        UwbStartRanging uwb_ranging_start = 489 [(module) = "uwb"];
780        AppCompactedV2 app_compacted_v2 = 491 [(module) = "framework"];
781        // reserved 492
782        DisplayBrightnessChanged display_brightness_changed = 494 [(module) = "framework"];
783        ActivityActionBlocked activity_action_blocked = 495 [(module) = "framework"];
784        NetworkDnsServerSupportReported network_dns_server_support_reported = 504 [(module) = "resolv"];
785        VmBooted vm_booted = 505 [(module) = "virtualizationservice"];
786        VmExited vm_exited = 506 [(module) = "virtualizationservice"];
787        AmbientBrightnessStatsReported ambient_brightness_stats_reported = 507 [(module) = "framework"];
788        MediametricsSpatializerCapabilitiesReported mediametrics_spatializercapabilities_reported =
789                508 [(module) = "media_metrics"];
790        MediametricsSpatializerDeviceEnabledReported mediametrics_spatializerdeviceenabled_reported =
791                509 [(module) = "media_metrics"];
792        MediametricsHeadTrackerDeviceEnabledReported mediametrics_headtrackerdeviceenabled_reported =
793                510 [(module) = "media_metrics"];
794        MediametricsHeadTrackerDeviceSupportedReported mediametrics_headtrackerdevicesupported_reported =
795                511 [(module) = "media_metrics"];
796        HearingAidInfoReported hearing_aid_info_reported = 513 [(module) = "framework"];
797        DeviceWideJobConstraintChanged device_wide_job_constraint_changed =
798            514 [(module) = "framework"];
799        AmbientModeChanged ambient_mode_changed = 515 [(module) = "framework"];
800        ANRLatencyReported anr_latency_reported = 516 [(module) = "framework"];
801        ResourceValueApiStatisticsReported resource_api_info = 517 [(module) = "framework"];
802        SystemDefaultNetworkChanged system_default_network_changed =
803            518 [(module) = "network_stack"];
804        IwlanSetupDataCallResultReported iwlan_setup_data_call_result_reported = 519 [(module) = "iwlan"];
805        IwlanPdnDisconnectedReasonReported iwlan_pdn_disconnected_reason_reported = 520 [(module) = "iwlan"];
806        AirplaneModeSessionReported airplane_mode_session_reported = 521 [(module) = "wifi", (module) = "bluetooth"];
807        VmCpuStatusReported vm_cpu_status_reported = 522 [(module) = "virtualizationservice", deprecated = true];
808        VmMemStatusReported vm_mem_status_reported = 523 [(module) = "virtualizationservice", deprecated = true];
809        PackageInstallationSessionReported package_installation_session_reported = 524 [(module) = "framework"];
810        DefaultNetworkRematchInfo default_network_rematch_info = 525 [(module) = "connectivity"];
811        NetworkSelectionPerformance network_selection_performance = 526 [(module) = "connectivity"];
812        NetworkNsdReported network_nsd_reported = 527 [(module) = "connectivity"];
813        BluetoothDisconnectionReasonReported bluetooth_disconnection_reason_reported = 529 [(module) = "bluetooth"];
814        BluetoothLocalVersionsReported bluetooth_local_versions_reported = 530 [(module) = "bluetooth"];
815        BluetoothRemoteSupportedFeaturesReported bluetooth_remote_supported_features_reported = 531 [(module) = "bluetooth"];
816        BluetoothLocalSupportedFeaturesReported bluetooth_local_supported_features_reported = 532 [(module) = "bluetooth"];
817        BluetoothGattAppInfo bluetooth_gatt_app_info = 533 [(module) = "bluetooth"];
818        BrightnessConfigurationUpdated brightness_configuration_updated = 534 [(module) = "framework"];
819        WearMediaOutputSwitcherLaunched wear_media_output_switcher_launched =
820            538 [(module) = "MediaOutputSwitcher"];
821        WearMediaOutputSwitcherFinished wear_media_output_switcher_finished =
822            539 [(module) = "MediaOutputSwitcher"];
823        WearMediaOutputSwitcherConnectionReported
824            wear_media_output_switcher_connection_reported =
825                540 [(module) = "MediaOutputSwitcher"];
826        WearMediaOutputSwitcherDeviceScanTriggered
827            wear_media_output_switcher_device_scan_triggered =
828                541 [(module) = "MediaOutputSwitcher"];
829        WearMediaOutputSwitcherFirstDeviceScanLatency
830            wear_media_output_switcher_first_device_scan_latency =
831                542 [(module) = "MediaOutputSwitcher"];
832        WearMediaOutputSwitcherConnectDeviceLatency
833            wear_media_output_switcher_connect_device_latency =
834                543 [(module) = "MediaOutputSwitcher"];
835        PackageManagerSnapshotReported
836            package_manager_snapshot_reported = 544 [(module) = "framework"];
837        PackageManagerAppsFilterCacheBuildReported
838            package_manager_apps_filter_cache_build_reported = 545 [(module) = "framework"];
839        PackageManagerAppsFilterCacheUpdateReported
840            package_manager_apps_filter_cache_update_reported = 546 [(module) = "framework"];
841        sysui.LauncherImpressionEvent launcher_impression_event = 547 [(module) = "sysui"];
842        WearMediaOutputSwitcherAllDevicesScanLatency
843            wear_media_output_switcher_all_devices_scan_latency =
844                549 [(module) = "MediaOutputSwitcher"];
845        WsWatchFaceEdited ws_watch_face_edited = 551 [(module) = "wearservices"];
846        WsWatchFaceFavouriteActionReported ws_watch_face_favorite_action_reported = 552 [(module) = "wearservices"];
847        WsWatchFaceSetActionReported ws_watch_face_set_action_reported = 553 [(module) = "wearservices"];
848        PackageUninstallationReported package_uninstallation_reported = 554 [(module) = "framework"];
849        agif.GameModeChanged game_mode_changed = 555 [(module) = "framework"];
850        agif.GameModeConfigurationChanged game_mode_configuration_changed = 556 [(module) = "framework"];
851        BedtimeModeStateChanged bedtime_mode_state_changed = 557 [(module) = "framework"];
852        NetworkSliceSessionEnded network_slice_session_ended = 558 [(module) = "connectivity"];
853        NetworkSliceDailyDataUsageReported network_slice_daily_data_usage_reported = 559 [(module) = "connectivity"];
854        NfcTagTypeOccurred nfc_tag_type_occurred = 560 [(module) = "nfc"];
855        NfcAIDConflictOccurred nfc_aid_conflict_occurred = 561 [(module) = "nfc"];
856        NfcReaderConflictOccurred nfc_reader_conflict_occurred = 562 [(module) = "nfc"];
857        WsTileListChanged ws_tile_list_changed = 563 [(module) = "wearservices"];
858        GetTypeAccessedWithoutPermission get_type_accessed_without_permission = 564[(module) = "framework"];
859        MobileBundledAppInfoGathered mobile_bundled_app_info_gathered = 566 [(module) = "framework"];
860        WsWatchFaceComplicationSetChanged ws_watch_face_complication_set_changed = 567 [(module) = "wearservices"];
861        media.MediaDrmCreated media_drm_created = 568 [(module) = "media_metrics"];
862        media.MediaDrmErrored media_drm_errored = 569 [(module) = "media_metrics"];
863        media.MediaDrmSessionOpened media_drm_session_opened = 570
864            [(module) = "media_metrics"];
865        media.MediaDrmSessionClosed media_drm_session_closed = 571
866            [(module) = "media_metrics"];
867        UserSelectedResolution user_selected_resolution = 572 [(module) = "settings"];
868        UnsafeIntentEventReported unsafe_intent_event_reported = 573 [(module) = "framework"];
869        adpf.PerformanceHintSessionReported performance_hint_session_reported = 574 [(module) = "framework"];
870        MediametricsMidiDeviceCloseReported mediametrics_midi_device_close_reported =
871            576 [(module) = "media_metrics"];
872        hardware.biometrics.BiometricTouchReported biometric_touch_reported = 577 [(module) = "sysui"];
873        hotword.HotwordAudioEgressEventReported hotword_audio_egress_event_reported = 578
874            [(module) = "framework"];
875        location.LocationEnabledStateChanged location_enabled_state_changed = 580 [(module) = "framework"];
876        view.inputmethod.ImeRequestFinished ime_request_finished = 581 [(module) = "framework"];
877        usb.UsbComplianceWarningsReported usb_compliance_warnings_reported = 582 [(module) = "framework"];
878        locale.AppSupportedLocalesChanged app_supported_locales_changed = 583 [(module) = "framework"];
879        providers.mediaprovider.MediaProviderVolumeRecoveryReported
880            media_provider_volume_recovery_reported = 586 [(module) = "mediaprovider"];
881        hardware.biometrics.BiometricPropertiesCollected
882            biometric_properties_collected = 587 [(module) = "framework"];
883        kernel.KernelWakeupAttributed kernel_wakeup_attributed = 588 [(module) = "framework"];
884        display.ScreenStateChangedV2 screen_state_changed_v2 = 589 [(module) = "framework"];
885        wearservices.WsBackupActionReported ws_backup_action_reported = 590
886            [(module) = "wearservices"];
887        wearservices.WsRestoreActionReported ws_restore_action_reported = 591
888            [(module) = "wearservices"];
889        devicelogs.DeviceLogAccessEventReported device_log_access_event_reported = 592 [(module) = "sysui"];
890        wear.media.MediaSessionUpdated media_session_updated = 594 [(module) = "wearmedia"];
891        wearsysui.WearOobeStateChanged wear_oobe_state_changed = 595 [(module) = "framework"];
892        wearservices.WsNotificationUpdated ws_notification_updated = 596
893            [(module) = "wearservices"];
894        // reserved 597
895        corenetworking.connectivity.NetworkValidationFailureStatsDailyReported
896            network_validation_failure_stats_daily_reported = 601 [(module) = "connectivity"];
897        wearservices.WsComplicationTapped ws_complication_tapped = 602 [(module) = "wearservices"];
898        wearservices.WsNotificationBlocking ws_notification_blocking = 780 [(module) = "wearservices"];
899        wearservices.WsNotificationBridgemodeUpdated ws_notification_bridgemode_updated = 822 [(module) = "wearservices"];
900        wearservices.WsNotificationDismissalActioned ws_notification_dismissal_actioned = 823 [(module) = "wearservices"];
901        wearservices.WsNotificationActioned ws_notification_actioned = 824 [(module) = "wearservices"];
902        wearservices.WsNotificationLatency ws_notification_latency = 880 [(module) = "wearservices"];
903    }
904
905    // Pushed atom extensions.
906    // The atom definitions are under atoms/<feature>/<feature>_extension_atoms.proto
907    extensions 332; // ArtDatumReported art_datum_reported
908    extensions 366; // OdrefreshReported odrefresh_reported
909    extensions 385; // AppSearchSetSchemaStatsReported app_search_set_schema_stats_reported
910    extensions 435; // AdServicesApiCalled ad_services_api_called
911    extensions 436; // AdServicesMeasurementReportsUploaded ad_services_mesurement_reports_uploaded
912    extensions 467; // BackgroundDexoptJobEnded background_dexopt_job_ended
913    extensions 483; // JSScriptEngineLatencyReported jsscriptengine_latency_reported
914    extensions 488; // SandboxApiCalled sandbox_api_called
915    extensions 490; // MobileDataDownloadFileGroupDownloadStatusReported mobile_data_download_file_group_status_reported
916    extensions 493; // AdServicesSettingsUsageReported ad_services_settings_usage_reported
917    extensions 496; // BackgroundFetchProcessReported background_fetch_process_reported
918    extensions 497; // UpdateCustomAudienceProcessReported update_custom_audience_process_reported
919    extensions 498; // RunAdBiddingProcessReported run_ad_bidding_process_reported
920    extensions 499; // RunAdScoringProcessReported run_ad_scoring_process_reported
921    extensions 500; //RunAdSelectionProcessReported run_ad_selection_process_reported
922    extensions 501; // RunAdBiddingPerCAProcessReported run_ad_bidding_per_ca_process_reported
923    extensions 502; // MobileDataDownloadDownloadResultReported mobile_data_download_download_result_reported
924    extensions 503; // MobileDataDownloadFileGroupStorageStatsReported mobile_data_download_file_group_storage_stats_reported
925    extensions 512; // AdServicesMeasurementRegistrations ad_services_measurement_registrations
926    extensions 528; // ExpressEventReported express_event_reported
927    extensions 535; // AdServicesGetTopicsReported ad_services_get_topics_reported
928    extensions 536; // AdServicesEpochComputationGetTopTopicsReported ad_services_epoch_computation_get_top_topics_reported
929    extensions 537; // ServicesEpochComputationClassifierReported ad_services_epoch_computation_classifier_reported
930    extensions 548; // OdsignReported odsign_reported
931    extensions 550; // ArtDeviceDatumReported art_device_datum_reported
932    extensions 565; // ArtDatumDeltaReported art_datum_delta_reported
933    extensions 579; // AppSearchSchemaMigrationStatsReported app_search_schema_migration_stats_reported
934    extensions 584; // ApplicationGrammaticalInflectionChanged application_grammatical_inflection_changed
935    extensions 585; // CredentialManagerApiCalled credential_manager_api_called
936    extensions 593; // ExpressHistogramSampleReported express_histogram_sample_reported
937    extensions 598; // AdServicesBackCompatGetTopicsReported ad_services_back_compat_get_topics_reported
938    extensions 599; // AdServicesBackCompatEpochComputationClassifierReported ad_services_back_compat_epoch_computation_classifier_reported
939    extensions 600; // MediaCodecReclaimRequestCompleted media_codec_reclaim_request_completed
940    extensions 603; // AutofillUiEventReported autofill_ui_event_reported
941    extensions 604; // AutofillFillRequestReported autofill_fill_request_reported
942    extensions 605; // AutofillFillResponseReported autofill_fill_response_reported
943    extensions 606; // AutofillSaveEventReported autofill_save_event_reported
944    extensions 607; // AutofillSessionCommitted autofill_session_committed
945    extensions 608; // MediaActionReported media_action_reported
946    extensions 609; // MediaControlsLaunched media_controls_launched
947    extensions 610; // WsWearTimeSession ws_wear_time_session
948    extensions 611; // LockscreenShortcutSelected lockscreen_shortcut_selected
949    extensions 612; // LockscreenShortcutTriggered lockscreen_shortcut_triggered
950    extensions 613; // BluetoothHashedDeviceNameReported bluetooth_hashed_device_name_reported
951    extensions 614; // BluetoothL2capCocClientConnection bluetooth_l2cap_coc_client_connection
952    extensions 615; // BluetoothL2capCocServerConnection bluetooth_l2cap_coc_server_connection
953    extensions 616; // HealthConnectApiCalled health_connect_api_called
954    extensions 617; // HealthConnectUsageStats health_usage_stats
955    extensions 618; // HealthConnectStorageStats health_connect_storage_stats
956    extensions 619; // WearAdaptiveSuspendStatsReported wear_adaptive_suspend_stats_reported
957    extensions 620; // WearPowerAnomalyServiceOperationalStatsReported wear_power_anomaly_service_operational_stats_reported
958    extensions 621; // WearPowerAnomalyServiceEventStatsReported wear_power_anomaly_service_event_stats_reported
959    extensions 622; // SettingsSpaReported settings_spa_reported
960    extensions 623; // HealthConnectUiImpression health_connect_ui_impression
961    extensions 624; // HealthConnectUiInteraction health_connect_ui_interaction
962    extensions 625; // HealthConnectAppOpenedReported health_connect_app_opened_reported
963    extensions 626; // WsIncomingCallActionReported ws_incoming_call_action_reported
964    extensions 627; // WsCallDisconnectionReported ws_call_disconnection_reported
965    extensions 628; // WsCallDurationReported ws_call_duration_reported
966    extensions 629; // WsCallUserExperienceLatencyReported ws_call_user_experience_latency_reported
967    extensions 630; // WsCallInteractionReported ws_call_interaction_reported
968    extensions 631; // FullScreenIntentLaunched full_screen_intent_launched
969    extensions 632; // BalAllowed bal_allowed
970    extensions 633; // EmergencyStateChanged emergency_state_changed
971    extensions 634; // QualifiedRatListChanged qualified_rat_list_changed
972    extensions 635; // QnsImsCallDropStats qns_ims_call_drop_stats
973    extensions 636; // QnsFallbackRestrictionChanged qns_fallback_restriction_changed
974    extensions 637; // EmergencyNumberDialed emergency_number_dialed
975    extensions 638; // WifiAwareNdpReported wifi_aware_ndp_reported
976    extensions 639; // WifiAwareAttachReported wifi_aware_attach_reported
977    extensions 640; // AdServicesMeasurementDebugKeys ad_services_measurement_debug_keys
978    extensions 641; // MediaCodecStarted media_codec_started
979    extensions 642; // MediaCodecStopped media_codec_stopped
980    extensions 643; // HealthConnectApiInvoked health_connect_api_invoked
981    extensions 644; // ExpressUidEventReported express_uid_event_reported
982    extensions 645; // PermissionRationaleDialogViewed permission_rationale_dialog_viewed
983    extensions 646; // PermissionRationaleDialogActionReported permission_rationale_dialog_action_reported
984    extensions 647; // AppDataSharingUpdatesNotificationInteraction app_data_sharing_updates_notification_interaction
985    extensions 648; // AppDataSharingUpdatesFragmentViewed app_data_sharing_updates_fragment_viewed
986    extensions 649; // AppDataSharingUpdatesFragmentActionReported app_data_sharing_updates_fragment_action_reported
987    extensions 650; // DailykeepaliveInfoReported daily_keepalive_info_reported
988    extensions 651; // CredentialManagerInitialPhaseReported credential_manager_init_phase_reported
989    extensions 652; // CredentialManagerCandidatePhaseReported credential_manager_candidate_phase_reported
990    extensions 653; // CredentialManagerFinalPhaseReported credential_manager_final_phase_reported
991    extensions 654; // ExerciseRouteApiCalled exercise_route_api_called
992    extensions 655; // PluginInitialized plugin_initialized
993    extensions 656; // BluetoothLeSessionConnected bluetooth_le_session_connected
994    extensions 657; // DNDStateChanged dnd_state_changed
995    extensions 658; // ExpressUidHistogramSampleReported express_uid_histogram_sample_reported
996    extensions 659; // AutofillFieldClassificationEventReported autofill_field_classification_event_reported
997    extensions 660; // TestExtensionAtomReported test_extension_atom_reported
998    extensions 661; // WifiSelfRecoveryTriggered wifi_self_recovery_triggered
999    extensions 662; // AdServicesErrorReported ad_services_error_reported
1000    extensions 663; // AdServicesBackgroundJobsExecutionReported ad_services_background_jobs_execution_reported
1001    extensions 664; // RkpdPoolStats rkpd_pool_stats
1002    extensions 665; // RkpdClientOperation rkpd_client_operation
1003    extensions 666;  // RestrictedBluetoothDeviceNameReported restricted_bluetooth_device_name_reported
1004    extensions 667; // CredentialManagerTotalCandidateReported credential_manager_total_reported
1005    extensions 668; // CredentialManagerFinalNoUidReported credential_manager_finalnouid_reported
1006    extensions 669; // CredentialManagerGetProviderReported credential_manager_get_reported
1007    extensions 670; // CredentialManagerBrowsedAuthenticationClicked credential_manager_auth_click_reported
1008    extensions 671; // CredentialManagerApiV2Called credential_manager_apiv2_called
1009    extensions 672; // TestRestrictedAtomReported test_restricted_atom_reported
1010    extensions 673; // AdServicesMeasurementDelayedSourceRegistration ad_services_measurement_delayed_source_registration
1011    extensions 674; // AdServicesMeasurementAttribution ad_services_measurement_attribution
1012    extensions 675; // AdServicesMeasurementJobs ad_services_measurement_jobs
1013    extensions 676; // AdServicesMeasurementWipeout ad_services_measurement_wipeout
1014    extensions 677; // MediaSessionStateChanged media_session_state_changed
1015    extensions 678; // IkeSessionTerminated ike_session_terminated
1016    extensions 679; // TvLowPowerStandbyPolicy tv_low_power_standby_policy
1017    extensions 680; // SoftApStarted softap_started
1018    extensions 681; // SoftApStopped softap_stopped
1019    extensions 682; // KeyboardConfigured keyboard_configured
1020    extensions 683; // KeyboardSystemsEventReported keyboard_systems_event_reported
1021    extensions 684; // MediaCodecRendered media_codec_rendered
1022    extensions 685; // InTaskActivityStarted in_task_activity_started
1023    extensions 686; // InputDeviceUsageReported inputdevice_usage_reported
1024    extensions 687; // WifiLockReleased wifi_lock_released
1025    extensions 688; // WifiLockDeactivated wifi_lock_deactivated
1026    extensions 689; // WifiConfigSaved wifi_config_saved
1027    extensions 690; // WifiAwareResourceUsingChanged wifi_aware_resource_using_changed
1028    extensions 691; // WifiAwareHalApiCalled wifi_aware_hal_api_called
1029    extensions 692; // WifiLocalOnlyRequestReceived wifi_local_only_request_received
1030    extensions 693; // WifiLocalOnlyRequestScanTriggered wifi_local_only_request_scan_triggered
1031    extensions 694; // WifiThreadTaskExecuted wifi_thread_task_executed
1032    extensions 695; // AdServicesMeasurementAdIdMatchForDebugKeys ad_services_ad_id_match_for_debug_keys
1033    extensions 696; // BluetoothProfileConnectionAttempted bluetooth_profile_connection_attempted
1034    extensions 697; // AdServicesEnrollmentDataStored ad_services_enrollment_data_stored
1035    extensions 698; // AdServicesEnrollmentFileDownloaded ad_services_enrollment_file_downloaded
1036    extensions 699; // AdServicesEnrollmentMatched ad_services_enrollment_matched
1037    extensions 700; // WifiStateChanged wifi_state_changed
1038    extensions 701; // HdmiEarcStatusReported hdmi_earc_status_reported
1039    extensions 702; // AdServicesConsentMigrated ad_services_consent_migrated
1040    extensions 703; // CronetEngineCreated cronet_engine_created
1041    extensions 704; // CronetTrafficReported cronet_traffic_reported
1042    extensions 705; // DreamSettingChanged dream_setting_changed
1043    extensions 706; // AiWallpapersButtonPressed ai_wallpapers_button_pressed
1044    extensions 707; // AiWallpapersTemplateSelected ai_wallpapers_template_selected
1045    extensions 708; // AiWallpapersTermSelected ai_wallpapers_term_selected
1046    extensions 709; // AiWallpapersWallpaperSet ai_wallpapers_wallpaper_set
1047    extensions 710; // AiWallpapersSessionSummary ai_wallpapers_session_summary
1048    extensions 711; // OnDevicePersonalizationApiCalled ondevicepersonalization_api_called
1049    extensions 712; // FederatedComputeApiCalled federated_compute_api_called
1050    extensions 713; // CellularRadioPowerStateChanged cellular_radio_power_state_changed
1051    extensions 714; // AdServicesEnrollmentFailed ad_services_enrollment_failed
1052    extensions 715; // WearModeStateChanged wear_mode_state_changed
1053    extensions 716; // LauncherImpressionEventV2 launcher_impression_event_v2
1054    extensions 717; // ExternalTvInputEvent external_tv_input_event
1055    extensions 718; // StylusPredictionMetricsReported stylus_prediction_metrics_reported
1056    extensions 719; // PnoScanStarted pno_scan_started
1057    extensions 720; // PnoScanStopped pno_scan_stopped
1058    extensions 721; // MediatorUpdated mediator_updated
1059    extensions 722; // WifiIsUnusableReported wifi_is_unusable_reported
1060    extensions 723; // WifiApCapabilitiesReported wifi_ap_capabilities_reported
1061    extensions 724; // HdmiSoundbarModeStatusReported hdmi_soundbar_mode_status_reported
1062    extensions 725; // UserRiskEventReported user_risk_event_reported
1063    extensions 726; // DeviceLockCheckInRequestReported device_lock_check_in_request_reported
1064    extensions 727; // DeviceLockProvisioningCompleteReported device_lock_provisioning_complete_reported
1065    extensions 728; // DeviceLockKioskAppRequestReported device_lock_kiosk_app_request_reported
1066    extensions 729; // MediaProjectionStateChanged media_projection_state_changed
1067    extensions 730; // MediaProjectionTargetChanged media_projection_target_changed
1068    extensions 731; // WearPowerMenuOpened wear_power_menu_opened
1069    extensions 732; // ApexInstallationRequested apex_installation_requested
1070    extensions 733; // ApexInstallationStaged apex_installation_staged
1071    extensions 734; // ApexInstallationEnded apex_installation_ended
1072    extensions 735; // SandboxActivityEventOccurred sandbox_activity_event_occurred
1073    extensions 736; // RendererInitialized renderer_initialized
1074    extensions 737; // SchemaVersionReceived schema_version_received
1075    extensions 738; // ThreadnetworkTelemetryDataReported threadnetwork_telemetry_data_reported
1076    extensions 739; // ThreadnetworkTopoEntryRepeated threadnetwork_topo_entry_repeated
1077    extensions 740; // ThreadnetworkDeviceInfoReported threadnetwork_device_info_reported
1078    extensions 741; // LayoutInspected layout_inspected
1079    extensions 742; // LayoutExpressionsInspected layout_expression_inspected
1080    extensions 743; // LayoutAnimationsInspected layout_animations_inspected
1081    extensions 744; // MaterialComponentsInspected material_components_inspected
1082    extensions 745; // TileRequested tile_requested
1083    extensions 746; // StateResponseReceived state_response_received
1084    extensions 747; // TileResponseReceived tile_response_received
1085    extensions 748; // InflationFinished inflation_finished
1086    extensions 749; // InflationFailed inflation_failed
1087    extensions 750; // IgnoredInflationFailuresReported ignored_inflation_failures_reported
1088    extensions 751; // DrawableRendered drawable_rendered
1089    extensions 752; // StatsSocketLossReported stats_socket_loss_reported
1090    extensions 753; // DisplaySwitchLatencyTracked display_switch_latency_tracked
1091    extensions 754; // KernelOomKillOccurred kernel_oom_kill_occurred
1092    extensions 755; // WearAssistantOpened wear_assistant_opened
1093    extensions 756; // AdServicesMeasurementClickVerification ad_services_measurement_click_verification
1094    extensions 757; // WearMediaOutputSwitcherDeviceScanApiLatency wear_media_output_switcher_device_scan_api_latency
1095    extensions 758; // WearMediaOutputSwitcherSassDeviceUnavailable wear_media_output_switcher_sass_device_unavailable
1096    extensions 759; // WearMediaOutputSwitcherFastPairApiTimeout wear_media_output_switcher_fastpair_api_timeout
1097    extensions 760; // IkeLivenessCheckSessionValidated ike_liveness_check_session_validated
1098    extensions 761; // HotwordEventEgressSize hotword_egress_size_atom_reported
1099    extensions 762; // CronetEngineBuilderInitialized cronet_engine_builder_initialized
1100    extensions 763; // CronetHttpFlagsInitialized cronet_http_flags_initialized
1101    extensions 764; // CronetInitialized cronet_initialized
1102    extensions 765; // AdServicesEncryptionKeyFetched ad_services_encryption_key_fetched
1103    extensions 766; // AdServicesEncryptionKeyDbTransactionEnded ad_services_encryption_key_db_transaction_ended
1104    extensions 767; // DestinationRegisteredBeacons destination_registered_beacons
1105    extensions 768; // ReportInteractionApiCalled report_interaction_api_called
1106    extensions 769; // InteractionReportingTableCleared interaction_reporting_table_cleared
1107    extensions 770; // CarRecentsEventReported car_recents_event_reported
1108    extensions 771; // FederatedComputeTrainingEventReported federated_compute_training_event_reported
1109    extensions 772; // ThermalStatusCalled thermal_status_called
1110    extensions 773; // ThermalHeadroomCalled thermal_headroom_called
1111    extensions 774; // ThermalHeadroomThresholdsCalled thermal_headroom_thresholds_called
1112    extensions 775; // BootIntegrityInfoReported boot_integrity_info_reported
1113    extensions 776; // ScreenOffReported screen_off_reported
1114    extensions 777; // ApfSessionInfoReported apf_session_info_reported
1115    extensions 778; // IpClientRaInfoReported ip_client_ra_info_reported
1116    extensions 779; // NetworkRequestStateChanged network_request_state_changed
1117    extensions 781; // BluetoothContentProfileErrorReported bluetooth_content_profile_error_reported
1118    extensions 782; // BluetoothRfcommConnectionAttempted bluetooth_rfcomm_connection_attempted
1119    extensions 783; // NetworkStatsRecorderFileOperated network_stats_recorder_file_operated
1120    extensions 784; // MediaProviderDatabaseRollbackReported media_provider_database_rollback_reported
1121    extensions 785; // BackupSetupStatusReported backup_setup_status_reported
1122    extensions 786; // SysproxyConnectionUpdated sysproxy_connection_updated
1123    extensions 787; // WsOnBodyStateChanged ws_on_body_state_changed
1124    extensions 788; // AppManifestConfigHelperCalled app_manifest_config_helper_called
1125    extensions 789; // CheckInRetryReported device_lock_check_in_retry_reported
1126    extensions 790; // ProvisionFailureReported device_lock_provision_failure_reported
1127    extensions 791; // LockUnlockDeviceFailureReported device_lock_unlock_device_failure_reported
1128    extensions 792; // DisplayModeDirectorVoteChanged display_mode_director_vote_changed
1129    extensions 793; // AdFilteringProcessJoinCAReported ad_filtering_process_join_ca_reported
1130    extensions 794; // AdFilteringProcessAdSelectionReported ad_filtering_process_ad_selection_reported
1131    extensions 795; // AdCounterHistogramUpdaterReported ad_counter_histogram_updater_reported
1132    extensions 796; // SdkSandboxRestrictedAccessInSession sdk_sandbox_restricted_access_in_session
1133    extensions 797; // CarCalmModeEventReported car_calm_mode_event_reported
1134    extensions 798; // MediaEditingEndedReported media_editing_ended_reported
1135    extensions 799; // SELinux selinux_audit_log
1136    extensions 800; // CellularIdentifierDisclosed cellular_identifier_disclosed
1137    // reserved 801
1138    extensions 802; // WsWatchFaceRestrictedComplicationsImpacted ws_watch_face_restricted_complications_impacted
1139    extensions 803; // WsWatchFaceDefaultRestrictedComplicationsRemoved ws_watch_face_default_restricted_complications_removed
1140    extensions 804; // WsComplicationsImpactedNotificationEventReported ws_complications_impacted_notification_event_reported
1141    extensions 805; // SoftApStateChanged soft_ap_state_changed
1142    extensions 806; // ExternalDisplayStateChanged external_display_state_changed
1143    extensions 807; // SignatureVerification signature_verification
1144    extensions 808; // KAnonImmediateSignJoinStatusReported k_anon_immediate_sign_join_status_reported
1145    extensions 809; // KAnonBackgroundJobStatusReported k_anon_background_job_status_reported
1146    extensions 810; // KAnonInitializeStatusReported k_anon_initialize_status_reported
1147    extensions 811; // KAnonSignStatusReported k_anon_sign_status_reported
1148    extensions 812; // KAnonJoinStatusReported k_anon_join_status_reported
1149    extensions 813; // KAnonKeyAttestationStatusReported k_anon_key_attestation_status_reported
1150    extensions 814; // GetAdSelectionDataApiCalled get_ad_selection_data_api_called
1151    extensions 815; // GetAdSelectionDataBuyerInputGenerated get_ad_selection_data_buyer_input_generated
1152    extensions 816; // SystemGrammaticalInflectionChanged system_grammatical_inflection_changed
1153    extensions 817; // BiometricFRRNotification biometric_frr_notification
1154    extensions 818; // DesktopModeUIChanged desktop_mode_ui_changed
1155    extensions 819; // DesktopModeSessionTaskUpdate desktop_mode_session_task_update
1156    extensions 820; // AdaptiveAuthUnlockAfterLockReported adaptive_auth_unlock_after_lock_reported
1157    extensions 821; // NegotiatedSecurityAssociation negotiated_security_association
1158    extensions 825; // AppSearchUsageSearchIntentStatsReported app_search_usage_search_intent_stats_reported
1159    extensions 826; // AppSearchUsageSearchIntentRawQueryStatsReported app_search_usage_search_intent_raw_query_stats_reported
1160    extensions 827; // EnhancedConfirmationDialogResultReported
1161    extensions 828; // EnhancedConfirmationRestrictionCleared
1162    extensions 829; // NotificationListenerService
1163    extensions 830; // SensitiveContentMediaProjectionSession
1164    extensions 831; // SensitiveNotificationAppProtectionSession
1165    extensions 832; // SensitiveNotificationAppProtectionApplied
1166    extensions 833; // SensitiveNotificationRedaction
1167    extensions 834; // BackgroundJobSchedulingReported background_job_scheduling_reported
1168    extensions 835; // SensitiveContentAppProtection
1169    extensions 836; // ScreenTimeoutOverrideReported screen_timeout_override_reported
1170    extensions 837; // ScreenInteractiveSessionReported screen_interactive_session_reported
1171    extensions 838; // ExampleIteratorNextLatencyReported example_iterator_next_latency_reported
1172    extensions 839; // AdpfHintSessionTidCleanup adpf_hint_session_tid_cleanup
1173    extensions 840; // TopicsEncryptionEpochComputationReported topics_encryption_epoch_computation_reported
1174    extensions 841; // TopicsEncryptionGetTopicsReported topics_encryption_get_topics_reported
1175    extensions 842; // AdServicesShellCommandCalled adservices_shell_command_called
1176    extensions 843; // UpdateSignalsApiCalled update_signals_api_called
1177    extensions 844; // EncodingJobRun encoding_job_run
1178    extensions 845; // EncodingJsFetch encoding_js_fetch
1179    extensions 846; // EncodingJsExecution encoding_js_execution
1180    extensions 847; // PersistAdSelectionResultCalled persist_ad_selection_result_called
1181    extensions 848; // ServerAuctionKeyFetchCalled server_auction_key_fetch_called
1182    extensions 849; // ServerAuctionBackgroundKeyFetchScheduled server_auction_background_key_fetch_enabled
1183    extensions 850; // VpnConnectionStateChanged vpn_connection_state_changed
1184    extensions 851; // VpnConnectionReported vpn_connection_reported
1185    extensions 852; // CarWakeupFromSuspendReported car_wakeup_from_suspend_reported
1186    extensions 853; // ExcessiveBinderProxyCountReported excessive_binder_proxy_count_reported
1187    extensions 854; // DataRatStateChanged data_rat_state_changed
1188    extensions 855; // NfcObserveModeStateChanged nfc_observe_mode_state_changed
1189    extensions 856; // NfcFieldChanged nfc_field_changed
1190    extensions 857; // NfcPollingLoopNotificationReported nfc_polling_loop_notification_reported
1191    extensions 858; // NfcProprietaryCapabilitiesReported nfc_proprietary_capabilities_reported
1192    extensions 859; // PdfLoadReported pdf_load_reported
1193    extensions 860; // PdfApiUsageReported pdf_api_usage_reported
1194    extensions 861; // PdfSearchReported pdf_search_reported
1195    extensions 862; // RemoteDeviceInformationWithMetricId remote_device_information_with_metric_id
1196    extensions 863; // ComponentStateChangedReported component_state_changed_reported
1197    extensions 864; // AdServicesMeasurementProcessOdpRegistration ad_services_measurement_process_odp_registration
1198    extensions 865; // AdServicesMeasurementNotifyRegistrationToOdp ad_services_measurement_notify_registration_to_odp
1199    extensions 866; // AppRestrictionStateChanged app_restriction_state_changed
1200    extensions 867; // ScreenDimReported screen_dim_reported
1201    extensions 868; // ChreSignificantMotionStateChanged chre_significant_motion_state_changed
1202    extensions 869; // NavHandleTouchPoints nav_handle_touch_points
1203    extensions 870; // LeAppScanStateChanged le_app_scan_state_changed
1204    extensions 871; // LeRadioScanStopped le_radio_scan_stopped
1205    extensions 872; // LeScanResultReceived le_scan_result_received
1206    extensions 873; // LeScanAbused le_scan_abused
1207    extensions 874; // LeAdvStateChanged le_adv_state_changed
1208    extensions 875; // LeAdvErrorReported le_adv_error_reported
1209    extensions 876; // SelectAdsFromOutcomesApiCalled select_ads_from_outcomes_api_called
1210    extensions 877; // ReportImpressionApiCalled report_impression_api_called
1211    extensions 878; // Reserved for b/333882013
1212    extensions 879; // Reserved for b/333882013
1213    extensions 881; // Reserved for b/339008431
1214    extensions 882; // ConnectedChannelChanged connected_channel_changed
1215    extensions 883; // PreRebootDexoptJobEnded pre_reboot_dexopt_job_ended
1216    extensions 884; // ScorerPredictionResultReported scorer_prediction_result_reported
1217    extensions 885; // AdServicesEnrollmentTransactionStats ad_services_enrollment_transaction_stats
1218    extensions 886; // PhotopickerSessionInfoReported photopicker_session_info_reported
1219    extensions 887; // PhotopickerApiInfoReported photopicker_api_info_reported
1220    extensions 888; // PhotopickerUIEventLogged photopicker_ui_event_logged
1221    extensions 889; // PhotopickerMediaItemStatusRepoprted photopicker_media_item_status_reported
1222    extensions 890; // PhotopickerPreviewInfoLogged photopicker_preview_info_logged
1223    extensions 891; // PhotopickerMenuInteractionLogged photopicker_menu_interaction_logged
1224    extensions 892; // PhotopickerBannerInteractionLogged photopicker_banner_interaction_logged
1225    extensions 893; // PhotopickerMediaLibraryInfoLogged photopicker_media_library_info_logged
1226    extensions 894; // PhotopickerPageInfoLogged photopicker_page_info_logged
1227    extensions 895; // PhotopickerMediaGridSyncInfoReported photopicker_media_grid_sync_info_reported
1228    extensions 896; // PhotopickerAlbumSyncInfoReported photopicker_album_sync_info_reported
1229    extensions 897; // PhotopickerSearchInfoReported photopicker_search_info_reported
1230    extensions 898; // SearchDataExtractionDetailsReported search_data_extraction_details_reported
1231    extensions 899; // EmbeddedPhotopickerInfoReported embedded_photopicker_info_reported
1232    extensions 900; // CameraFeatureCombinationQueryEvent camera_feature_combination_query_event
1233    extensions 901; // MicroXRDeviceBootCompleteReported microxr_device_boot_complete_reported
1234    extensions 902; // AdServicesCobaltLoggerEventReported ad_services_cobalt_logger_event_reported
1235    extensions 903; // AdServicesCobaltPeriodicJobEventReported ad_services_cobalt_periodic_job_event_reported
1236    extensions 904; // A2dpSessionReported a2dp_session_reported
1237    extensions 905; // UpdateSignalsProcessReported update_signals_process_reported
1238    extensions 906; // DeviceOrientationChanged device_orientation_changed
1239    extensions 907; // HealthConnectExportInvoked
1240    extensions 908; // CommunalHubWidgetEventReported communal_hub_widget_event_reported
1241    extensions 909; // AppSearchAppsIndexerStatsReported app_search_apps_indexer_stats_reported
1242    extensions 910; // AccessibilityCheckResultReported accessibility_check_result_reported
1243    extensions 911; // WearTimeSyncRequested wear_time_sync_requested
1244    extensions 912; // WearTimeUpdateStarted wear_time_update_started
1245    extensions 913; // WearTimeSyncAttemptCompleted wear_time_sync_attempt_completed
1246    extensions 914; // WearTimeChanged wear_time_changed
1247    extensions 915; // TestUprobeStatsAtomReported
1248    extensions 916; // BluetoothCrossLayerEventReported bluetooth_cross_layer_event_reported
1249    extensions 917; // FirstOverlayStateChanged first_overlay_state_changed
1250    extensions 918; // HealthConnectImportInvoked
1251    extensions 919; // HealthConnectExportImportStatsReported
1252    extensions 920; // WsRemoteEventUsageReported ws_remote_event_usage_reported
1253    extensions 921; // WearCompanionConnectionState
1254    extensions 922; // BroadcastSent broadcast_sent
1255    extensions 923; // IwlanUnderlyingNetworkValidationResultReported iwlan_underlying_network_validation_result_reported
1256    extensions 924; // PostGcMemorySnapshot postgc_memory_snapshot
1257    extensions 925; // TetheringActiveSessionsReported
1258    extensions 926; // PowerSaveTempAllowlistChanged power_save_temp_allowlist_changed
1259    extensions 927; // BroadcastAudioSessionReported broadcast_audio_session_reported
1260    extensions 928; // BroadcastAudioSyncReported broadcast_audio_sync_reported
1261    extensions 929; // ArtDex2OatReported art_dex2oat_reported
1262    extensions 930; // TopicsScheduleEpochJobSettingReported topics_schedule_epoch_job_setting_reported
1263    extensions 931; // AppOpAccessTracked app_op_access_tracked
1264    extensions 932; // InputEventLatencyReported input_event_latency_reported
1265    extensions 933; // ContentOrFileUriEventReported content_or_file_uri_event_reported
1266    extensions 934; // CertificateTransparencyLogListStateChanged certificate_transparency_log_list_state_changed
1267    extensions 935; // DesktopModeTaskSizeUpdated desktop_mode_task_size_updated
1268    extensions 940; // DeviceIdleTempAllowlistUpdated device_idle_temp_allowlist_updated
1269    extensions 941; // WsNotificationManagedDismissalSync ws_notification_managed_dismissal_sync
1270    extensions 942; // PeripheralTutorialLaunched peripheral_tutorial_launched
1271    extensions 943; // AppOpNoteOpOrCheckOpBinderApiCalled app_op_note_op_or_check_op_binder_api_called
1272    extensions 944; // BiometricUnenrolled biometric_unenrolled
1273    extensions 945; // BiometricEnumerated biometric_enumerated
1274    extensions 946; // HardwareRendererEvent hardware_renderer_event
1275    extensions 947; // TextureViewEvent texture_view_event
1276    extensions 948; // SurfaceControlEvent surface_control_event
1277    extensions 949; // SysproxyServiceStateUpdated sysproxy_service_state_updated
1278    extensions 950; // JankFrameCountByWidgetReported jank_frame_count_by_widget_reported
1279    extensions 951; // AccountManagerEvent account_manager_event
1280    extensions 952; // OnDevicePersonalizationTraceEvent ondevicepersonalization_trace_event
1281    extensions 953; // WearSetupWizardDeviceStatusReported wear_setup_wizard_device_status_reported
1282    extensions 954; // WearSetupWizardPairingCompleted wear_setup_wizard_pairing_completed
1283    extensions 955; // WearSetupWizardConnectionEstablished wear_setup_wizard_connection_established
1284    extensions 956; // WearSetupWizardCheckinCompleted wear_setup_wizard_checkin_completed
1285    extensions 957; // WearSetupWizardCompanionTimeReported wear_setup_wizard_companion_time_reported
1286    extensions 958; // WearSetupWizardStatusReported wear_setup_wizard_status_reported
1287    extensions 959; // WearSetupWizardHeartbeatReported wear_setup_wizard_hearbeat_reported
1288    extensions 960; // WearSetupWizardFrpTriggered wear_setup_wizard_frp_triggered
1289    extensions 961; // WearSetupWizardSystemUpdateTriggered wear_setup_wizard_system_update_triggered
1290    extensions 962; // WearSetupWizardPhoneSwitchTriggered wear_setup_wizard_phone_switch_triggered
1291    extensions 963; // HealthConnectPermissionStats health_connect_permission_stats
1292    extensions 964; // WsBugreportEventReported ws_bugreport_event_reported
1293    extensions 965; // ConscryptServiceUsed conscrypt_service_used
1294    extensions 966; // MediaControlApiUsageReported media_control_api_usage_reported
1295    extensions 967; // ScheduledCustomAudienceUpdateScheduleAttempted scheduled_custom_audience_update_schedule_attempted
1296    extensions 968; // ScheduledCustomAudienceUpdatePerformed scheduled_custom_audience_update_performed
1297    extensions 969; // ScheduledCustomAudienceUpdatePerformedAttemptedFailureReported scheduled_custom_audience_update_performed_attempted_failure_reported
1298    extensions 970; // ScheduledCustomAudienceUpdateBackgroundJobRan scheduled_custom_audience_update_background_job_ran
1299    extensions 971; // ContextualEducationTriggered contextual_education_triggered
1300    extensions 972; // CertificateTransparencyLogListUpdateFailed certificate_transparency_log_list_update_failed
1301    extensions 973; // Reserved for b/375457523
1302    extensions 974; // CarSystemUiDataSubscriptionEventReported car_system_ui_data_subscription_event_reported
1303    extensions 975; // CarSettingsDataSubscriptionEventReported car_settings_data_subscription_event_reported
1304    extensions 976; // CarQcLibEventReported car_qc_lib_event_reported
1305    extensions 977; // ImageDecoded image_decoded
1306    extensions 978; // IntentCreatorTokenAdded intent_creator_token_added
1307    extensions 979; // CoreNetworkingTerribleErrorOccurred core_networking_terrible_error_occurred
1308    extensions 980; // HealthConnectPhrApiInvoked health_connect_phr_api_invoked
1309    extensions 981; // HealthConnectPhrUsageStats health_connect_phr_usage_stats
1310    extensions 982; // BluetoothRfcommConnectionReportedAtClose bluetooth_rfcomm_connection_reported_at_close
1311    extensions 983; // NotificationChannelClassification notification_channel_classification
1312    extensions 984; // HealthConnectPhrStorageStats health_connect_phr_storage_stats
1313    extensions 985; // HealthConnectRestrictedEcosystemStats health_connect_restricted_ecosystem_stats
1314    extensions 986; // HealthConnectEcosystemStats health_connect_ecosystem_stats
1315    extensions 987; // BackportedFixStatusReported backported_fix_status_reported
1316    extensions 988; // BluetoothLeConnection bluetooth_le_connection
1317    extensions 989; // CertificateTransparencyVerificationReported certificate_transparency_verification_reported
1318    extensions 990; // MediaSubscriptionChanged media_subscription_changed
1319    extensions 991; // HdmiPowerStateChangeOnActiveSourceLostToggled hdmi_power_state_change_on_active_source_lost_toggled
1320    extensions 992; // FederatedComputeTraceEventReported federated_compute_trace_event_reported
1321    extensions 993; // RangingSessionConfigured ranging_session_configured
1322    extensions 994; // RangingSessionStarted ranging_session_started
1323    extensions 995; // RangingSessionClosed ranging_session_closed
1324    extensions 996; // RangingTechnologyStarted ranging_technology_started
1325    extensions 997; // RangingTechnologyStopped ranging_technology_stopped
1326    extensions 998; // AppFunctionsRequestReported app_functions_request_reported
1327    extensions 999; // CameraStatusForCompatibilityChanged camera_status_for_compatibility_changed
1328    extensions 9999; // Atom9999 atom_9999
1329
1330    // StatsdStats tracks platform atoms with ids up to 900.
1331    // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
1332
1333    // Pulled events will start at field 10000.
1334    // Next: 10231
1335    oneof pulled {
1336        WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
1337        WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
1338        MobileBytesTransfer mobile_bytes_transfer =
1339                10002 [(module) = "framework", (truncate_timestamp) = true];
1340        MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
1341                10003 [(module) = "framework", (truncate_timestamp) = true];
1342        BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
1343        KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
1344        SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "framework", (module) = "statsdtest"];
1345        CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
1346        CpuTimePerUidFreq cpu_time_per_uid_freq =
1347                10010 [(module) = "framework", (module) = "statsd"];
1348        WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
1349        ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
1350        BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
1351        ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
1352        SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
1353        SystemUptime system_uptime = 10015 [(module) = "framework"];
1354        CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
1355        CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
1356        DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
1357        RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
1358        FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
1359        Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
1360        BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
1361        BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
1362        LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
1363        DiskStats disk_stats = 10025 [(module) = "framework"];
1364        DirectoryUsage directory_usage = 10026 [(module) = "framework"];
1365        AppSize app_size = 10027 [(module) = "framework"];
1366        CategorySize category_size = 10028 [(module) = "framework"];
1367        ProcStats proc_stats = 10029 [(module) = "framework"];
1368        BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
1369        NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
1370        DiskIo disk_io = 10032 [(module) = "framework"];
1371        PowerProfile power_profile = 10033 [(module) = "framework"];
1372        ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
1373        ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
1374        CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
1375        OnDevicePowerMeasurement on_device_power_measurement = 10038 [(module) = "framework"];
1376        DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
1377        ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
1378        BatteryLevel battery_level = 10043 [(module) = "framework"];
1379        BuildInformation build_information = 10044 [(module) = "framework"];
1380        BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
1381        DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
1382        DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
1383        NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
1384        RoleHolder role_holder = 10049 [(module) = "framework"];
1385        DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
1386        TrainInfo train_info = 10051 [(module) = "statsd"];
1387        TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
1388        ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
1389        GpuStatsGlobalInfo gpu_stats_global_info = 10054;
1390        GpuStatsAppInfo gpu_stats_app_info = 10055;
1391        SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
1392        AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
1393        FaceSettings face_settings = 10058 [(module) = "framework"];
1394        CoolingDevice cooling_device = 10059 [(module) = "framework"];
1395        AppOps app_ops = 10060 [(module) = "framework"];
1396        ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
1397        SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
1398        SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
1399        ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
1400        VmsClientStats vms_client_stats = 10065 [(module) = "car"];
1401        NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
1402        DangerousPermissionStateSampled dangerous_permission_state_sampled =
1403                10067 [(module) = "framework"];
1404        GraphicsStats graphics_stats = 10068 [(module) = "hwui"];
1405        RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
1406        IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
1407        PackageNotificationPreferences package_notification_preferences =
1408                10071 [(module) = "framework"];
1409        PackageNotificationChannelPreferences package_notification_channel_preferences =
1410                10072 [(module) = "framework"];
1411        PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
1412                10073 [(module) = "framework"];
1413        GnssStats gnss_stats = 10074 [(module) = "framework"];
1414        AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
1415        VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
1416        VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
1417        SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
1418        SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
1419        SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
1420        BlobInfo blob_info = 10081 [(module) = "framework"];
1421        DataUsageBytesTransfer data_usage_bytes_transfer =
1422                10082 [(module) = "framework", (truncate_timestamp) = true];
1423        BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
1424                10083 [(module) = "framework", (truncate_timestamp) = true];
1425        dnd.DNDModeProto dnd_mode_rule = 10084 [(module) = "framework"];
1426        GeneralExternalStorageAccessStats general_external_storage_access_stats =
1427            10085 [(module) = "mediaprovider"];
1428        IncomingSms incoming_sms = 10086 [(module) = "telephony"];
1429        OutgoingSms outgoing_sms = 10087 [(module) = "telephony"];
1430        CarrierIdTableVersion carrier_id_table_version = 10088 [(module) = "telephony"];
1431        DataCallSession data_call_session = 10089 [(module) = "telephony"];
1432        CellularServiceState cellular_service_state = 10090 [(module) = "telephony"];
1433        CellularDataServiceSwitch cellular_data_service_switch = 10091 [(module) = "telephony"];
1434        SystemMemory system_memory = 10092 [(module) = "framework"];
1435        ImsRegistrationTermination ims_registration_termination = 10093 [(module) = "telephony"];
1436        ImsRegistrationStats ims_registration_stats = 10094 [(module) = "telephony"];
1437        CpuTimePerClusterFreq cpu_time_per_cluster_freq = 10095 [(module) = "framework"];
1438        CpuCyclesPerUidCluster cpu_cycles_per_uid_cluster = 10096 [(module) = "framework"];
1439        DeviceRotatedData device_rotated_data = 10097 [(module) = "framework"];
1440        CpuCyclesPerThreadGroupCluster cpu_cycles_per_thread_group_cluster = 10098 [(module) = "framework"];
1441        MediaDrmActivityInfo media_drm_activity_info = 10099 [(module) = "media_metrics"];
1442        OemManagedBytesTransfer oem_managed_bytes_transfer = 10100 [(module) = "framework"];
1443        GnssPowerStats gnss_power_stats = 10101 [(module) = "framework"];
1444        TimeZoneDetectorState time_zone_detector_state = 10102 [(module) = "framework"];
1445        Keystore2StorageStats keystore2_storage_stats = 10103 [(module) = "framework"];
1446        RkpPoolStats rkp_pool_stats = 10104 [deprecated = true];
1447        ProcessDmabufMemory process_dmabuf_memory = 10105 [(module) = "framework"];
1448        PendingAlarmInfo pending_alarm_info = 10106 [(module) = "framework"];
1449        UserLevelHibernatedApps user_level_hibernated_apps = 10107 [(module) = "framework"];
1450        sysui.LauncherLayoutSnapshot launcher_layout_snapshot = 10108
1451            [(module) = "sysui"];
1452        GlobalHibernatedApps global_hibernated_apps = 10109 [(module) = "framework"];
1453        input.InputEventLatencySketch input_event_latency_sketch = 10110 [(module) = "input"];
1454        BatteryUsageStatsBeforeReset battery_usage_stats_before_reset =
1455            10111 [(module) = "framework"];
1456        BatteryUsageStatsSinceReset battery_usage_stats_since_reset =
1457            10112 [(module) = "framework"];
1458        BatteryUsageStatsSinceResetUsingPowerProfileModel
1459            battery_usage_stats_since_reset_using_power_profile_model =
1460            10113 [(module) = "framework"];
1461        InstalledIncrementalPackage installed_incremental_package = 10114 [(module) = "framework"];
1462        TelephonyNetworkRequests telephony_network_requests =
1463            10115 [(module) = "telephony", deprecated = true];
1464        AppSearchStorageInfo app_search_storage_info = 10116 [(module) = "appsearch"];
1465        VmStat vmstat = 10117 [(module) = "framework"];
1466        Keystore2KeyCreationWithGeneralInfo keystore2_key_creation_with_general_info =
1467                10118 [(module) = "framework"];
1468        Keystore2KeyCreationWithAuthInfo keystore2_key_creation_with_auth_info =
1469                10119 [(module) = "framework"];
1470        Keystore2KeyCreationWithPurposeAndModesInfo
1471                keystore2_key_creation_with_purpose_and_modes_info = 10120 [(module) = "framework"];
1472        Keystore2AtomWithOverflow keystore2_atom_with_overflow = 10121 [(module) = "framework"];
1473        Keystore2KeyOperationWithPurposeAndModesInfo
1474                keystore2_key_operation_with_purpose_and_modes_info =
1475                        10122 [(module) = "framework"];
1476        Keystore2KeyOperationWithGeneralInfo keystore2_key_operation_with_general_info =
1477                10123 [(module) = "framework"];
1478        RkpErrorStats rkp_error_stats = 10124 [(module) = "framework"];
1479        Keystore2CrashStats keystore2_crash_stats = 10125 [(module) = "framework"];
1480        VendorApexInfo vendor_apex_info = 10126 [(module) = "framework"];
1481        AccessibilityShortcutStats accessibility_shortcut_stats = 10127 [(module) = "framework"];
1482        AccessibilityFloatingMenuStats accessibility_floating_menu_stats =
1483            10128 [(module) = "framework"];
1484        DataUsageBytesTransferV2 data_usage_bytes_transfer_v2 = 10129 [(module) = "framework",
1485                (truncate_timestamp) = true];
1486        MediaCapabilities media_capabilities = 10130 [(module) = "framework"];
1487        CarWatchdogSystemIoUsageSummary car_watchdog_system_io_usage_summary =
1488            10131 [(module) = "car"];
1489        CarWatchdogUidIoUsageSummary car_watchdog_uid_io_usage_summary = 10132 [(module) = "car"];
1490        ImsRegistrationFeatureTagStats ims_registration_feature_tag_stats =
1491                10133 [(module) = "telephony"];
1492        RcsClientProvisioningStats rcs_client_provisioning_stats =
1493                10134 [(module) = "telephony"];
1494        RcsAcsProvisioningStats rcs_acs_provisioning_stats =
1495                10135 [(module) = "telephony"];
1496        SipDelegateStats sip_delegate_stats = 10136 [(module) = "telephony"];
1497        SipTransportFeatureTagStats sip_transport_feature_tag_stats =
1498                10137 [(module) = "telephony"];
1499        SipMessageResponse sip_message_response = 10138 [(module) = "telephony"];
1500        SipTransportSession sip_transport_session = 10139 [(module) = "telephony"];
1501        ImsDedicatedBearerListenerEvent ims_dedicated_bearer_listener_event =
1502                10140 [(module) = "telephony"];
1503        ImsDedicatedBearerEvent ims_dedicated_bearer_event = 10141 [(module) = "telephony"];
1504        ImsRegistrationServiceDescStats ims_registration_service_desc_stats =
1505                10142 [(module) = "telephony"];
1506        UceEventStats uce_event_stats = 10143 [(module) = "telephony"];
1507        PresenceNotifyEvent presence_notify_event = 10144 [(module) = "telephony"];
1508        GbaEvent gba_event = 10145 [(module) = "telephony"];
1509        PerSimStatus per_sim_status = 10146 [(module) = "telephony"];
1510        GpuWorkPerUid gpu_work_per_uid = 10147;
1511        PersistentUriPermissionsAmountPerPackage persistent_uri_permissions_amount_per_package =
1512            10148 [(module) = "framework"];
1513        SignedPartitionInfo signed_partition_info = 10149 [(module) = "framework"];
1514        PinnedFileSizesPerPackage pinned_file_sizes_per_package = 10150
1515            [(module) = "framework"];
1516        PendingIntentsPerPackage pending_intents_per_package = 10151
1517            [(module) = "framework"];
1518        UserInfo user_info = 10152 [(module) = "framework"];
1519        TelephonyNetworkRequestsV2 telephony_network_requests_v2 = 10153 [(module) = "telephony"];
1520        DeviceTelephonyProperties device_telephony_properties = 10154 [(module) = "telephony"];
1521        RemoteKeyProvisioningErrorCounts remote_key_provisioning_error_counts = 10155 [deprecated = true];
1522        SafetyState safety_state = 10156 [(module) = "permissioncontroller"];
1523        IncomingMms incoming_mms = 10157 [(module) = "mms"];
1524        OutgoingMms outgoing_mms = 10158 [(module) = "mms"];
1525        MultiUserInfo multi_user_info = 10160 [(module) = "framework"];
1526        NetworkBpfMapInfo network_bpf_map_info = 10161 [(module) = "connectivity"];
1527        OutgoingShortCodeSms outgoing_short_code_sms = 10162 [(module) = "telephony"];
1528        ConnectivityStateSample connectivity_state_sample = 10163 [(module) = "connectivity"];
1529        NetworkSelectionRematchReasonsInfo network_selection_rematch_reasons_info = 10164 [(module) = "connectivity"];
1530        agif.GameModeInfo game_mode_info = 10165 [(module) = "framework"];
1531        agif.GameModeConfiguration game_mode_configuration = 10166 [(module) = "framework"];
1532        agif.GameModeListener game_mode_listener = 10167 [(module) = "framework"];
1533        NetworkSliceRequestCountSample network_slice_request_count = 10168 [(module) = "connectivity"];
1534        WsTileSnapshot ws_tile_snapshot = 10169 [(module) = "wearservices"];
1535        WsActiveWatchFaceComplicationSetSnapshot ws_active_watch_face_complication_set_snapshot = 10170 [(module) = "wearservices"];
1536        ProcessState process_state = 10171 [(module) = "framework"];
1537        ProcessAssociation process_association = 10172 [(module) = "framework"];
1538        adpf.ADPFSystemComponentInfo adpf_system_component_info = 10173 [(module) = "framework"];
1539        sysui.NotificationMemoryUse notification_memory_use = 10174 [(module) = "sysui"];
1540        display.HdrCapabilities hdr_capabilities = 10175 [(module) = "framework"];
1541        WsFavouriteWatchFaceListSnapshot ws_favourite_watch_face_list_snapshot = 10176 [(module) = "wearservices"];
1542    }
1543
1544    // Pulled atom extensions.
1545    // The atom definitions are under atoms/<feature>/<feature>_extension_atoms.proto
1546    extensions 10159; // SandboxSdkStorage sandbox_sdk_storage
1547    extensions 10177; // QnsRatPreferenceMismatchInfo qns_rat_preference_mismatch_info
1548    extensions 10178; // QnsHandoverTimeMillis qns_handover_time_millis
1549    extensions 10179; // QnsHandoverPingpong qns_handover_pingpong
1550    extensions 10180; // EmergencyNumbersInfo emergency_numbers_info
1551    extensions 10181; // MteState mte_state
1552    extensions 10182; // SatelliteController satellite_controller
1553    extensions 10183; // SatelliteSession satellite_session
1554    extensions 10184; // SatelliteIncomingDatagram satellite_incoming_datagram
1555    extensions 10185; // SatelliteOutgoingDatagram satellite_outgoing_datagram
1556    extensions 10186; // SatelliteProvision satellite_provision
1557    extensions 10187; // SatelliteSosMessageRecommender satellite_sos_message_recommender
1558    extensions 10188; // UwbActivityInfo uwb_activity_info
1559    extensions 10189; // CachedAppsHighWaterMark cached_apps_high_watermark
1560    extensions 10190; // WifiAwareCapabilities wifi_aware_capabilities
1561    extensions 10191; // TouchpadUsage touchpad_usage
1562    extensions 10192; // DreamSettingSnapshot dream_setting_snapshot
1563    extensions 10193; // WifiModuleInfo wifi_module_info
1564    extensions 10194; // WifiSettingInfo wifi_setting_info
1565    extensions 10195; // WifiComplexSettingInfo wifi_complex_setting_info
1566    extensions 10196; // SysproxyBluetoothBytesTransfer sysproxy_bluetooth_bytes_transfer
1567    extensions 10197; // WsStandaloneModeSnapshot ws_standalone_mode_snapshot
1568    extensions 10198; // WifiConfiguredNetworkInfo wifi_configured_network_info;
1569    extensions 10199; // CpuPolicy cpu_policy
1570    extensions 10200; // ProxyBytesTransferByFgBg proxy_bytes_transfer_by_fg_bg
1571    extensions 10201; // ThermalHeadroomThresholds thermal_headroom_thresholds
1572    extensions 10202; // Reserved for b/308823939.
1573    extensions 10203; // Reserved for b/308823939.
1574    extensions 10204; // MobileBytesTransferByProcState mobile_bytes_transfer_by_proc_state
1575    extensions 10205; // ArtDeviceStatus art_device_status
1576    extensions 10206; // WsFavouriteWatchFaceSnapshot ws_favorite_watch_face_snapshot
1577    extensions 10207; // DataNetworkValidation data_network_validation
1578    // 10208 is reserved due to removing the old atom.
1579    extensions 10209; // BatteryUsageStatsPerUid battery_usage_stats_per_uid
1580    extensions 10210; // Reserved for b/339008431
1581    extensions 10211; // CarrierRoamingSatelliteSession carrier_roaming_satellite_session
1582    extensions 10212; // CarrierRoamingSatelliteControllerStats carrier_roaming_satellite_controller_stats
1583    extensions 10213; // ControllerStatsPerPackage controller_stats_per_package
1584    extensions 10214; // SatelliteEntitlement satellite_entitlement
1585    extensions 10215; // SatelliteConfigUpdater satellite_config_updater
1586    extensions 10216; // DevicePolicyManagementMode
1587    extensions 10217; // DevicePolicyPolicyState
1588    extensions 10218; // AdpfSessionSnapshot adpf_session_snapshot
1589    extensions 10219; // SatelliteAccessController satellite_access_controller
1590    extensions 10220; // AndroidHardwareHealthBattery android_hardware_health_battery
1591    extensions 10221; // CallStats call_stats
1592    extensions 10222; // CallAudioRouteStats call_audio_route_stats
1593    extensions 10223; // TelecomApiStats telecom_api_stats
1594    extensions 10224; // TelecomErrorStats telecom_error_stats
1595    extensions 10225; // WsPhotosWatchFaceFeatureSnapshot ws_photos_watch_face_feature_snapshot
1596    extensions 10226; // CommunalHubSnapshot communal_hub_snapshot
1597    extensions 10227; // WsWatchFaceCustomizationSnapshot ws_watch_face_customization_snapshot
1598    // 10228 is reserved due to removing the old atom
1599    extensions 10229; // PressureStallInformation pressure_stall_information
1600    extensions 10230; // FrameworkWakelockInfo framework_wakelock_info
1601    extensions 99999; // Atom99999 atom_99999
1602
1603    // DO NOT USE field numbers above 100,000 in AOSP.
1604    // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
1605    // Field numbers 200,000 and above are reserved for future use; do not use them at all.
1606    reserved 54, 58, 83, 360 to 363, 492, 597, 801, 936, 937, 938, 939, 10008, 10036, 10040, 10041, 10228, 21004, 21005;
1607}
1608
1609/*
1610 * *****************************************************************************
1611 * Below are all of the individual atoms that are logged by Android via statsd.
1612 *
1613 * RULES:
1614 *   - The field ids for each atom must start at 1, and count upwards by 1.
1615 *     Skipping field ids is not allowed.
1616 *   - These form an API, so renaming, renumbering or removing fields is
1617 *     not allowed between android releases.  (This is not currently enforced,
1618 *     but there will be a tool to enforce this restriction).
1619 *   - The types must be built-in protocol buffer types, namely, no sub-messages
1620 *     are allowed (yet).  The bytes type is also not allowed.
1621 *   - The CamelCase name of the message type should match the
1622 *     underscore_separated name as defined in Atom.
1623 *   - If an atom represents work that can be attributed to an app, there can
1624 *     be exactly one AttributionChain field. It must be field number 1.
1625 *   - A field that is a uid should be an int32 field, tagged with the
1626 *     [(is_uid) = true] annotation.
1627 *
1628 * CONVENTIONS:
1629 *   - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
1630 *   - If there is a UID, it goes first. Think in an object-oriented fashion.
1631 * *****************************************************************************
1632 */
1633
1634/**
1635 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
1636 * Logs when the Thermal service HAL notifies the throttling start/stop events.
1637 *
1638 * Logged from:
1639 *   frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
1640 */
1641message ThermalThrottlingStateChanged {
1642    // The type of temperature being reported (CPU, GPU, SKIN, etc)
1643    optional android.os.TemperatureTypeEnum sensor_type = 1;
1644
1645    // Throttling state, this field is DEPRECATED
1646    enum State {
1647        UNKNOWN = 0;
1648        START = 1; // START indicated that throttling was triggered.
1649        STOP = 2; // STOP indicates that throttling was cleared.
1650    }
1651    optional State state = 2;
1652
1653    optional float temperature = 3;
1654}
1655
1656/**
1657 * Track transcoding service usage
1658 * Logged from:
1659 *   packages/providers/MediaProvider/src/com/android/providers/media/TranscodeHelper.java
1660 * Next Tag: 14
1661 */
1662message TranscodingData {
1663    // Reason that leads to the type of access.
1664    enum AccessReason {
1665        UNKNOWN = 0;
1666        SYSTEM_DEFAULT = 1; // Default option
1667        SYSTEM_CONFIG = 2;  // Server-side/on-device config
1668        APP_MANIFEST = 3;  // media_capabilites.xml
1669        APP_COMPAT = 4;   // App compat framework
1670        APP_EXTRA = 5;   // ApplicationMediaCapabilities API in open()
1671    }
1672
1673    // Causes that leads to the failure of transcode.
1674    enum FailureCause {
1675        CAUSE_UNKNOWN = 0;
1676        TRANSCODING_SERVICE_ERROR = 1;     // Error from transcoding service.
1677        TRANSCODING_CLIENT_TIMEOUT = 2;    // Timeout from MediaProvider.
1678        TRANSCODING_SESSION_CANCELED = 3; // MediaProvider cancels the transcode.
1679    }
1680
1681    enum AccessType {
1682        HEVC_WRITE = 1;
1683        READ_DIRECT = 2;
1684        READ_CACHE = 3;
1685        READ_TRANSCODE = 4;
1686        WRITE_CACHE = 5; // App trying to write to transcodeid avc file in cache, this is rare.
1687        AVC_WRITE = 6;
1688    }
1689
1690    enum Result {
1691        SUCCESS = 0;
1692        FAIL = 1;
1693        UNDEFINED = 2;
1694    }
1695
1696    optional string requestor_package = 1;
1697    optional AccessType access_type = 2;
1698    optional int64 file_size_bytes = 3;
1699    optional Result transcode_result = 4;
1700    optional int64 transcode_duration_millis = 5; // The duration of transcoding.
1701    optional int64 file_duration_millis = 6; // The duration of the video file.
1702    optional int64 file_framerate_fps = 7; // The framerate of the video file.
1703    optional AccessReason access_reason = 8;
1704    optional int64 width = 9;
1705    optional int64 height = 10;
1706    optional bool hit_anr = 11;
1707    optional FailureCause failure_cause = 12;   // This field is valid only when fails.
1708    optional int64 transcoding_service_error_code = 13; // Error code from transcoding service.
1709}
1710
1711/**
1712 * Logs when the screen state changes.
1713 *
1714 * Logged from:
1715 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1716 */
1717message ScreenStateChanged {
1718    // New screen state, from frameworks/proto_logging/stats/enums/view/enums.proto.
1719    optional android.view.DisplayStateEnum state = 1
1720            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
1721}
1722
1723/**
1724 * Part of the go/activity-security project. Logs information about activity
1725 * starts which would be blocked as part of the project.
1726 *
1727 * Logged from:
1728 *  - frameworks/base/services/core/java/com/android/server/wm/ActivityStarter.java
1729 *  - frameworks/base/services/core/java/com/android/server/wm/ActivityClientController.java
1730 */
1731message ActivityActionBlocked {
1732    enum Action {
1733        ACTION_UNSPECIFIED = 0;
1734        ACTIVITY_START_SAME_TASK = 1;
1735        ACTIVITY_START_DIFFERENT_TASK = 2;
1736        ACTIVITY_START_NEW_TASK = 3;
1737        FINISH_TASK = 4;
1738    }
1739    optional int32 caller_uid = 1 [(is_uid) = true];
1740    optional string caller_activity_class_name = 2;
1741    optional int32 target_task_top_activity_uid = 3 [(is_uid) = true];
1742    optional string target_task_top_activity_class_name = 4;
1743    optional bool target_task_is_different = 5;
1744    optional int32 target_activity_uid = 6 [(is_uid) = true];
1745    optional string target_activity_class_name = 7;
1746    optional string target_intent_action = 8;
1747    optional int32 target_intent_flags = 9;
1748
1749    optional Action action = 10;
1750    optional int32 version = 11;
1751    optional bool multi_window = 12;
1752    optional int32 bal_code = 13;
1753    optional string task_debug_info = 14;
1754}
1755
1756/**
1757 * Logs that the process state of the uid, as determined by ActivityManager
1758 * (i.e. the highest process state of that uid's processes) has changed.
1759 *
1760 * Logged from:
1761 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1762 */
1763message UidProcessStateChanged {
1764    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
1765
1766    // The state, from frameworks/proto_logging/stats/enums/app_shared/app_enums.proto.
1767    optional android.app.ProcessStateEnum state = 2
1768            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
1769}
1770
1771/**
1772 * Logs process state change of a process, as per the activity manager.
1773 *
1774 * Logged from:
1775 *   frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
1776 */
1777message ProcessStateChanged {
1778    optional int32 uid = 1 [(is_uid) = true];
1779    optional string process_name = 2;
1780    optional string package_name = 3;
1781    // TODO: remove this when validation is done
1782    optional int64 version = 5;
1783    // The state, from frameworks/proto_logging/stats/enums/app_shared/app_enums.proto.
1784    optional android.app.ProcessStateEnum state = 4;
1785}
1786
1787/**
1788 * Logs how long a process was in each of the states.
1789 */
1790message ProcessState {
1791  optional int32 uid = 1 [(is_uid) = true];
1792  optional string process_name = 2;
1793
1794  // Measurement period. Can be used as denominator.
1795  // The gauge duration is not representative because we want uptime and also
1796  // the measurement usually ends at a time earlier than pull time.
1797  optional int32 measurement_start_uptime_seconds = 3;
1798  optional int32 measurement_end_uptime_seconds = 4;
1799  optional int32 measurement_duration_uptime_seconds = 5;
1800
1801  // Individual state breakdowns, summing up to total process runtime.
1802  // Flattening (instead of a dimensions - value pair) for two reasons:
1803  // 1. Makes metric filtering possible (can pull the entire process data based
1804  //    on a specific value.
1805  // 2. More efficient to encode (proto id serves as dimension).
1806  optional int32 top_seconds = 6;
1807  optional int32 fgs_seconds = 7;
1808  optional int32 bound_top_seconds = 8;
1809  optional int32 bound_fgs_seconds = 9;
1810  optional int32 important_fg_bg_seconds = 10;
1811  optional int32 cached_seconds = 11;
1812  optional int32 frozen_seconds = 12;
1813  optional int32 other_seconds = 13;
1814}
1815
1816/**
1817 * Logs association between processes.
1818 */
1819message ProcessAssociation {
1820  optional int32 client_uid = 1 [(is_uid) = true];
1821
1822  // If we only care about the package name name we do not need to upload this
1823  // (even though we should add it to the atom for filtering / sharding)
1824  optional string client_process = 2;
1825
1826  optional int32 service_uid = 3 [(is_uid) = true];
1827
1828  optional string service_name = 4;
1829
1830  optional string service_process = 10;
1831
1832  // Measurement period. Can be used as denominator.
1833  // The gauge duration is not representative because we want uptime and also
1834  // the measurement usually ends at a time earlier than pull time.
1835  optional int32 measurement_start_uptime_seconds = 5;
1836  optional int32 measurement_end_uptime_seconds = 6;
1837  optional int32 measurement_duration_uptime_seconds = 7;
1838
1839  optional int32 duration_seconds = 8;
1840
1841  // Number of times this association was established.
1842  optional int32 count = 9;
1843}
1844
1845/**
1846 * Logs when ActivityManagerService sleep state is changed.
1847 *
1848 * Logged from:
1849 *   frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
1850 */
1851message ActivityManagerSleepStateChanged {
1852    // TODO: import frameworks proto
1853    enum State {
1854        UNKNOWN = 0;
1855        ASLEEP = 1;
1856        AWAKE = 2;
1857    }
1858    optional State state = 1
1859            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
1860}
1861
1862/**
1863 * Logs when system memory state changes.
1864 *
1865 * Logged from:
1866 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1867 */
1868message MemoryFactorStateChanged {
1869    // TODO: import frameworks proto
1870    enum State {
1871        MEMORY_UNKNOWN = 0;
1872        NORMAL = 1;     // normal.
1873        MODERATE = 2;   // moderate memory pressure.
1874        LOW = 3;        // low memory.
1875        CRITICAL = 4;   // critical memory.
1876
1877    }
1878    optional State factor = 1 [
1879        (state_field_option).exclusive_state = true,
1880        (state_field_option).nested = false
1881    ];
1882}
1883
1884/**
1885 * Logs when app is using too much cpu, according to ActivityManagerService.
1886 *
1887 * Logged from:
1888 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1889 */
1890message ExcessiveCpuUsageReported {
1891    optional int32 uid = 1 [(is_uid) = true];
1892    optional string process_name = 2;
1893    optional string package_name = 3;
1894    // package version. TODO: remove this when validation is done
1895    optional int64 version = 4;
1896}
1897
1898/**
1899 * Logs when a cached process is killed, along with its pss.
1900 *
1901 * Logged from:
1902 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1903 */
1904message CachedKillReported {
1905    optional int32 uid = 1 [(is_uid) = true];
1906    optional string process_name = 2;
1907    optional string package_name = 3;
1908    // TODO: remove this when validation is done
1909    optional int64 version = 5;
1910    optional int64 pss = 4;
1911}
1912
1913/**
1914 * Logs the change in wifi health.
1915 *
1916 * Logged from:
1917 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
1918 */
1919message WifiHealthStatReported {
1920    enum Band {
1921        UNKNOWN = 0;
1922        // All of 2.4GHz band
1923        BAND_2G = 1;
1924        // Frequencies in the range of [5150, 5250) GHz
1925        BAND_5G_LOW = 2;
1926        // Frequencies in the range of [5250, 5725) GHz
1927        BAND_5G_MIDDLE = 3;
1928        // Frequencies in the range of [5725, 5850) GHz
1929        BAND_5G_HIGH = 4;
1930        // Frequencies in the range of [5925, 6425) GHz
1931        BAND_6G_LOW = 5;
1932        // Frequencies in the range of [6425, 6875) GHz
1933        BAND_6G_MIDDLE = 6;
1934        // Frequencies in the range of [6875, 7125) GHz
1935        BAND_6G_HIGH = 7;
1936    }
1937    // duration this stat is obtained over in milliseconds
1938    optional int32 duration_millis = 1;
1939    // whether wifi is classified as sufficient for the user's data traffic, determined
1940    // by whether the calculated throughput exceeds the average demand within |duration_millis|
1941    optional bool is_sufficient = 2;
1942    // whether cellular data is available
1943    optional bool is_cell_data_available = 3;
1944    // the Band bucket the connected network is on
1945    optional Band band = 4;
1946    // the Signal strength in the range of [-126, 0)
1947    optional int32 rssi = 5;
1948    // estimated tx throughput in kbps
1949    optional int32 tx_kbps = 6 [default = -1];
1950    // estimated rx throughput in kbps
1951    optional int32 rx_kbps = 7 [default = -1];
1952   // External scorer UID if external scorer is enabled. Otherwise WIFI_UID for
1953   // AOSP scorer.
1954   optional int32 scorer_uid = 8 [(is_uid) = true];
1955   // Whether or not Wi-Fi is predicted as usable by the scorer
1956   // Note: 'is_wifi_predicted_as_usable' is deprectaed by 'wifi_predicted_usability_state'.
1957   optional bool is_wifi_predicted_as_usable = 9;
1958   // Wi-Fi usability state as predicted by the scorer
1959   optional android.net.wifi.WifiPredictedUsabilityState wifi_predicted_usability_state = 10;
1960}
1961
1962/**
1963 * Logged when wifi detects a significant change in connection failure rate.
1964 *
1965 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
1966 *
1967 */
1968message WifiFailureStatReported {
1969    enum AbnormalityType {
1970        UNKNOWN = 0;
1971        SIGNIFICANT_INCREASE = 1;
1972        SIGNIFICANT_DECREASE = 2;
1973        SIMPLY_HIGH = 3;
1974    }
1975    enum FailureType {
1976        FAILURE_UNKNOWN = 0;
1977        FAILURE_CONNECTION = 1;
1978        FAILURE_ASSOCIATION_REJECTION = 2;
1979        FAILURE_ASSOCIATION_TIMEOUT = 3;
1980        FAILURE_AUTHENTICATION = 4;
1981        FAILURE_NON_LOCAL_DISCONNECTION = 5;
1982        FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
1983    }
1984    // Reason for uploading this stat
1985    optional AbnormalityType abnormality_type = 1;
1986    // The particular type of failure
1987    optional FailureType failure_type = 2;
1988    // How many times we have encountered this combination of AbnormalityType and FailureType
1989    optional int32 failure_count = 3;
1990}
1991
1992/**
1993 * Logs whether a Wifi connection attempt was successful and reasons for failure if it wasn't.
1994 *
1995 * Logged from:
1996 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
1997 */
1998message WifiConnectionResultReported {
1999    enum FailureCode {
2000        FAILURE_UNKNOWN = 0;
2001        FAILURE_ASSOCIATION_TIMEOUT = 1;
2002        FAILURE_ASSOCIATION_REJECTION = 2;
2003        FAILURE_AUTHENTICATION_GENERAL = 3;
2004        FAILURE_AUTHENTICATION_EAP = 4;
2005        FAILURE_DHCP = 5;
2006        FAILURE_NETWORK_DISCONNECTION = 6;
2007        FAILURE_ROAM_TIMEOUT = 7;
2008        FAILURE_WRONG_PASSWORD = 8;
2009        FAILURE_CONNECT_NETWORK_FAILED = 9;
2010        FAILURE_NEW_CONNECTION_ATTEMPT = 10;
2011        FAILURE_REDUNDANT_CONNECTION_ATTEMPT = 11;
2012        FAILURE_NETWORK_NOT_FOUND = 12;
2013        FAILURE_NO_RESPONSE = 13;
2014        FAILURE_OTHERS = 14;
2015    }
2016
2017    enum Trigger {
2018        UNKNOWN = 0;
2019        // Connection attempt was initiated manually.
2020        MANUAL = 1;
2021        // Automatic reconnection to the same network as connected previously.
2022        RECONNECT_SAME_NETWORK = 2;
2023        // Automatic reconnection to a saved network, but not the previous one.
2024        AUTOCONNECT_CONFIGURED_NETWORK = 3;
2025        // Automatic first connection attempt after device boot.
2026        AUTOCONNECT_BOOT = 4;
2027    }
2028
2029    // True represents a successful connection.
2030    optional bool connection_result = 1;
2031    // Reason for the connection failure.
2032    optional FailureCode failure_code = 2;
2033    // Scan RSSI before the connection attempt.
2034    optional int32 rssi = 3;
2035    // Time taken by this connection attempt.
2036    optional int32 connection_attempt_duration_millis = 4;
2037    // Band bucket the connected network is on.
2038    optional android.net.wifi.WifiBandBucket band = 5;
2039    // Authentication type.
2040    optional android.net.wifi.WifiAuthType auth_type = 6;
2041    // What triggered this connection attempt.
2042    optional Trigger trigger = 7;
2043    // Whether this network was used (successfully connected to) previously.
2044    optional bool network_used = 8;
2045    // Time taken from the last successful connection (or device boot if that's the first one).
2046    optional int32 time_since_last_connection_seconds = 9;
2047    // Whether the connection is carrier wifi.
2048    optional bool is_carrier_wifi = 10;
2049    // Whether the OOB pseeudonym is enabled for the current connection.
2050    optional bool is_oob_pseudonym_enabled = 11;
2051    // The client mode role for the connection, can use to determine the connection type.
2052    optional android.net.wifi.ClientModeRole role = 12;
2053    // The status code specific to each failure code.
2054    // - For FAILURE_ASSOCIATION_REJECTION, the value should be one of
2055    //   SupplicantStaIfaceHal.StaIfaceStatusCode.
2056    // - For FAILURE_NETWORK_DISCONNECTION, the value should be
2057    //   one of SupplicantStaIfaceHal.StaIfaceReasonCode.
2058    // - For FAILURE_AUTHENTICATION_EAP, the value should be a EAP failure code.
2059    // For all other failure codes, this should be 0.
2060    optional int32 failure_specific_status_code = 13;
2061    // Information only applicable for EAP networks.
2062    optional android.net.wifi.EapType eap_type = 14;
2063    optional android.net.wifi.EapInnerMethod eap_inner_method = 15;
2064    optional android.net.wifi.RoamingType passpoint_roaming_type = 16;
2065    // carrier ID of the network
2066    optional int32 carrier_id = 17;
2067    optional android.net.wifi.TofuConfiguration tofu_configuration = 18;
2068    // uid of the caller who initiated this connection
2069    optional int32 connection_uid = 19 [(is_uid) = true];
2070}
2071
2072/**
2073 * Logs when a Wifi connection drops.
2074 *
2075 * Logged from:
2076 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
2077 */
2078message WifiDisconnectReported {
2079    enum FailureCode {
2080        UNKNOWN = 0;
2081
2082        // Wifi supplicant failure reason codes (IEEE Std 802.11-2016, 9.4.1.7, Table 9-45).
2083        // See ISupplicantStaIfaceCallback.java:ReasonCode
2084        UNSPECIFIED = 1;
2085        PREV_AUTH_NOT_VALID = 2;
2086        DEAUTH_LEAVING = 3;
2087        DISASSOC_DUE_TO_INACTIVITY = 4;
2088        DISASSOC_AP_BUSY = 5;
2089        CLASS2_FRAME_FROM_NONAUTH_STA = 6;
2090        CLASS3_FRAME_FROM_NONASSOC_STA = 7;
2091        DISASSOC_STA_HAS_LEFT = 8;
2092        STA_REQ_ASSOC_WITHOUT_AUTH = 9;
2093        PWR_CAPABILITY_NOT_VALID = 10;
2094        SUPPORTED_CHANNEL_NOT_VALID = 11;
2095        BSS_TRANSITION_DISASSOC = 12;
2096        INVALID_IE = 13;
2097        MICHAEL_MIC_FAILURE = 14;
2098        FOURWAY_HANDSHAKE_TIMEOUT = 15;
2099        GROUP_KEY_UPDATE_TIMEOUT = 16;
2100        IE_IN_4WAY_DIFFERS = 17;
2101        GROUP_CIPHER_NOT_VALID = 18;
2102        PAIRWISE_CIPHER_NOT_VALID = 19;
2103        AKMP_NOT_VALID = 20;
2104        UNSUPPORTED_RSN_IE_VERSION = 21;
2105        INVALID_RSN_IE_CAPAB = 22;
2106        IEEE_802_1X_AUTH_FAILED = 23;
2107        CIPHER_SUITE_REJECTED = 24;
2108        TDLS_TEARDOWN_UNREACHABLE = 25;
2109        TDLS_TEARDOWN_UNSPECIFIED = 26;
2110        SSP_REQUESTED_DISASSOC = 27;
2111        NO_SSP_ROAMING_AGREEMENT = 28;
2112        BAD_CIPHER_OR_AKM = 29;
2113        NOT_AUTHORIZED_THIS_LOCATION = 30;
2114        SERVICE_CHANGE_PRECLUDES_TS = 31;
2115        UNSPECIFIED_QOS_REASON = 32;
2116        NOT_ENOUGH_BANDWIDTH = 33;
2117        DISASSOC_LOW_ACK = 34;
2118        EXCEEDED_TXOP = 35;
2119        STA_LEAVING = 36;
2120        END_TS_BA_DLS = 37;
2121        UNKNOWN_TS_BA = 38;
2122        TIMEOUT = 39;
2123        PEERKEY_MISMATCH = 45;
2124        AUTHORIZED_ACCESS_LIMIT_REACHED = 46;
2125        EXTERNAL_SERVICE_REQUIREMENTS = 47;
2126        INVALID_FT_ACTION_FRAME_COUNT = 48;
2127        INVALID_PMKID = 49;
2128        INVALID_MDE = 50;
2129        INVALID_FTE = 51;
2130        MESH_PEERING_CANCELLED = 52;
2131        MESH_MAX_PEERS = 53;
2132        MESH_CONFIG_POLICY_VIOLATION = 54;
2133        MESH_CLOSE_RCVD = 55;
2134        MESH_MAX_RETRIES = 56;
2135        MESH_CONFIRM_TIMEOUT = 57;
2136        MESH_INVALID_GTK = 58;
2137        MESH_INCONSISTENT_PARAMS = 59;
2138        MESH_INVALID_SECURITY_CAP = 60;
2139        MESH_PATH_ERROR_NO_PROXY_INFO = 61;
2140        MESH_PATH_ERROR_NO_FORWARDING_INFO = 62;
2141        MESH_PATH_ERROR_DEST_UNREACHABLE = 63;
2142        MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64;
2143        MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65;
2144        MESH_CHANNEL_SWITCH_UNSPECIFIED = 66;
2145
2146        // ClientModeImpl error codes
2147        // Defined in /frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
2148        IFACE_DESTROYED = 10000;
2149        WIFI_DISABLED = 10001;
2150        SUPPLICANT_DISCONNECTED = 10002;
2151        CONNECTING_WATCHDOG_TIMER = 10003;
2152        ROAM_WATCHDOG_TIMER = 10004;
2153
2154        // New reasons tracking disconnections initiated by wifi framework
2155        DISCONNECT_GENERAL = 10005; // Framework disconnect, generic reason
2156        // Disconnecting due to unspecified IP reachability lost.
2157        DISCONNECT_NUD_FAILURE_GENERIC = 10006;
2158        // Disconnecting due to IP reachability lost from roaming
2159        DISCONNECT_NUD_FAILURE_ROAM = 10007;
2160        // Disconnecting due to IP reachability lost from the CONFIRM command
2161        DISCONNECT_NUD_FAILURE_CONFIRM = 10008;
2162        // Disconnecting due to IP reachability lost from kernel check
2163        DISCONNECT_NUD_FAILURE_ORGANIC = 10009;
2164        // Connectivity no longer wants this network
2165        DISCONNECT_UNWANTED_BY_CONNECTIVITY = 10010;
2166        // Timeout creating the IP client
2167        DISCONNECT_CREATE_IP_CLIENT_TIMEOUT = 10011;
2168        DISCONNECT_IP_PROVISIONING_FAILURE = 10012; // IP provisioning failure
2169        DISCONNECT_P2P_REQUESTED_DISCONNECT = 10013; // Disconnect by P2P
2170        // Network is removed from the WifiConfigManager
2171        DISCONNECT_NETWORK_REMOVED = 10014;
2172        DISCONNECT_NETWORK_UNTRUSTED = 10015; // Network is marked as untrusted
2173        DISCONNECT_NETWORK_METERED = 10016; // Network is marked as metered
2174        DISCONNECT_TEMP_DISABLED = 10017; // Network is temporarily disabled
2175        DISCONNECT_PERM_DISABLED = 10018; // Network is permanently disabled
2176        DISCONNECT_CARRIER_OFFLOAD_DISABLED = 10019;
2177        // Disconnecting due to Passpoint terms and conditions page
2178        DISCONNECT_PASSPOINT_TAC = 10020;
2179        // Disconnecting due to issues with terms and conditions URL
2180        DISCONNECT_VNC_REQUEST = 10021;
2181        // Connected to a network that is already removed
2182        DISCONNECT_UNKNOWN_NETWORK = 10022;
2183        // User initiated a new connection
2184        DISCONNECT_NEW_CONNECTION_USER = 10023;
2185        // New connection triggered by non-user
2186        DISCONNECT_NEW_CONNECTION_OTHERS = 10024;
2187        // Wi-Fi 7 is enabled or disabled for this network
2188        DISCONNECT_NETWORK_WIFI7_TOGGLED = 10025;
2189    }
2190
2191    // How long the session lasted from successful connection to disconnect.
2192    optional int32 connected_duration_seconds = 1;
2193
2194    // Reason for the disconnect.
2195    optional FailureCode failure_code = 2;
2196
2197    // Band bucket the connected network was on.
2198    optional android.net.wifi.WifiBandBucket band = 3;
2199
2200    // Authentication type.
2201    optional android.net.wifi.WifiAuthType auth_type = 4;
2202
2203    // Last seen RSSI before the disconnect.
2204    optional int32 last_rssi = 5;
2205
2206    // Last seen link speed before the disconnect.
2207    optional int32 last_link_speed = 6;
2208
2209    // Time since the last RSSI and link speed update.
2210    // Useful for filtering out very old data
2211    optional int32 time_since_last_rssi_poll_seconds = 7;
2212
2213    // Time from the last NETWORK_CONNECTION_EVENT to the disconnect
2214    optional int32 connected_time_since_last_roam_seconds = 8;
2215
2216    // The purpose the of the connection
2217    optional android.net.wifi.ClientModeRole role = 9;
2218
2219    // The type of EAP authentication. Only applicable for EAP networks.
2220    optional android.net.wifi.EapType eap_type = 10;
2221
2222    optional android.net.wifi.EapInnerMethod eap_inner_method = 11;
2223
2224    optional android.net.wifi.RoamingType passpoint_roaming_type = 12;
2225
2226    // Carrier id of the network.
2227    optional int32 carrier_id = 13;
2228
2229    // uid of the caller who initiated this connection
2230    optional int32 connection_uid = 14 [(is_uid) = true];
2231}
2232
2233/**
2234 * Logs when Wifi connection is established or dropped.
2235 *
2236 * Logged from:
2237 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
2238 */
2239message WifiConnectionStateChanged {
2240    optional bool is_connected = 1 [
2241        (state_field_option).exclusive_state = true,
2242        (state_field_option).nested = false
2243    ];
2244
2245    // Band bucket the connected network was on.
2246    // Filled for both connected and disconnected cases.
2247    optional android.net.wifi.WifiBandBucket band = 2;
2248
2249    // Authentication type.
2250    // Filled for both connected and disconnected cases.
2251    optional android.net.wifi.WifiAuthType auth_type = 3;
2252}
2253
2254/**
2255 * Logged when wifi peer to peer connection happens
2256 */
2257message WifiP2pConnectionReported {
2258    enum Type {
2259        UNSPECIFIED = 0;
2260        // fresh new connection.
2261        FRESH = 1;
2262        // reinvoke a group.
2263        REINVOKE = 2;
2264        // create a group with the current device as the group owner locally.
2265        LOCAL = 3;
2266        // create a group or join a group with config.
2267        FAST = 4;
2268    }
2269    enum FailureCode {
2270        // Failure is unknown.
2271        UNKNOWN = 0;
2272        // No failure.
2273        NONE = 1;
2274        // Timeout for current connecting request.
2275        TIMEOUT = 2;
2276        // The connecting request is canceled by the user.
2277        CANCEL = 3;
2278        // Provision discovery failure, e.g. no pin code, timeout, rejected by the peer.
2279        PROV_DISC_FAIL = 4;
2280        // Invitation failure, e.g. rejected by the peer.
2281        INVITATION_FAIL = 5;
2282        // Incoming request is rejected by the user.
2283        USER_REJECT = 6;
2284        // New connection request is issued before ending previous connecting request.
2285        NEW_CONNECTION_ATTEMPT = 7;
2286        // Group has been removed
2287        GROUP_REMOVED = 8;
2288        // Creating group failed
2289        CREATE_GROUP_FAILED = 9;
2290    }
2291    enum GroupRole {
2292        GROUP_UNKNOWN = 0;
2293        GROUP_OWNER = 1;
2294        GROUP_CLIENT = 2;
2295    }
2296    enum Band {
2297        // Unknown band/frequency
2298        BAND_UNKNOWN = 0;
2299        // any band
2300        BAND_AUTO = 1;
2301        // With 2G band
2302        BAND_2G = 2;
2303        // With 5G band
2304        BAND_5G = 3;
2305        // With 6G band
2306        BAND_6G = 4;
2307        // With a specific frequency
2308        BAND_FREQUENCY = 5;
2309    }
2310    // Type of the connection.
2311    optional Type type = 1;
2312    // Duration to connect in millis.
2313    optional int32 latency_ms= 2;
2314    // Duration to connect in step size of 200 millis.
2315    optional int32 latency_200ms= 3;
2316    // Failure code
2317    optional FailureCode failure_code = 4;
2318    // Group role. This could be unknown with connect() call when the WifiConfig doesn't have the
2319    // credential.
2320    optional GroupRole group_role = 5;
2321    // Group band preference
2322    optional Band band = 6;
2323    // Group frequency in MHz if positive. Otherwise, no frequency preference.
2324    optional int32 frequency_mhz = 7;
2325    // STA mode channel frequency. 0 means unknown.
2326    optional int32 sta_frequency_mhz = 8;
2327    // The uid of the app that initiates the connection.
2328    optional int32 uid = 9 [(is_uid) = true];
2329    // if the country code is in the world mode
2330    optional bool is_country_code_world_mode = 10;
2331    // fallback to negotiation if device receives invitation response status code "information is
2332    // currently unavailable"
2333    optional bool fallback_to_negotiation_on_invite_status_info_unavailable = 11;
2334    // The try count of connection
2335    optional int32 try_count = 12;
2336    // The Attribution tag to identify the caller
2337    optional string attribution_tag = 13;
2338}
2339
2340/**
2341 * Logged when wifi setup failure or crash reported
2342 */
2343message WifiSetupFailureCrashReported {
2344    enum Type {
2345        UNKNOWN = 0;
2346        // Wifi HAL crash
2347        HAL_CRASH = 1;
2348        // Wificond crash
2349        WIFICOND_CRASH = 2;
2350        // Supplicant crash
2351        SUPPLICANT_CRASH = 3;
2352        // hostapd crash
2353        HOSTAPD_CRASH = 4;
2354        // HAL error on WifiNative.setupInterfaceForClientMode
2355        CLIENT_FAILURE_HAL = 5;
2356        // Wificond error on WifiNative.setupInterfaceForClientMode
2357        CLIENT_FAILURE_WIFICOND = 6;
2358        // Supplicant error on WifiNative.setupInterfaceForClientMode
2359        CLIENT_FAILURE_SUPPLICANT = 7;
2360        // HAL error on WifiNative.setupInterfaceForSoftApMode
2361        SOFT_AP_FAILURE_HAL = 8;
2362        // Wificond error on WifiNative.setupInterfaceForSoftApMode
2363        SOFT_AP_FAILURE_WIFICOND = 9;
2364        // Hostapd error on WifiNative.setupInterfaceForSoftApMode
2365        SOFT_AP_FAILURE_HOSTAPD = 10;
2366        // HAL error on WifiP2pNative.setupInterface
2367        P2P_FAILURE_HAL = 11;
2368        // Supplicant error on WifiP2pNative.setupInterface
2369        P2P_FAILURE_SUPPLICANT = 12;
2370    }
2371    // Type of failure
2372    optional Type type= 1;
2373}
2374
2375
2376/*
2377 * Logs metrics on bedtime mode state changed
2378 *
2379 * Logged From:
2380 *  frameworks/opt/wear/src/com/google/android/clockwork/healthservices/BedtimeModeController.java
2381*/
2382message BedtimeModeStateChanged {
2383    enum BedTimeModeState {
2384        BEDTIME_OFF = 0;
2385        BEDTIME_ON = 1;
2386    }
2387    // Log the bedtime mode state
2388    optional BedTimeModeState bedtime_mode_state = 1;
2389    enum State {
2390        OFF = 0;
2391        ON = 1;
2392    }
2393    // Current Wifi state when bedtime mode is toggled
2394    optional State current_wifi_state = 2;
2395
2396    // Current LTE state when bedtime mode is toggled
2397    optional State current_cellular_state = 3;
2398
2399    // Current BT state when bedtime mode is toggled
2400    optional State current_bluetooth_state = 4;
2401
2402    // Current Battery level. Should be in [0, 100].
2403    optional int32 battery_level = 5;
2404}
2405
2406/**
2407 * Logs when memory stats of a process is reported.
2408 *
2409 * Logged from:
2410 *   frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
2411 */
2412message ProcessMemoryStatReported {
2413    optional int32 uid = 1 [(is_uid) = true];
2414    optional string process_name = 2;
2415    optional string package_name = 3;
2416    //TODO: remove this when validation is done
2417    optional int64 version = 9;
2418    optional int64 pss = 4;
2419    optional int64 uss = 5;
2420    optional int64 rss = 6;
2421    enum Type {
2422        ADD_PSS_INTERNAL_SINGLE = 0;
2423        ADD_PSS_INTERNAL_ALL_MEM = 1;
2424        ADD_PSS_INTERNAL_ALL_POLL = 2;
2425        ADD_PSS_EXTERNAL = 3;
2426        ADD_PSS_EXTERNAL_SLOW = 4;
2427    }
2428    optional Type type = 7;
2429    optional int64 duration_millis = 8;
2430
2431    // The types of the components this process is hosting at the moment this
2432    // snapshot is taken.
2433    // See the available types in HostingComponentType in AppProtoEnums.
2434    optional int32 current_hosting_component_types = 10;
2435
2436    // The historical types of the components this process is or was hosting
2437    // since it's born.
2438    // See the available types in HostingComponentType in AppProtoEnums.
2439    optional int32 historical_hosting_component_types = 11;
2440}
2441
2442/**
2443 * Logs that a process started, finished, crashed, or ANRed.
2444 *
2445 * Logged from:
2446 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2447 */
2448message ProcessLifeCycleStateChanged {
2449    optional int32 uid = 1 [(is_uid) = true];
2450
2451    // The process name (usually same as the app name).
2452    optional string process_name = 2;
2453
2454    // What lifecycle state the process changed to.
2455    // This enum is specific to atoms.proto.
2456    enum State {
2457        FINISHED = 0;
2458        STARTED = 1;
2459        CRASHED = 2;
2460    }
2461    optional State state = 3;
2462}
2463
2464/**
2465 * Logs when the ble scan state changes.
2466 *
2467 * Logged from:
2468 *   packages/apps/Bluetooth/src/com/android/bluetooth/le_scan/AppScanStats.java
2469 */
2470message BleScanStateChanged {
2471    repeated AttributionNode attribution_node = 1
2472            [(state_field_option).primary_field_first_uid = true];
2473
2474    enum State {
2475        OFF = 0;
2476        ON = 1;
2477        // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
2478        RESET = 2;
2479    }
2480    optional State state = 2 [
2481        (state_field_option).exclusive_state = true,
2482        (state_field_option).default_state_value = 0 /* State.OFF */,
2483        (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
2484        (state_field_option).nested = true
2485    ];
2486
2487    // Does the scan have a filter.
2488    optional bool is_filtered = 3 [(state_field_option).primary_field = true];
2489    // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
2490    optional bool is_first_match = 4 [(state_field_option).primary_field = true];
2491    // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
2492    optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
2493}
2494
2495/**
2496 * Logs reporting of a ble scan finding results.
2497 *
2498 * Logged from:
2499 *   packages/apps/Bluetooth/src/com/android/bluetooth/le_scan/AppScanStats.java
2500 */
2501// TODO: Consider also tracking per-scanner-id.
2502message BleScanResultReceived {
2503    repeated AttributionNode attribution_node = 1;
2504
2505    // Number of ble scan results returned.
2506    optional int32 num_results = 2;
2507}
2508
2509/**
2510 * Logs when a sensor state changes.
2511 *
2512 * Logged from:
2513 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2514 */
2515message SensorStateChanged {
2516    repeated AttributionNode attribution_node = 1;
2517
2518    // The id (int) of the sensor.
2519    optional int32 sensor_id = 2;
2520
2521    enum State {
2522        OFF = 0;
2523        ON = 1;
2524    }
2525    optional State state = 3;
2526}
2527
2528/**
2529 * Logs when GPS signal quality.
2530 *
2531 * Logged from:
2532 *   /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
2533 */
2534message GpsSignalQualityChanged {
2535    optional android.server.location.GpsSignalQualityEnum level = 1;
2536}
2537
2538
2539/**
2540 * Logs when a sync manager sync state changes.
2541 *
2542 * Logged from:
2543 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2544 */
2545message SyncStateChanged {
2546    repeated AttributionNode attribution_node = 1;
2547
2548    // Name of the sync (as named in the app). Can be chosen at run-time.
2549    optional string sync_name = 2;
2550
2551    enum State {
2552        OFF = 0;
2553        ON = 1;
2554    }
2555    optional State state = 3;
2556}
2557
2558/*
2559 * Deferred job stats.
2560 *
2561 * Logged from:
2562 *   frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
2563*/
2564message DeferredJobStatsReported {
2565    repeated AttributionNode attribution_node = 1;
2566
2567    // Number of jobs deferred.
2568    optional int32 num_jobs_deferred = 2;
2569
2570    // Time since the last job runs.
2571    optional int64 time_since_last_job_millis = 3;
2572}
2573
2574/**
2575 * Logs when a job scheduler job state changes.
2576 *
2577 * Logged from:
2578 *   frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
2579 *   frameworks/base/services/core/java/com/android/server/job/JobServiceContext.java
2580 *
2581 * Next tag: 57
2582 */
2583message ScheduledJobStateChanged {
2584    repeated AttributionNode attribution_node = 1;
2585
2586    // Name of the job (as named in the app)
2587    optional string job_name = 2;
2588
2589    enum State {
2590        // A job started executing (passed through the STARTED state) and has finished.
2591        FINISHED = 0;
2592        // A scheduled job has just started executing.
2593        STARTED = 1;
2594        // An app just scheduled this job to be executed at some point in the future.
2595        SCHEDULED = 2;
2596        // The job was SCHEDULED but cancelled before it started executing (so it never went
2597        // through the STARTED state).
2598        CANCELLED = 3;
2599    }
2600    optional State state = 3;
2601
2602    // The internal reason a job has stopped.
2603    // This is only applicable when the state is FINISHED.
2604    // The default value is INTERNAL_STOP_REASON_UNKNOWN.
2605    optional android.app.job.InternalStopReasonEnum internal_stop_reason = 4;
2606
2607    // The publicly returned reason onStopJob() was called.
2608    // This is only applicable when the state is FINISHED, but may be undefined if
2609    // JobService.onStopJob() was never called for the job.
2610    // The default value is STOP_REASON_UNDEFINED.
2611    optional android.app.job.StopReasonEnum public_stop_reason = 17;
2612
2613    // The standby bucket of the app that scheduled the job. These match the framework constants
2614    // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
2615    // already assigned 0.
2616    enum Bucket {
2617        UNKNOWN = -1;
2618        ACTIVE = 0;
2619        WORKING_SET = 1;
2620        FREQUENT = 2;
2621        RARE = 3;
2622        NEVER = 4;
2623        RESTRICTED = 5;
2624        EXEMPTED = 6;
2625    }
2626    optional Bucket standby_bucket = 5 [default = UNKNOWN];
2627
2628    // On T- builds, this is the job id (as assigned by the app).
2629    // On U+ builds, this is generated by the system, factoring in the job's namespace.
2630    optional int64 job_id = 6;
2631
2632    // One flag for each of the API constraints defined by JobScheduler. Does not include implicit
2633    // constraints as they are always assumed to be set.
2634    optional bool has_charging_constraint = 7;
2635    optional bool has_battery_not_low_constraint = 8;
2636    optional bool has_storage_not_low_constraint = 9;
2637    optional bool has_timing_delay_constraint = 10;
2638    optional bool has_deadline_constraint = 11;
2639    optional bool has_idle_constraint = 12;
2640    optional bool has_connectivity_constraint = 13;
2641    optional bool has_content_trigger_constraint = 14;
2642    optional bool is_prefetch = 18;
2643    optional bool is_periodic = 34;
2644    optional bool has_flex_constraint = 47;
2645
2646    // True if the app has requested this run as an expedited job.
2647    optional bool is_requested_expedited_job = 15;
2648    // True if the job is running as an expedited job. Only valid for STARTED and FINISHED states.
2649    optional bool is_running_as_expedited_job = 16;
2650
2651    // True if the app has requested this run as a user initiated job.
2652    optional bool is_requested_as_user_initiated_job = 32;
2653    // True if the job is running as a user initiated job. Only valid for STARTED/FINISHED states.
2654    optional bool is_running_as_user_initiated_job = 33;
2655
2656    // The priority set by the app (via JobInfo.Builder.setPriority()).
2657    optional int32 requested_priority = 19;
2658    // The priority JobScheduler ran the job at. Only valid for STARTED and FINISHED states.
2659    optional int32 effective_priority = 20;
2660
2661    // Number of times JobScheduler has tried to run this particular job. This value is incremented
2662    // when a job is stopped and rescheduled for various reasons (lost network, constraints no
2663    // longer satisfied, etc). For periodic jobs, this value is reset after a successful run.
2664    optional int32 num_previous_attempts = 21;
2665
2666    // The deadline that the Job has requested.
2667    // This is only valid if has_deadline_constraint is true.
2668    optional int64 deadline_ms = 22;
2669
2670    // The delay that the Job has requested.
2671    // This is only valid if has_timing_delay_constraint is true.
2672    optional int64 delay_ms = 35;
2673
2674    // True if the Job hit its deadline
2675    optional bool is_deadline_constraint_satisfied = 23;
2676
2677    optional bool is_charging_constraint_satisfied = 24;
2678
2679    optional bool is_battery_not_low_constraint_satisfied = 25;
2680
2681    optional bool is_storage_not_low_constraint_satisfied = 26;
2682
2683    optional bool is_timing_delay_constraint_satisfied = 27;
2684
2685    optional bool is_idle_constraint_satisfied = 28;
2686
2687    optional bool is_connectivity_constraint_satisfied = 29;
2688
2689    optional bool is_content_trigger_constraint_satisfied = 30;
2690
2691    optional bool is_flex_constraint_satisfied = 48;
2692
2693    // The amount of time that elapsed between the job being scheduled (state = SCHEDULED)
2694    // and it being started (state = STARTED). Persisted jobs loaded at boot are considered
2695    // to be scheduled at boot, so all values are within the current boot cycle. Periodic
2696    // and other rescheduled jobs are considered to be newly scheduled and therefore this
2697    // value reflects the time since the most recent (re)schedule.
2698    // This is only valid for the STARTED and FINISHED states.
2699    optional int64 job_start_latency_ms = 31;
2700
2701    // The amount of data the app estimated it would download.
2702    // This is only valid if has_connectivity_constraint is true.
2703    // If the job has JobWorkItems attached, this value will include the estimates from the items.
2704    optional int64 estimated_download_bytes = 36;
2705
2706    // The amount of data the app estimated it would upload.
2707    // This is only valid if has_connectivity_constraint is true.
2708    // If the job has JobWorkItems attached, this value will include the estimates from the items.
2709    optional int64 estimated_upload_bytes = 37;
2710
2711    // The number of JobWorkItems the app has attached to this job but not completed
2712    // (by calling JobParameters.completeWork()).
2713    optional int32 num_uncompleted_work_items = 38;
2714
2715    // Proc state of the UID of the logged event
2716    optional android.app.ProcessStateEnum proc_state = 39 [default = PROCESS_STATE_UNKNOWN];
2717
2718    // Hash of the namespace set via JobScheduler.forNamespace(String).
2719    optional string namespace_hash = 40;
2720
2721    // System estimated/measured bytes that the job
2722    // downloaded over its runtime. Only valid for FINISHED
2723    // state. We measure here for the SOURCE UID
2724    optional int64 system_measured_source_download_bytes = 41;
2725
2726    // System estimated/measured uploaded bytes that the job
2727    // uploaded over its runtime. Only valid for FINISHED
2728    // state. We measure here for the SOURCE UID
2729    optional int64 system_measured_source_upload_bytes = 42;
2730
2731    // System estimated/measured bytes that the job
2732    // downloaded over its runtime. Only valid for FINISHED
2733    // state. We measure here for the CALLING UID
2734    optional int64 system_measured_calling_download_bytes = 43;
2735
2736    // System estimated/measured uploaded bytes that the job
2737    // uploaded over its runtime. Only valid for FINISHED
2738    // state. We measure here for the CALLING UID
2739    optional int64 system_measured_calling_upload_bytes = 44;
2740
2741    // Interval for the job to recur when it is set as periodic.
2742    // Valid only if is_periodic is true
2743    optional int64 periodic_job_interval_ms = 45;
2744
2745    // Flex interval for the periodic job. This value is set via the second
2746    // parameter of JobInfo.Builder.setPeriodic(long, long). The job can
2747    // execute at any time in a window flex length at the end of the period.
2748    // Valid only if is_periodic is true
2749    optional int64 periodic_job_flex_interval_ms = 46;
2750
2751    // Whether transport preference logic can be applied to this job with flex policy
2752    optional bool can_apply_transport_affinities = 49;
2753
2754    // The number of flexible job constraints being applied to the job.
2755    // num_required_flex_constraints = num_applied_flex_constraints - num_dropped_flex_constraints.
2756    optional int32 num_applied_flex_constraints = 50;
2757
2758    // The number of required flexible job constraints that have been dropped for this job.
2759    // num_required_flex_constraints = num_applied_flex_constraints - num_dropped_flex_constraints.
2760    optional int32 num_dropped_flex_constraints = 51;
2761
2762    // Trace tag set via JobInfo.Builder.setTraceTag(). Basic PII filtering has been applied,
2763    // but further filtering should be done by clients.
2764    optional string filtered_trace_tag = 52;
2765
2766    // Set of tags set by the app to characterize the work being done. Set via
2767    // JobInfo.Builder.addDebugTag(). Basic PII filtering has been applied,
2768    // but further filtering should be done by clients.
2769    repeated string filtered_debug_tags = 53;
2770
2771    // Number of reschedules due to job being abandoned.
2772    optional int32 num_reschedules_due_to_abandonment = 54;
2773
2774    // Back off policy applied to the job that gets rescheduled.
2775    // This is defined in JobInfo.java (See JobInfo.BACKOFF_POLICY_*).
2776    enum BackOffPolicyType {
2777        UNKNOWN_POLICY = 0;
2778        LINEAR = 1;
2779        EXPONENTIAL = 2;
2780    }
2781    // Back off policy applied to the job that gets rescheduled.
2782    optional BackOffPolicyType back_off_policy_type  = 55;
2783    // Is back off policy restriction applied due to abandoned job.
2784    optional bool is_back_off_policy_restriction_applied = 56;
2785}
2786
2787/**
2788 * Logs when the audio state changes.
2789 *
2790 * Logged from:
2791 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2792 */
2793message AudioStateChanged {
2794    repeated AttributionNode attribution_node = 1;
2795
2796    enum State {
2797        OFF = 0;
2798        ON = 1;
2799        // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
2800        RESET = 2;
2801    }
2802    optional State state = 2;
2803}
2804
2805/**
2806 * Logs when the video codec state changes.
2807 *
2808 * Logged from:
2809 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2810 */
2811message MediaCodecStateChanged {
2812    repeated AttributionNode attribution_node = 1;
2813
2814    enum State {
2815        OFF = 0;
2816        ON = 1;
2817        // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
2818        RESET = 2;
2819    }
2820    optional State state = 2;
2821}
2822
2823/**
2824 * Logs when the flashlight state changes.
2825 *
2826 * Logged from:
2827 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2828 */
2829message FlashlightStateChanged {
2830    repeated AttributionNode attribution_node = 1;
2831
2832    enum State {
2833        OFF = 0;
2834        ON = 1;
2835        // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
2836        RESET = 2;
2837    }
2838    optional State state = 2;
2839}
2840
2841/**
2842 * Logs when the camera state changes.
2843 *
2844 * Logged from:
2845 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2846 */
2847message CameraStateChanged {
2848    repeated AttributionNode attribution_node = 1;
2849
2850    enum State {
2851        OFF = 0;
2852        ON = 1;
2853        // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
2854        RESET = 2;
2855    }
2856    optional State state = 2;
2857}
2858
2859/**
2860 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
2861 *
2862 * Logged from:
2863 *   TODO
2864 */
2865message WakelockStateChanged {
2866    repeated AttributionNode attribution_node = 1
2867            [(state_field_option).primary_field_first_uid = true];
2868
2869    // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
2870    // From frameworks/proto_logging/stats/enums/os/enums.proto.
2871    optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
2872
2873    // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
2874    optional string tag = 3 [(state_field_option).primary_field = true];
2875
2876    enum State {
2877        RELEASE = 0;
2878        ACQUIRE = 1;
2879        CHANGE_RELEASE = 2;
2880        CHANGE_ACQUIRE = 3;
2881    }
2882    optional State state = 4 [
2883        (state_field_option).exclusive_state = true,
2884        (state_field_option).default_state_value = 0,
2885        (state_field_option).nested = true
2886    ];
2887
2888    optional android.app.ProcessStateEnum process_state = 5 [default = PROCESS_STATE_UNKNOWN];
2889}
2890
2891/**
2892 * Logs when a partial wakelock is considered 'long' (over 1 min).
2893 *
2894 * Logged from:
2895 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2896 */
2897message LongPartialWakelockStateChanged {
2898    repeated AttributionNode attribution_node = 1;
2899
2900    // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
2901    optional string tag = 2;
2902
2903    // TODO: I have no idea what this is.
2904    optional string history_tag = 3;
2905
2906    enum State {
2907        OFF = 0;
2908        ON = 1;
2909    }
2910    optional State state = 4;
2911}
2912
2913/**
2914 * Logs when the device is interactive, according to the PowerManager Notifier.
2915 *
2916 * Logged from:
2917 *   frameworks/base/services/core/java/com/android/server/power/Notifier.java
2918 */
2919message InteractiveStateChanged {
2920    enum State {
2921        OFF = 0;
2922        ON = 1;
2923    }
2924    optional State state = 1
2925            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2926}
2927
2928/**
2929 * Logs Battery Saver state change.
2930 *
2931 * Logged from:
2932 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2933 */
2934message BatterySaverModeStateChanged {
2935    enum State {
2936        OFF = 0;
2937        ON = 1;
2938    }
2939    optional State state = 1
2940            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2941}
2942
2943/**
2944 * Logs Doze mode state change.
2945 *
2946 * Logged from:
2947 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2948 */
2949message DeviceIdleModeStateChanged {
2950    optional android.server.DeviceIdleModeEnum state = 1
2951            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2952}
2953
2954
2955/**
2956 * Logs state change of Doze mode including maintenance windows.
2957 *
2958 * Logged from:
2959 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2960 */
2961message DeviceIdlingModeStateChanged {
2962    optional android.server.DeviceIdleModeEnum state = 1
2963            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2964}
2965
2966/**
2967 * Logs screen brightness level.
2968 *
2969 * Logged from:
2970 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2971 */
2972message ScreenBrightnessChanged {
2973    // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
2974    optional int32 level = 1;
2975}
2976
2977/**
2978 * Logs battery level (percent full, from 0 to 100).
2979 *
2980 * Logged from:
2981 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2982 */
2983message BatteryLevelChanged {
2984    // Battery level. Should be in [0, 100].
2985    optional int32 battery_level = 1;
2986}
2987
2988/**
2989 * Logs change in charging status of the device.
2990 *
2991 * Logged from:
2992 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2993 */
2994message ChargingStateChanged {
2995    // State of the battery, from frameworks/proto_logging/stats/enums/os/enums.proto.
2996    optional android.os.BatteryStatusEnum state = 1
2997            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2998}
2999
3000/**
3001 * Logs whether the device is plugged in, and what power source it is using.
3002 *
3003 * Logged from:
3004 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3005 */
3006message PluggedStateChanged {
3007    // Whether the device is plugged in, from frameworks/proto_logging/stats/enums/os/enums.proto.
3008    optional android.os.BatteryPluggedStateEnum state = 1
3009            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
3010}
3011
3012/**
3013 * Logs whether the device is docked, and what type of dock it is using.
3014 *
3015 * Logged from:
3016 *   services/core/java/com/android/server/power/PowerManagerService.java
3017 */
3018message DockStateChanged {
3019    // The device dock state, from frameworks/proto_logging/stats/enums/server/enums.proto.
3020    optional android.server.DockStateEnum state = 1
3021    [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
3022}
3023
3024/**
3025 * Logs when an app's wakeup alarm fires.
3026 *
3027 * Logged from:
3028 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3029 */
3030message WakeupAlarmOccurred {
3031    repeated AttributionNode attribution_node = 1;
3032
3033    // Name of the wakeup alarm.
3034    optional string tag = 2;
3035
3036    // Name of source package (for historical reasons, since BatteryStats tracked it).
3037    optional string package_name = 3;
3038
3039    // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
3040    optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
3041}
3042
3043/**
3044 * Logs when an an app causes the mobile radio to change state.
3045 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
3046 *
3047 * Logged from:
3048 *   frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
3049 */
3050message MobileRadioPowerStateChanged {
3051    repeated AttributionNode attribution_node = 1;
3052
3053    // Power state, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
3054    optional android.telephony.DataConnectionPowerStateEnum state = 2;
3055}
3056
3057/**
3058 * Logs when an an app causes the wifi radio to change state.
3059 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
3060 *
3061 * Logged from:
3062 *   frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
3063 */
3064message WifiRadioPowerStateChanged {
3065    repeated AttributionNode attribution_node = 1;
3066
3067    // Power state, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
3068    optional android.telephony.DataConnectionPowerStateEnum state = 2;
3069}
3070
3071/**
3072 * Logs kernel wakeup reasons and aborts.
3073 *
3074 * Logged from:
3075 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3076 */
3077message KernelWakeupReported {
3078    // Name of the kernel wakeup reason (or abort).
3079    optional string wakeup_reason_name = 1;
3080
3081    // Duration (in microseconds) for the wake-up interrupt to be serviced.
3082    optional int64 duration_micros = 2;
3083
3084    // The elapsed time when this wake-up was reported.
3085    optional int64 elapsed_millis = 3;
3086}
3087
3088/**
3089 * Logs when Wifi is toggled on/off.
3090 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
3091 *
3092 * Logged from:
3093 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
3094 */
3095message WifiEnabledStateChanged {
3096    enum State {
3097        OFF = 0;
3098        ON = 1;
3099    }
3100    optional State state = 1;
3101}
3102
3103/**
3104 * This atom is deprecated starting in R.
3105 *
3106 * Logs when an app causes Wifi to run. In this context, 'to run' means to use Wifi Client Mode.
3107 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
3108 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
3109 *
3110 * Logged from:
3111 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
3112 */
3113message WifiRunningStateChanged {
3114    repeated AttributionNode attribution_node = 1;
3115
3116    enum State {
3117        OFF = 0;
3118        ON = 1;
3119    }
3120    optional State state = 2;
3121}
3122
3123/**
3124 * Logs wifi locks held by an app.
3125 *
3126 * Logged from:
3127 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3128 */
3129message WifiLockStateChanged {
3130    repeated AttributionNode attribution_node = 1;
3131
3132    enum State {
3133        OFF = 0;
3134        ON = 1;
3135    }
3136    optional State state = 2;
3137
3138    // WifiLock type, from frameworks/proto_logging/stats/enums/wifi/enums.proto.
3139    optional android.net.wifi.WifiModeEnum mode = 3;
3140}
3141
3142/**
3143 * Logs wifi signal strength changes.
3144 *
3145 * Logged from:
3146 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
3147 */
3148message WifiSignalStrengthChanged {
3149    // Signal strength, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
3150    optional android.telephony.SignalStrengthEnum signal_strength = 1
3151            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
3152}
3153
3154/**
3155 * Logs wifi scans performed by an app.
3156 *
3157 * Logged from:
3158 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
3159 */
3160message WifiScanStateChanged {
3161    repeated AttributionNode attribution_node = 1;
3162
3163    enum State {
3164        OFF = 0;
3165        ON = 1;
3166    }
3167    optional State state = 2;
3168}
3169
3170/**
3171 * Logs wifi multicast locks held by an app
3172 *
3173 * Logged from:
3174 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
3175 */
3176message WifiMulticastLockStateChanged {
3177    repeated AttributionNode attribution_node = 1;
3178
3179    enum State {
3180        OFF = 0;
3181        ON = 1;
3182    }
3183    optional State state = 2;
3184
3185    optional string tag = 3;
3186}
3187
3188/**
3189 * Logs shutdown reason and duration on next boot.
3190 *
3191 * Logged from:
3192 *   frameworks/base/core/java/com/android/server/BootReceiver.java
3193 */
3194message ShutdownSequenceReported {
3195    // True if shutdown is for a reboot. Default: false if we do not know.
3196    optional bool reboot = 1;
3197
3198    // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
3199    optional string reason = 2;
3200
3201    // Beginning of shutdown time in ms using wall clock time since unix epoch.
3202    // Default: 0 if no start time received.
3203    optional int64 start_time_millis = 3;
3204
3205    // Duration of shutdown in ms. Default: 0 if no duration received.
3206    optional int64 duration_millis = 4;
3207}
3208
3209
3210/**
3211 * Logs boot reason and duration.
3212 *
3213 * Logged from:
3214 *   system/core/bootstat/bootstat.cpp
3215 */
3216message BootSequenceReported {
3217    // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
3218    // Default: "<EMPTY>" if not available.
3219    optional string bootloader_reason = 1;
3220
3221    // Reason for system boot. Eg. bootloader, reboot,userrequested
3222    // Default: "<EMPTY>" if not available.
3223    optional string system_reason = 2;
3224
3225    // End of boot time in ms from unix epoch using system wall clock.
3226    optional int64 end_time_millis = 3;
3227
3228    // Total boot duration in ms.
3229    optional int64 total_duration_millis = 4;
3230
3231    // Bootloader duration in ms.
3232    optional int64 bootloader_duration_millis = 5;
3233
3234    // Time since last boot in ms. Default: 0 if not available.
3235    optional int64 time_since_last_boot = 6;
3236}
3237
3238
3239/**
3240 * Logs call state and disconnect cause (if applicable).
3241 *
3242 * Logged from:
3243 *   packages/services/Telecomm/src/com/android/server/telecom/Call.java
3244 */
3245message CallStateChanged {
3246    // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
3247    // From frameworks/proto_logging/stats/enums/telecomm/enums.proto.
3248    optional android.telecom.CallStateEnum call_state = 1;
3249
3250    // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
3251    // This value is only applicable when the call_state is DISCONNECTED, and
3252    // should always be UNKNOWN if the call_state is not DISCONNECTED.
3253    // From frameworks/proto_logging/stats/enums/telecomm/enums.proto.
3254    optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
3255
3256    // True if the call is self-managed, which are apps that use the
3257    // telecom infrastructure to make their own calls.
3258    optional bool self_managed = 3;
3259
3260    // True if call is external. External calls are calls on connected Wear
3261    // devices but show up in Telecom so the user can pull them onto the device.
3262    optional bool external_call = 4;
3263
3264    // True if call is emergency call.
3265    optional bool emergency_call = 5;
3266
3267    // UID of the package that has initiated the call.
3268    optional int32 uid = 6 [(is_uid) = true];
3269
3270    // Elapsed time between CALL_STATE_ACTIVE to CALL_STATE_DISCONNECTED.
3271    // This value is only applicable when the call_state is DISCONNECTED,
3272    // 0 otherwise.
3273    optional int32 duration_seconds = 7;
3274
3275    // Number of all existing calls when this call is created.
3276    optional int32 existing_call_count = 8;
3277
3278    // Number of existing calls held by this call.
3279    // This value is set after a call is actually held, 0 otherwise.
3280    optional int32 held_call_count = 9;
3281
3282    // The reason the call hasn't been started by device condition.
3283    // This value is only applicable when the call_state is DISCONNECTED,
3284    // and should always be NONE if the call_state is not DISCONNECTED.
3285    // From frameworks/base/core/proto/android/telecomm/enums.proto.
3286    optional android.telecom.CallFailureCauseEnum start_fail_cause = 10;
3287}
3288
3289/*
3290 * Logs changes to the configuration of the device. The configuration is defined
3291 * in frameworks/base/core/java/android/content/res/Configuration.java
3292 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
3293 * Please go there to interpret the possible values each field can be.
3294 *
3295 * Logged from:
3296 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3297 */
3298message ResourceConfigurationChanged {
3299    // Bit mask of color capabilities of the screen.
3300    // Contains information about the color gamut and hdr mode of the screen.
3301    // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
3302    optional int32 color_mode = 1;
3303
3304    // The target screen density being rendered to.
3305    // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
3306    optional int32 density_dpi = 2;
3307
3308    // Current user preference for the scaling factor for fonts,
3309    // relative to the base density scaling.
3310    // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
3311    optional float font_scale = 3;
3312
3313    // Flag indicating whether the hard keyboard is hidden.
3314    // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
3315    optional int32 hard_keyboard_hidden = 4;
3316
3317    // The type of keyboard attached to the device.
3318    // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
3319    optional int32 keyboard = 5;
3320
3321    // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
3322    // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
3323    optional int32 keyboard_hidden = 6;
3324
3325    // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
3326    // 0 if undefined.
3327    // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
3328    optional int32 mcc = 7;
3329
3330    // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
3331    // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
3332    // MNC_ZERO symbol defined in Configuration.java.
3333    // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
3334    optional int32 mnc = 8;
3335
3336    // The kind of navigation available on the device.
3337    // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
3338    optional int32 navigation = 9;
3339
3340    // Flag indicating whether the navigation is available.
3341    // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
3342    optional int32 navigation_hidden = 10;
3343
3344    // Overall orientation of the screen.
3345    // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
3346    optional int32 orientation = 11;
3347
3348    // The current height of the available screen space, in dp units.
3349    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
3350    optional int32 screen_height_dp = 12;
3351
3352    // Bit mask of overall layout of the screen.
3353    // Contains information about screen size, whether the screen is wider/taller
3354    // than normal, whether the screen layout is right-tl-left or left-to-right,
3355    // and whether the screen has a rounded shape.
3356    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
3357    optional int32 screen_layout = 13;
3358
3359    // Current width of the available screen space, in dp units.
3360    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
3361    optional int32 screen_width_dp = 14;
3362
3363    // The smallest screen size an application will see in normal operation.
3364    // This is the smallest value of both screenWidthDp and screenHeightDp
3365    // in portrait and landscape.
3366    // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
3367    optional int32 smallest_screen_width_dp = 15;
3368
3369    // The type of touch screen attached to the device.
3370    // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
3371    optional int32 touchscreen = 16;
3372
3373    // Bit mask of the ui mode.
3374    // Contains information about the overall ui mode of the device.
3375    // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
3376    // Also contains information about whether the device is in night mode.
3377    // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
3378    optional int32 ui_mode = 17;
3379}
3380
3381
3382/**
3383 * Logs changes in the connection state of the mobile radio.
3384 *
3385 * Logged from:
3386 *    frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
3387 */
3388message MobileConnectionStateChanged {
3389    // States are from the state machine DataConnection.java.
3390    enum State {
3391        UNKNOWN = 0;
3392        // The connection is inactive, or disconnected.
3393        INACTIVE = 1;
3394        // The connection is being activated, or connecting.
3395        ACTIVATING = 2;
3396        // The connection is active, or connected.
3397        ACTIVE = 3;
3398        // The connection is disconnecting.
3399        DISCONNECTING = 4;
3400        // The connection is disconnecting after creating a connection.
3401        DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
3402    }
3403    optional State state  = 1;
3404    // For multi-sim phones, this distinguishes between the sim cards.
3405    optional int32 sim_slot_index = 2;
3406    // Used to identify the connection. Starts at 0 and increments by 1 for
3407    // every new network created. Resets whenever the device reboots.
3408    optional int32 data_connection_id = 3;
3409    // A bitmask for the capabilities of this connection.
3410    // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
3411    // Default value (if we have no information): 0
3412    optional int64 capabilities = 4;
3413    // If this connection has internet.
3414    // This just checks if the DEFAULT bit of capabilities is set.
3415    optional bool has_internet = 5;
3416}
3417
3418/**
3419 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
3420 *
3421 * Logged from:
3422 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
3423 */
3424message MobileRadioTechnologyChanged {
3425    optional android.telephony.NetworkTypeEnum state = 1;
3426    // For multi-sim phones, this distinguishes between the sim cards.
3427    optional int32 sim_slot_index = 2;
3428}
3429
3430/**
3431 * Logs the VID and PID of any connected USB devices.
3432 *
3433 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
3434 *
3435 * Logged by Vendor.
3436 */
3437message UsbDeviceAttached {
3438    optional int32 vid = 1;
3439    optional int32 pid = 2;
3440    optional bool has_audio = 3;
3441    optional bool has_hid = 4;
3442    optional bool has_storage = 5;
3443    enum State {
3444        STATE_DISCONNECTED = 0;
3445        STATE_CONNECTED = 1;
3446    }
3447    optional State state = 6;
3448    optional int64 last_connect_duration_millis = 7;
3449}
3450
3451
3452/**
3453 * Logs when Bluetooth is enabled and disabled.
3454 *
3455 * Logged from:
3456 *   services/core/java/com/android/server/BluetoothManagerService.java
3457 */
3458message BluetoothEnabledStateChanged {
3459    repeated AttributionNode attribution_node = 1;
3460    // Whether or not bluetooth is enabled on the device.
3461    enum State {
3462        UNKNOWN = 0;
3463        ENABLED = 1;
3464        DISABLED = 2;
3465    }
3466    optional State state = 2;
3467    // The reason for being enabled/disabled.
3468    // Eg. Airplane mode, crash, application request.
3469    optional android.bluetooth.EnableDisableReasonEnum reason = 3;
3470    // If the reason is an application request, this will be the package name.
3471    optional string pkg_name = 4;
3472    // Previous state. Default: UNKNOWN if there is no previous state.
3473    optional State previous_state = 5;
3474    // Timedelta in milliseconds since the last state changed.
3475    // Default: 0 if there is no previous state.
3476    optional int64 time_since_last_changed_millis = 6;
3477}
3478
3479/**
3480 * Logs when profiles on a Bluetooth device connects and disconnects.
3481 *
3482 * Logged from:
3483 *    packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
3484 *
3485 * Next Tag: 6
3486 */
3487message BluetoothConnectionStateChanged {
3488    // The state of the connection.
3489    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
3490    optional android.bluetooth.ConnectionStateEnum state = 1;
3491    // An identifier that can be used to match connect and disconnect events.
3492    // Currently is last two bytes of a hash of a device level ID and
3493    // the mac address of the bluetooth device that is connected.
3494    // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
3495    optional int32 obfuscated_id = 2 [deprecated = true];
3496    // The profile that is connected. Eg. GATT, A2DP, HEADSET.
3497    // From android.bluetooth.BluetoothAdapter.java
3498    // Default: 0 when not used
3499    optional int32 bt_profile = 3;
3500    // An identifier that can be used to match events for this device.
3501    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3502    // Salt: Randomly generated 256 bit value
3503    // Hash algorithm: HMAC-SHA256
3504    // Size: 32 byte
3505    // Default: null or empty if the device identifier is not known
3506    optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
3507    // An identifier that can be used to match events for this device.
3508    // The incremental identifier is locally generated and guaranteed not derived
3509    // from any globally unique hardware id.
3510    // For paired devices, it stays consistent between Bluetooth toggling for the
3511    // same remote device.
3512    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3513    // session for the same remote device.
3514    // Default: 0 if the device's metric id is unknown.
3515    optional int32 metric_id = 5;
3516    // An index to group connection events by session. It's a counter generated by
3517    // each profile. e.g. Gatt server generate such id to identify Gatt apps
3518    optional int32 session_index = 6;
3519    // An identifier that indicates the connection failure reason
3520    optional int32 connection_reason = 7;
3521}
3522
3523/**
3524 * Logs when a Bluetooth device connects and disconnects over ACL
3525 *
3526 * Logged from:
3527 *    packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
3528 *
3529 * Next Tag: 4
3530 */
3531message BluetoothAclConnectionStateChanged {
3532    // An identifier that can be used to match events for this device.
3533    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3534    // Salt: Randomly generated 256 bit value
3535    // Hash algorithm: HMAC-SHA256
3536    // Size: 32 byte
3537    // Default: null or empty if the device identifier is not known
3538    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3539    // The state of the connection.
3540    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
3541    optional android.bluetooth.ConnectionStateEnum state = 2;
3542    // An identifier that can be used to match events for this device.
3543    // The incremental identifier is locally generated and guaranteed not derived
3544    // from any globally unique hardware id.
3545    // For paired devices, it stays consistent between Bluetooth toggling for the
3546    // same remote device.
3547    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3548    // session for the same remote device.
3549    // Default: 0 if the device's metric id is unknown.
3550    optional int32 metric_id = 3;
3551    // Used transport of this event.
3552    optional android.bluetooth.TransportTypeEnum transport = 4;
3553}
3554
3555/**
3556 * Logs when a Bluetooth device connects and disconnects over SCO
3557 *
3558 * Logged from:
3559 *    packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
3560 *    packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
3561 *
3562 * Next Tag: 5
3563 */
3564message BluetoothScoConnectionStateChanged {
3565    // An identifier that can be used to match events for this device.
3566    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3567    // Salt: Randomly generated 256 bit value
3568    // Hash algorithm: HMAC-SHA256
3569    // Size: 32 byte
3570    // Default: null or empty if the device identifier is not known
3571    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3572    // The state of the connection.
3573    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
3574    optional android.bluetooth.ConnectionStateEnum state = 2;
3575    // Codec used for this SCO connection
3576    // Default: UNKNOWN
3577    optional android.bluetooth.hfp.ScoCodec codec = 3;
3578    // An identifier that can be used to match events for this device.
3579    // The incremental identifier is locally generated and guaranteed not derived
3580    // from any globally unique hardware id.
3581    // For paired devices, it stays consistent between Bluetooth toggling for the
3582    // same remote device.
3583    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3584    // session for the same remote device.
3585    // Default: 0 if the device's metric id is unknown.
3586    optional int32 metric_id = 4;
3587}
3588
3589/**
3590 * Logged when active device of a profile changes
3591 *
3592 * Logged from:
3593 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
3594 *     packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
3595 *     packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
3596 */
3597message BluetoothActiveDeviceChanged {
3598    // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
3599    // From android.bluetooth.BluetoothProfile
3600    optional int32 bt_profile = 1;
3601    // An identifier that can be used to match events for this new active device.
3602    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3603    // Salt: Randomly generated 256 bit value
3604    // Hash algorithm: HMAC-SHA256
3605    // Size: 32 byte
3606    // Default: null or empty if there is no active device for this profile
3607    optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
3608    // An identifier that can be used to match events for this device.
3609    // The incremental identifier is locally generated and guaranteed not derived
3610    // from any globally unique hardware id.
3611    // For paired devices, it stays consistent between Bluetooth toggling for the
3612    // same remote device.
3613    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3614    // session for the same remote device.
3615    // Default: 0 if the device's metric id is unknown.
3616    optional int32 metric_id = 3;
3617}
3618
3619// Logs when there is an event affecting Bluetooth device's link layer connection.
3620// - This event is triggered when there is a related HCI command or event
3621// - Users of this metrics can deduce Bluetooth device's connection state from these events
3622// - HCI commands are logged before the command is sent, after receiving command status, and after
3623//   receiving command complete
3624// - HCI events are logged when they arrive
3625//
3626// Low level log from system/bt
3627//
3628// Bluetooth classic commands:
3629// - CMD_CREATE_CONNECTION
3630// - CMD_DISCONNECT
3631// - CMD_CREATE_CONNECTION_CANCEL
3632// - CMD_ACCEPT_CONNECTION_REQUEST
3633// - CMD_REJECT_CONNECTION_REQUEST
3634// - CMD_SETUP_ESCO_CONNECTION
3635// - CMD_ACCEPT_ESCO_CONNECTION
3636// - CMD_REJECT_ESCO_CONNECTION
3637// - CMD_ENH_SETUP_ESCO_CONNECTION
3638// - CMD_ENH_ACCEPT_ESCO_CONNECTION
3639//
3640// Bluetooth low energy commands:
3641// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
3642// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
3643// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
3644// - CMD_BLE_CLEAR_WHITE_LIST
3645// - CMD_BLE_ADD_WHITE_LIST
3646// - CMD_BLE_REMOVE_WHITE_LIST
3647//
3648// Bluetooth classic events:
3649// - EVT_CONNECTION_COMP
3650// - EVT_CONNECTION_REQUEST
3651// - EVT_DISCONNECTION_COMP
3652// - EVT_ESCO_CONNECTION_COMP
3653// - EVT_ESCO_CONNECTION_CHANGED
3654//
3655// Bluetooth low energy meta events:
3656// - BLE_EVT_CONN_COMPLETE_EVT
3657// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
3658//
3659// Next tag: 10
3660message BluetoothLinkLayerConnectionEvent {
3661    // An identifier that can be used to match events for this device.
3662    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3663    // Salt: Randomly generated 256 bit value
3664    // Hash algorithm: HMAC-SHA256
3665    // Size: 32 byte
3666    // Default: null or empty if the device identifier is not known
3667    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3668    // Connection handle of this connection if available
3669    // Range: 0x0000 - 0x0EFF (12 bits)
3670    // Default: 0xFFFF if the handle is unknown
3671    optional int32 connection_handle = 2;
3672    // Direction of the link
3673    // Default: DIRECTION_UNKNOWN
3674    optional android.bluetooth.DirectionEnum direction = 3;
3675    // Type of this link
3676    // Default: LINK_TYPE_UNKNOWN
3677    optional android.bluetooth.LinkTypeEnum type = 4;
3678
3679    // Reason metadata for this link layer connection event, rules for interpretation:
3680    // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
3681    //    EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
3682    // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
3683    //    set and valid, ignore hci_ble_event
3684
3685    // HCI command associated with this event
3686    // Default: CMD_UNKNOWN
3687    optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
3688    // HCI event associated with this event
3689    // Default: EVT_UNKNOWN
3690    optional android.bluetooth.hci.EventEnum hci_event = 6;
3691    // HCI BLE meta event associated with this event
3692    // Default: BLE_EVT_UNKNOWN
3693    optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
3694    // HCI command status code if this is triggerred by hci_cmd
3695    // Default: STATUS_UNKNOWN
3696    optional android.bluetooth.hci.StatusEnum cmd_status = 8;
3697    // HCI reason code associated with this event
3698    // Default: STATUS_UNKNOWN
3699    optional android.bluetooth.hci.StatusEnum reason_code = 9;
3700    // An identifier that can be used to match events for this device.
3701    // The incremental identifier is locally generated and guaranteed not derived
3702    // from any globally unique hardware id.
3703    // For paired devices, it stays consistent between Bluetooth toggling for the
3704    // same remote device.
3705    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3706    // session for the same remote device.
3707    // Default: 0 if the device's metric id is unknown.
3708    optional int32 metric_id = 10;
3709}
3710
3711/**
3712 * Logs when a module is rolled back by Watchdog.
3713 *
3714 * Logged from: Rollback Manager
3715 */
3716message WatchdogRollbackOccurred {
3717    enum RollbackType {
3718        UNKNOWN = 0;
3719        ROLLBACK_INITIATE = 1;
3720        ROLLBACK_SUCCESS = 2;
3721        ROLLBACK_FAILURE = 3;
3722        ROLLBACK_BOOT_TRIGGERED = 4;
3723    }
3724    optional RollbackType rollback_type = 1;
3725
3726    optional string package_name = 2;
3727
3728    optional int32 package_version_code = 3;
3729
3730    enum RollbackReasonType {
3731        REASON_UNKNOWN = 0;
3732        REASON_NATIVE_CRASH = 1;
3733        REASON_EXPLICIT_HEALTH_CHECK = 2;
3734        REASON_APP_CRASH = 3;
3735        REASON_APP_NOT_RESPONDING = 4;
3736        REASON_NATIVE_CRASH_DURING_BOOT = 5;
3737        REASON_NETWORK_RELATED_CRASH = 6;
3738        REASON_BOOT_LOOPING = 7;
3739    }
3740    optional RollbackReasonType rollback_reason = 4;
3741
3742    // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
3743    // is initiated. Empty if the package is unknown.
3744    optional string failing_package_name = 5;
3745
3746    optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
3747}
3748
3749/**
3750 * Logs when there is a change in Bluetooth A2DP playback state
3751 *
3752 * Logged from:
3753 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
3754 */
3755message BluetoothA2dpPlaybackStateChanged {
3756    // An identifier that can be used to match events for this device.
3757    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3758    // Salt: Randomly generated 256 bit value
3759    // Hash algorithm: HMAC-SHA256
3760    // Size: 32 byte
3761    // Default: null or empty if the device identifier is not known
3762    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3763    // Current playback state
3764    // Default: PLAYBACK_STATE_UNKNOWN
3765    optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
3766    // Current audio coding mode
3767    // Default: AUDIO_CODING_MODE_UNKNOWN
3768    optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
3769    // An identifier that can be used to match events for this device.
3770    // The incremental identifier is locally generated and guaranteed not derived
3771    // from any globally unique hardware id.
3772    // For paired devices, it stays consistent between Bluetooth toggling for the
3773    // same remote device.
3774    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3775    // session for the same remote device.
3776    // Default: 0 if the device's metric id is unknown.
3777    optional int32 metric_id = 4;
3778}
3779
3780/**
3781 * Logs when there is a change in A2DP codec config for a particular remote device
3782 *
3783 * Logged from:
3784 *     frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
3785 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
3786 */
3787message BluetoothA2dpCodecConfigChanged {
3788    // An identifier that can be used to match events for this device.
3789    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3790    // Salt: Randomly generated 256 bit value
3791    // Hash algorithm: HMAC-SHA256
3792    // Size: 32 byte
3793    // Default: null or empty if the device identifier is not known
3794    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3795    // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
3796    // Default SOURCE_CODEC_TYPE_INVALID
3797    optional int32 codec_type = 2;
3798    // Codec priroity, the higher the more preferred, -1 for disabled
3799    // Default: CODEC_PRIORITY_DEFAULT
3800    optional int32 codec_priority = 3;
3801    // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
3802    // Default: SAMPLE_RATE_NONE
3803    optional int32 sample_rate = 4;
3804    // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
3805    // Default: BITS_PER_SAMPLE_NONE
3806    optional int32 bits_per_sample = 5;
3807    // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
3808    // Default: CHANNEL_MODE_NONE
3809    optional int32 channel_mode = 6;
3810    // Codec specific values
3811    // Default 0
3812    optional int64 codec_specific_1 = 7;
3813    optional int64 codec_specific_2 = 8;
3814    optional int64 codec_specific_3 = 9;
3815    optional int64 codec_specific_4 = 10;
3816    // An identifier that can be used to match events for this device.
3817    // The incremental identifier is locally generated and guaranteed not derived
3818    // from any globally unique hardware id.
3819    // For paired devices, it stays consistent between Bluetooth toggling for the
3820    // same remote device.
3821    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3822    // session for the same remote device.
3823    // Default: 0 if the device's metric id is unknown.
3824    optional int32 metric_id = 11;
3825}
3826
3827/**
3828 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
3829 * Each codec's capability is logged separately due to statsd restriction
3830 *
3831 * Logged from:
3832 *     frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
3833 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
3834 */
3835message BluetoothA2dpCodecCapabilityChanged {
3836    // An identifier that can be used to match events for this device.
3837    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3838    // Salt: Randomly generated 256 bit value
3839    // Hash algorithm: HMAC-SHA256
3840    // Size: 32 byte
3841    // Default: null or empty if the device identifier is not known
3842    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3843    // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
3844    // Default SOURCE_CODEC_TYPE_INVALID
3845    optional int32 codec_type = 2;
3846    // Codec priroity, the higher the more preferred, -1 for disabled
3847    // Default: CODEC_PRIORITY_DEFAULT
3848    optional int32 codec_priority = 3;
3849    // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
3850    // in BluetoothCodecConfig
3851    // Default: empty and SAMPLE_RATE_NONE for individual item
3852    optional int32 sample_rate = 4;
3853    // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
3854    // in BluetoothCodecConfig
3855    // Default: empty and BITS_PER_SAMPLE_NONE for individual item
3856    optional int32 bits_per_sample = 5;
3857    // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
3858    // BluetoothCodecConfig
3859    // Default: empty and CHANNEL_MODE_NONE for individual item
3860    optional int32 channel_mode = 6;
3861    // Codec specific values
3862    // Default 0
3863    optional int64 codec_specific_1 = 7;
3864    optional int64 codec_specific_2 = 8;
3865    optional int64 codec_specific_3 = 9;
3866    optional int64 codec_specific_4 = 10;
3867    // An identifier that can be used to match events for this device.
3868    // The incremental identifier is locally generated and guaranteed not derived
3869    // from any globally unique hardware id.
3870    // For paired devices, it stays consistent between Bluetooth toggling for the
3871    // same remote device.
3872    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3873    // session for the same remote device.
3874    // Default: 0 if the device's metric id is unknown.
3875    optional int32 metric_id = 11;
3876}
3877
3878/**
3879 * Logs when A2DP failed to read from PCM source.
3880 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
3881 *
3882 * Logged from:
3883 *     system/bt
3884 */
3885message BluetoothA2dpAudioUnderrunReported {
3886    // An identifier that can be used to match events for this device.
3887    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3888    // Salt: Randomly generated 256 bit value
3889    // Hash algorithm: HMAC-SHA256
3890    // Size: 32 byte
3891    // Default: null or empty if the device identifier is not known
3892    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3893    // Encoding interval in nanoseconds
3894    // Default: 0
3895    optional int64 encoding_interval_nanos = 2;
3896    // Number of bytes of PCM data that could not be read from the source
3897    // Default: 0
3898    optional int32 num_missing_pcm_bytes = 3;
3899    // An identifier that can be used to match events for this device.
3900    // The incremental identifier is locally generated and guaranteed not derived
3901    // from any globally unique hardware id.
3902    // For paired devices, it stays consistent between Bluetooth toggling for the
3903    // same remote device.
3904    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3905    // session for the same remote device.
3906    // Default: 0 if the device's metric id is unknown.
3907    optional int32 metric_id = 4;
3908}
3909
3910/**
3911 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
3912 * buffer queue is full and we have to drop data
3913 *
3914 * Logged from:
3915 *     system/bt
3916 */
3917message BluetoothA2dpAudioOverrunReported {
3918    // An identifier that can be used to match events for this device.
3919    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3920    // Salt: Randomly generated 256 bit value
3921    // Hash algorithm: HMAC-SHA256
3922    // Size: 32 byte
3923    // Default: null or empty if the device identifier is not known
3924    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3925    // Encoding interval in nanoseconds
3926    // Default: 0
3927    optional int64 encoding_interval_nanos = 2;
3928    // Number of buffers dropped in this event
3929    // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
3930    // Default: 0
3931    optional int32 num_dropped_buffers = 3;
3932    // Number of encoded buffers dropped in this event
3933    // Default 0
3934    optional int32 num_dropped_encoded_frames = 4;
3935    // Number of encoded bytes dropped in this event
3936    // Default: 0
3937    optional int32 num_dropped_encoded_bytes = 5;
3938    // An identifier that can be used to match events for this device.
3939    // The incremental identifier is locally generated and guaranteed not derived
3940    // from any globally unique hardware id.
3941    // For paired devices, it stays consistent between Bluetooth toggling for the
3942    // same remote device.
3943    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3944    // session for the same remote device.
3945    // Default: 0 if the device's metric id is unknown.
3946    optional int32 metric_id = 6;
3947}
3948
3949/**
3950 * Logs when we receive reports regarding a device's RSSI value
3951 *
3952 * Logged from:
3953 *     system/bt
3954 */
3955message BluetoothDeviceRssiReported {
3956    // An identifier that can be used to match events for this device.
3957    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3958    // Salt: Randomly generated 256 bit value
3959    // Hash algorithm: HMAC-SHA256
3960    // Size: 32 byte
3961    // Default: null or empty if the device identifier is not known
3962    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3963    // Connection handle of this connection if available
3964    // Range: 0x0000 - 0x0EFF (12 bits)
3965    // Default: 0xFFFF if the handle is unknown
3966    optional int32 connection_handle = 2;
3967    // HCI command status code if this is triggerred by hci_cmd
3968    // Default: STATUS_UNKNOWN
3969    optional android.bluetooth.hci.StatusEnum hci_status = 3;
3970    // BR/EDR
3971    //   Range: -128 ≤ N ≤ 127 (signed integer)
3972    //   Units: dB
3973    // LE:
3974    //   Range: -127 to 20, 127 (signed integer)
3975    //   Units: dBm
3976    // Invalid when an out of range value is reported
3977    optional int32 rssi = 4;
3978    // An identifier that can be used to match events for this device.
3979    // The incremental identifier is locally generated and guaranteed not derived
3980    // from any globally unique hardware id.
3981    // For paired devices, it stays consistent between Bluetooth toggling for the
3982    // same remote device.
3983    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3984    // session for the same remote device.
3985    // Default: 0 if the device's metric id is unknown.
3986    optional int32 metric_id = 5;
3987}
3988
3989/**
3990 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
3991 *
3992 * Logged from:
3993 *     system/bt
3994 */
3995message BluetoothDeviceFailedContactCounterReported {
3996    // An identifier that can be used to match events for this device.
3997    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3998    // Salt: Randomly generated 256 bit value
3999    // Hash algorithm: HMAC-SHA256
4000    // Size: 32 byte
4001    // Default: null or empty if the device identifier is not known
4002    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
4003    // Connection handle of this connection if available
4004    // Range: 0x0000 - 0x0EFF (12 bits)
4005    // Default: 0xFFFF if the handle is unknown
4006    optional int32 connection_handle = 2;
4007    // HCI command status code if this is triggerred by hci_cmd
4008    // Default: STATUS_UNKNOWN
4009    optional android.bluetooth.hci.StatusEnum cmd_status = 3;
4010    // Number of consecutive failed contacts for a connection corresponding to the Handle
4011    // Range: uint16_t, 0-0xFFFF
4012    // Default: 0xFFFFF
4013    optional int32 failed_contact_counter = 4;
4014    // An identifier that can be used to match events for this device.
4015    // The incremental identifier is locally generated and guaranteed not derived
4016    // from any globally unique hardware id.
4017    // For paired devices, it stays consistent between Bluetooth toggling for the
4018    // same remote device.
4019    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4020    // session for the same remote device.
4021    // Default: 0 if the device's metric id is unknown.
4022    optional int32 metric_id = 5;
4023}
4024
4025/**
4026 * Logs when we receive reports regarding the tranmit power level used for a specific connection
4027 *
4028 * Logged from:
4029 *     system/bt
4030 */
4031message BluetoothDeviceTxPowerLevelReported {
4032    // An identifier that can be used to match events for this device.
4033    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
4034    // Salt: Randomly generated 256 bit value
4035    // Hash algorithm: HMAC-SHA256
4036    // Size: 32 byte
4037    // Default: null or empty if the device identifier is not known
4038    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
4039    // Connection handle of this connection if available
4040    // Range: 0x0000 - 0x0EFF (12 bits)
4041    // Default: 0xFFFF if the handle is unknown
4042    optional int32 connection_handle = 2;
4043    // HCI command status code if this is triggered by hci_cmd
4044    // Default: STATUS_UNKNOWN
4045    optional android.bluetooth.hci.StatusEnum hci_status = 3;
4046    // Range: -30 ≤ N ≤ 20
4047    // Units: dBm
4048    // Invalid when an out of range value is reported
4049    optional int32 transmit_power_level = 4;
4050    // An identifier that can be used to match events for this device.
4051    // The incremental identifier is locally generated and guaranteed not derived
4052    // from any globally unique hardware id.
4053    // For paired devices, it stays consistent between Bluetooth toggling for the
4054    // same remote device.
4055    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4056    // session for the same remote device.
4057    // Default: 0 if the device's metric id is unknown.
4058    optional int32 metric_id = 5;
4059}
4060
4061/**
4062 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
4063 * receiving an HCI command from the host
4064 *
4065 * Logged from: system/bt
4066 */
4067message BluetoothHciTimeoutReported {
4068    // HCI command associated with this event
4069    // Default: CMD_UNKNOWN
4070    optional android.bluetooth.hci.CommandEnum hci_command = 1;
4071}
4072
4073/**
4074 * Logs when we receive Bluetooth Link Quality Report event from the controller
4075 * See Android Bluetooth HCI specification for more details
4076 *
4077 * Note: all count and bytes field are counted since last event
4078 *
4079 * Logged from: system/bt
4080 */
4081message BluetoothQualityReportReported {
4082    // Quality report ID
4083    // Original type: uint8_t
4084    // Default: BQR_ID_UNKNOWN
4085    optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
4086    // Packet type of the connection
4087    // Original type: uint8_t
4088    // Default: BQR_PACKET_TYPE_UNKNOWN
4089    optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
4090    // Connection handle of the connection
4091    // Original type: uint16_t
4092    optional int32 connection_handle = 3;
4093    // Performing Role for the connection
4094    // Original type: uint8_t
4095    optional int32 connection_role = 4;
4096    // Current Transmit Power Level for the connection. This value is the same as the controller's
4097    // response to the HCI_Read_Transmit_Power_Level HCI command
4098    // Original type: uint8_t
4099    optional int32 tx_power_level = 5;
4100    // Received Signal Strength Indication (RSSI) value for the connection. This value is an
4101    // absolute receiver signal strength value
4102    // Original type: int8_t
4103    optional int32 rssi = 6;
4104    // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
4105    // channels used by the link currently
4106    // Original type: uint8_t
4107    optional int32 snr = 7;
4108    // Indicates the number of unused channels in AFH_channel_map
4109    // Original type: uint8_t
4110    optional int32 unused_afh_channel_count = 8;
4111    // Indicates the number of the channels which are interfered and quality is bad but are still
4112    // selected for AFH
4113    // Original type: uint8_t
4114    optional int32 afh_select_unideal_channel_count = 9;
4115    // Current Link Supervision Timeout Setting
4116    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
4117    // Original type: uint16_t
4118    optional int32 lsto = 10;
4119    // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
4120    // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
4121    // 0x01 (Piconet Clock)
4122    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
4123    // Original type: uint32_t
4124    optional int64 connection_piconet_clock = 11;
4125    // The count of retransmission
4126    // Original type: uint32_t
4127    optional int64 retransmission_count = 12;
4128    // The count of no RX
4129    // Original type: uint32_t
4130    optional int64 no_rx_count = 13;
4131    // The count of NAK (Negative Acknowledge)
4132    // Original type: uint32_t
4133    optional int64 nak_count = 14;
4134    // Controller timestamp of last TX ACK
4135    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
4136    // Original type: uint32_t
4137    optional int64 last_tx_ack_timestamp = 15;
4138    // The count of Flow-off (STOP)
4139    // Original type: uint32_t
4140    optional int64 flow_off_count = 16;
4141    // Controller timestamp of last Flow-on (GO)
4142    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
4143    // Original type: uint32_t
4144    optional int64 last_flow_on_timestamp = 17;
4145    // Buffer overflow count (how many bytes of TX data are dropped) since the last event
4146    // Original type: uint32_t
4147    optional int64 buffer_overflow_bytes = 18;
4148    // Buffer underflow count (in byte) since last event
4149    // Original type: uint32_t
4150    optional int64 buffer_underflow_bytes = 19;
4151}
4152
4153/**
4154 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
4155 *
4156 * Notes:
4157 * - Each event can be partially filled as we might learn different pieces of device
4158 *   information at different time
4159 * - Multiple device info events can be combined to give more complete picture
4160 * - When multiple device info events tries to describe the same information, the
4161 *   later one wins
4162 *
4163 * Logged from:
4164 *     packages/apps/Bluetooth
4165 */
4166message BluetoothDeviceInfoReported {
4167    // An identifier that can be used to match events for this device.
4168    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
4169    // Salt: Randomly generated 256 bit value
4170    // Hash algorithm: HMAC-SHA256
4171    // Size: 32 byte
4172    // Default: null or empty if the device identifier is not known
4173    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
4174    // Where is this device info obtained from
4175    optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
4176    // Name of the data source
4177    // For EXTERNAL: package name of the data source
4178    // For INTERNAL: null for general case, component name otherwise
4179    optional string source_name = 3;
4180    // Name of the manufacturer of this device
4181    optional string manufacturer = 4;
4182    // Model of this device
4183    optional string model = 5;
4184    // Hardware version of this device
4185    optional string hardware_version = 6;
4186    // Software version of this device
4187    optional string software_version = 7;
4188    // An identifier that can be used to match events for this device.
4189    // The incremental identifier is locally generated and guaranteed not derived
4190    // from any globally unique hardware id.
4191    // For paired devices, it stays consistent between Bluetooth toggling for the
4192    // same remote device.
4193    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4194    // session for the same remote device.
4195    // Default: 0 if the device's metric id is unknown.
4196    optional int32 metric_id = 8;
4197    // A flag indicating if the MAC address of the remote device is public or
4198    // random.
4199    optional android.bluetooth.AddressTypeEnum address_type = 9;
4200    // The first byte of MAC address
4201    optional int32 byte1 = 10;
4202    // The second byte of MAC address
4203    optional int32 byte2 = 11;
4204    // The third byte of MAC address
4205    optional int32 byte3 = 12;
4206
4207}
4208
4209/**
4210 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
4211 * device, as documented by the Bluetooth Core HCI specification
4212 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
4213 * Vol 2, Part E, Page 1118
4214 *
4215 * Logged from:
4216 *     system/bt
4217 */
4218message BluetoothRemoteVersionInfoReported {
4219    // Connection handle of the connection
4220    // Original type: uint16_t
4221    optional int32 connection_handle = 1;
4222    // HCI command status code
4223    // Default: STATUS_UNKNOWN
4224    optional android.bluetooth.hci.StatusEnum hci_status = 2;
4225    // 1 byte Version of current LMP in the remote controller
4226    optional int32 lmp_version = 3;
4227    // 2 bytes LMP manufacturer code of the remote controller
4228    // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
4229    optional int32 lmp_manufacturer_code = 4;
4230    // 4 bytes subversion of the LMP in the remote controller
4231    optional int32 lmp_subversion = 5;
4232}
4233
4234/**
4235 * Logs when certain Bluetooth SDP attributes are discovered
4236 * Constant definitions are from:
4237 *     https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
4238 *
4239 * Current logged attributes:
4240 * - BluetoothProfileDescriptorList
4241 * - Supported Features Bitmask
4242 *
4243 * Logged from:
4244 *     system/bt
4245 */
4246message BluetoothSdpAttributeReported {
4247    // An identifier that can be used to match events for this device.
4248    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
4249    // Salt: Randomly generated 256 bit value
4250    // Hash algorithm: HMAC-SHA256
4251    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
4252    // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
4253    // Original type: uint16_t
4254    optional int32 protocol_uuid = 2;
4255    // Short form UUIDs used to identify Bluetooth SDP attribute types
4256    // Original type: uint16_t
4257    optional int32 attribute_id = 3;
4258    // Attribute value for the particular attribute
4259    optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
4260    // An identifier that can be used to match events for this device.
4261    // The incremental identifier is locally generated and guaranteed not derived
4262    // from any globally unique hardware id.
4263    // For paired devices, it stays consistent between Bluetooth toggling for the
4264    // same remote device.
4265    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4266    // session for the same remote device.
4267    // Default: 0 if the device's metric id is unknown.
4268    optional int32 metric_id = 5;
4269}
4270
4271/**
4272* Logs the user created Bluetooth device's name.
4273* It is pushed at Bluetooth pairing and connection.
4274*
4275* Logged from:
4276*     packages/modules/Bluetooth
4277*/
4278message BluetoothDeviceNameReported {
4279   // An identifier that can be used to match events for this device.
4280   // The incremental identifier is locally generated and guaranteed not derived
4281   // from any globally unique hardware id.
4282   // For paired devices, it stays consistent between Bluetooth toggling for the
4283   // same remote device.
4284   // For unpaired devices, it stays consistent within the same Bluetooth adapter
4285   // session for the same remote device.
4286   // Default: 0 if the device's metric id is unknown.
4287   optional int32 metric_id = 1;
4288
4289   // Name of the Bluetooth device. It is created by the user.
4290   optional string device_name = 2;
4291}
4292
4293/**
4294 * Logs when bond state of a Bluetooth device changes
4295 *
4296 * Logged from:
4297 *     frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
4298 *     packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
4299 */
4300message BluetoothBondStateChanged {
4301    // An identifier that can be used to match events for this device.
4302    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
4303    // Salt: Randomly generated 256 bit value
4304    // Hash algorithm: HMAC-SHA256
4305    // Size: 32 byte
4306    // Default: null or empty if the device identifier is not known
4307    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
4308    // Preferred transport type to remote dual mode device
4309    // Default: TRANSPORT_AUTO means no preference
4310    optional android.bluetooth.TransportTypeEnum transport = 2;
4311    // The type of this Bluetooth device (Classic, LE, or Dual mode)
4312    // Default: UNKNOWN
4313    optional android.bluetooth.DeviceTypeEnum type = 3;
4314    // Current bond state (NONE, BONDING, BONDED)
4315    // Default: BOND_STATE_UNKNOWN
4316    optional android.bluetooth.BondStateEnum bond_state = 4;
4317    // Bonding sub state
4318    // Default: BOND_SUB_STATE_UNKNOWN
4319    optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
4320    // Unbond Reason
4321    // Default: UNBOND_REASON_UNKNOWN
4322    optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
4323    // An identifier that can be used to match events for this device.
4324    // The incremental identifier is locally generated and guaranteed not derived
4325    // from any globally unique hardware id.
4326    // For paired devices, it stays consistent between Bluetooth toggling for the
4327    // same remote device.
4328    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4329    // session for the same remote device.
4330    // Default: 0 if the device's metric id is unknown.
4331    optional int32 metric_id = 7;
4332}
4333
4334/**
4335 * Logs there is an event related Bluetooth classic pairing
4336 *
4337 * Logged from:
4338 *     system/bt
4339 */
4340message BluetoothClassicPairingEventReported {
4341    // An identifier that can be used to match events for this device.
4342    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
4343    // Salt: Randomly generated 256 bit value
4344    // Hash algorithm: HMAC-SHA256
4345    // Size: 32 byte
4346    // Default: null or empty if the device identifier is not known
4347    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
4348    // Connection handle of this connection if available
4349    // Range: 0x0000 - 0x0EFF (12 bits)
4350    // Default: 0xFFFF if the handle is unknown
4351    optional int32 connection_handle = 2;
4352    // HCI command associated with this event
4353    // Default: CMD_UNKNOWN
4354    optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
4355    // HCI event associated with this event
4356    // Default: EVT_UNKNOWN
4357    optional android.bluetooth.hci.EventEnum hci_event = 4;
4358    // HCI command status code if this is triggerred by hci_cmd
4359    // Default: STATUS_UNKNOWN
4360    optional android.bluetooth.hci.StatusEnum cmd_status = 5;
4361    // HCI reason code associated with this event
4362    // Default: STATUS_UNKNOWN
4363    optional android.bluetooth.hci.StatusEnum reason_code = 6;
4364    // A status value related to this specific event
4365    // Default: 0
4366    optional int64 event_value = 7;
4367    // An identifier that can be used to match events for this device.
4368    // The incremental identifier is locally generated and guaranteed not derived
4369    // from any globally unique hardware id.
4370    // For paired devices, it stays consistent between Bluetooth toggling for the
4371    // same remote device.
4372    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4373    // session for the same remote device.
4374    // Default: 0 if the device's metric id is unknown.
4375    optional int32 metric_id = 8;
4376}
4377
4378/**
4379 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
4380 *
4381 * Logged from:
4382 *     system/bt
4383 */
4384message BluetoothSmpPairingEventReported {
4385    // An identifier that can be used to match events for this device.
4386    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
4387    // Salt: Randomly generated 256 bit value
4388    // Hash algorithm: HMAC-SHA256
4389    // Size: 32 byte
4390    // Default: null or empty if the device identifier is not known
4391    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
4392    // SMP command sent or received over L2CAP
4393    // Default: CMD_UNKNOWN
4394    optional android.bluetooth.smp.CommandEnum smp_command = 2;
4395    // Whether this command is sent or received
4396    // Default: DIRECTION_UNKNOWN
4397    optional android.bluetooth.DirectionEnum direction = 3;
4398    // SMP failure reason code
4399    // Default: PAIRING_FAIL_REASON_DEFAULT
4400    optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
4401    // An identifier that can be used to match events for this device.
4402    // The incremental identifier is locally generated and guaranteed not derived
4403    // from any globally unique hardware id.
4404    // For paired devices, it stays consistent between Bluetooth toggling for the
4405    // same remote device.
4406    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4407    // session for the same remote device.
4408    // Default: 0 if the device's metric id is unknown.
4409    optional int32 metric_id = 5;
4410}
4411
4412/**
4413 * Logs when a Bluetooth socket’s connection state changed
4414 *
4415 * Logged from:
4416 *   system/bt
4417 */
4418message BluetoothSocketConnectionStateChanged {
4419    // An identifier that can be used to match events for this device.
4420    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
4421    // Salt: Randomly generated 256 bit value
4422    // Hash algorithm: HMAC-SHA256
4423    // Size: 32 byte
4424    // Default: null or empty if this is a server listener socket
4425    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
4426    // Temporary port of this socket for the current connection or session only
4427    // Default 0 when unknown or don't care
4428    optional int32 port = 2;
4429    // Socket type as mentioned in
4430    // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
4431    // Default: SOCKET_TYPE_UNKNOWN
4432    optional android.bluetooth.SocketTypeEnum type = 3;
4433    // Socket connection state
4434    // Default: SOCKET_CONNECTION_STATE_UNKNOWN
4435    optional android.bluetooth.SocketConnectionstateEnum state = 4;
4436    // Number of bytes sent to remote device during this connection
4437    optional int64 tx_bytes = 5;
4438    // Number of bytes received from remote device during this connection
4439    optional int64 rx_bytes = 6;
4440    // Socket owner's UID
4441    optional int32 uid = 7 [(is_uid) = true];
4442    // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
4443    // |port| must be spawned by |server_port|
4444    // Default 0 when unknown or don't care
4445    optional int32 server_port = 8;
4446    // Whether this is a server listener socket
4447    optional android.bluetooth.SocketRoleEnum is_server = 9;
4448    // An identifier that can be used to match events for this device.
4449    // The incremental identifier is locally generated and guaranteed not derived
4450    // from any globally unique hardware id.
4451    // For paired devices, it stays consistent between Bluetooth toggling for the
4452    // same remote device.
4453    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4454    // session for the same remote device.
4455    // Default: 0 if the device's metric id is unknown.
4456    optional int32 metric_id = 10;
4457}
4458
4459/**
4460 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
4461 *
4462 * Logged from:
4463 *   packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
4464 *   packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
4465 *
4466 */
4467message BluetoothClassOfDeviceReported {
4468    // An identifier that can be used to match events for this device.
4469    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
4470    // Salt: Randomly generated 256 bit value
4471    // Hash algorithm: HMAC-SHA256
4472    // Size: 32 byte
4473    // Default: null or empty if this is a server listener socket
4474    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
4475    // Class of Device (CoD) value including both Major, Minor device class and service class
4476    // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
4477    // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
4478    // Default: 0
4479    optional int32 class_of_device = 2;
4480    // An identifier that can be used to match events for this device.
4481    // The incremental identifier is locally generated and guaranteed not derived
4482    // from any globally unique hardware id.
4483    // For paired devices, it stays consistent between Bluetooth toggling for the
4484    // same remote device.
4485    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4486    // session for the same remote device.
4487    // Default: 0 if the device's metric id is unknown.
4488    optional int32 metric_id = 3;
4489}
4490
4491/**
4492 * Logs when there is a crash in hardware abstraction layer (HAL)
4493 *
4494 * Logged from:
4495 *   system/bt
4496 *
4497 */
4498message BluetoothHALCrashReasonReported {
4499    // An identifier that can be used to match events for this device.
4500    // The incremental identifier is locally generated and guaranteed not derived
4501    // from any globally unique hardware id.
4502    // For paired devices, it stays consistent between Bluetooth toggling for the
4503    // same remote device.
4504    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4505    // session for the same remote device.
4506    // Default: 0 if the device's metric id is unknown.
4507    optional int32 metric_id = 1;
4508    // An identifier that can be used to match events for this device.
4509    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
4510    // Salt: Randomly generated 256 bit value
4511    // Hash algorithm: HMAC-SHA256
4512    // Size: 32 byte
4513    // Default: null or empty if the device identifier is not known
4514    optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
4515    // Bluetooth HAL crash reason error code.
4516    // Original type: uint8_t
4517    // Default: 0x00 (DEFAULT)
4518    optional int32 error_code = 3;
4519    // Bluetooth HAL crash reason vendor error code.
4520    // Original type: uint8_t
4521    // Default: 0x00 (DEFAULT)
4522    optional int32 vendor_error_code = 4;
4523}
4524
4525/**
4526 * Logs when an LE Audio connection session ended
4527 *
4528 * Logged from:
4529 *   packages/modules/Bluetooth
4530 *
4531 */
4532message LeAudioConnectionSessionReported {
4533    // Size of this CSIS group
4534    optional int32 group_size = 1;
4535    // An identifier that can be used to match events for this CSIS group.
4536    // The incremental identifier is locally generated and guaranteed not derived
4537    // from any globally unique hardware id.
4538    // For paired groups, it stays consistent between Bluetooth toggling for the
4539    // same remote group.
4540    // For unpaired groups, it stays consistent within the same Bluetooth adapter
4541    // session for the same remote group.
4542    // Default: 0 if the group's metric id is unknown.
4543    optional int32 group_metric_id = 2;
4544    // Total duration of this LeAudioConnectionSession
4545    optional int64 duration_nanos = 3;
4546
4547    // Connecting timestamp offset to the beginning of this session of each device session
4548    repeated int64 device_connecting_offset_nanos = 4;
4549    // Connected timestamp offset to the beginning of this session of each device session
4550    repeated int64 device_connected_offset_nanos = 5;
4551    // Duration of each device session
4552    repeated int64 device_connection_duration_nanos = 6;
4553    // Connection status of each device session
4554    repeated android.bluetooth.leaudio.ConnectionStatus device_connection_status = 7;
4555    // Disconnection status of each device session
4556    repeated android.bluetooth.leaudio.ConnectionStatus device_disconnection_status = 8;
4557    // An identifier that can be used to match events for this device.
4558    // The incremental identifier is locally generated and guaranteed not derived
4559    // from any globally unique hardware id.
4560    // For paired devices, it stays consistent between Bluetooth toggling for the
4561    // same remote device.
4562    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4563    // session for the same remote device.
4564    // Default: 0 if the device's metric id is unknown.
4565    repeated int32 device_metric_id = 9;
4566
4567    // Streaming beginning timestamp offset to the beginning of this session
4568    repeated int64 streaming_session_offset_nanos = 10;
4569    // Streaming ending timestamp offset to the beginning of this session
4570    repeated int64 streaming_session_duration_nanos = 11;
4571    // Streaming context type of each steaming session
4572    repeated android.bluetooth.leaudio.ContextType streaming_context_type = 12;
4573}
4574
4575/**
4576 * Logs when an LE Audio broadcast session ended
4577 *
4578 * Logged from:
4579 *   packages/modules/Bluetooth
4580 *
4581 */
4582message LeAudioBroadcastSessionReported {
4583    // Broadcast duration
4584    optional int64 duration_nanos = 1;
4585}
4586
4587/**
4588 * Logs when the counter is incremented
4589 *
4590 * Logged from:
4591 *   system/bt
4592 *   packages/apps/Bluetooth
4593 *
4594 */
4595message BluetoothCodePathCounter {
4596    // Keys of events with enum ranges to be defined
4597    optional android.bluetooth.CodePathCounterKeyEnum key = 1;
4598    // Number of frequency of events
4599    optional int64 number = 2;
4600}
4601
4602/**
4603 * Logs when an application attempts to start a Bluetooth Low Energy scan.
4604 * It only happens when the scan is initiated and does not repeatedly call
4605 * while the scan is running.
4606 *
4607 * Logged from:
4608 *   packages/apps/Bluetooth/src/com/android/bluetooth/gatt/GattService.java
4609 *
4610 */
4611message BluetoothLeBatchScanReportDelay {
4612    optional int32 application_uid = 1 [(is_uid) = true];
4613    optional int64 application_report_delay_millis = 2;
4614}
4615
4616message BluetoothLocalVersionsReported {
4617    // Chip Manufacturer name
4618    optional int32 lmp_manufacturer_name = 1;
4619    // LMP Version
4620    optional int32 lmp_version = 2;
4621    // LMP Subversion
4622    optional int32 lmp_subversion = 3;
4623    // HCI Version
4624    optional int32 hci_version = 4;
4625    // HCI Revision
4626    optional int32 hci_revision = 5;
4627}
4628
4629message BluetoothRemoteSupportedFeaturesReported {
4630    // An identifier that can be used to match events for this device.
4631    // The incremental identifier is locally generated and guaranteed not derived
4632    // from any globally unique hardware id.
4633    // For paired devices, it stays consistent between Bluetooth toggling for the
4634    // same remote device.
4635    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4636    // session for the same remote device.
4637    // Default: 0 if the device's metric id is unknown.
4638    optional int32 metric_id = 1;
4639    // Page of the feature bit masks
4640    optional int32 page = 2;
4641    // Bit mask of features
4642    optional int64 features_page2 = 3;
4643    // Connection handle of this connection if available
4644    // Range: 0x0000 - 0x0EFF (12 bits)
4645    // Default: 0xFFFF if the handle is unknown
4646    optional int32 connection_handle = 4;
4647}
4648
4649message BluetoothLocalSupportedFeaturesReported {
4650    // Page of the feature bit masks
4651    optional int32 page_num = 1;
4652    // Bit mask of features
4653    optional int64 features_page = 2;
4654}
4655
4656message BluetoothDisconnectionReasonReported {
4657    // Disconnection reason
4658    optional int32 reason = 1;
4659    // An identifier that can be used to match events for this device.
4660    // The incremental identifier is locally generated and guaranteed not derived
4661    // from any globally unique hardware id.
4662    // For paired devices, it stays consistent between Bluetooth toggling for the
4663    // same remote device.
4664    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4665    // session for the same remote device.
4666    // Default: 0 if the device's metric id is unknown.
4667    optional int32 metric_id = 2;
4668    // Connection handle of this connection if available
4669    // Range: 0x0000 - 0x0EFF (12 bits)
4670    // Default: 0xFFFF if the handle is unknown
4671    optional int32 connection_handle = 3;
4672}
4673
4674message BluetoothGattAppInfo {
4675    // An index to group connection events by session. It's a counter generated by
4676    // each profile. e.g. Gatt server generate such id to identify Gatt apps
4677    optional int32 session_index = 1;
4678    // An identifier that can be used to match events for this device.
4679    // The incremental identifier is locally generated and guaranteed not derived
4680    // from any globally unique hardware id.
4681    // For paired devices, it stays consistent between Bluetooth toggling for the
4682    // same remote device.
4683    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4684    // session for the same remote device.
4685    // Default: 0 if the device's metric id is unknown.
4686    optional int32 metric_id = 2;
4687    // UID of the GATT app
4688    optional int32 uid = 3 [(is_uid) = true];
4689}
4690
4691/**
4692 * Logs when something is plugged into or removed from the USB-C connector.
4693 *
4694 * Logged from:
4695 *  UsbService
4696 */
4697message UsbConnectorStateChanged {
4698    enum State {
4699        STATE_DISCONNECTED = 0;
4700        STATE_CONNECTED = 1;
4701    }
4702    optional State state = 1
4703            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
4704    optional string id = 2 [(state_field_option).primary_field = true];
4705    // Last active session in ms.
4706    // 0 when the port is in connected state.
4707    optional int64 last_connect_duration_millis = 3;
4708}
4709
4710/**
4711 * Logs the reported speaker impedance.
4712 *
4713 * Logged from:
4714 *  Vendor audio implementation.
4715 */
4716message SpeakerImpedanceReported {
4717    optional int32 speaker_location = 1;
4718    optional int32 impedance = 2;
4719}
4720
4721/**
4722 * Logs the report of a failed hardware.
4723 *
4724 * Logged from:
4725 *  Vendor HALs.
4726 *
4727 */
4728message HardwareFailed {
4729    enum HardwareType {
4730        HARDWARE_FAILED_UNKNOWN = 0;
4731        HARDWARE_FAILED_MICROPHONE = 1;
4732        HARDWARE_FAILED_CODEC = 2;
4733        HARDWARE_FAILED_SPEAKER = 3;
4734        HARDWARE_FAILED_FINGERPRINT = 4;
4735    }
4736    optional HardwareType hardware_type = 1;
4737
4738   /**
4739    * hardware_location allows vendors to differentiate between multiple instances of
4740    * the same hardware_type.  The specific locations are vendor defined integers,
4741    * referring to board-specific numbering schemes.
4742    */
4743    optional int32 hardware_location = 2;
4744
4745    /**
4746     * failure_code is specific to the HardwareType of the failed hardware.
4747     * It should use one of the enum values defined below.
4748     */
4749    enum HardwareErrorCode {
4750        UNKNOWN = 0;
4751        COMPLETE = 1;
4752        SPEAKER_HIGH_Z = 2;
4753        SPEAKER_SHORT = 3;
4754        FINGERPRINT_SENSOR_BROKEN = 4;
4755        FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
4756        DEGRADE = 6;
4757    }
4758    optional int32 failure_code = 3;
4759}
4760
4761/**
4762 * Log an event when the device has been physically dropped.
4763 * Reported from the /vendor partition.
4764 */
4765message PhysicalDropDetected {
4766    // Confidence that the event was actually a drop, 0 -> 100
4767    optional int32 confidence_pctg = 1;
4768    // Peak acceleration of the drop, in 1/1000s of a g.
4769    optional int32 accel_peak_thousandths_g = 2;
4770    // Duration of freefall in ms
4771    optional int32 freefall_time_millis = 3;
4772}
4773
4774/**
4775 * Log bucketed battery charge cycles.
4776 *
4777 * Each bucket represents cycles of the battery past
4778 * a given charge point.  For example, if 10 cycle buckets are
4779 * initialized, bucket 1 is the lowest 1/10th of the battery,
4780 * and bucket 10 is 100%.
4781 *
4782 * Logged from:
4783 * /sys/class/power_supply/bms/cycle_count, via Vendor.
4784 */
4785message ChargeCyclesReported {
4786    optional int32 cycle_bucket_1 = 1;
4787    optional int32 cycle_bucket_2 = 2;
4788    optional int32 cycle_bucket_3 = 3;
4789    optional int32 cycle_bucket_4 = 4;
4790    optional int32 cycle_bucket_5 = 5;
4791    optional int32 cycle_bucket_6 = 6;
4792    optional int32 cycle_bucket_7 = 7;
4793    optional int32 cycle_bucket_8 = 8;
4794    optional int32 cycle_bucket_9 = 9;
4795    optional int32 cycle_bucket_10 = 10;
4796}
4797
4798/**
4799 * Log battery health snapshot.
4800 *
4801 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
4802 * are snapshotted periodically over 24hrs.
4803 */
4804message BatteryHealthSnapshot {
4805    enum BatterySnapshotType {
4806        UNKNOWN = 0;
4807        MIN_TEMP = 1;         // Snapshot at min batt temp over 24hrs.
4808        MAX_TEMP = 2;         // Snapshot at max batt temp over 24hrs.
4809        MIN_RESISTANCE = 3;   // Snapshot at min batt resistance over 24hrs.
4810        MAX_RESISTANCE = 4;   // Snapshot at max batt resistance over 24hrs.
4811        MIN_VOLTAGE = 5;      // Snapshot at min batt voltage over 24hrs.
4812        MAX_VOLTAGE = 6;      // Snapshot at max batt voltage over 24hrs.
4813        MIN_CURRENT = 7;      // Snapshot at min batt current over 24hrs.
4814        MAX_CURRENT = 8;      // Snapshot at max batt current over 24hrs.
4815        MIN_BATT_LEVEL = 9;   // Snapshot at min battery level (SoC) over 24hrs.
4816        MAX_BATT_LEVEL = 10;  // Snapshot at max battery level (SoC) over 24hrs.
4817        AVG_RESISTANCE = 11;  // Snapshot at average battery resistance over 24hrs.
4818    }
4819    optional BatterySnapshotType type = 1;
4820    // Temperature, in 1/10ths of degree C.
4821    optional int32 temperature_deci_celsius = 2;
4822    // Voltage Battery Voltage, in microVolts.
4823    optional int32 voltage_micro_volt = 3;
4824    // Current Battery current, in microAmps.
4825    optional int32 current_micro_amps = 4;
4826    // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
4827    optional int32 open_circuit_micro_volt = 5;
4828    // Resistance Battery Resistance, in microOhms.
4829    optional int32 resistance_micro_ohm = 6;
4830    // Level Battery Level, as % of full.
4831    optional int32 level_percent = 7;
4832}
4833
4834/**
4835 * Log slow I/O operations on the primary storage.
4836 */
4837message SlowIo {
4838    // Classifications of IO Operations.
4839    enum IoOperation {
4840        UNKNOWN = 0;
4841        READ = 1;
4842        WRITE = 2;
4843        UNMAP = 3;
4844        SYNC = 4;
4845    }
4846    optional IoOperation operation = 1;
4847
4848    // The number of slow IO operations of this type over 24 hours.
4849    optional int32 count = 2;
4850}
4851
4852/**
4853 * Log battery caused shutdown with the last recorded voltage.
4854 */
4855message BatteryCausedShutdown {
4856    // The last recorded battery voltage prior to shutdown.
4857    optional int32 last_recorded_micro_volt = 1;
4858}
4859
4860/**
4861 * Logs when ThermalService receives throttling events.
4862 *
4863 * Logged from:
4864 *   frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
4865 */
4866message ThermalThrottlingSeverityStateChanged {
4867  // The type of temperature being reported (CPU, GPU, SKIN, etc)
4868  optional android.os.TemperatureTypeEnum sensor_type = 1
4869      [(state_field_option).primary_field = true];
4870
4871  // The name of the temperature source. Eg. CPU0
4872  optional string sensor_name = 2 [(state_field_option).primary_field = true];
4873
4874  // Temperature in tenths of a degree C.
4875  // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
4876  optional int32 temperature_deci_celsius = 3;
4877
4878  // Relative severity of the throttling, see enum definition.
4879  optional android.os.ThrottlingSeverityEnum severity = 4 [
4880    (state_field_option).exclusive_state = true,
4881    (state_field_option).nested = false
4882  ];
4883}
4884
4885/**
4886 * Logs phone signal strength changes.
4887 *
4888 * The atom doesn't tell which SIM had signal strength changed -- use with caution when there are
4889 * multiple SIMs present.
4890 *
4891 * Logged from:
4892 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
4893 */
4894message PhoneSignalStrengthChanged {
4895    // Signal strength, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
4896    optional android.telephony.SignalStrengthEnum signal_strength = 1
4897            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
4898}
4899
4900
4901/**
4902 * Logs when the phone state, sim state or signal strength changes
4903 *
4904 * Logged from:
4905 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
4906 */
4907message PhoneServiceStateChanged {
4908    optional android.telephony.ServiceStateEnum state = 1;
4909    optional android.telephony.SimStateEnum sim_state = 2;
4910    optional android.telephony.SignalStrengthEnum signal_strength = 3;
4911}
4912
4913/**
4914 * Logs when the phone becomes on or off.
4915 *
4916 * Logged from:
4917 *   frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
4918 */
4919message PhoneStateChanged {
4920    enum State {
4921        OFF = 0;
4922        ON = 1;
4923    }
4924    optional State state = 1;
4925}
4926
4927message ExclusionRectStateChanged {
4928    optional string component_name = 1;    // if not available, simply packageName
4929    optional int32 requested_height = 2;   // px
4930    optional int32 rejected_height = 3;    // px
4931
4932    enum WindowHorizontalLocation {
4933        DEFAULT_LOCATION = 0;
4934        LEFT = 1;
4935        RIGHT = 2;
4936    }
4937    optional WindowHorizontalLocation x_location = 4;
4938    optional bool landscape = 5;
4939    optional bool splitscreen = 6 [deprecated = true];
4940    optional int32 duration_millis = 7;
4941}
4942
4943/**
4944 * Logs when Wallpaper or ThemePicker UI has changed.
4945 *
4946 * Logged from:
4947 *   packages/apps/ThemePicker
4948 *   packages/apps/WallpaperPicker2
4949 */
4950message StyleUIChanged {
4951    optional android.stats.style.Action action = 1;
4952    optional int32 color_package_hash = 2;
4953    optional int32 font_package_hash  = 3;
4954    optional int32 shape_package_hash = 4;
4955    optional int32 clock_package_hash = 5;
4956    optional int32 launcher_grid = 6;
4957    optional int32 wallpaper_category_hash = 7;
4958    optional int32 wallpaper_id_hash = 8;
4959    optional int32 color_preference = 9;
4960    optional android.stats.style.LocationPreference location_preference = 10;
4961    optional android.stats.style.DatePreference date_preference = 11;
4962    optional android.stats.style.LaunchedPreference launched_preference = 12;
4963    optional android.stats.style.EffectPreference effect_preference = 13;
4964    optional int32 effect_id_hash = 14;
4965    optional int32 lock_wallpaper_category_hash = 15;
4966    optional int32 lock_wallpaper_id_hash = 16;
4967    optional int32 first_launch_date_since_setup = 17;
4968    optional int32 first_wallpaper_apply_date_since_setup = 18;
4969    optional int32 app_launch_count = 19;
4970    optional int32 color_variant = 20;
4971    optional int64 time_elapsed_millis = 21;
4972    optional int32 effect_status_code = 22;
4973    optional int32 app_session_id = 23;
4974    optional android.stats.style.SetWallpaperEntryPoint set_wallpaper_entry_point = 24;
4975    optional android.stats.style.WallpaperDestination wallpaper_destination = 25;
4976    optional android.stats.style.ColorSource color_source = 26;
4977    optional int32 seed_color = 27;
4978    optional android.stats.style.ClockSize clock_size = 28;
4979    optional bool toggle_on = 29;
4980    optional string shortcut = 30;
4981    optional string shortcut_slot_id = 31;
4982    optional int32 lock_effect_id_hash = 32;
4983}
4984
4985/**
4986 * Logs when Settings UI has changed.
4987 *
4988 * Logged from:
4989 *   packages/apps/Settings
4990 */
4991message SettingsUIChanged {
4992    /**
4993     * Where this SettingsUIChange event comes from. For example, if
4994     * it's a PAGE_VISIBLE event, where the page is opened from.
4995     */
4996    optional android.app.settings.PageId attribution = 1;
4997
4998    /**
4999     * What the UI action is.
5000     */
5001    optional android.app.settings.Action action = 2;
5002
5003    /**
5004     * Where the action is happening
5005     */
5006    optional android.app.settings.PageId page_id = 3;
5007
5008    /**
5009     * What preference changed in this event.
5010     */
5011    optional string changed_preference_key = 4;
5012
5013    /**
5014     * The new value of the changed preference.
5015     */
5016    optional int64 changed_preference_int_value = 5;
5017
5018    /**
5019     * Data about elapsed time since setup wizard finished.
5020     */
5021    optional int64 elapsed_time_millis = 6;
5022}
5023
5024/**
5025 * Logs that a setting was updated.
5026 * Logged from:
5027 *   frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
5028 * The tag and is_default allow resetting of settings to default values based on the specified
5029 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
5030 */
5031message SettingChanged {
5032    // The name of the setting.
5033    optional string setting = 1;
5034
5035    // The change being imposed on this setting. May represent a number, eg "3".
5036    optional string value = 2;
5037
5038    // The new value of this setting. For most settings, this is same as value. For some settings,
5039    // value is +X or -X where X represents an element in a set. For example, if the previous value
5040    // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
5041    // The +/- feature is currently only used for location_providers_allowed.
5042    optional string new_value = 3;
5043
5044    // The previous value of this setting.
5045    optional string prev_value = 4;
5046
5047    // The tag used with the is_default for resetting sets of settings. This is generally null.
5048    optional string tag = 5;
5049
5050    // True if this setting with tag should be resettable.
5051    optional bool is_default = 6;
5052
5053    // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
5054    optional int32 user = 7;
5055
5056    enum ChangeReason {
5057        UPDATED = 1; // Updated can be an insertion or an update.
5058        DELETED = 2;
5059    }
5060    optional ChangeReason reason = 8;
5061}
5062
5063/**
5064 * Logs activity going to foreground or background
5065 *
5066 * Logged from:
5067  *   frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
5068 */
5069message ActivityForegroundStateChanged {
5070    optional int32 uid = 1 [(is_uid) = true];
5071    optional string pkg_name = 2;
5072    optional string class_name = 3;
5073
5074    enum State {
5075        BACKGROUND = 0;
5076        FOREGROUND = 1;
5077    }
5078    optional State state = 4;
5079}
5080
5081/**
5082 * Logs when a volume entered low Storage state.
5083 * Logged from:
5084 *      frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
5085 */
5086message LowStorageStateChanged {
5087    // Volume that ran out of storage.
5088    optional string volume_description = 1;
5089
5090    enum State {
5091        UNKNOWN = 0;
5092        OFF = 1;
5093        ON = 2;
5094    }
5095    optional State state = 2;
5096}
5097
5098/**
5099 * Logs when an app is downgraded.
5100 * Logged from:
5101 *      frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
5102 */
5103message AppDowngraded {
5104    optional string package_name = 1;
5105    // Size of the package (all data) before being downgraded.
5106    optional int64 size_in_bytes_before = 2;
5107    // Size of the package (all data) after being downgraded.
5108    optional int64 size_in_bytes_after = 3;
5109
5110    optional bool aggressive = 4;
5111}
5112
5113/**
5114 * Logs when an app is optimized after being downgraded.
5115 * Logged from:
5116 *      frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
5117 */
5118message AppOptimizedAfterDowngraded {
5119    optional string package_name = 1;
5120}
5121
5122/**
5123 * Logs whenever an app is installed on external storage.
5124 * Logged from:
5125        frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
5126 */
5127message AppInstallOnExternalStorageReported {
5128    // The type of external storage.
5129    optional android.stats.storage.ExternalStorageType storage_type = 1;
5130    // The name of the package that is installed on the sd card.
5131    optional string package_name = 2;
5132}
5133
5134/**
5135 * Logs when an app crashes.
5136 * Logged from:
5137 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5138 */
5139message AppCrashOccurred {
5140    optional int32 uid = 1 [(is_uid) = true];
5141
5142    optional string event_type = 2;
5143
5144    // The name of the process.
5145    // system_server if it is not by an app
5146    optional string process_name = 3;
5147
5148    // The pid if available. -1 means not available.
5149    optional int32 pid = 4;
5150
5151    optional string package_name = 5;
5152
5153    enum InstantApp {
5154        UNAVAILABLE = 0;
5155        FALSE = 1;
5156        TRUE = 2;
5157    }
5158    optional InstantApp is_instant_app = 6;
5159
5160    enum ForegroundState {
5161        UNKNOWN = 0;
5162        BACKGROUND = 1;
5163        FOREGROUND = 2;
5164    }
5165    optional ForegroundState foreground_state = 7;
5166
5167    optional android.server.ErrorSource error_source = 8;
5168
5169    optional bool is_incremental = 9;
5170
5171    optional float loading_progress = 10;
5172
5173    optional int64 millis_since_oldest_pending_read = 11;
5174
5175    // Status code to represent the health of the file system backing storage, as defined in
5176    // frameworks/base/core/java/android/os/incremental/IStorageHealthListener.aidl.
5177    // Value -1 if the app is not installed on Incremental
5178    optional int32 storage_health_code = 12;
5179
5180    // Status code to represent the status of data loader, as defined in
5181    // frameworks/base/core/java/android/content/pm/IDataLoaderStatusListener.aidl.
5182    // Value -1 if the app is not installed on Incremental
5183    optional int32 data_loader_status_code = 13;
5184
5185    // Whether read logs collection is enabled
5186    optional bool read_logs_enabled = 14;
5187
5188    // Duration since last attempt to bind data loader. 0 means did not attempt to bind.
5189    // -1 means the app is not installed on Incremental.
5190    optional int64 millis_since_last_data_loader_bind = 15;
5191
5192    // Delay for retrying to bind data loader. If not bound, it shows how soon it will be bound.
5193    optional int64 data_loader_bind_delay_millis = 16;
5194
5195    // Total count of delayed reads, as reported by Incremental File System.
5196    optional int32 total_delayed_reads = 17;
5197
5198    // Total count of failed reads (timeout or hash errors) as reported by Incremental File System.
5199    optional int32 total_failed_reads = 18;
5200
5201    // UID of the process that tried to read a page from the app but failed.
5202    // This shows whether the read was initiated by the system, the app itself, or some other apps.
5203    // -1 means there was no read error or the app is not installed on Incremental.
5204    optional int32 last_read_error_uid = 19 [(is_uid) = true];
5205
5206    // Duration since that last read failure.
5207    // -1 means there was no read error or the app is not installed on Incremental.
5208    optional int64 last_read_error_millis_since = 20;
5209
5210    // Error code of last read failure. ETIME (value=62) for timeout, EBADMSG (value=74) for hash
5211    // and other positive values for other errors. -1 means app is not installed on Incremental.
5212    optional int32 last_read_error_code = 21;
5213
5214    // Total duration of delayed reads in milliseconds
5215    optional int64 total_delayed_reads_duration_millis = 22;
5216}
5217
5218/**
5219 * Logs when a WTF (What a Terrible Failure) happened.
5220 * Logged from:
5221 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5222 */
5223message WTFOccurred {
5224    optional int32 uid = 1 [(is_uid) = true];
5225
5226    optional string tag = 2;
5227
5228    // The name of the process.
5229    // system_server if it is not by an app
5230    optional string process_name = 3;
5231
5232    // The pid if available. -1 means not available.
5233    optional int32 pid = 4;
5234
5235    optional android.server.ErrorSource error_source = 5;
5236}
5237
5238/**
5239 * Logs when system server reports low memory.
5240 * Logged from:
5241 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5242 */
5243message LowMemReported {
5244}
5245
5246/**
5247 * Logs when an app ANR (App Not Responding) occurs.
5248 * Logged from:
5249 *      frameworks/base/services/core/java/com/android/server/am/AppErrors.java
5250 */
5251message ANROccurred {
5252    optional int32 uid = 1 [(is_uid) = true];
5253
5254    optional string process_name = 2;
5255
5256    optional string short_component_name = 3;
5257
5258    optional string reason = 4;
5259
5260    enum InstantApp {
5261        UNAVAILABLE = 0;
5262        FALSE = 1;
5263        TRUE = 2;
5264    }
5265    optional InstantApp is_instant_app = 5;
5266
5267    enum ForegroundState {
5268        UNKNOWN = 0;
5269        BACKGROUND = 1;
5270        FOREGROUND = 2;
5271    }
5272    optional ForegroundState foreground_state = 6;
5273
5274    optional android.server.ErrorSource error_source = 7;
5275
5276    optional string package_name = 8;
5277
5278    optional bool is_incremental = 9;
5279
5280    optional float loading_progress = 10;
5281
5282    optional int64 millis_since_oldest_pending_read = 11;
5283
5284    // Status code to represent the health of the file system backing storage, as defined in
5285    // frameworks/base/core/java/android/os/incremental/IStorageHealthListener.aidl.
5286    // Value -1 if the app is not installed on Incremental
5287    optional int32 storage_health_code = 12;
5288
5289    // Status code to represent the status of data loader, as defined in
5290    // frameworks/base/core/java/android/content/pm/IDataLoaderStatusListener.aidl.
5291    // Value -1 if the app is not installed on Incremental
5292    optional int32 data_loader_status_code = 13;
5293
5294    // Whether read logs collection is enabled
5295    optional bool read_logs_enabled = 14;
5296
5297    // Duration since last attempt to bind data loader. 0 means did not attempt to bind.
5298    // -1 means the app is not installed on Incremental.
5299    optional int64 millis_since_last_data_loader_bind = 15;
5300
5301    // Delay for retrying to bind data loader. If not bound, it shows how soon it will be bound.
5302    optional int64 data_loader_bind_delay_millis = 16;
5303
5304    // Total count of delayed reads, as reported by Incremental File System.
5305    optional int32 total_delayed_reads = 17;
5306
5307    // Total count of failed reads (timeout or hash errors) as reported by Incremental File System.
5308    optional int32 total_failed_reads = 18;
5309
5310    // UID of the process that tried to read a page from the app but failed.
5311    // This shows whether the read was initiated by the system, the app itself, or some other apps.
5312    // -1 means there was no read error or the app is not installed on Incremental.
5313    optional int32 last_read_error_uid = 19 [(is_uid) = true];
5314
5315    // Duration since that last read failure.
5316    // -1 means there was no read error or the app is not installed on Incremental.
5317    optional int64 last_read_error_millis_since = 20;
5318
5319    // Error code of last read failure. ETIME (value=62) for timeout, EBADMSG (value=74) for hash
5320    // and other positive values for other errors. -1 means app is not installed on Incremental.
5321    optional int32 last_read_error_code = 21;
5322
5323    // Total duration of delayed reads in milliseconds
5324    optional int64 total_delayed_reads_duration_millis = 22;
5325}
5326
5327/**
5328 * Logs immediately after an app ANR (App Not Responding) occurs. In contrast, ANROccurred (the
5329 * atom above) logs some time (not necessarily immediately) after the ANR is detected.
5330 * Logged from:
5331 *      frameworks/base/services/core/java/com/android/server/am/AppErrors.java
5332 */
5333message ANROccurredProcessingStarted {
5334  optional string process_name = 1;
5335}
5336
5337/**
5338 * Logs when the vibrator state changes.
5339 * Logged from:
5340 *      frameworks/base/services/core/java/com/android/vibrator/VibratorManagerService.java
5341 */
5342message VibratorStateChanged {
5343    repeated AttributionNode attribution_node = 1;
5344
5345    enum State {
5346        OFF = 0;
5347        ON = 1;
5348    }
5349    optional State state = 2;
5350
5351    // Duration (in milliseconds) requested to keep the vibrator on.
5352    // Only applicable for State == ON.
5353    optional int64 duration_millis = 3;
5354}
5355
5356/**
5357 * Logs vibration request.
5358 * Logged from:
5359 *      frameworks/base/services/core/java/com/android/server/vibrator/VibratorManagerService.java
5360 */
5361// Next tag: 28
5362message VibrationReported {
5363  repeated AttributionNode attribution_node = 1;
5364
5365  enum VibrationType {
5366
5367    // Unknown vibration type.
5368    UNKNOWN = 0;
5369
5370    // One-off vibration effect/pattern.
5371    SINGLE = 1;
5372
5373    // Infinitely repeating vibration pattern.
5374    REPEATED = 2;
5375
5376    // Vibration defined in the platform outside the vibrator service
5377    // (e.g. from audio-coupled haptics or haptic generator).
5378    EXTERNAL = 3;
5379
5380    // Vibration defined by vendor apps/services.
5381    VENDOR = 4;
5382  }
5383
5384  // Vibration identifiers for aggregation.
5385  optional VibrationType vibration_type = 2;
5386  // One of VibrationAttributes.USAGE_* constant values.
5387  optional int32 vibration_usage = 3;
5388  optional int32 vibration_status = 4;
5389
5390  // Vibration parameters.
5391  // Adaptive scale value applied to this vibration, 0 if unset.
5392  optional float adaptive_scale = 26;
5393
5394  // Vibration completion causes.
5395  // Flag indicating if the vibration was canceled by the same process
5396  // or superseded/canceled by another vibration from the same process.
5397  optional bool ended_by_same_uid = 5;
5398  // Usage value of the vibration that superseded/canceled this one.
5399  optional int32 ended_by_usage = 6;
5400  // Usage value of the vibration that was superseded/canceled by this one.
5401  optional int32 interrupted_usage = 7;
5402
5403  // Vibration execution counters.
5404  optional int32 repeat_count = 8;
5405  // Total duration of this vibration at the service, including setup and cleanup.
5406  optional int64 vibration_duration_millis = 9;
5407  // Total duration the vibrator motor was active with non-zero amplitude.
5408  optional int64 vibrator_on_duration_millis = 10;
5409  // Delta between the incoming binder call to vibrate and the first step in the
5410  // vibration conductor (closest measure of starting HAL interactions).
5411  optional int64 start_latency_millis = 11;
5412  // Delta between the HAL reporting the last vibrate operation has completed and
5413  // vibrator service has finished the vibration and become idle.
5414  optional int64 end_latency_millis = 12;
5415
5416  // Vibrator hardware HAL API interaction counters.
5417  // The majority of vibrations will populate only a couple of the fields below.
5418  optional int32 hal_compose_count = 13;
5419  optional int32 hal_compose_pwle_count = 14;
5420  optional int32 hal_on_count = 15;
5421  optional int32 hal_off_count = 16;
5422  optional int32 hal_perform_count = 17;
5423  optional int32 hal_set_amplitude_count = 18;
5424  optional int32 hal_set_external_control_count = 19;
5425  optional int32 hal_perform_vendor_count = 27;
5426
5427  // Vibrator hardware HAL API constants used (deduped).
5428  // Values from CompositionPrimitive.aidl successfully triggered by this vibration at least once.
5429  repeated int32 hal_supported_composition_primitives_used = 20;
5430  // Values from Effect.aidl triggered by this vibration at least once.
5431  repeated int32 hal_supported_effects_used = 21;
5432  // Values from CompositionPrimitive.aidl triggered but not supported by the device.
5433  repeated int32 hal_unsupported_composition_primitives_used = 22;
5434  // Values from Effect.aidl triggered but not supported by the device.
5435  repeated int32 hal_unsupported_effects_used = 23;
5436  // Vibrator hardware HAL argument sizes (total).
5437  optional int32 hal_composition_size = 24;
5438  optional int32 hal_pwle_size = 25;
5439}
5440
5441/*
5442 * Allows other apps to push events into statsd.
5443 * Logged from:
5444 *      frameworks/base/core/java/android/util/StatsLog.java
5445 */
5446message AppBreadcrumbReported {
5447    // The uid of the application that sent this custom atom.
5448    optional int32 uid = 1 [(is_uid) = true];
5449
5450    // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
5451    optional int32 label = 2;
5452
5453    // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
5454    // predicates for the metrics).
5455    enum State {
5456        UNKNOWN = 0;
5457        UNSPECIFIED = 1;  // For events that are known to not represent START/STOP.
5458        STOP = 2;
5459        START = 3;
5460    }
5461    optional State state = 3;
5462}
5463
5464/**
5465 * Logs the wall-clock time when a significant wall-clock time shift occurs.
5466 * For example, this could be due to the user manually changing the time.
5467 *
5468 * Logged from:
5469 *   frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
5470 */
5471message WallClockTimeShifted {
5472    // New wall-clock time in milliseconds, according to System.currentTimeMillis().
5473    optional int64 wall_clock_timestamp_millis = 1;
5474}
5475
5476/**
5477 * Logs when statsd detects an anomaly.
5478 *
5479 * Logged from:
5480 *   frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
5481 */
5482message AnomalyDetected {
5483    // Uid that owns the config whose anomaly detection alert fired.
5484    optional int32 config_uid = 1 [(is_uid) = true];
5485
5486    // Id of the config whose anomaly detection alert fired.
5487    optional int64 config_id = 2;
5488
5489    // Id of the alert (i.e. name of the anomaly that was detected).
5490    optional int64 alert_id = 3;
5491}
5492
5493message AppStartOccurred {
5494    // The uid if available. -1 means not available.
5495    optional int32 uid = 1 [(is_uid) = true];
5496
5497    // The app package name.
5498    optional string pkg_name = 2;
5499
5500    enum TransitionType {
5501        UNKNOWN = 0;
5502        WARM = 1;
5503        HOT = 2;
5504        COLD = 3;
5505        RELAUNCH = 4;
5506    }
5507    // The transition type.
5508    optional TransitionType type = 3;
5509
5510    // The activity name.
5511    optional string activity_name = 4;
5512
5513    // The name of the calling app. Empty if not set.
5514    optional string calling_pkg_name = 5;
5515
5516    // Whether the app is an instant app.
5517    optional bool is_instant_app = 6;
5518
5519    // Device uptime when activity started. Deprecated: use activity_start_timestamp_millis instead.
5520    optional int64 activity_start_millis = 7 [deprecated = true];
5521
5522    optional android.app.AppTransitionReasonEnum reason = 8;
5523
5524    optional int32 transition_delay_millis = 9;
5525    // -1 if not set.
5526    optional int32 starting_window_delay_millis = 10;
5527    // -1 if not set.
5528    optional int32 bind_application_delay_millis = 11;
5529    optional int32 windows_drawn_delay_millis = 12;
5530
5531    // Empty if not set.
5532    optional string launch_token = 13;
5533
5534    // The reason why the package was optimized.
5535    optional int32 package_optimization_compilation_reason = 14;
5536
5537    // The compiler filter used when when the package was optimized.
5538    optional int32 package_optimization_compilation_filter = 15;
5539
5540    enum SourceType {
5541        UNAVAILABLE = 0;
5542        LAUNCHER = 1;
5543        NOTIFICATION = 2;
5544        LOCKSCREEN = 3;
5545        RECENTS_ANIMATION = 4;
5546    }
5547    // The type of the startup source.
5548    optional SourceType source_type = 16;
5549
5550    // The time from the startup source to the beginning of handling the startup event.
5551    // -1 means not available.
5552    optional int32 source_event_delay_millis = 17;
5553
5554    // Whether the app is hibernating when it started
5555    optional bool is_hibernating = 18;
5556
5557    // Whether the app is installed on Incremental File System.
5558    optional bool is_incremental = 19;
5559
5560    // Whether the app is still being streamed.
5561    optional bool is_loading = 20;
5562
5563    // The hash value of the activity name.
5564    optional int32 activity_name_hash = 21;
5565
5566    // The timestamp(SystemClock#elapsedRealtime()) when starting activity.
5567    optional int64 activity_start_timestamp_millis = 22;
5568
5569    /**
5570     * The process state of apps, keep in sync with
5571     * frameworks/base/core/java/android/app/ActivityManager.java
5572     */
5573    enum AppProcessState {
5574        PROCESS_STATE_UNKNOWN = -1;
5575        PROCESS_STATE_PERSISTENT = 0;
5576        PROCESS_STATE_PERSISTENT_UI = 1;
5577        PROCESS_STATE_TOP = 2;
5578        PROCESS_STATE_BOUND_TOP = 3;
5579        PROCESS_STATE_FOREGROUND_SERVICE = 4;
5580        PROCESS_STATE_BOUND_FOREGROUND_SERVICE = 5;
5581        PROCESS_STATE_IMPORTANT_FOREGROUND = 6;
5582        PROCESS_STATE_IMPORTANT_BACKGROUND = 7;
5583        PROCESS_STATE_TRANSIENT_BACKGROUND = 8;
5584        PROCESS_STATE_BACKUP = 9;
5585        PROCESS_STATE_SERVICE = 10;
5586        PROCESS_STATE_RECEIVER = 11;
5587        PROCESS_STATE_TOP_SLEEPING = 12;
5588        PROCESS_STATE_HEAVY_WEIGHT = 13;
5589        PROCESS_STATE_HOME = 14;
5590        PROCESS_STATE_LAST_ACTIVITY = 15;
5591        PROCESS_STATE_CACHED_ACTIVITY = 16;
5592        PROCESS_STATE_CACHED_ACTIVITY_CLIENT = 17;
5593        PROCESS_STATE_CACHED_RECENT = 18;
5594        PROCESS_STATE_CACHED_EMPTY = 19;
5595        PROCESS_STATE_NONEXISTENT = 20;
5596    }
5597
5598    // The process state of the launching activity prior to the launch.
5599    optional AppProcessState process_state = 23;
5600
5601    // The oom adj score of the launching activity prior to the launch.
5602    optional int32 process_oom_adj = 24;
5603
5604    // The stopped state (if any) the package was in before the launch
5605    optional PackageStoppedState package_stopped_state = 25;
5606
5607    // Reserved for b/281564325.
5608    optional bool is_xr_activity = 26;
5609
5610    // Whether this is the first launch of the app since install
5611    optional bool first_launch = 27;
5612
5613    // How long since this package was stopped, if it was in
5614    // package_stopped_state == PACKAGE_STATE_STOPPED
5615    optional int64 millis_since_stopped = 28;
5616
5617    /**
5618     * The type of multi-window launch.
5619     * This should match the constants declared in ActivityMetricsLogger.
5620     */
5621    enum MultiWindowLaunchType {
5622        LAUNCH_TYPE_UNSPECIFIED = 0;
5623        LAUNCH_TYPE_APP_PAIR = 1;
5624    }
5625
5626    // The multi-indow launch type
5627    optional MultiWindowLaunchType multi_window_launch_type = 29;
5628}
5629
5630message AppStartCanceled {
5631    // The uid if available. -1 means not available.
5632    optional int32 uid = 1 [(is_uid) = true];
5633
5634    // The app package name.
5635    optional string pkg_name = 2;
5636
5637    enum TransitionType {
5638        UNKNOWN = 0;
5639        WARM = 1;
5640        HOT = 2;
5641        COLD = 3;
5642        RELAUNCH = 4;
5643    }
5644    // The transition type.
5645    optional TransitionType type = 3;
5646
5647    // The activity name.
5648    optional string activity_name = 4;
5649}
5650
5651message AppStartFullyDrawn {
5652    // The uid if available. -1 means not available.
5653    optional int32 uid = 1 [(is_uid) = true];
5654
5655    // The app package name.
5656    optional string pkg_name = 2;
5657
5658    enum TransitionType {
5659        UNKNOWN = 0;
5660        WITH_BUNDLE = 1;
5661        WITHOUT_BUNDLE = 2;
5662    }
5663    // The transition type.
5664    optional TransitionType type = 3;
5665
5666    // The activity name.
5667    optional string activity_name = 4;
5668
5669    optional bool transition_process_running = 5;
5670
5671    // App startup time (until call to Activity#reportFullyDrawn()).
5672    optional int64 app_startup_time_millis = 6;
5673
5674    // The reason why the package was optimized.
5675    optional int32 package_optimization_compilation_reason = 7;
5676
5677    // The compiler filter used when when the package was optimized.
5678    optional int32 package_optimization_compilation_filter = 8;
5679
5680    enum SourceType {
5681        UNAVAILABLE = 0;
5682        LAUNCHER = 1;
5683        NOTIFICATION = 2;
5684        LOCKSCREEN = 3;
5685    }
5686    // The type of the startup source.
5687    optional SourceType source_type = 9;
5688
5689    // The time from the startup source to the beginning of handling the startup event.
5690    // -1 means not available.
5691    optional int32 source_event_delay_millis = 10;
5692
5693    // Whether the app is installed on Incremental File System.
5694    optional bool is_incremental = 11;
5695
5696    // Whether the app is still being streamed.
5697    optional bool is_loading = 12;
5698
5699    // The hash value of the activity name.
5700    optional int32 activity_name_hash = 13;
5701
5702    // The timestamp(SystemClock#elapsedRealtime()) when starting activity.
5703    optional int64 activity_start_timestamp_millis = 14;
5704}
5705
5706/**
5707 * Logs when an app enters a different App Compat state.
5708 *
5709 * Logged from:
5710 *   frameworks/base/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
5711 */
5712message AppCompatStateChanged {
5713    // UID of the package whose state changed.
5714    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
5715
5716    enum State {
5717        UNKNOWN = 0;
5718        // The app is not visible or has been closed.
5719        NOT_VISIBLE = 1;
5720        // The app’s bounds aren’t letterboxed.
5721        NOT_LETTERBOXED = 2;
5722        // The app’s bounds are letterboxed because of size-compat-mode.
5723        LETTERBOXED_FOR_SIZE_COMPAT_MODE = 3;
5724        // The app’s bounds are letterboxed because of fixed orientation.
5725        LETTERBOXED_FOR_FIXED_ORIENTATION = 4;
5726        // The app’s bounds are letterboxed because of aspect ratio restrictions.
5727        LETTERBOXED_FOR_ASPECT_RATIO = 5;
5728    }
5729
5730    // Position of the letterbox
5731    enum Position {
5732        UNKNOWN_POSITION = 0;
5733        NOT_LETTERBOXED_POSITION = 1;
5734        CENTER = 2;
5735        LEFT = 3;
5736        RIGHT = 4;
5737        TOP = 5;
5738        BOTTOM = 6;
5739    }
5740
5741    // The state that was entered.
5742    optional State state = 2 [
5743      (state_field_option).exclusive_state = true,
5744      (state_field_option).nested = false];
5745
5746    optional Position letterbox_position = 3;
5747}
5748
5749/**
5750 * Logs when an app that is letterboxed changes position.
5751 *
5752 * Logged from:
5753 *   frameworks/base/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
5754 */
5755
5756message LetterboxPositionChanged {
5757    // UID of the package that is letterboxed.
5758    optional int32 uid = 1 [(is_uid) = true];
5759
5760    // The new position of the letterbox
5761    enum PositionChange {
5762        UNKNOWN = 0;
5763        CENTER_TO_LEFT = 1;
5764        LEFT_TO_CENTER = 2;
5765        CENTER_TO_RIGHT= 3;
5766        RIGHT_TO_CENTER = 4;
5767        CENTER_TO_TOP = 5;
5768        TOP_TO_CENTER = 6;
5769        CENTER_TO_BOTTOM = 7;
5770        BOTTOM_TO_CENTER = 8;
5771    }
5772
5773    optional PositionChange position_change = 2;
5774
5775}
5776
5777/**
5778 * Logs events reported for the Size Compat restart button of an app.
5779 *
5780 * Logged from:
5781 *   frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
5782 */
5783message SizeCompatRestartButtonEventReported {
5784    // UID of the package that has the button.
5785    optional int32 uid = 1 [(is_uid) = true];
5786
5787    enum Event {
5788        UNKNOWN = 0;
5789        APPEARED = 1;
5790        CLICKED = 2;
5791    }
5792
5793    // The event that was reported.
5794    optional Event event = 2;
5795}
5796
5797/**
5798 * Logs a picture-in-picture action
5799 * Logged from:
5800 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5801 *      frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
5802 *      frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
5803 */
5804message PictureInPictureStateChanged {
5805    // -1 if it is not available
5806    optional int32 uid = 1 [(is_uid) = true];
5807
5808    optional string short_name = 2;
5809
5810    enum State {
5811        ENTERED = 1;
5812        EXPANDED_TO_FULL_SCREEN = 2;
5813        MINIMIZED = 3;
5814        DISMISSED = 4;
5815    }
5816    optional State state = 3;
5817}
5818
5819/**
5820 * Logs overlay action
5821 * Logged from:
5822 *     services/core/java/com/android/server/wm/Session.java
5823 */
5824message OverlayStateChanged {
5825    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
5826
5827    optional string package_name = 2 [(state_field_option).primary_field = true];
5828
5829    optional bool using_alert_window = 3;
5830
5831    enum State {
5832        ENTERED = 1;
5833        EXITED = 2;
5834    }
5835    optional State state = 4
5836            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
5837}
5838
5839/**
5840 * Logs foreground service starts and stops.
5841 * Note that this is not when a service starts or stops, but when it is
5842 * considered foreground.
5843 * Logged from
5844 *     frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
5845 */
5846message ForegroundServiceStateChanged {
5847    optional int32 uid = 1 [(is_uid) = true];
5848    // package_name + "/" + class_name
5849    optional string short_name = 2;
5850
5851    enum State {
5852        UNKNOWN_STATE = 0;
5853        ENTER = 1;
5854        EXIT = 2;
5855        DENIED = 3;
5856        API_CALL = 4; // this event is to annotate API call.
5857        TIMED_OUT = 5; // time-restricted fgs type timed out.
5858    }
5859    optional State state = 3;
5860
5861    // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
5862    // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
5863    optional bool allow_while_in_use_permission = 4;
5864    // the reason why FGS is allowed or denied to start. The reason code is defined as
5865    // PowerExemptionManager#ReasonCode.
5866    optional int32 fgs_start_reason_code = 5;
5867    // FGS service's targetSdkVersion.
5868    optional int32 target_sdk_version = 6;
5869    // uid of the app that start/bind this service.
5870    optional int32 calling_uid = 7 [(is_uid) = true];
5871    // targetSdkVersion of the app that start/bind this service.
5872    optional int32 caller_target_sdk_version = 8;
5873    // uid of the app that set the temp-allowlist, INVALID_UID (-1) if not in any
5874    // temp-allowlist.
5875    optional int32 temp_allow_list_calling_uid = 9 [(is_uid) = true];
5876    // FGS notification was deferred.
5877    optional bool fgs_notification_deferred = 10;
5878    // FGS notification was shown before the FGS finishes, or it wasn't deferred in the first place.
5879    optional bool fgs_notification_shown = 11;
5880    // The duration from state ENTER to state EXIT. Only meaningful when the state is EXIT.
5881    optional int32 fgs_duration_ms = 12;
5882    // Number of times startForeground() is called on this service.
5883    optional int32 fgs_start_count = 13;
5884    // SHA-1 hashed short_name combined with ANDROID_ID.
5885    optional int32 short_name_hash = 14;
5886    // Whether this FGS package had permission to notify the user.
5887    optional bool fgs_has_notification_permission = 15;
5888
5889    // Keep in sync with frameworks/base/core/java/android/content/pm/ServiceInfo.java
5890    enum ForegroundServiceType {
5891        FOREGROUND_SERVICE_TYPE_NONE = 0;
5892        FOREGROUND_SERVICE_TYPE_DATA_SYNC = 0x0001; // 1 << 0
5893        FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK = 0x0002; // 1 << 1
5894        FOREGROUND_SERVICE_TYPE_PHONE_CALL = 0x0004; //1 << 2
5895        FOREGROUND_SERVICE_TYPE_LOCATION = 0x0008; // 1 << 3
5896        FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE = 0x0010; // 1 << 4
5897        FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION = 0x0020; // 1 << 5
5898        FOREGROUND_SERVICE_TYPE_CAMERA = 0x0040; // 1 << 6
5899        FOREGROUND_SERVICE_TYPE_MICROPHONE = 0x0080; // 1 << 7
5900        FOREGROUND_SERVICE_TYPE_HEALTH = 0x0100; // 1 << 8
5901        FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING = 0x0200; // 1 << 9
5902        FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED = 0x0400; // 1 << 10
5903        FOREGROUND_SERVICE_TYPE_SHORT_SERVICE = 0x0800; // 1 << 11
5904        // 1 << 12 is being skipping since it was temporarily reserved for FILE_MANAGEMENT
5905        FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING = 0x2000; // 1 << 13
5906        FOREGROUND_SERVICE_TYPE_SPECIAL_USE = 0x40000000; // 1 << 30
5907    }
5908
5909    // The foreground service types, must be one or a combination of the types
5910    // in the ForegroundServiceType above.
5911    optional int32 fgs_types = 16;
5912    // The result check code for the fgs type enforcement.
5913    optional android.app.FgsTypePolicyCheckEnum fgs_type_check_code = 17;
5914    // If true, this FGS service is a delegate (instead of real FGS).
5915    optional bool is_delegate = 18;
5916    // The actual client app's uid.
5917    optional int32 delegate_client_uid = 19 [(is_uid) = true];
5918    // The service module that start/stop the delegate, could be
5919    // MediaSessionService, VOIP, Camera, Audio, Location etc.
5920    // The enum is defined in interface
5921    // ForegroundServiceDelegationOptions.DelegationService
5922    optional int32 delegation_service = 20;
5923
5924    enum ApiJourneyState {
5925    	  UNKNOWN_JOURNEY_STATE = 0;
5926        ENTER_WITH_FGS = 1;
5927        EXIT_WITH_FGS = 2;
5928        EXIT_WITHOUT_FGS = 3;
5929        PAUSE = 4;
5930        RESUME = 5;
5931    }
5932
5933    optional ApiJourneyState api_state = 21;
5934
5935    enum ApiType {
5936    	  UNKNOWN_API_TYPE = 0;
5937        CAMERA = 1;
5938        BLUETOOTH = 2;
5939        LOCATION = 3;
5940        MEDIA_PLAYBACK = 4;
5941        AUDIO = 5;
5942        MICROPHONE = 6;
5943        PHONE_CALL = 7;
5944        USB = 8;
5945        CDM = 9;
5946    }
5947
5948    repeated ApiType api_type = 22;
5949
5950    repeated int64 api_timestamp = 23;
5951
5952    optional int64 api_before_fgs_start_duration_millis = 28;
5953
5954    optional int64 api_after_fgs_end_duration_millis = 29;
5955
5956    // Keep it in sync with ActivityManager.ProcessCapability.
5957    enum ProcessCapability {
5958        PROCESS_CAPABILITY_NONE = 0;
5959        PROCESS_CAPABILITY_FOREGROUND_LOCATION = 1;
5960        PROCESS_CAPABILITY_FOREGROUND_CAMERA = 2;
5961        PROCESS_CAPABILITY_FOREGROUND_MICROPHONE = 4;
5962        PROCESS_CAPABILITY_POWER_RESTRICTED_NETWORK = 8;
5963        PROCESS_CAPABILITY_BFSL = 16;
5964        PROCESS_CAPABILITY_USER_RESTRICTED_NETWORK = 32;
5965    }
5966
5967    optional android.app.ProcessStateEnum service_uid_state = 24 [default = PROCESS_STATE_UNKNOWN];
5968    optional ProcessCapability service_uid_capabilities = 25;
5969
5970    optional android.app.ProcessStateEnum calling_uid_state = 26 [default = PROCESS_STATE_UNKNOWN];
5971    optional ProcessCapability calling_uid_capabilities = 27;
5972
5973    optional int32 while_in_use_reason_code_no_binding = 30;
5974    optional int32 while_in_use_reason_code_in_bind_service = 31;
5975    optional int32 while_in_use_reason_code_by_bindings = 32;
5976    optional int32 fgs_start_reason_code_no_binding = 33;
5977    optional int32 fgs_start_reason_code_in_bind_service = 34;
5978    optional int32 fgs_start_reason_code_by_bindings = 35;
5979
5980    enum FgsStartApi {
5981        // Not available -- used in atoms that are unrelated to this selection.
5982        FGSSTARTAPI_NA = 0;
5983        // The FGS was not started. (likely it's bound.)
5984        FGSSTARTAPI_NONE = 1;
5985        // The FGS was started with Context.startService().
5986        FGSSTARTAPI_START_SERVICE = 2;
5987        // The FGS was started with Context.startForegroundService().
5988        FGSSTARTAPI_START_FOREGROUND_SERVICE = 3;
5989        // It's a delegate FGS.
5990        FGSSTARTAPI_DELEGATE = 4;
5991
5992    }
5993    optional FgsStartApi fgs_start_api = 36;
5994
5995    // Whether setFgsRestrictionLocked() was called in Service.startForeground().
5996    optional bool fgs_restriction_recalculated = 37;
5997}
5998
5999/**
6000 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
6001 * A foreground service session is any continuous period during which the uid holds at least one
6002 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
6003 * Accesses initiated while the uid is in the TOP state are ignored.
6004 * Sessions with no attempted accesses are not logged.
6005 * Logged from
6006 *     frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
6007 */
6008message ForegroundServiceAppOpSessionEnded {
6009    optional int32 uid = 1 [(is_uid) = true];
6010
6011    // The operation's name.
6012    // Only following four ops are logged
6013    // COARSE_LOCATION = 0
6014    // FINE_LOCATION = 1
6015    // CAMERA = 26
6016    // RECORD_AUDIO = 27
6017    optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
6018
6019    // The uid's permission mode for accessing the AppOp during this fgs session.
6020    enum Mode {
6021        MODE_UNKNOWN = 0;
6022        MODE_ALLOWED = 1; // Always allowed
6023        MODE_IGNORED = 2; // Denied
6024        MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
6025    }
6026    optional Mode app_op_mode = 3;
6027
6028    // Number of times this AppOp was requested and allowed.
6029    optional int32 count_ops_accepted = 4;
6030    // Number of times this AppOp was requested but denied.
6031    optional int32 count_ops_rejected = 5;
6032}
6033
6034/**
6035 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
6036 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
6037 * attributed back to the parent (host) uid. One example is Chrome.
6038 *
6039 * Logged from:
6040 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
6041 */
6042message IsolatedUidChanged {
6043    // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
6044    // This field is ignored when event == REMOVED.
6045    optional int32 parent_uid = 1 [(is_uid) = true];
6046
6047    optional int32 isolated_uid = 2 [(is_uid) = true];
6048
6049    // We expect an isolated uid to be removed before if it's used for another parent uid.
6050    enum Event {
6051        REMOVED = 0;
6052        CREATED = 1;
6053    }
6054    optional Event event = 3;
6055}
6056
6057/*
6058 * Logs the reception of an incoming network packet causing the main system to wake up for
6059 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
6060 * and processed by WakeupController.cpp.
6061 */
6062message PacketWakeupOccurred {
6063    // The uid owning the socket into which the packet was delivered, or -1 if the packet was
6064    // delivered nowhere.
6065    optional int32 uid = 1 [(is_uid) = true];
6066    // The interface name on which the packet was received.
6067    optional string iface = 2;
6068    // The ethertype value of the packet.
6069    optional int32 ethertype = 3;
6070    // String representation of the destination MAC address of the packet.
6071    optional string destination_hardware_address = 4;
6072    // String representation of the source address of the packet if this was an IP packet.
6073    optional string source_ip = 5;
6074    // String representation of the destination address of the packet if this was an IP packet.
6075    optional string destination_ip = 6;
6076    // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
6077    // field if this was an IPv6 packet. The range of possible values is the same for both IP
6078    // families.
6079    optional int32 ip_next_header = 7;
6080    // The source port if this was a TCP or UDP packet.
6081    optional int32 source_port = 8;
6082    // The destination port if this was a TCP or UDP packet.
6083    optional int32 destination_port = 9;
6084}
6085
6086/*
6087 * Logs the memory stats for an app on startup.
6088 * Logged from:
6089 *     frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6090 */
6091message AppStartMemoryStateCaptured {
6092    // The uid if available. -1 means not available.
6093    optional int32 uid = 1 [(is_uid) = true];
6094
6095    // The process name.
6096    optional string process_name = 2;
6097
6098    // The activity name.
6099    optional string activity_name = 3;
6100
6101    // # of page-faults
6102    optional int64 page_fault = 4;
6103
6104    // # of major page-faults
6105    optional int64 page_major_fault = 5;
6106
6107    // RSS
6108    optional int64 rss_in_bytes = 6;
6109
6110    // CACHE
6111    optional int64 cache_in_bytes = 7;
6112
6113    // SWAP
6114    optional int64 swap_in_bytes = 8;
6115}
6116
6117/*
6118 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
6119 * Logged from:
6120 *      system/core/lmkd/lmkd.c
6121 */
6122message LmkKillOccurred {
6123    enum Reason {
6124        UNKNOWN = 0;
6125        PRESSURE_AFTER_KILL = 1;
6126        NOT_RESPONDING = 2;
6127        LOW_SWAP_AND_THRASHING = 3;
6128        LOW_MEM_AND_SWAP = 4;
6129        LOW_MEM_AND_THRASHING = 5;
6130        DIRECT_RECL_AND_THRASHING = 6;
6131        LOW_MEM_AND_SWAP_UTIL = 7;
6132        LOW_FILECACHE_AFTER_THRASHING = 8;
6133        LOW_MEM = 9;
6134        DIRECT_RECL_STUCK = 10;
6135    }
6136
6137    // The uid if available. -1 means not available.
6138    optional int32 uid = 1 [(is_uid) = true];
6139
6140    // The process name.
6141    optional string process_name = 2;
6142
6143    // oom adj score.
6144    optional int32 oom_adj_score = 3;
6145
6146    // # of page-faults
6147    optional int64 page_fault = 4;
6148
6149    // # of major page-faults
6150    optional int64 page_major_fault = 5;
6151
6152    // RSS
6153    optional int64 rss_in_bytes = 6;
6154
6155    // CACHE
6156    optional int64 cache_in_bytes = 7;
6157
6158    // SWAP
6159    optional int64 swap_in_bytes = 8;
6160
6161    // The elapsed real time of start of the process.
6162    optional int64 process_start_time_nanos = 9;
6163
6164    // Min oom adj score considered by lmkd.
6165    optional int32 min_oom_score = 10;
6166
6167    // Free physical memory on device at LMK time.
6168    optional int32 free_mem_kb = 11;
6169
6170    // Free swap on device at LMK time.
6171    optional int32 free_swap_kb = 12;
6172
6173    // What triggered the LMK event.
6174    optional Reason reason = 13;
6175
6176    // Current thrashing levels (workingset_refaults/filecache in %).
6177    optional int32 thrashing = 14;
6178
6179    // Max thrashing levels (workingset_refaults/filecache in %).
6180    optional int32 max_thrashing = 15;
6181
6182    // How many active foreground services across the system
6183    optional int32 total_foreground_services = 16;
6184
6185    // How many processes hosting foreground services
6186    optional int32 procs_with_foreground_services = 17;
6187}
6188
6189/*
6190 * Logs when the ActivityManagerService detects that an app died.
6191 *
6192 * Logged from:
6193 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6194 */
6195message AppDied {
6196    // timestamp(elapsedRealtime) of record creation
6197    optional uint64 timestamp_millis = 1;
6198}
6199
6200/**
6201 * An atom for generic metrics logging. Available from Android Q.
6202 */
6203message GenericAtom {
6204    // The uid of the application that sent this custom atom.
6205    optional int32 uid = 1 [(is_uid) = true];
6206
6207    // An event_id indicates the type of event.
6208    optional android.stats.EventType event_id = 2;
6209}
6210
6211/**
6212 * Atom for simple logging of user interaction and impression events, such as "the user touched
6213 * this button" or "this dialog was displayed".
6214 * Keep the UI event stream clean: don't use for system or background events.
6215 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
6216 *
6217 * Logged from:
6218 *   frameworks/base/services/core/java/com/android/server/
6219 *   frameworks/base/packages/SystemUI/src/com/android/systemui/
6220 */
6221message UiEventReported {
6222    // The event_id.
6223    optional int32 event_id = 1;
6224    // The event's source or target uid and package, if applicable.
6225    // For example, the package posting a notification, or the destination package of a share.
6226    optional int32 uid = 2 [(is_uid) = true];
6227    optional string package_name = 3;
6228    // An identifier used to disambiguate which logs refer to a particular instance of some
6229    // UI element. Useful when there might be multiple instances simultaneously active.
6230    optional int32 instance_id = 4;
6231}
6232
6233/**
6234 * Atom for logging Dream user interaction and impression events.
6235 *
6236 * Logged from:
6237 *   frameworks/base/services/core/java/com/android/server/
6238 */
6239message DreamUiEventReported {
6240    // The event's source or target uid, if applicable.
6241    optional int32 uid = 1 [(is_uid) = true];
6242    // The event_id (as for UiEventReported).
6243    optional int32 event_id = 2;
6244    // An identifier used to disambiguate which logs refer to a particular instance of some
6245    // UI element. Useful when there might be multiple instances simultaneously active.
6246    optional int32 instance_id = 3;
6247
6248    // The name of the dream component, which identifies the type of the dream.
6249    optional string dream_component_name = 4;
6250}
6251
6252/**
6253 * Reports a notification was created or updated.
6254 *
6255 * Logged from:
6256 *   frameworks/base/services/core/java/com/android/server/notification/
6257 */
6258message NotificationReported {
6259    // The event_id (as for UiEventReported).
6260    optional int32 event_id = 1;
6261    // The notifying app's uid and package.
6262    optional int32 uid = 2 [(is_uid) = true];
6263    optional string package_name = 3;
6264    // A small system-assigned identifier for the notification.
6265    // Locally probably-unique, but expect collisions across users and/or days.
6266    optional int32 instance_id = 4;
6267    optional int32 notification_id_hash = 5;  // Small hash of the app-assigned notif ID + tag
6268    optional int32 channel_id_hash = 6;  // Small hash of app-assigned channel ID
6269
6270    // Grouping information
6271    optional int32 group_id_hash = 7;  // Small hash of the group ID of the notification
6272    optional int32 group_instance_id = 8;  // Instance_id of the group-summary notification
6273    optional bool is_group_summary = 9;  // Tags the group-summary notification
6274
6275    // Attributes
6276    optional string category = 10;   // App-assigned notification category (API-defined strings)
6277    optional int32 style = 11;       // App-assigned notification style
6278    optional int32 num_people = 12;  // Number of Person records attached to the notification
6279
6280    // Ordering, importance and interruptiveness
6281
6282    optional int32 position = 13;    // Position in NotificationManager's list
6283
6284    optional android.stats.sysui.NotificationImportance importance = 14;
6285    optional int32 alerting = 15;    // Bitfield, 1=buzz 2=beep 4=blink
6286
6287    enum NotificationImportanceExplanation {
6288        IMPORTANCE_EXPLANATION_UNKNOWN = 0;
6289        IMPORTANCE_EXPLANATION_APP = 1;     // App-specified channel importance.
6290        IMPORTANCE_EXPLANATION_USER = 2;    // User-specified channel importance.
6291        IMPORTANCE_EXPLANATION_ASST = 3;    // Notification Assistant override.
6292        IMPORTANCE_EXPLANATION_SYSTEM = 4;  // System override.
6293        // Like _APP, but based on pre-channels priority signal.
6294        IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
6295    }
6296
6297    optional NotificationImportanceExplanation importance_source = 16;
6298    optional android.stats.sysui.NotificationImportance importance_initial = 17;
6299    optional NotificationImportanceExplanation importance_initial_source = 18;
6300    optional android.stats.sysui.NotificationImportance importance_asst = 19;
6301    optional int32 assistant_hash = 20;
6302    optional float assistant_ranking_score = 21;
6303
6304    // Fields for tracking ongoing and foreground service notifications
6305    optional bool is_ongoing = 22;
6306    optional bool is_foreground_service = 23;
6307    // Fields to know about the timeout for notifications.
6308    optional int64 timeout_millis = 24;
6309
6310    // Field for tracking whether the notification is non-dismissible
6311    optional bool is_non_dismissible = 25;
6312
6313    // Time elapsed between the notify() API call and the NLSes being told about the notification.
6314    // Will be 0 for NotificationReported protos that do not correspond to a notify() call.
6315    optional int64 post_duration_millis = 26;
6316
6317    // State of the full screen intent posted with this notification.
6318    enum FsiState {
6319        // This notification was not posted with a full screen intent.
6320        NO_FSI = 0;
6321        // This notification was posted with a full screen intent and the FSI permission is granted.
6322        FSI_ALLOWED = 1;
6323        // This notification was posted with a full screen intent but the FSI permission is denied.
6324        FSI_DENIED = 2;
6325    }
6326    optional FsiState fsi_state = 27;
6327
6328    // True if the device was locked or showing unlocked AOD.
6329    optional bool is_locked = 28;
6330
6331    // Age of the notification in minutes.
6332    optional int32 age_in_minutes = 29;
6333}
6334
6335/**
6336 * Reports a notification channel, or channel group, was created, updated, or deleted.
6337 *
6338 * Logged from:
6339 *   frameworks/base/services/core/java/com/android/server/notification/
6340 */
6341message NotificationChannelModified {
6342    // The event_id (as for UiEventReported).
6343    optional int32 event_id = 1;
6344    // The notifying app's uid and package.
6345    optional int32 uid = 2 [(is_uid) = true];
6346    optional string package_name = 3;
6347    // Hash of app-assigned notification channel ID or channel-group ID
6348    optional int32 channel_id_hash = 4;
6349    // Previous importance setting, if applicable
6350    optional android.stats.sysui.NotificationImportance old_importance = 5;
6351    // New importance setting
6352    optional android.stats.sysui.NotificationImportance importance = 6;
6353    // whether or not this channel represents a conversation
6354    optional bool is_conversation = 7;
6355    // Hash of app-assigned notification conversation id
6356    optional int32 conversation_id_hash = 8;
6357    // whether or not the user demoted this channel out of the conversation space
6358    optional bool is_conversation_demoted = 9;
6359    // whether this conversation is marked as being a priority
6360    optional bool is_conversation_priority = 10;
6361}
6362
6363/**
6364 * Logged when notification are dismissed. If multiple notifications are dismissed together,
6365 * this is only logged once per style per UID.
6366 * Logged from
6367 *    frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging
6368 */
6369message NotificationDismissed {
6370    // UID if the application (can be mapped to package and version)
6371    optional int32 uid = 1 [(is_uid) = true];
6372    // Integer enum value showing aggregated notification style.
6373    optional android.stats.sysui.NotificationStyle style = 2;
6374    // Reason for dismissal, based on REASON_ constants in
6375    // frameworks/base/core/java/android/service/notification/NotificationListenerService.java
6376    optional int32 reason = 3;
6377    // Number of notifications dismissed.
6378    optional int32 count = 4;
6379    // Memory use of Notification object being dismissed, in KB.
6380    optional int32 notificationObjectMemoryUse = 5;
6381    // Memory use of Notification views being dismissed, in KB.
6382    optional int32 notificationViewMemoryUse = 6;
6383    // Current memory use of SystemUI, RSS Anon in KB.
6384    optional int32 systemUiMemoryUse = 7;
6385}
6386
6387/**
6388 * Logs when a biometric acquire event occurs.
6389 *
6390 * Logged from:
6391 *   frameworks/base/services/core/java/com/android/server/biometrics
6392 */
6393message BiometricAcquired {
6394    // Biometric modality that was acquired.
6395    optional android.hardware.biometrics.ModalityEnum modality = 1;
6396    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
6397    optional int32 user = 2;
6398    // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
6399    optional bool is_crypto = 3;
6400    // Action that the device is performing. Acquired messages are only expected for enroll and
6401    // authenticate. Other actions may indicate an error.
6402    optional android.hardware.biometrics.ActionEnum action = 4;
6403    // The client that this acquisition was received for.
6404    optional android.hardware.biometrics.ClientEnum client = 5;
6405    // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
6406    optional int32 acquire_info = 6;
6407    // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
6408    optional int32 acquire_info_vendor = 7;
6409    // Dictates if this message should trigger additional debugging.
6410    optional bool debug = 8;
6411    // The ID of the biometric sensor associated with this action.
6412    optional int32 sensor_id = 9;
6413    // The ID of the session this event occurred in (if any)
6414    optional int32 session_id = 10;
6415    // The type of session (i.e. CUJ)
6416    optional android.hardware.biometrics.SessionTypeEnum session_type = 11;
6417    // If the AoD was on when this event occurred.
6418    optional bool is_aod = 12;
6419    // If the display is on when this event occurred.
6420    optional bool is_display_on = 13;
6421    // The dock state when this event occurred.
6422    optional android.server.DockStateEnum dock_state = 14;
6423    // The orientation of the device when this event occurred
6424    optional android.hardware.biometrics.OrientationEnum orientation = 15;
6425    // The fold state of the device when this event occurred
6426    optional android.hardware.biometrics.FoldStateEnum fold_state = 16;
6427    // The order this event was processed by the framework, if part of a session
6428    optional int32 session_order = 17;
6429    // An associated device wake up reason for this event, or UNKNOWN if the event was not triggered due to a wake up event.
6430    optional android.hardware.biometrics.WakeReasonEnum wake_reason = 18;
6431}
6432
6433/**
6434 * Logs when a biometric authentication event occurs.
6435 *
6436 * Logged from:
6437 *   frameworks/base/services/core/java/com/android/server/biometrics
6438 */
6439message BiometricAuthenticated {
6440    // Biometric modality that was used.
6441    optional android.hardware.biometrics.ModalityEnum modality = 1;
6442    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
6443    optional int32 user = 2;
6444    // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
6445    // storage.
6446    optional bool is_crypto = 3;
6447    // The client that this acquisition was received for.
6448    optional android.hardware.biometrics.ClientEnum client = 4;
6449    // If authentication requires user confirmation. See BiometricPrompt's
6450    // setRequireConfirmation(bool) method.
6451    optional bool require_confirmation = 5;
6452
6453    enum State {
6454        UNKNOWN = 0;
6455        REJECTED = 1;
6456        PENDING_CONFIRMATION = 2;
6457        CONFIRMED = 3;
6458    }
6459
6460    // State of the current auth attempt.
6461    optional State state = 6;
6462    // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
6463    // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
6464    // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
6465    // CONFIRMED.
6466    optional int64 latency_millis = 7;
6467    // Dictates if this message should trigger additional debugging.
6468    optional bool debug = 8;
6469    // The ID of the biometric sensor associated with this action.
6470    optional int32 sensor_id = 9;
6471    // The ambient light lux when authenticated.
6472    optional float ambient_light_lux = 10;
6473    // The ID of the session this event occurred in (if any)
6474    optional int32 session_id = 11;
6475    // The type of session (i.e. CUJ)
6476    optional android.hardware.biometrics.SessionTypeEnum session_type = 12;
6477    // If the AoD was on when this event occurred.
6478    optional bool is_aod = 13;
6479    // If the display is on when this event occurred.
6480    optional bool is_display_on = 14;
6481    // The dock state when this event occurred.
6482    optional android.server.DockStateEnum dock_state = 15;
6483    // The orientation of the device when this event occurred
6484    optional android.hardware.biometrics.OrientationEnum orientation = 16;
6485    // The fold state of the device when this event occurred
6486    optional android.hardware.biometrics.FoldStateEnum fold_state = 17;
6487    // The order this event was processed by the framework, if part of a session
6488    optional int32 session_order = 18;
6489    // An associated device wake up reason for this event, or UNKNOWN if the event was not triggered due to a wake up event.
6490    optional android.hardware.biometrics.WakeReasonEnum wake_reason = 19;
6491    // Additional modality-specific details that caused a biometric to be activated (often associated with a device wake_reason).
6492    repeated android.hardware.biometrics.WakeReasonDetailsEnum wake_reason_details = 20;
6493    // If the authentication is due to identity check being enabled
6494    optional bool identity_check = 21;
6495}
6496
6497/**
6498 * Logs when a biometric error occurs.
6499 *
6500 * Logged from:
6501 *   frameworks/base/services/core/java/com/android/server/biometrics
6502 */
6503message BiometricErrorOccurred {
6504    // Biometric modality that was used.
6505    optional android.hardware.biometrics.ModalityEnum modality = 1;
6506    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
6507    optional int32 user = 2;
6508    // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
6509    optional bool is_crypto = 3;
6510    // Action that the device is performing.
6511    optional android.hardware.biometrics.ActionEnum action = 4;
6512    // The client that this acquisition was received for.
6513    optional android.hardware.biometrics.ClientEnum client = 5;
6514    // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
6515    // are unique to modality.
6516    optional int32 error_info = 6;
6517    // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
6518    // by the vendor and not specified by the HIDL interface.
6519    optional int32 error_info_vendor = 7;
6520    // Dictates if this message should trigger additional debugging.
6521    optional bool debug = 8;
6522    // Time spent during the authentication attempt.
6523    optional int64 latency_millis = 9;
6524    // The ID of the biometric sensor associated with this action.
6525    optional int32 sensor_id = 10;
6526    // The ID of the session this event occurred in (if any)
6527    optional int32 session_id = 11;
6528    // The type of session (i.e. CUJ)
6529    optional android.hardware.biometrics.SessionTypeEnum session_type = 12;
6530    // If the AoD was on when this event occurred.
6531    optional bool is_aod = 13;
6532    // If the display is on when this event occurred.
6533    optional bool is_display_on = 14;
6534    // The dock state when this event occurred.
6535    optional android.server.DockStateEnum dock_state = 15;
6536    // The orientation of the device when this event occurred
6537    optional android.hardware.biometrics.OrientationEnum orientation = 16;
6538    // The fold state of the device when this event occurred
6539    optional android.hardware.biometrics.FoldStateEnum fold_state = 17;
6540    // The order this event was processed by the framework, if part of a session
6541    optional int32 session_order = 18;
6542    // An associated device wake up reason for this event, or UNKNOWN if the event was not triggered due to a wake up event.
6543    optional android.hardware.biometrics.WakeReasonEnum wake_reason = 19;
6544    // Additional modality-specific details that caused a biometric to be activated (often associated with a device wake_reason).
6545    repeated android.hardware.biometrics.WakeReasonDetailsEnum wake_reason_details = 20;
6546    // If the authentication is due to identity check being enabled
6547    optional bool identity_check = 21;
6548}
6549
6550/**
6551 * Logs when a system health issue is detected.
6552 * Logged from:
6553 *   frameworks/base/services/core/java/com/android/server/biometrics
6554 */
6555message BiometricSystemHealthIssueDetected {
6556    // Biometric modality.
6557    optional android.hardware.biometrics.ModalityEnum modality = 1;
6558    // Type of issue detected.
6559    optional android.hardware.biometrics.IssueEnum issue = 2;
6560    // Dictates if this message should trigger additional debugging.
6561    optional bool debug = 3;
6562    // The ID of the biometric sensor associated with this action.
6563    optional int32 sensor_id = 4;
6564}
6565
6566/**
6567 * Logs when a biometric enrollment occurs.
6568 *
6569 * Logged from:
6570 *   frameworks/base/services/core/java/com/android/server/biometrics
6571 */
6572message BiometricEnrolled {
6573    // Biometric modality that was used.
6574    optional android.hardware.biometrics.ModalityEnum modality = 1;
6575    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
6576    optional int32 user = 2;
6577    // The amount of time the enrollment took in milliseconds.
6578    optional int64 latency_millis = 3;
6579    // Whether or not the enrollment was successful.
6580    optional bool success = 4;
6581    // The ID of the biometric sensor associated with this action.
6582    optional int32 sensor_id = 5;
6583    // The ambient light lux when the user enrolled.
6584    optional float ambient_light_lux = 6;
6585    // The source for where this enrollment came frame
6586    optional android.hardware.biometrics.EnrollmentSourceEnum enroll_source = 7;
6587    // Numerical ID for enrolled template that increments with every new enrollment. Eg: 1, 2...
6588    optional int32 template_id = 8;
6589}
6590
6591
6592/*
6593 * Logs when one of the BiometricPrompt#authenticate() method variants is called.
6594 *
6595 * Logged from:
6596 *   frameworks/base/services/core/java/com/android/server/biometrics
6597 *
6598 */
6599 message AuthPromptAuthenticateInvoked {
6600    // Whether an explicit CryptoObject was passed to the biometric prompt.
6601    optional bool is_crypto = 1;
6602    // The value passed to setConfirmationRequired(boolean), or true if not set.
6603    optional bool is_confirmation_required = 2;
6604    // The value passed to setDeviceCredentialAllowed(boolean), or false if not set.
6605    optional bool is_credential_allowed = 3;
6606    // Whether a value was passed to setAllowedAuthenticators(int).
6607    optional bool is_allowed_authenticators_set = 4;
6608    // The value passed to setAllowedAuthenticators(int), if any.
6609    optional int32 allowed_authenticators = 5;
6610}
6611
6612/*
6613 * Logs when one of the BiometricPrompt#canAuthenticate() method variants is called.
6614 *
6615 * Logged from:
6616 *   frameworks/base/services/core/java/com/android/server/biometrics
6617 *
6618 */
6619message AuthManagerCanAuthenticateInvoked {
6620    // Whether a bit field of allowed authenticator types was provided as an argument.
6621    optional bool is_allowed_authenticators_set = 1;
6622    // The bit field of allowed authenticator types provided, if any.
6623    optional int32 allowed_authenticators = 2;
6624    // The authentication status code that was returned.
6625    optional int32 result_code = 3;
6626}
6627
6628/*
6629 * Logs when Biometric enrollment is requested via the ACTION_BIOMETRIC_ENROLL intent action.
6630 *
6631 * Logged from:
6632 *   frameworks/base/services/core/java/com/android/server/biometrics
6633 *
6634 */
6635message AuthEnrollActionInvoked {
6636    // Whether a Class 3 (strong) biometric was previously enrolled on this device.
6637    optional bool is_strong_biometric_enrolled = 1;
6638    // Whether a Class 2 (weak) biometric was previously enrolled on this device.
6639    optional bool is_weak_biometric_enrolled = 2;
6640    // Whether a PIN/pattern/password was previously enrolled on this device.
6641    optional bool is_device_credential_enrolled = 3;
6642    // Whether a bit field of allowed authenticator types was provided as an extra.
6643    optional bool is_allowed_authenticators_set = 4;
6644    // The bit field of allowed authenticator types provided, if any.
6645    optional int32 allowed_authenticators = 5;
6646}
6647
6648/*
6649 * Logs when an application uses a deprecated biometric or authentication API feature.
6650 *
6651 * Logged from:
6652 *   frameworks/base/services/core/java/com/android/server/biometrics
6653 */
6654 message AuthDeprecatedAPIUsed {
6655    enum APIEnum {
6656        API_UNKNOWN = 0;
6657        // android.hardware.fingerprint.FingerprintManager#authenticate(CryptoObject,
6658        // CancellationSignal, int, AuthenticationCallback, Handler)
6659        API_FINGERPRINT_MANAGER_AUTHENTICATE = 1;
6660        // android.hardware.fingerprint.FingerprintManager#hasEnrolledFingerprints()
6661        API_FINGERPRINT_MANAGER_HAS_ENROLLED_FINGERPRINTS = 2;
6662        // android.hardware.fingerprint.FingerprintManager#isHardwareDetected()
6663        API_FINGERPRINT_MANAGER_IS_HARDWARE_DETECTED = 3;
6664        // android.hardware.biometrics.BiometricManager#canAuthenticate()
6665        API_BIOMETRIC_MANAGER_CAN_AUTHENTICATE = 4;
6666    }
6667
6668     // The deprecated API feature that was used.
6669     optional APIEnum deprecated_api = 1;
6670     // The UID of the application that used the deprecated API.
6671     optional int32 app_uid = 2 [(is_uid) = true];
6672     // The target SDK version (API level) of the application that used the deprecated API.
6673     optional int32 target_sdk = 3;
6674 }
6675
6676/*
6677 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
6678 */
6679message FlagFlipUpdateOccurred {
6680    // If the event is from a flag config package, specify the package name.
6681    optional string flag_flip_package_name = 1;
6682
6683    // The order id of the package
6684    optional int64 order_id = 2;
6685}
6686
6687/**
6688 * Potential experiment ids that goes with a train install.
6689 * Should be kept in sync with experiment_ids.proto.
6690 */
6691message TrainExperimentIds {
6692    repeated int64 experiment_id = 1;
6693}
6694
6695/*
6696 * Logs when a binary push state changes.
6697 * Logged by the installer via public api.
6698 */
6699message BinaryPushStateChanged {
6700    // Name of the train.
6701    optional string train_name = 1;
6702    // Version code for a "train" of packages that need to be installed atomically
6703    optional int64 train_version_code = 2;
6704    // After installation of this package, device requires a restart.
6705    optional bool requires_staging = 3;
6706    // Rollback should be enabled for this install.
6707    optional bool rollback_enabled = 4;
6708    // Requires low latency monitoring if possible.
6709    optional bool requires_low_latency_monitor = 5;
6710
6711    enum State {
6712        UNKNOWN = 0;
6713        INSTALL_REQUESTED = 1;
6714        INSTALL_STARTED = 2;
6715        INSTALL_STAGED_NOT_READY = 3;
6716        INSTALL_STAGED_READY = 4;
6717        INSTALL_SUCCESS = 5;
6718        // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6719        // and INSTALL_FAILURE_COMMIT.
6720        INSTALL_FAILURE = 6  [deprecated = true];
6721        // This enum is for installs that are manually cancelled via the Manual Update UI.
6722        INSTALL_CANCELLED = 7;
6723        INSTALLER_ROLLBACK_REQUESTED = 8;
6724        INSTALLER_ROLLBACK_INITIATED = 9;
6725        INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6726        INSTALLER_ROLLBACK_STAGED = 11;
6727        INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6728        INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6729        INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6730        INSTALLER_ROLLBACK_SUCCESS = 15;
6731        INSTALLER_ROLLBACK_FAILURE = 16;
6732        INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6733        INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6734        INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6735        INSTALL_STAGED_CANCEL_REQUESTED = 20;
6736        INSTALL_STAGED_CANCEL_SUCCESS = 21;
6737        INSTALL_STAGED_CANCEL_FAILURE = 22;
6738        INSTALL_FAILURE_DOWNLOAD = 23;
6739        INSTALL_FAILURE_STATE_MISMATCH = 24;
6740        INSTALL_FAILURE_COMMIT = 25;
6741        REBOOT_TRIGGERED = 26;
6742        // Logged after INSTALL_REQUESTED for devices installing a train that
6743        // contains no module requiring reboot.
6744        REBOOT_NOT_REQUIRED = 27;
6745        // Logged after INSTALL_REQUESTED for devices that are installing a train
6746        // which requires reboot and eligible for soft restart.
6747        SOFT_RESTART_ELIGIBLE = 28;
6748        // Logged after INSTALL_REQUESTED for devices that are installing a train
6749        // which requires reboot and eligible for notification restart.
6750        NOTIFICATION_RESTART_ELIGIBLE = 29;
6751        // Logged after INSTALL_REQUESTED for devices that are installing a train
6752        // which requires reboot and not eligible for any reboot promotion strategy
6753        // (e.g. soft restart, notification restart).
6754        NO_REBOOT_PROMOTION_STRATEGY_ELIGIBLE = 30;
6755        REBOOT_TRIGGER_FAILURE = 31;
6756        // Logged after INSTALL_REQUESTED for devices installing a train which
6757        // requires reboot and eligible for unattended reboot.
6758        UNATTENDED_REBOOT_ELIGIBLE = 32;
6759        // Logged when Phonesky trys to prepare LSKF.
6760        LSKF_PREPARATION_INITITATED = 33;
6761        // Logged when LSKF preparation succeeded.
6762        LSKF_PREPARATION_SUCCESS = 34;
6763        // Logged when LSKF preparation failed.
6764        LSKF_PREPARATION_FAILURE = 35;
6765        // Logged when Phonesky cannot schedule reboot job on a unattended reboot
6766        // eligible device.
6767        UNATTENDED_REBOOT_NOT_TRIGGERED = 36;
6768        // Logged when SIM PIN recovery preparation succeeded.
6769        SIM_PIN_PREPARATION_SUCCESS = 37;
6770        // Logged when SIM PIN recovery preparation failed.
6771        SIM_PIN_PREPARATION_FAILURE = 38 [deprecated = true];
6772        // Logged when unattended reboot is aborted and falls back to organic
6773        // reboot.
6774        UNATTENDED_REBOOT_ABORT = 39;
6775        // Logged when Phonesky re-prepares LSKF.
6776        LSKF_PREPARATION_RETRY = 40;
6777        // Logged when the device doesn’t support checkpoint and cannot stage
6778        // multiple sessions.
6779        CHECKPOINT_NOT_SUPPORTED = 41;
6780        // Logged when Phonesky instructs Android platform to monitor reboot
6781        // readiness signal.
6782        PENDING_REBOOT_MARKED = 42;
6783        // Logged when Phonesky instructs Android platform to stop monitoring reboot
6784        // readiness signal.
6785        PENDING_REBOOT_CANCELLED = 43 [deprecated = true];
6786        // Logged when Phonesky receives reboot readiness broadcast and the device
6787        // is ready to reboot.
6788        SIGNAL_READY_TO_REBOOT_RECEIVED = 44;
6789        // Logged when Phonesky receives reboot readiness broadcast and the device
6790        // is not ready to reboot.
6791        SIGNAL_NOT_READY_TO_REBOOT_RECEIVED = 45;
6792        // Logged when Phonesky cancels an untracked train.
6793        UNTRACKED_TRAIN_CANCELLED = 46;
6794    }
6795    optional State state = 6;
6796    // Possible experiment ids for monitoring this push.
6797    optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
6798    // Index of the Android User. E.g. 0 for primary profile, 10, 11, 12
6799    // for guest and secondary profiles. Not PII.
6800    optional int32 user_id = 8;
6801    // Log additional info for a state when needed.
6802    // When state = REBOOT_TRIGGERED, this field logs the reboot type:
6803    //  USERSPACE_REBOOT = 1.
6804    //  FORCED_REBOOT = 2.
6805    //  NOTIFICATION_RESTART_REBOOT = 3.
6806    //  UNATTENDED_REBOOT_SECURED_AND_SIM_PIN = 4.
6807    //  UNATTENDED_REBOOT_SECURED_NO_SIM_PIN = 5.
6808    //  UNATTENDED_REBOOT_UNSECURED_AND_SIM_PIN = 6.
6809    //  UNATTENDED_REBOOT_UNSECURED_NO_SIM_PIN = 7.
6810    // When state = INSTALL_FAILURE, this field logs the Install errors related
6811    // statusCode
6812    // When state = UNATTENDED_REBOOT_ABORT, this field logs the cancellation
6813    // reason:
6814    //  LSKF_RETRY_EXCEED_MAXIMUM = 1.
6815    //  SIM_PIN_NOT_PREPARED = 2.
6816    // When state = UNATTENDED_REBOOT_ELIGIBLE, this field logs the cancellation
6817    // reason:
6818    //  UNATTENDED_REBOOT_SECURED_AND_SIM_PIN = 1.
6819    //  UNATTENDED_REBOOT_SECURED_NO_SIM_PIN = 2.
6820    //  UNATTENDED_REBOOT_UNSECURED_AND_SIM_PIN = 3.
6821    //  UNATTENDED_REBOOT_UNSECURED_NO_SIM_PIN = 4.
6822    // When state = UNATTENDED_REBOOT_NOT_TRIGGERED, this field logs the
6823    // cancellation reason:
6824    //  LSKF_NOT_PREPARED = 1.
6825    //  REBOOT_NOT_READY = 2.
6826    // When state = PENDING_REBOOT_CANCELLED, this field logs the cancellation
6827    // reason:
6828    //  LSKF_NOT_PREPARED = 1.
6829    //  NO_STAGED_TRAIN = 2.
6830    //  HAS_SIM_PIN_AND_SIM_PIN_STORAGE_DISABLED = 3.
6831    optional int32 reason = 9;
6832    // Whether or not this is a rollback event.
6833    optional bool is_rollback = 10;
6834}
6835
6836/* Test atom, is not logged anywhere */
6837message TestAtomReported {
6838    repeated AttributionNode attribution_node = 1;
6839    optional int32 int_field = 2;
6840    optional int64 long_field = 3;
6841    optional float float_field = 4;
6842    optional string string_field = 5;
6843    optional bool boolean_field = 6;
6844    enum State {
6845        UNKNOWN = 0;
6846        OFF = 1;
6847        ON = 2;
6848    }
6849    optional State state = 7;
6850    optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
6851    repeated int32 repeated_int_field = 9;
6852    repeated int64 repeated_long_field = 10;
6853    repeated float repeated_float_field = 11;
6854    repeated string repeated_string_field = 12;
6855    repeated bool repeated_boolean_field = 13;
6856    repeated State repeated_enum_field = 14;
6857}
6858
6859/** Represents USB port overheat event. */
6860message UsbPortOverheatEvent {
6861    /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
6862    optional int32 plug_temperature_deci_c = 1;
6863
6864    /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
6865    optional int32 max_temperature_deci_c = 2;
6866
6867    /* Time between USB plug event and overheat threshold trip, in seconds. */
6868    optional int32 time_to_overheat_secs = 3;
6869
6870    /* Time between overheat threshold trip and hysteresis, in seconds. */
6871    optional int32 time_to_hysteresis_secs = 4;
6872
6873    /* Time between hysteresis and active mitigation ending, in seconds. */
6874    optional int32 time_to_inactive_secs = 5;
6875};
6876
6877/**
6878 * Logs total effective full charge and discharge cycles on a battery.
6879 * Here are some examples of one effective cycle:
6880 *   1) the battery charges from 0% to 100% and drains back to 0%,
6881 *   2) charging from 50% to 100% and draining back to 50% twice.
6882 * Pulled from:
6883 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
6884 */
6885message BatteryCycleCount {
6886    /* Number of total charge and discharge cycles on the system battery. */
6887    optional int32 cycle_count = 1;
6888}
6889
6890/**
6891 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
6892 * others), its type (public or private) and the size in bytes.
6893 * Pulled from:
6894 *   StatsCompanionService
6895 */
6896
6897message ExternalStorageInfo {
6898
6899    enum VolumeType {
6900        UNKNOWN = 0;
6901        PUBLIC = 1;
6902        PRIVATE = 2;
6903        OTHER = 3;
6904    }
6905
6906    // The type of external storage.
6907    optional android.stats.storage.ExternalStorageType storage_type = 1;
6908    // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
6909    optional VolumeType volume_type = 2;
6910    // Total size of the sd card in bytes.
6911    optional int64 size_bytes = 3;
6912}
6913
6914/*
6915 * Logs when a connection becomes available and lost.
6916 * Logged in StatsCompanionService.java
6917 */
6918message ConnectivityStateChanged {
6919  // Id of the network.
6920  optional int32 net_id = 1;
6921
6922  enum State {
6923    UNKNOWN = 0;
6924    CONNECTED = 1;
6925    DISCONNECTED = 2;
6926  }
6927  // Connected state of a network.
6928  optional State state = 2;
6929}
6930
6931/**
6932 * Logs when a service starts and stops.
6933 * Logged from:
6934 *   services/core/java/com/android/server/am/ActiveServices.java
6935 */
6936message ServiceStateChanged {
6937
6938    optional int32 uid = 1 [(is_uid) = true];
6939
6940    optional string package_name = 2;
6941
6942    optional string service_name = 3;
6943
6944    enum State {
6945        START = 1;
6946        STOP = 2;
6947    }
6948
6949    optional State state = 4;
6950}
6951
6952/**
6953 * Logs when a service is launched.
6954 * Logged from:
6955 *   services/core/java/com/android/server/am/ActiveServices.java
6956 */
6957message ServiceLaunchReported {
6958
6959    optional int32 uid = 1 [(is_uid) = true];
6960
6961    optional string package_name = 2;
6962
6963    optional string service_name = 3;
6964}
6965
6966/**
6967 * The type of process start. It's the same as ProcessStartTime.StartType but we
6968 * can't re-type that for background compatibility.
6969 */
6970enum ProcessStartType {
6971    PROCESS_START_TYPE_UNKNOWN = 0;
6972    PROCESS_START_TYPE_WARM = 1;
6973    PROCESS_START_TYPE_HOT = 2;
6974    PROCESS_START_TYPE_COLD = 3;
6975}
6976
6977/**
6978 * The stopped state of a package.
6979 */
6980enum PackageStoppedState {
6981    PACKAGE_STATE_UNKNOWN = 0;
6982    PACKAGE_STATE_NORMAL = 1; // The package is not in any stopped state
6983    PACKAGE_STATE_STOPPED = 2; // ApplicationInfo.FLAG_STOPPED
6984}
6985
6986/**
6987 * Logs when a service request is made.
6988 * Logged from:
6989 *   services/core/java/com/android/server/am/ActiveServices.java
6990 */
6991message ServiceRequestEventReported {
6992    /** The package uid of the service host. */
6993    optional int32 uid = 1 [(is_uid) = true];
6994
6995    /** The package uid of the service launch request. */
6996    optional int32 requester_uid = 2 [(is_uid) = true];
6997
6998    /** The action name of the service request. */
6999    optional string action_name = 3;
7000
7001    /**
7002     * The types of the requests to the service.
7003     */
7004    enum RequestType {
7005        UNKNOWN = 0;
7006        START = 1;
7007        BIND = 2;
7008    }
7009
7010    /** The type of the current request to the service.*/
7011    optional RequestType request_type = 4;
7012
7013    /** Whether or not it's requested to start as a foreground service. */
7014    optional bool fg_required = 5;
7015
7016    /** The start type of the host process. */
7017    optional ProcessStartType proc_start_type = 6;
7018
7019    /** The process name who requests the service launch */
7020    optional string request_process_name = 7;
7021
7022    /** The service component name, here consists of the class name part only */
7023    optional string service_component_name = 8;
7024
7025    /** The state the package was in when the service was requested */
7026    optional PackageStoppedState package_stopped_state = 9;
7027
7028    /** The package name of the service host */
7029    optional string package_name = 10;
7030
7031    /** The package name of the service lunch request */
7032    optional string requester_package_name = 11;
7033
7034    /** The process state of the requester */
7035    optional android.app.ProcessStateEnum requester_process_state = 12;
7036
7037    /** The process state of the service host before this service request */
7038    optional android.app.ProcessStateEnum service_process_state = 13;
7039
7040    /** Whether this is the first launch of the app since install */
7041    optional bool first_launch = 14;
7042
7043    // How long since this package was stopped, if it was in
7044    // package_stopped_state == PACKAGE_STATE_STOPPED
7045    optional int64 millis_since_stopped = 15;
7046}
7047
7048/**
7049 * Logs indicating a broadcast is being delivered to a receiver.
7050 *
7051 * Logged from:
7052 *     frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7053 */
7054message BroadcastDeliveryEventReported {
7055    /** The package uid of the broadcast receiver. */
7056    optional int32 uid = 1 [(is_uid) = true];
7057
7058    /** The package uid of the broadcast sender. */
7059    optional int32 sender_uid = 2 [(is_uid) = true];
7060
7061    /** The action name of the broadcast. */
7062    optional string action_name = 3;
7063
7064    /**
7065     * The types of the broadcast receivers.
7066     */
7067    enum ReceiverType {
7068        UNKNOWN = 0;
7069        RUNTIME = 1;
7070        MANIFEST = 2;
7071    }
7072
7073    /** The type of the current broadcast receiver. */
7074    optional ReceiverType receiver_type = 4;
7075
7076    /** The start type of the host process. */
7077    optional ProcessStartType proc_start_type = 5;
7078
7079    /** The delay in ms from enqueue to dispatch of this intent to the set of receivers. */
7080    optional int64 dispatch_delay = 6;
7081
7082    /** The delay in ms from beginning of dispatch to this specific receiver. */
7083    optional int64 receive_delay = 7;
7084
7085    /** The delay in ms from dispatch to finish the handling of this intent. */
7086    optional int64 finish_delay = 8;
7087
7088    /** The stopped state (if any) the package was in before the broadcast was delivered */
7089    optional PackageStoppedState package_stopped_state = 9;
7090
7091    /** The package name of the broadcast receiver */
7092    optional string package_name = 10;
7093
7094    /** The package name of the broadcast sender */
7095    optional string sender_package_name = 11;
7096
7097    /** The type of the broadcast */
7098    optional int32 broadcast_type = 12;
7099
7100    /** Delivery group policy set for the broadcast */
7101    optional android.app.BroadcastDeliveryGroupPolicy delivery_group_policy = 13;
7102
7103    /** Flags set in the broadcast intent */
7104    optional int32 intent_flags = 14;
7105
7106    /** The intent filter priority of the broadcast receiver */
7107    optional int32 filter_priority = 15;
7108
7109    /** The procstate of the broadcast sender */
7110    optional android.app.ProcessStateEnum sender_proc_state = 16;
7111
7112    /** The procstate of the broadcast receiver before receiving this broadcast */
7113    optional android.app.ProcessStateEnum receiver_process_state = 17;
7114
7115    /** Whether this is the first launch of the app since install */
7116    optional bool first_launch = 18;
7117
7118    // How long since this package was stopped, if it was in
7119    // package_stopped_state == PACKAGE_STATE_STOPPED
7120    optional int64 millis_since_stopped = 19;
7121}
7122
7123/**
7124 * Logs indicating a client is requesting to acquire a provider,
7125 * this doesn't include the case where the provider has been installed in the
7126 * client's process space and it's just increasing a ref count.
7127 *
7128 * Logged from:
7129 *      frameworks/base/services/core/java/com/android/server/am/ContentProviderHelper.java
7130 */
7131message ProviderAcquisitionEventReported {
7132    /** The package uid of the content provider host. */
7133    optional int32 uid = 1 [(is_uid) = true];
7134
7135    /** The package uid of the content provider client who makes the request. */
7136    optional int32 client_uid = 2 [(is_uid) = true];
7137
7138    /** The start type of the host process. */
7139    optional ProcessStartType proc_start_type = 3;
7140
7141    /** The stopped state (if any) the package was in when acquiring the provider */
7142    optional PackageStoppedState package_stopped_state = 4;
7143
7144    /** The package name of the content provider host. */
7145    optional string package_name = 5;
7146
7147    /** The package name of the content provider client who makes the request. */
7148    optional string client_package_name = 6;
7149
7150    /** The process state of the client */
7151    optional android.app.ProcessStateEnum client_process_state = 7;
7152
7153    /** The process state of the content provider host before being acquired */
7154    optional android.app.ProcessStateEnum provider_process_state = 8;
7155
7156    /** Whether this is the first launch of the app since install */
7157    optional bool first_launch = 9;
7158
7159    // How long since this package was stopped, if it was in
7160    // package_stopped_state == PACKAGE_STATE_STOPPED
7161    optional int64 millis_since_stopped = 10;
7162}
7163
7164/**
7165 * Logs when a hidden API is used.
7166 *
7167 * Logged from:
7168 *     libcore/libart/src/main/java/dalvik/system/VMRuntime.java
7169 */
7170message HiddenApiUsed {
7171    // The uid of the app making the hidden access.
7172    optional int32 uid = 1 [(is_uid) = true];
7173
7174    // Signature of the method or field accessed.
7175    optional string signature = 2;
7176
7177    enum AccessMethod {
7178        NONE = 0;
7179        REFLECTION = 1;
7180        JNI = 2;
7181        LINKING = 3;
7182    }
7183
7184    // Type of access.
7185    optional AccessMethod access_method = 3;
7186
7187    // Whether the access was prevented or not.
7188    optional bool access_denied = 4;
7189}
7190
7191/**
7192 * Logs user interaction with the Privacy Indicators added in Q. In particular:
7193 * - When user sees privacy chip
7194 * - When user clicks privacy chip
7195 * - How does the user exit the Privacy Dialog
7196 * Logged from:
7197 *   packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
7198 */
7199message PrivacyIndicatorsInteracted {
7200
7201    enum Type {
7202        UNKNOWN = 0;
7203        CHIP_VIEWED = 1;
7204        CHIP_CLICKED = 2;
7205        reserved 3; // Used only in beta builds, never shipped
7206        DIALOG_DISMISS = 4;
7207        DIALOG_LINE_ITEM = 5;
7208    }
7209
7210    optional Type type = 1 [
7211        (state_field_option).exclusive_state = true,
7212        (state_field_option).nested = false
7213    ];
7214}
7215
7216/**
7217 * Logs information about a package that is moved from the internal to external storage and vice
7218 * versa.
7219 * It logs the package name, the type of the external storage where the package is installed
7220 * (if moved to external storage, or UNKNOWN if moved to internal storage),
7221 * and the move type: if it's from internal to external or the other way around.
7222 *
7223 * Logged from:
7224        frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
7225 */
7226message AppMovedStorageReported {
7227    enum MoveType {
7228        UNKNOWN = 0;
7229        TO_EXTERNAL = 1;
7230        TO_INTERNAL = 2;
7231    }
7232    // The type of the external storage.
7233    optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7234    // The type of move.
7235    optional MoveType move_type = 2;
7236    // The name of the package that was moved.
7237    optional string package_name = 3;
7238}
7239
7240/**
7241 * Logs when system server watchdog occurs.
7242 * Logged from:
7243 *      frameworks/base/services/core/java/com/android/server/Watchdog.java
7244 */
7245message SystemServerWatchdogOccurred {
7246    optional string subject = 1;
7247}
7248
7249/**
7250 * Logs when system server pre-watchdog occurs.
7251 * Logged from:
7252 *      frameworks/base/services/core/java/com/android/server/Watchdog.java
7253 */
7254message SystemServerPreWatchdogOccurred {
7255}
7256
7257/**
7258 * Logs when new file added to tombstones.
7259 * Logged from:
7260 *      frameworks/base/core/java/com/android/server/BootReceiver.java
7261 */
7262message TombStoneOccurred {
7263}
7264
7265/*
7266 * Information about a role request
7267 *
7268 * Logged from:
7269 *   packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
7270 */
7271message RoleRequestResultReported {
7272    // UID of application requesting the role
7273    optional int32 requesting_uid = 1 [(is_uid) = true];
7274
7275    // Package name of application requesting the role
7276    optional string requesting_package_name = 2;
7277
7278    // The role to be granted
7279    optional string role_name = 3;
7280
7281    // The count of applications qualifying for the role
7282    optional int32 qualifying_count = 4;
7283
7284    // UID of application current granted the role
7285    optional int32 current_uid = 5 [(is_uid) = true];
7286
7287    // Package name of application current granted the role
7288    optional string current_package_name = 6;
7289
7290    // UID of another application that user chose to grant the role to, instead of the requesting
7291    // application
7292    optional int32 granted_another_uid = 7 [(is_uid) = true];
7293
7294    // Package name of another application that user chose to grant the role to, instead of the
7295    // requesting application
7296    optional string granted_another_package_name = 8;
7297
7298    enum Result {
7299        UNDEFINED = 0;
7300        // role request was ignored
7301        IGNORED = 1;
7302        // role request was ignored because it's already granted
7303        IGNORED_ALREADY_GRANTED = 2;
7304        // role request was ignored because the application isn't qualified
7305        IGNORED_NOT_QUALIFIED = 3;
7306        // role request was ignored because user said it should be always denied
7307        IGNORED_USER_ALWAYS_DENIED = 4;
7308        // role was granted by user action
7309        USER_GRANTED = 5;
7310        // role was denied by user action
7311        USER_DENIED = 6;
7312        // role was denied by user granting another application the role
7313        USER_DENIED_GRANTED_ANOTHER = 7;
7314        // role was denied and set to be always denied by the user
7315        USER_DENIED_WITH_ALWAYS = 8;
7316        // role request was ignored because the user is blocked from changing
7317        // roles via DISALLOW_CONFIG_DEFAULT_APPS user restriction
7318        IGNORED_USER_RESTRICTION = 9;
7319        // role request was ignored when the package is enhanced confiramtion
7320        // restricted
7321        IGNORED_ENHANCED_CONFIRMATION_RESTRICTION = 10;
7322    }
7323    // The result of the role request
7324    optional Result result = 9;
7325}
7326
7327/**
7328 * Logs when a Vehicle Maps Service client's connection state has changed
7329 *
7330 * Logged from:
7331 *   packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
7332 */
7333message VmsClientConnectionStateChanged {
7334    // The UID of the VMS client app
7335    optional int32 uid = 1 [(is_uid) = true];
7336
7337    enum State {
7338        UNKNOWN = 0;
7339        // Attempting to connect to the client
7340        CONNECTING = 1;
7341        // Client connection established
7342        CONNECTED = 2;
7343        // Client connection closed unexpectedly
7344        DISCONNECTED = 3;
7345        // Client connection closed by VMS
7346        TERMINATED = 4;
7347        // Error establishing the client connection
7348        CONNECTION_ERROR = 5;
7349    }
7350
7351    optional State state  = 2;
7352}
7353
7354message MimeTypes {
7355    repeated string mime_types = 1;
7356}
7357
7358/**
7359 * Logs statistics regarding accesses to external storage.
7360 * All stats are normalized for one day period.
7361 *
7362 * Logged from:
7363 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
7364 */
7365message GeneralExternalStorageAccessStats {
7366    optional int32 uid = 1 [(is_uid) = true];
7367    // Total number of accesses like creation, open, delete and rename/update.
7368    // Includes file path and ContentResolver accesses
7369    optional uint32 total_accesses = 2;
7370    // Number of file path accesses, as opposed to file path and ContentResolver.
7371    optional uint32 file_path_accesses = 3;
7372    // Number of accesses on secondary volumes like SD cards.
7373    // Includes file path and ContentResolver accesses
7374    optional uint32 secondary_storage_accesses = 4;
7375    // Comma-separated list of mime types that were accessed.
7376    optional MimeTypes mime_types_accessed = 5 [(log_mode) = MODE_BYTES];
7377}
7378
7379/**
7380 * Logs when MediaProvider has successfully finished scanning a storage volume.
7381 *
7382 * Logged from:
7383 *   packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
7384 */
7385message MediaProviderScanOccurred {
7386    enum Reason {
7387        // Scan triggered due to unknown reason
7388        UNKNOWN = 0;
7389        // Scan triggered due to storage volume being mounted
7390        MOUNTED = 1;
7391        // Scan triggered due to explicit user action or app request
7392        DEMAND = 2;
7393        // Scan triggered due to idle maintenance
7394        IDLE = 3;
7395    }
7396
7397    // Volume type that this event pertains to
7398    optional android.stats.mediaprovider.VolumeType volume_type = 1;
7399    // Reason why this scan was triggered
7400    optional Reason reason = 2;
7401    // Total number of files scanned
7402    optional int64 item_count = 3;
7403    // Duration of scan, normalized per file
7404    optional float normalized_duration_millis = 4;
7405    // Number of database inserts, normalized per file
7406    optional float normalized_insert_count = 5;
7407    // Number of database updates, normalized per file
7408    optional float normalized_update_count = 6;
7409    // Number of database deletes, normalized per file
7410    optional float normalized_delete_count = 7;
7411}
7412
7413/**
7414 * Logs when an app has asked MediaProvider to delete media belonging to the user.
7415 *
7416 * Logged from:
7417 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
7418 */
7419message MediaContentDeleted {
7420    // Volume type that this event pertains to
7421    optional android.stats.mediaprovider.VolumeType volume_type = 1;
7422    // UID of app that requested deletion
7423    optional int32 uid = 2 [(is_uid) = true];
7424    // Number of items that were deleted
7425    optional int32 item_count = 3;
7426}
7427
7428/**
7429 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
7430 *
7431 * Logged from:
7432 *   packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
7433 */
7434message MediaProviderPermissionRequested {
7435    enum Result {
7436        UNKNOWN = 0;
7437        USER_GRANTED = 1;
7438        AUTO_GRANTED = 2;
7439        USER_DENIED = 3;
7440        USER_DENIED_WITH_PREJUDICE = 4;
7441        AUTO_DENIED = 5;
7442    }
7443
7444    // Volume type that this event pertains to
7445    optional android.stats.mediaprovider.VolumeType volume_type = 1;
7446    // UID of app that requested permission
7447    optional int32 uid = 2 [(is_uid) = true];
7448    // Number of items that were requested
7449    optional int32 item_count = 3;
7450    // Result of this request
7451    optional Result result = 4;
7452}
7453
7454/**
7455 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
7456 *
7457 * Logged from:
7458 *   packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
7459 */
7460message MediaProviderSchemaChanged {
7461    // Volume type that this event pertains to
7462    optional android.stats.mediaprovider.VolumeType volume_type = 1;
7463    // Old database version code
7464    optional int32 version_from = 2;
7465    // New database version code
7466    optional int32 version_to = 3;
7467    // Total number of files in database
7468    optional int64 item_count = 4;
7469    // Duration of schema change, normalized per file
7470    optional float normalized_duration_millis = 5;
7471}
7472
7473/**
7474 * Logs when MediaProvider has finished an idle maintenance job.
7475 *
7476 * Logged from:
7477 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
7478 */
7479message MediaProviderIdleMaintenanceFinished {
7480    // Volume type that this event pertains to
7481    optional android.stats.mediaprovider.VolumeType volume_type = 1;
7482
7483    // Total number of files in database
7484    optional int64 item_count = 2;
7485    // Duration of idle maintenance, normalized per file
7486    optional float normalized_duration_millis = 3;
7487    // Number of thumbnails found to be stale, normalized per file
7488    optional float normalized_stale_thumbnails = 4;
7489    // Number of items found to be expired, normalized per file
7490    optional float normalized_expired_media = 5;
7491}
7492
7493/**
7494 * Represents boot time event with duration in ms.
7495 *
7496 * Logged from: bootstat and various system server components. Check each enums for details.
7497 */
7498message BootTimeEventDuration {
7499    enum DurationEvent {
7500        UNKNOWN = 0;
7501        // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
7502        ABSOLUTE_BOOT_TIME = 1;
7503        // Bootloader's 1st stage execution time.
7504        // Logged from bootstat.
7505        BOOTLOADER_FIRST_STAGE_EXEC = 2;
7506        // Bootloader's 1st stage loading time.
7507        // Logged from bootstat.
7508        BOOTLOADER_FIRST_STAGE_LOAD = 3;
7509        // Bootloader's kernel loading time.
7510        // Logged from bootstat.
7511        BOOTLOADER_KERNEL_LOAD = 4;
7512        // Bootloader's 2nd stage execution time.
7513        // Logged from bootstat.
7514        BOOTLOADER_SECOND_STAGE_EXEC = 5;
7515        // Bootloader's 2nd stage loading time.
7516        // Logged from bootstat.
7517        BOOTLOADER_SECOND_STAGE_LOAD = 6;
7518        // Duration for Bootloader to show unlocked device's warning UI. This should not happen
7519        // for locked device.
7520        // Logged from bootstat.
7521        BOOTLOADER_UI_WAIT = 7;
7522        // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
7523        // Logged from bootstat.
7524        BOOTLOADER_TOTAL = 8;
7525        // Shutdown duration inside init for the reboot before the current boot up.
7526        // Logged from f/b/services/.../BootReceiver.java.
7527        SHUTDOWN_DURATION = 9;
7528        // Total time for mounting of disk devices during bootup.
7529        // Logged from f/b/services/.../BootReceiver.java.
7530        MOUNT_DEFAULT_DURATION = 10;
7531        // Total time for early stage mounting of disk devices during bootup.
7532        // Logged from f/b/services/.../BootReceiver.java.
7533        MOUNT_EARLY_DURATION = 11;
7534        // Total time for late stage mounting of disk devices during bootup.
7535        // Logged from f/b/services/.../BootReceiver.java.
7536        MOUNT_LATE_DURATION = 12;
7537        // Average time to scan non-system app after OTA
7538        // Logged from f/b/services/.../PackageManagerService.java
7539        OTA_PACKAGE_MANAGER_INIT_TIME = 13;
7540        // Time to initialize Package manager after OTA
7541        // Logged from f/b/services/.../PackageManagerService.java
7542        OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
7543        // Time to scan all system app from Package manager after OTA
7544        // Logged from f/b/services/.../PackageManagerService.java
7545        OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
7546        // Init's total time for cold boot stage.
7547        // Logged from bootstat.
7548        COLDBOOT_WAIT = 16;
7549        // Init's total time for initializing selinux.
7550        // Logged from bootstat.
7551        SELINUX_INIT = 17;
7552        // Time since last factory reset.
7553        // Logged from bootstat.
7554        FACTORY_RESET_TIME_SINCE_RESET = 18;
7555        // Init's total time spent for completing the 1st stage.
7556        // Logged from bootstat.
7557        ANDROID_INIT_STAGE_1 = 19;
7558    }
7559
7560    // Type of the event.
7561    optional DurationEvent event = 1;
7562    // Duration of the event in ms.
7563    optional int64 duration_millis = 2;
7564}
7565
7566/**
7567 * Represents the start of specific boot time event during bootup in ms. This is usually a time
7568 * since boot-up.
7569 *
7570 * Logged from: bootstat and various system server components. Check each enums for details.
7571 */
7572message BootTimeEventElapsedTime {
7573    enum ElapsedTimeEvent {
7574        UNKNOWN = 0;
7575        // Time when init starts 1st stage. Logged from bootstat.
7576        ANDROID_INIT_STAGE_1 = 1;
7577        // Time when sys.boot_completed prop is set.
7578        // Logged from bootstat.
7579        BOOT_COMPLETE = 2;
7580        // BOOT_COMPLETE for a device that uses full-disk encryption.  Note that
7581        // no devices running Android 13 or later use full-disk encryption, as
7582        // it has been replaced by file-based encryption.
7583        BOOT_COMPLETE_ENCRYPTION = 3;
7584        // BOOT_COMPLETE for a device that doesn't use full-disk encryption.
7585        BOOT_COMPLETE_NO_ENCRYPTION = 4;
7586        // Adjusted BOOT_COMPLETE for a device that uses full-disk encryption,
7587        // omitting the decryption time.
7588        BOOT_COMPLETE_POST_DECRYPT = 5;
7589        // BOOT_COMPLETE after factory reset.
7590        FACTORY_RESET_BOOT_COMPLETE = 6;
7591        // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
7592        FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
7593        // BOOT_COMPLETE_POST_DECRYPT after factory reset.
7594        FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
7595        // BOOT_COMPLETE after OTA.
7596        OTA_BOOT_COMPLETE = 9;
7597        // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
7598        OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
7599        // BOOT_COMPLETE_POST_DECRYPT after OTA.
7600        OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
7601        // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
7602        // Logged from  f/b/services/.../UserController.java
7603        FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
7604        // Time when the system starts sending BOOT_COMPLETED broadcast.
7605        // Logged from  f/b/services/.../UserController.java
7606        FRAMEWORK_BOOT_COMPLETED = 13;
7607        // Time when the package manager starts init.
7608        // Logged from f/b/services/.../SystemServer.java
7609        PACKAGE_MANAGER_INIT_START = 14;
7610        // Time when package manager is ready
7611        // Logged from f/b/services/.../SystemServer.java
7612        PACKAGE_MANAGER_INIT_READY = 15;
7613        // Represents the time when user has entered unlock credential for system with user pin.
7614        // Logged from bootstat.
7615        POST_DECRYPT = 16;
7616        // Represents the start of zygote's init.
7617        // Logged from zygote itself.
7618        ZYGOTE_INIT_START = 17;
7619        // Represents the start of secondary zygote's init.
7620        // TODO: add logging to zygote
7621        SECONDARY_ZYGOTE_INIT_START = 18;
7622        // Represents the start of system server's init.
7623        // Logged from f/b/services/.../SystemServer.java
7624        SYSTEM_SERVER_INIT_START = 19;
7625        // Represents the completion of system server's init.
7626        // Logged from f/b/services/.../SystemServer.java
7627        SYSTEM_SERVER_READY = 20;
7628        // Represents the start of launcher during boot-up.
7629        // TODO: add logging
7630        LAUNCHER_START = 21;
7631        // Represents the completion of launcher's initial rendering. User can use other apps from
7632        // launcher from this point.
7633        // TODO: add logging
7634        LAUNCHER_SHOWN = 22;
7635    }
7636
7637    // Type of the event.
7638    optional ElapsedTimeEvent event = 1;
7639    // Time since bootup for the event.
7640    // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
7641    optional int64 time_millis = 2;
7642}
7643
7644/**
7645 * Boot time events with UTC time.
7646 *
7647 * Logged from: bootstat and various system server components. Check each enums for details.
7648 */
7649message BootTimeEventUtcTime {
7650    enum UtcTimeEvent {
7651        UNKNOWN = 0;
7652        // Time of the bootstat's marking of 1st boot after the last factory reset.
7653        // Logged from bootstat.
7654        FACTORY_RESET_RESET_TIME = 1;
7655        // The time when bootstat records FACTORY_RESET_* events. This is close to
7656        // BOOT_COMPLETE time for the current bootup.
7657        // Logged from bootstat.
7658        FACTORY_RESET_CURRENT_TIME = 2;
7659        // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
7660        // Logged from bootstat.
7661        FACTORY_RESET_RECORD_VALUE = 3;
7662    }
7663
7664    // Type of the event.
7665    optional UtcTimeEvent event = 1;
7666    // UTC time for the event.
7667    optional int64 utc_time_secs = 2;
7668}
7669
7670/**
7671 * Boot time events representing specific error code during bootup.
7672 * Meaning of error code can be different per each event type.
7673 *
7674 * Logged from: bootstat and various system server components. Check each enums for details.
7675 */
7676message BootTimeEventErrorCode {
7677    enum ErrorCodeEvent {
7678        UNKNOWN = 0;
7679        // Linux error code for time() call to get the current UTC time.
7680        // Logged from bootstat.
7681        FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
7682        // Represents UmountStat before the reboot for the current boot up. Error codes defined
7683        // as UMOUNT_STAT_* from init/reboot.cpp.
7684        // Logged from f/b/services/.../BootReceiver.java.
7685        SHUTDOWN_UMOUNT_STAT = 2;
7686        // Reprepsents fie system mounting error code of /data partition for the current boot.
7687        // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
7688        // Logged from f/b/services/.../BootReceiver.java.
7689        FS_MGR_FS_STAT_DATA_PARTITION = 3;
7690    }
7691
7692    // Type of the event.
7693    optional ErrorCodeEvent event = 1;
7694    // error code defined per each event type.
7695    // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
7696    // FS_MGR_FS_STAT.
7697    optional int32 error_code = 2;
7698}
7699
7700/**
7701 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
7702 * after an OTA.
7703 *
7704 * Logged from:
7705 *  - system/update_engine/cleanup_previous_update_action.cc
7706 */
7707message SnapshotMergeReported {
7708    // Keep in sync with
7709    // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
7710    enum UpdateState {
7711        // No update or merge is in progress.
7712        NONE = 0;
7713        // An update is applying; snapshots may already exist.
7714        INITIATED = 1;
7715        // An update is pending, but has not been successfully booted yet.
7716        UNVERIFIED = 2;
7717        // The kernel is merging in the background.
7718        MERGING = 3;
7719        // Post-merge cleanup steps could not be completed due to a transient
7720        // error, but the next reboot will finish any pending operations.
7721        MERGE_NEEDS_REBOOT = 4;
7722        // Merging is complete, and needs to be acknowledged.
7723        MERGE_COMPLETED = 5;
7724        // Merging failed due to an unrecoverable error.
7725        MERGE_FAILED = 6;
7726        // The update was implicitly cancelled, either by a rollback or a flash
7727        // operation via fastboot. This state can only be returned by WaitForMerge.
7728        CANCELLED = 7;
7729    };
7730
7731    // Status codes correspond to specific failure conditions in
7732    // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.cpp
7733    //
7734    // Keep in sync with
7735    // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
7736    enum MergeFailureCode {
7737        OK = 0;
7738        READ_STATUS = 1;
7739        GET_TABLE_INFO = 2;
7740        UNKNOWN_TABLE = 3;
7741        GET_TABLE_PARAMS = 4;
7742        ACTIVATE_NEW_TABLE = 5;
7743        ACQUIRE_LOCK = 6;
7744        LIST_SNAPSHOTS = 7;
7745        WRITE_STATUS = 8;
7746        UNKNOWN_TARGET_TYPE = 9;
7747        QUERY_SNAPSHOT_STATUS = 10;
7748        EXPECTED_MERGE_TARGET = 11;
7749        UNMERGED_SECTORS_AFTER_COMPLETION = 12;
7750        UNEXPECTED_MERGE_STATE = 13;
7751        GET_COW_PATH_CONSISTENCY_CHECK = 14;
7752        OPEN_COW_CONSISTENCY_CHECK = 15;
7753        PARSE_COW_CONSISTENCY_CHECK = 16;
7754        OPEN_COW_DIRECT_CONSISTENCY_CHECK = 17;
7755        MEM_ALIGN_CONSISTENCY_CHECK = 18;
7756        DIRECT_READ_CONSISTENCY_CHECK = 19;
7757        WRONG_MERGE_COUNT_CONSISTENCY_CHECK = 20;
7758    };
7759
7760    // Status of the update after the merge attempts.
7761    optional UpdateState final_state = 1;
7762
7763    // Time to complete a merge operation in milliseconds.
7764    // A negative value corresponds to the case in which the merge operation
7765    // was interrupted and resumed (e.g. in case of a system reboot during the
7766    // merge).
7767    optional int64 duration_millis = 2;
7768
7769    // Number of reboots that occurred after issuing and before completing the
7770    // merge of all the snapshot devices.
7771    optional int32 intermediate_reboots = 3;
7772
7773    // The device has been upgraded to Virtual A/B.
7774    optional bool is_vab_retrofit = 4;
7775
7776    // Space that has been temporarily allocated in the /data partition
7777    // containing the dm-snapshot's copy-on-write data generated during a
7778    // Virtual A/B update.
7779    optional int64 cow_file_size_bytes = 5;
7780
7781    // Whether the device enables Virtual A/B compression.
7782    optional bool vab_compression_enabled = 6;
7783
7784    // Whether this update attempt uses Virtual A/B compression.
7785    optional bool vab_compression_used = 7;
7786
7787    // Total size used by COWs, including /data and the super partition.
7788    optional int64 total_cow_size_bytes = 8;
7789
7790    // Sum of the estimated COW fields in the OTA manifest.
7791    optional int64 estimated_cow_size_bytes = 9;
7792
7793    // Time from boot to sys.boot_completed, in milliseconds.
7794    optional int32 boot_complete_time_millis = 10;
7795
7796    // Time from sys.boot_completed to merge start, in milliseconds.
7797    optional int32 boot_complete_to_merge_start_time_millis = 11;
7798
7799    optional MergeFailureCode merge_failure_code = 12;
7800
7801    // Build fingerprint at the time the OTA was downloaded.
7802    optional string source_build_fingerprint = 13;
7803
7804    // Build fingerprint at the time the merge was initiated.
7805    optional string target_build_fingerprint = 14;
7806
7807    // Whether the device enabled userspace snapshots.
7808    optional bool userspace_snapshots_enabled = 15;
7809
7810    // Whether this update attempt used userspace snapshots.
7811    optional bool userspace_snapshots_used = 16;
7812
7813    // Whether the device enabled XOR compression.
7814    optional bool xor_compression_enabled = 17;
7815
7816    // Whether this update attempt used XOR compression.
7817    optional bool xor_compression_used = 18;
7818
7819    // Whether this update attempt used io_uring.
7820    optional bool iouring_used = 19;
7821}
7822
7823/**
7824 * Event representing when BlobStoreManager.Session#commit() is called
7825 *
7826 * Logged from:
7827 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
7828 */
7829message BlobCommitted {
7830    // Uid of the Blob committer
7831    optional int32 uid = 1 [(is_uid) = true];
7832
7833    // Id of the Blob committed
7834    optional int64 blob_id = 2;
7835
7836    // Size of the Blob
7837    optional int64 size = 3;
7838
7839    enum Result {
7840        UNKNOWN = 0;
7841        // Commit Succeeded
7842        SUCCESS = 1;
7843        // Commit Failed: Error occurred during commit
7844        ERROR_DURING_COMMIT = 2;
7845        // Commit Failed: Digest of the data did not match Blob digest
7846        DIGEST_MISMATCH = 3;
7847        // Commit Failed: Allowed count limit exceeded
7848        COUNT_LIMIT_EXCEEDED = 4;
7849    }
7850    optional Result result = 4;
7851}
7852
7853/**
7854 * Event representing when BlobStoreManager#acquireLease() is called
7855 *
7856 * Logged from:
7857 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
7858 */
7859message BlobLeased{
7860    // Uid of the Blob leasee
7861    optional int32 uid = 1 [(is_uid) = true];
7862
7863    // Id of the Blob leased or 0 if the Blob does not exist
7864    optional int64 blob_id = 2;
7865
7866    // Size of the Blob or 0 if the Blob does not exist
7867    optional int64 size = 3;
7868
7869    enum Result {
7870        UNKNOWN = 0;
7871        // Lease Succeeded
7872        SUCCESS = 1;
7873        // Lease Failed: Blob does not exist
7874        BLOB_DNE = 2;
7875        // Lease Failed: Leasee does not have access to the Blob
7876        ACCESS_NOT_ALLOWED = 3;
7877        // Lease Failed: Leasee requested an invalid expiry duration
7878        LEASE_EXPIRY_INVALID = 4;
7879        // Lease Failed: Leasee has exceeded the total data lease limit
7880        DATA_SIZE_LIMIT_EXCEEDED = 5;
7881        // Leasee Failed: Allowed count limit exceeded
7882        COUNT_LIMIT_EXCEEDED = 6;
7883    }
7884    optional Result result = 4;
7885}
7886
7887/**
7888 * Event representing when BlobStoreManager#openBlob() is called
7889 *
7890 * Logged from:
7891 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
7892 */
7893message BlobOpened{
7894    // Uid of the Blob opener
7895    optional int32 uid = 1 [(is_uid) = true];
7896
7897    // Id of the Blob opened or 0 if the Blob does not exist
7898    optional int64 blob_id = 2;
7899
7900    // Size of the Blob or 0 if the Blob does not exist
7901    optional int64 size = 3;
7902
7903    enum Result {
7904        UNKNOWN = 0;
7905        // Open Succeeded
7906        SUCCESS = 1;
7907        // Open Failed: Blob does not exist
7908        BLOB_DNE = 2;
7909        // Open Failed: Opener does not have access to the Blob
7910        ACCESS_NOT_ALLOWED = 3;
7911    }
7912    optional Result result = 4;
7913}
7914
7915/**
7916 * Event to track Jank for various system interactions.
7917 *
7918 * Logged from:
7919 *  frameworks/base/core/java/com/android/internal/jank/FrameTracker.java
7920 *
7921 * Next Tag: 10
7922 */
7923message UIInteractionFrameInfoReported {
7924    optional android.jank.InteractionType interaction_type = 1;
7925
7926    optional android.jank.DisplayResolution display_resolution = 8;
7927
7928    optional android.jank.DisplayRefreshRate display_refresh_rate = 9;
7929
7930    // Number of frames rendered during the interaction.
7931    optional int64 total_frames = 2;
7932
7933    // Number of frames that were skipped in rendering during the interaction.
7934    optional int64 missed_frames = 3;
7935
7936    // Number of frames that were missed in Surface Flinger during the interaction.
7937    optional int64 sf_missed_frames = 5;
7938
7939    // Number of frames that were missed in the app during the interaction.
7940    optional int64 app_missed_frames = 6;
7941
7942    // Maximum time it took to render a single frame during the interaction.
7943    optional int64 max_frame_time_nanos = 4;
7944
7945    // Maximum number of successive frames missed.
7946    optional int64 max_successive_missed_frames = 7;
7947}
7948
7949/**
7950 * Event to track various latencies in SystemUI.
7951 *
7952 * Logged from:
7953 *  frameworks/base/core/java/com/android/internal/util/LatencyTracker.java
7954 */
7955message UIActionLatencyReported {
7956    optional android.jank.ActionType action = 1;
7957
7958    optional int64 latency_millis = 2;
7959}
7960
7961//////////////////////////////////////////////////////////////////////
7962// Pulled atoms below this line //
7963//////////////////////////////////////////////////////////////////////
7964
7965/**
7966 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
7967 *
7968 * Pulled from:
7969 *   StatsCompanionService (using BatteryStats to get which interfaces are wifi)
7970 */
7971message WifiBytesTransfer {
7972    optional int32 uid = 1 [(is_uid) = true];
7973
7974    optional int64 rx_bytes = 2;
7975
7976    optional int64 rx_packets = 3;
7977
7978    optional int64 tx_bytes = 4;
7979
7980    optional int64 tx_packets = 5;
7981}
7982
7983/**
7984 * Pulls bytes transferred via wifi (separated by foreground and background usage).
7985 *
7986 * Pulled from:
7987 *   StatsCompanionService (using BatteryStats to get which interfaces are wifi)
7988 */
7989message WifiBytesTransferByFgBg {
7990    optional int32 uid = 1 [(is_uid) = true];
7991
7992    // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
7993    optional bool is_foreground = 2;
7994
7995    optional int64 rx_bytes = 3;
7996
7997    optional int64 rx_packets = 4;
7998
7999    optional int64 tx_bytes = 5;
8000
8001    optional int64 tx_packets = 6;
8002}
8003
8004/**
8005 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
8006 *
8007 * Pulled from:
8008 *   StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
8009 */
8010message MobileBytesTransfer {
8011    optional int32 uid = 1 [(is_uid) = true];
8012
8013    optional int64 rx_bytes = 2;
8014
8015    optional int64 rx_packets = 3;
8016
8017    optional int64 tx_bytes = 4;
8018
8019    optional int64 tx_packets = 5;
8020}
8021
8022/**
8023 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
8024 *
8025 * Pulled from:
8026 *   StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
8027 */
8028message MobileBytesTransferByFgBg {
8029    optional int32 uid = 1 [(is_uid) = true];
8030
8031    // 1 denotes foreground and 0 denotes background. This is called Set in
8032    // NetworkStats.
8033    optional bool is_foreground = 2;
8034
8035    optional int64 rx_bytes = 3;
8036
8037    optional int64 rx_packets = 4;
8038
8039    optional int64 tx_bytes = 5;
8040
8041    optional int64 tx_packets = 6;
8042}
8043
8044/**
8045 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
8046 * Note that the data is expected to be sliced into more dimensions in future. In other words,
8047 * the caller must not assume any row of data is one full report when filtering with a set of
8048 * matching conditions, because future data may represent with multiple rows what is currently
8049 * represented by one.
8050 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
8051 * query all the existing columns.
8052 *
8053 * Pulled from:
8054 *   StatsPullAtomService (using NetworkStatsService to get NetworkStats)
8055 */
8056message DataUsageBytesTransfer {
8057    // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
8058    // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
8059    // states combined, not including debug states. See NetworkStats#SET_*.
8060    optional int32 state = 1;
8061
8062    optional int64 rx_bytes = 2;
8063
8064    optional int64 rx_packets = 3;
8065
8066    optional int64 tx_bytes = 4;
8067
8068    optional int64 tx_packets = 5;
8069
8070    // Radio Access Technology (RAT) type of this record, should be one of
8071    // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
8072    // the record is for all rat types combined.
8073    optional int32 rat_type = 6;
8074
8075    // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
8076    // record is combined across subscriptions.
8077    optional string sim_mcc = 7;
8078    optional string sim_mnc = 8;
8079
8080    // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
8081    // See TelephonyManager#getSimCarrierId.
8082    optional int32 carrier_id = 9;
8083
8084    // Enumeration of opportunistic states with an additional ALL state indicates the record is
8085    // combined regardless of the boolean value in its field.
8086    enum DataSubscriptionState {
8087        UNKNOWN = 0; // For server side backward compatibility.
8088        ALL = 1;
8089        OPPORTUNISTIC = 2;
8090        NOT_OPPORTUNISTIC = 3;
8091    }
8092    // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
8093    // record is combined across opportunistic data subscriptions.
8094    // See {@link SubscriptionManager#setOpportunistic}.
8095    optional DataSubscriptionState opportunistic_data_sub = 10;
8096
8097    // Indicate whether NR is connected, server side could use this with RAT type to determine if
8098    // the record is for 5G NSA (Non Stand Alone) mode, where the primary cell is still LTE and
8099    // network allocates a secondary 5G cell so telephony reports RAT = LTE along with NR state as
8100    // connected.
8101    optional bool is_nr_connected = 11;
8102}
8103
8104/**
8105 * Note: This is a copy from DataUsageBytesTransfer and add a metered field.
8106 * TODO: DataUsageBytesTransfer should be eventually replaced with DataUsageBytesTransferV2.
8107 *
8108 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
8109 * Note that the data is expected to be sliced into more dimensions in future. In other words,
8110 * the caller must not assume any row of data is one full report when filtering with a set of
8111 * matching conditions, because future data may represent with multiple rows what is currently
8112 * represented by one.
8113 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
8114 * query all the existing columns.
8115 *
8116 * Pulled from:
8117 *   StatsPullAtomService (using NetworkStatsService to get NetworkStats)
8118 */
8119message DataUsageBytesTransferV2 {
8120    // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
8121    // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
8122    // states combined, not including debug states. See NetworkStats#SET_*.
8123    optional int32 state = 1;
8124
8125    optional int64 rx_bytes = 2;
8126
8127    optional int64 rx_packets = 3;
8128
8129    optional int64 tx_bytes = 4;
8130
8131    optional int64 tx_packets = 5;
8132
8133    // Radio Access Technology (RAT) type of this record, should be one of
8134    // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
8135    // the record is for all rat types combined.
8136    optional int32 rat_type = 6;
8137
8138    // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
8139    // record is combined across subscriptions.
8140    optional string sim_mcc = 7;
8141    optional string sim_mnc = 8;
8142
8143    // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
8144    // See TelephonyManager#getSimCarrierId.
8145    optional int32 carrier_id = 9;
8146
8147    // Enumeration of opportunistic states with an additional DSS_ALL state indicates the record is
8148    // combined regardless of the boolean value in its field.
8149    enum DataSubscriptionState {
8150        DSS_UNKNOWN = 0; // For server side backward compatibility.
8151        DSS_ALL = 1;
8152        DSS_OPPORTUNISTIC = 2;
8153        DSS_NOT_OPPORTUNISTIC = 3;
8154    }
8155    // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
8156    // record is combined across opportunistic data subscriptions.
8157    // See {@link SubscriptionManager#setOpportunistic}.
8158    optional DataSubscriptionState opportunistic_data_sub = 10;
8159
8160    // Indicate whether NR is connected, server side could use this with RAT type to determine if
8161    // the record is for 5G NSA (Non Stand Alone) mode, where the primary cell is still LTE and
8162    // network allocates a secondary 5G cell so telephony reports RAT = LTE along with NR state as
8163    // connected.
8164    optional bool is_nr_connected = 11;
8165
8166    // Enumeration of metered states.
8167    enum MeteredState {
8168        METERED_UNKNOWN = 0;
8169        METERED_ALL = 1;
8170        METERED_NO = 2;
8171        METERED_YES = 3;
8172    }
8173    // Mark the reported data is metered or non-metered, and METERED_ALL indicates the record is
8174    // combined across metered data.
8175    optional MeteredState metered = 12;
8176}
8177
8178/**
8179 * Pulls bytes transferred via OEM managed networks. Data is split up by which
8180 * type of OEM managed network it is, what transport it went over, and if it was
8181 * in the foreground or background.
8182 *
8183 * Pulled from:
8184 *   StatsPullAtomService
8185 */
8186 message OemManagedBytesTransfer {
8187    optional int32 uid = 1 [(is_uid) = true];
8188
8189    // 1 denotes foreground and 0 denotes background. This is called Set in
8190    // NetworkStats.
8191    optional bool is_foreground = 2;
8192
8193    // Corresponds to the type of OEM managed network, see
8194    // {@link NetworkTemplate#OEM_MANAGED_ANY} and {@code NetworkIdentity#OEM_*}.
8195    optional int32 oem_managed_type = 3;
8196
8197    // Corresponds to the type of transport the bytes were transferred over, see
8198    // {@link NetworkTemplate#transportToMatchRule} and
8199    // {@code NetworkCapabilities#TRANSPORT_*}
8200    optional int32 transport_type = 4;
8201
8202    optional int64 rx_bytes = 5;
8203
8204    optional int64 rx_packets = 6;
8205
8206    optional int64 tx_bytes = 7;
8207
8208    optional int64 tx_packets = 8;
8209  }
8210
8211/**
8212 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
8213 *
8214 * Pulled from:
8215 *   StatsCompanionService
8216 */
8217message BluetoothBytesTransfer {
8218    optional int32 uid = 1 [(is_uid) = true];
8219
8220    optional int64 rx_bytes = 2;
8221
8222    optional int64 tx_bytes = 3;
8223}
8224
8225/**
8226 * Pulls the kernel wakelock durations. This atom is adapted from
8227 * android/internal/os/KernelWakelockStats.java
8228 *
8229 * Pulled from:
8230 *   StatsCompanionService using KernelWakelockReader.
8231 */
8232message KernelWakelock {
8233    optional string name = 1;
8234
8235    optional int32 count = 2;
8236
8237    optional int32 version = 3;
8238
8239    optional int64 time_micros = 4;
8240}
8241
8242/**
8243 * Pulls power state information.
8244 * Pulled from:
8245 *   frameworks/base/services/core/java/com/android/server/powerstats/StatsPullAtomCallbackImpl.java
8246 */
8247message SubsystemSleepState {
8248    // Subsystem name
8249    optional string subsystem_name = 1;
8250    // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
8251    // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
8252    // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
8253    //    powerEntityStateName from the corresponding PowerEntityStateInfo.
8254    optional string subname = 2;
8255    // The number of times it entered, or voted for entering the sleep state
8256    optional uint64 count = 3;
8257    // The length of time spent in, or spent voting for, the sleep state
8258    optional uint64 time_millis = 4;
8259}
8260
8261/**
8262 * Pulls on-device power measurement information.
8263 * Pulled from:
8264 *   frameworks/base/services/core/java/com/android/server/powerstats/StatsPullAtomCallbackImpl.java
8265 */
8266message OnDevicePowerMeasurement {
8267    // Name of the subsystem (to which the rail belongs).
8268    optional string subsystem_name = 1;
8269
8270    // Rail name. The rail lies within the subsystem.
8271    optional string rail_name = 2;
8272
8273    // Time (in ms since boot) at which the rail energy value was measured.
8274    // This may differ slightly from the time that statsd logs this information.
8275    optional uint64 measurement_timestamp_millis = 3;
8276
8277    // Accumulated energy used via the rail since device boot in uWs.
8278    optional uint64 energy_microwatt_secs = 4;
8279}
8280
8281/**
8282 * Pulls Cpu time per cluster per frequency.
8283 * This is tracked by the timeInState eBPF program.
8284 */
8285message CpuTimePerClusterFreq {
8286    optional uint32 cluster = 1;
8287    optional uint32 freq_khz = 2;
8288    // Time spent at this frequency excluding sleep since tracking started.
8289    optional uint64 time_millis = 3;
8290}
8291
8292/**
8293 * Pulls Cpu Time Per Uid.
8294 * Note that isolated process uid time should be attributed to host uids.
8295 */
8296message CpuTimePerUid {
8297    optional int32 uid = 1 [(is_uid) = true];
8298    optional uint64 user_time_micros = 2;
8299    optional uint64 sys_time_micros = 3;
8300}
8301
8302/**
8303 * Pulls Cpu Cycles Per Uid Per Cluster.
8304 * Note that uids are transformed to reduce the number of uploaded entries. Shared GIDs are
8305 * combined under single uid LAST_SHARED_APPLICATION_GID. Individual isolated uids are excluded
8306 * because they are recycled and removed from the underlying data source. All uids are normalized
8307 * to their base uids.
8308 */
8309message CpuCyclesPerUidCluster {
8310    optional int32 uid = 1 [(is_uid) = true];
8311    optional int32 cluster = 2;
8312    // Megacycles, i.e. millions of cycles.
8313    optional int64 mcycles = 3;
8314    // Time excluding sleep since tracking started.
8315    optional int64 time_millis = 4;
8316    // Power estimate: time * average power for frequency / 1000.
8317    optional int64 power_profile_estimate = 5;
8318}
8319
8320/**
8321 * Pulls Cpu Time Per Uid per frequency.
8322 * Note that uids are transformed to reduce the number of uploaded entries. Shared GIDs are
8323 * combined under single uid LAST_SHARED_APPLICATION_GID. Individual isolated uids are excluded
8324 * because they are recycled and removed from the underlying data source. All uids are normalized
8325 * to their base uids.
8326 */
8327message CpuTimePerUidFreq {
8328    optional int32 uid = 1 [(is_uid) = true];
8329    optional uint32 freq_index = 2;
8330    optional uint64 time_millis = 3;
8331}
8332
8333/**
8334  * Pulls Cpu Cycles Per ThreadGroup Per Cluster.
8335  * This is tracked by the timeInState eBPF program.
8336  */
8337message CpuCyclesPerThreadGroupCluster {
8338    enum ThreadGroup {
8339        UNKNOWN_THREAD_GROUP = 0;
8340
8341        // System server threads serving Binder calls.
8342        SYSTEM_SERVER_BINDER = 1;
8343
8344        // All system server threads.
8345        SYSTEM_SERVER = 2;
8346
8347        // All surface flinger threads.
8348        SURFACE_FLINGER = 3;
8349    }
8350    optional ThreadGroup thread_group = 1;
8351
8352    optional int32 cluster = 2;
8353
8354    // Megacycles, i.e. millions of cycles.
8355    optional int64 mcycles = 3;
8356    // Time excluding sleep since tracking started.
8357    optional int64 time_millis = 4;
8358}
8359
8360/**
8361 * Pulls Wifi Controller Activity Energy Info
8362 */
8363message WifiActivityInfo {
8364    // timestamp(wall clock) of record creation
8365    optional uint64 timestamp_millis = 1;
8366    // stack reported state
8367    // TODO: replace this with proto enum
8368    optional int32 stack_state = 2;
8369    // tx time in millis
8370    optional uint64 controller_tx_time_millis = 3;
8371    // rx time in millis
8372    optional uint64 controller_rx_time_millis = 4;
8373    // idle time in millis
8374    optional uint64 controller_idle_time_millis = 5;
8375    // product of current(mA), voltage(V) and time(ms)
8376    optional uint64 controller_energy_used = 6;
8377}
8378
8379/**
8380 * Pulls Modem Activity Energy Info
8381 */
8382message ModemActivityInfo {
8383    // timestamp(wall clock) of record creation
8384    optional uint64 timestamp_millis = 1;
8385    // sleep time in millis.
8386    optional uint64 sleep_time_millis = 2;
8387    // idle time in millis
8388    optional uint64 controller_idle_time_millis = 3;
8389    /**
8390     * Tx power index
8391     * index 0 = tx_power < 0dBm
8392     * index 1 = 0dBm < tx_power < 5dBm
8393     * index 2 = 5dBm < tx_power < 15dBm
8394     * index 3 = 15dBm < tx_power < 20dBm
8395     * index 4 = tx_power > 20dBm
8396     */
8397    // tx time in ms at power level 0
8398    optional uint64 controller_tx_time_pl0_millis = 4;
8399    // tx time in ms at power level 1
8400    optional uint64 controller_tx_time_pl1_millis = 5;
8401    // tx time in ms at power level 2
8402    optional uint64 controller_tx_time_pl2_millis = 6;
8403    // tx time in ms at power level 3
8404    optional uint64 controller_tx_time_pl3_millis = 7;
8405    // tx time in ms at power level 4
8406    optional uint64 controller_tx_time_pl4_millis = 8;
8407    // rx time in ms at power level 5
8408    optional uint64 controller_rx_time_millis = 9;
8409    // product of current(mA), voltage(V) and time(ms)
8410    optional uint64 energy_used = 10 [deprecated=true];
8411}
8412
8413/**
8414 * Pulls Bluetooth Activity Energy Info
8415 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
8416 */
8417message BluetoothActivityInfo {
8418    // timestamp(wall clock) of record creation
8419    optional uint64 timestamp_millis = 1;
8420    // bluetooth stack state
8421    optional int32 bluetooth_stack_state = 2;
8422    // tx time in millis
8423    optional uint64 controller_tx_time_millis = 3;
8424    // rx time in millis
8425    optional uint64 controller_rx_time_millis = 4;
8426    // idle time in millis
8427    optional uint64 controller_idle_time_millis = 5;
8428    // product of current(mA), voltage(V) and time(ms)
8429    optional uint64 energy_used = 6;
8430}
8431
8432/*
8433 * Logs the memory stats for a process.
8434 *
8435 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
8436 */
8437message ProcessMemoryState {
8438    // The uid if available. -1 means not available.
8439    optional int32 uid = 1 [(is_uid) = true];
8440
8441    // The process name.
8442    // Usually package name, "system" for system server.
8443    // Provided by ActivityManagerService.
8444    optional string process_name = 2;
8445
8446    // Current OOM score adjustment. Value read from ProcessRecord.
8447    optional int32 oom_adj_score = 3;
8448
8449    // # of page-faults
8450    optional int64 page_fault = 4;
8451
8452    // # of major page-faults
8453    optional int64 page_major_fault = 5;
8454
8455    // RSS
8456    // Value is read from memory.stat, field total_rss if per-app memory
8457    // cgroups are enabled. Otherwise, value from /proc/pid/stat.
8458    optional int64 rss_in_bytes = 6;
8459
8460    // CACHE
8461    // Value is read from memory.stat, field total_cache if per-app memory
8462    // cgroups are enabled. Otherwise, 0.
8463    optional int64 cache_in_bytes = 7;
8464
8465    // SWAP
8466    // Value is read from memory.stat, field total_swap if per-app memory
8467    // cgroups are enabled. Otherwise, 0.
8468    optional int64 swap_in_bytes = 8;
8469
8470    // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
8471    optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
8472
8473    // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
8474    optional int64 start_time_nanos = 10 [deprecated = true];
8475
8476    // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
8477    optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
8478}
8479
8480/*
8481 * Logs the memory high-water mark for a process.
8482 *
8483 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
8484 * and for selected native processes.
8485 *
8486 * Pulling this atom resets high-water mark counters for all processes.
8487 */
8488message ProcessMemoryHighWaterMark {
8489    // The uid if available. -1 means not available.
8490    optional int32 uid = 1 [(is_uid) = true];
8491
8492    // The process name.
8493    // Usually package name or process cmdline.
8494    // Provided by ActivityManagerService or read from /proc/PID/cmdline.
8495    optional string process_name = 2;
8496
8497    // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
8498    // computed by converting kilobytes to bytes.
8499    optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
8500
8501    // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
8502    // /proc/PID/status.
8503    optional int32 rss_high_water_mark_in_kilobytes = 4;
8504}
8505
8506/*
8507 * Logs the memory stats for a process.
8508 *
8509 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
8510 * and for selected native processes.
8511 */
8512message ProcessMemorySnapshot {
8513    // The uid if available. -1 means not available.
8514    optional int32 uid = 1 [(is_uid) = true];
8515
8516    // The process name.
8517    // Usually package name or process cmdline.
8518    // Provided by ActivityManagerService or read from /proc/PID/cmdline.
8519    optional string process_name = 2;
8520
8521    // The pid of the process.
8522    // Allows to disambiguate instances of the process.
8523    optional int32 pid = 3;
8524
8525    // The current OOM score adjustment value.
8526    // Read from ProcessRecord for managed processes.
8527    // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
8528    optional int32 oom_score_adj = 4;
8529
8530    // The current RSS of the process.
8531    // VmRSS from /proc/pid/status.
8532    optional int32 rss_in_kilobytes = 5;
8533
8534    // The current anon RSS of the process.
8535    // RssAnon from /proc/pid/status.
8536    optional int32 anon_rss_in_kilobytes = 6;
8537
8538    // The current swap size of the process.
8539    // VmSwap from /proc/pid/status.
8540    optional int32 swap_in_kilobytes = 7;
8541
8542    // The sum of rss_in_kilobytes and swap_in_kilobytes.
8543    optional int32 anon_rss_and_swap_in_kilobytes = 8;
8544
8545    // GPU memory usage as measured by the kernel tracepoints
8546    // Equivalent to dumpsys gpu --gpumem
8547    optional int32 gpu_memory_kb = 9;
8548
8549    // Whether or not this process is hosting one or more foregound services.
8550    optional bool has_foreground_services = 10;
8551
8552    // The current rss memory in shared space.
8553    optional int32 shmem_kb = 11;
8554
8555    // The types of the components this process is hosting at the moment this
8556    // snapshot is taken.
8557    // See the available types in HostingComponentType in AppProtoEnums.
8558    optional int32 current_hosting_component_types = 12;
8559
8560    // The historical types of the components this process is or was hosting
8561    // since it's born.
8562    // See the available types in HostingComponentType in AppProtoEnums.
8563    optional int32 historical_hosting_component_types = 13;
8564}
8565
8566/*
8567 * Elapsed real time from SystemClock.
8568 */
8569message SystemElapsedRealtime {
8570    optional uint64 time_millis = 1;
8571}
8572
8573/*
8574 * Up time from SystemClock.
8575 */
8576message SystemUptime {
8577    // Milliseconds since the system was booted.
8578    // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
8579    // for external input).
8580    // It is not affected by clock scaling, idle, or other power saving mechanisms.
8581    optional uint64 uptime_millis = 1;
8582}
8583
8584/*
8585 * Reads from /proc/uid_concurrent_active_time which has the format:
8586 * active: X (X is # cores)
8587 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
8588 * [uid1]: [time-0] [time-1] [time-2] ... ...
8589 * ...
8590 * Time-N means the CPU time a UID spent running concurrently with N other processes.
8591 * The file contains a monotonically increasing count of time for a single boot.
8592 */
8593message CpuActiveTime {
8594    optional int32 uid = 1 [(is_uid) = true];
8595    optional uint64 time_millis = 2;
8596}
8597
8598/**
8599 * Reads from /proc/uid_concurrent_policy_time which has the format:
8600 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
8601 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
8602 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
8603 * ...
8604 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
8605 * The file contains a monotonically increasing count of time for a single boot.
8606 */
8607message CpuClusterTime {
8608    optional int32 uid = 1 [(is_uid) = true];
8609    optional int32 cluster_index = 2;
8610    optional uint64 time_millis = 3;
8611}
8612
8613/*
8614 * Pulls free disk space, for data, system partition and temporary directory.
8615 */
8616message DiskSpace {
8617    // available bytes in data partition
8618    optional uint64 data_available_bytes = 1;
8619    // available bytes in system partition
8620    optional uint64 system_available_bytes = 2;
8621    // available bytes in download cache or temp directories
8622    optional uint64 temp_available_bytes = 3;
8623}
8624
8625/**
8626 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
8627 *
8628 * Pulled from StatsCompanionService.java
8629 */
8630message RemainingBatteryCapacity {
8631    optional int32 charge_micro_ampere_hour = 1;
8632}
8633
8634/**
8635 * Pulls battery capacity, which is the battery capacity when full in uAh.
8636 * Pulled from:
8637 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
8638 */
8639message FullBatteryCapacity {
8640    optional int32 capacity_micro_ampere_hour = 1;
8641}
8642
8643/**
8644 * Pulls battery voltage.
8645 * Pulled from:
8646 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
8647 */
8648message BatteryVoltage {
8649    // The voltage of the battery, in millivolts.
8650    optional int32 voltage_millivolt = 1;
8651}
8652
8653/**
8654 * Pulls battery level (percent full, from 0 to 100).
8655 *
8656 * Pulled from:
8657 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
8658 */
8659message BatteryLevel {
8660    // Battery level. Should be in [0, 100].
8661    optional int32 battery_level = 1;
8662}
8663
8664/**
8665 * Pulls the temperature of various parts of the device.
8666 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
8667 *
8668 * Pulled from StatsCompanionService.java
8669 */
8670message Temperature {
8671    // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
8672    optional android.os.TemperatureTypeEnum sensor_location = 1;
8673
8674    // The name of the temperature source. Eg. CPU0
8675    optional string sensor_name = 2;
8676
8677    // Temperature in tenths of a degree C.
8678    // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
8679    optional int32 temperature_deci_celsius = 3;
8680
8681    // Relative severity of the throttling, see enum definition.
8682    optional android.os.ThrottlingSeverityEnum severity = 4;
8683}
8684
8685/**
8686 * Pulls the statistics of calls to Binder.
8687 *
8688 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
8689 * config on the device.
8690 *
8691 * Next tag: 15
8692 */
8693message BinderCalls {
8694    // UID of the process responsible for the binder transaction. It will be set if the process
8695    // executing the binder transaction attribute the transaction to another uid using
8696    // Binder.setThreadWorkSource().
8697    //
8698    // If not set, the value will be -1.
8699    optional int32 uid = 1 [(is_uid) = true];
8700    // UID of the process executing the binder transaction.
8701    optional int32 direct_caller_uid = 14 [(is_uid) = true];
8702    // Fully qualified class name of the API call.
8703    //
8704    // This is a system server class name.
8705    //
8706    // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
8707    // gets recycled and we have isolated uids, we might attribute the data incorrectly.
8708    // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
8709    // commonly used APIs.
8710    optional string service_class_name = 2;
8711    // Method name of the API call. It can also be a transaction code if we cannot
8712    // resolve it to a name. See Binder#getTransactionName.
8713    //
8714    // This is a system server method name.
8715    optional string service_method_name = 3;
8716    // Total number of API calls.
8717    optional int64 call_count = 4;
8718    // True if the screen was interactive PowerManager#isInteractive at the end of the call.
8719    optional bool screen_interactive = 13;
8720    // Total number of API calls we have data recorded for. If we collected data for all the calls,
8721    // call_count will be equal to recorded_call_count.
8722    //
8723    // If recorded_call_count is different than call_count, it means data collection has been
8724    // sampled. All the fields below will be sampled in this case.
8725    optional int64 recorded_call_count = 12;
8726    // Number of exceptions thrown by the API.
8727    optional int64 recorded_exception_count = 5;
8728    // Total latency of all API calls.
8729    // Average can be computed using total_latency_micros / recorded_call_count.
8730    optional int64 recorded_total_latency_micros = 6;
8731    // Maximum latency of one API call.
8732    optional int64 recorded_max_latency_micros = 7;
8733    // Total CPU usage of all API calls.
8734    // Average can be computed using total_cpu_micros / recorded_call_count.
8735    // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
8736    optional int64 recorded_total_cpu_micros = 8;
8737    // Maximum CPU usage of one API call.
8738    optional int64 recorded_max_cpu_micros = 9;
8739    // Maximum parcel reply size of one API call.
8740    optional int64 recorded_max_reply_size_bytes = 10;
8741    // Maximum parcel request size of one API call.
8742    optional int64 recorded_max_request_size_bytes = 11;
8743}
8744
8745/**
8746 * Pulls the statistics of exceptions during calls to Binder.
8747 *
8748 * Binder stats are cumulative from boot unless somebody reset the data using
8749 * > adb shell dumpsys binder_calls_stats --reset
8750 */
8751message BinderCallsExceptions {
8752    // Exception class name, e.g. java.lang.IllegalArgumentException.
8753    //
8754    // This is an exception class name thrown by the system server.
8755    optional string exception_class_name = 1;
8756    // Total number of exceptions.
8757    optional int64 exception_count = 2;
8758}
8759
8760/**
8761 * Pulls the statistics of message dispatching on HandlerThreads.
8762 *
8763 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
8764 * config on the device.
8765 *
8766 * Next tag: 11
8767 */
8768message LooperStats {
8769    // The uid that made a call to the System Server and caused the message to be enqueued.
8770    optional int32 uid = 1 [(is_uid) = true];
8771
8772    // Fully qualified class name of the handler target class.
8773    //
8774    // This field does not contain PII. This is a system server class name.
8775    optional string handler_class_name = 2;
8776
8777    // The name of the thread that runs the Looper.
8778    //
8779    // This field does not contain PII. This is a system server thread name.
8780    optional string looper_thread_name = 3;
8781
8782    // The name of the dispatched message.
8783    //
8784    // This field does not contain PII. This is a system server constant or class
8785    // name.
8786    optional string message_name = 4;
8787
8788    // Total number of successfully dispatched messages.
8789    optional int64 message_count = 5;
8790
8791    // Total number of messages that failed dispatching.
8792    optional int64 exception_count = 6;
8793
8794    // Total number of processed messages we have data recorded for. If we
8795    // collected data for all the messages, message_count will be equal to
8796    // recorded_message_count.
8797    //
8798    // If recorded_message_count is different than message_count, it means data
8799    // collection has been sampled. The fields below will be sampled in this case.
8800    optional int64 recorded_message_count = 7;
8801
8802    // Total latency of all processed messages.
8803    // Average can be computed using recorded_total_latency_micros /
8804    // recorded_message_count.
8805    optional int64 recorded_total_latency_micros = 8;
8806
8807    // Total CPU usage of all processed message.
8808    // Average can be computed using recorded_total_cpu_micros /
8809    // recorded_message_count. Total can be computed using
8810    // recorded_total_cpu_micros / recorded_message_count * message_count.
8811    optional int64 recorded_total_cpu_micros = 9;
8812
8813    // True if the screen was interactive PowerManager#isInteractive at the end of the call.
8814    optional bool screen_interactive = 10;
8815
8816    // Max recorded CPU usage of all processed messages.
8817    optional int64 recorded_max_cpu_micros = 11;
8818
8819    // Max recorded latency of all processed messages.
8820    optional int64 recorded_max_latency_micros = 12;
8821
8822    // Total number of messages we tracked the dispatching delay for. If we
8823    // collected data for all the messages, message_count will be equal to
8824    // recorded_delay_message_count.
8825    //
8826    // If recorded_delay_message_count is different than message_count, it means data
8827    // collection has been sampled or/and not all messages specified the target dispatch time.
8828    // The fields below will be sampled in this case.
8829    optional int64 recorded_delay_message_count = 13;
8830
8831    // Total dispatching delay of all processed messages.
8832    // Calculated as a difference between the target dispatching time (Message.when)
8833    // and the actual dispatching time.
8834    // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
8835    optional int64 recorded_total_delay_millis = 14;
8836
8837    // Max dispatching delay of all processed messages.
8838    // Calculated as a difference between the target dispatching time (Message.when)
8839    // and the actual dispatching time.
8840    optional int64 recorded_max_delay_millis = 15;
8841}
8842
8843/**
8844 * Pulls disk information, such as write speed and latency.
8845 */
8846message DiskStats {
8847    // Time taken to open, write 512B to, and close a file.
8848    // -1 if error performing the check.
8849    optional int64 data_write_latency_millis = 1;
8850
8851    optional bool file_based_encryption = 2;
8852
8853    // Recent disk write speed in kB/s.
8854    // -1 if error querying storageed.
8855    // 0 if data is unavailable.
8856    optional int32 recent_disk_write_speed = 3;
8857}
8858
8859
8860/**
8861 * Free and total bytes of the Data, Cache, System, and Metadata partitions.
8862 */
8863message DirectoryUsage {
8864    enum Directory {
8865        UNKNOWN = 0;
8866        DATA = 1;
8867        CACHE = 2;
8868        SYSTEM = 3;
8869        METADATA = 4;
8870    }
8871    optional Directory directory = 1;
8872    optional int64 free_bytes = 2;
8873    optional int64 total_bytes = 3;
8874}
8875
8876
8877/**
8878 * Size of an application: apk size, data size, and cache size.
8879 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
8880 * Information is only reported for apps with the primary user (user 0).
8881 * Sizes are aggregated by package name.
8882 */
8883message AppSize {
8884    // Including uids will involve modifying diskstats logic.
8885    optional string package_name = 1;
8886    // App size in bytes. -1 if unavailable.
8887    optional int64 app_size_bytes = 2;
8888    // App data size in bytes. -1 if unavailable.
8889    optional int64 app_data_size_bytes = 3;
8890    // App cache size in bytes. -1 if unavailable.
8891    optional int64 app_cache_size_bytes = 4;
8892    // Time that the cache file was produced.
8893    // Uses System.currentTimeMillis(), which is wall clock time.
8894    optional int64 cache_time_millis = 5;
8895}
8896
8897
8898/**
8899 * Size of a particular category. Eg: photos, videos.
8900 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
8901 */
8902message CategorySize {
8903    enum Category {
8904        UNKNOWN = 0;
8905        APP_SIZE = 1;
8906        APP_DATA_SIZE = 2;
8907        APP_CACHE_SIZE = 3;
8908        PHOTOS = 4;
8909        VIDEOS = 5;
8910        AUDIO = 6;
8911        DOWNLOADS = 7;
8912        SYSTEM = 8;
8913        OTHER = 9;
8914    }
8915    optional Category category = 1;
8916    // Category size in bytes.
8917    optional int64 size_bytes = 2;
8918    // Time that the cache file was produced.
8919    // Uses System.currentTimeMillis(), which is wall clock time.
8920    optional int64 cache_time_millis = 3;
8921}
8922
8923/**
8924 * Pulls per uid I/O stats. The stats are cumulative since boot.
8925 *
8926 * Read/write bytes are I/O events from a storage device
8927 * Read/write chars are data requested by read/write syscalls, and can be
8928 *   satisfied by caching.
8929 *
8930 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
8931 */
8932message DiskIo {
8933    optional int32 uid = 1 [(is_uid) = true];
8934    optional int64 fg_chars_read = 2;
8935    optional int64 fg_chars_write = 3;
8936    optional int64 fg_bytes_read = 4;
8937    optional int64 fg_bytes_write = 5;
8938    optional int64 bg_chars_read = 6;
8939    optional int64 bg_chars_write = 7;
8940    optional int64 bg_bytes_read = 8;
8941    optional int64 bg_bytes_write = 9;
8942    optional int64 fg_fsync = 10;
8943    optional int64 bg_fsync= 11;
8944}
8945
8946
8947/**
8948 * Pulls the number of fingerprints for each user.
8949 *
8950 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
8951 */
8952message NumFingerprintsEnrolled {
8953    // The associated user. Eg: 0 for owners, 10+ for others.
8954    // Defined in android/os/UserHandle.java
8955    optional int32 user = 1;
8956    // Number of fingerprints registered to that user.
8957    optional int32 num_fingerprints_enrolled = 2;
8958}
8959
8960/**
8961 * Pulls the number of faces for each user.
8962 *
8963 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
8964 */
8965message NumFacesEnrolled {
8966    // The associated user. Eg: 0 for owners, 10+ for others.
8967    // Defined in android/os/UserHandle.java
8968    optional int32 user = 1;
8969    // Number of faces registered to that user.
8970    optional int32 num_faces_enrolled = 2;
8971}
8972/**
8973 * A mapping of role holder -> role
8974 */
8975message RoleHolder {
8976    // uid of the role holder
8977    optional int32 uid = 1 [(is_uid) = true];
8978
8979    // package name of the role holder
8980    optional string package_name = 2;
8981
8982    // the role held
8983    optional string role = 3;
8984}
8985
8986message AggStats {
8987    // These are all in byte resolution.
8988    optional int64 min = 1 [deprecated = true];
8989    optional int64 average = 2 [deprecated = true];
8990    optional int64 max = 3 [deprecated = true];
8991
8992    // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
8993    // int64 fields.
8994    optional int32 mean_kb = 4;
8995    optional int32 max_kb = 5;
8996}
8997
8998// A reduced subset of process states; reducing the number of possible states allows more
8999// aggressive device-side aggregation of statistics and hence reduces metric upload size.
9000enum ProcessStateAggregated {
9001    PROCESS_STATE_UNKNOWN = 0;
9002    // Persistent system process.
9003    PROCESS_STATE_PERSISTENT = 1;
9004    // Top activity; actually any visible activity.
9005    PROCESS_STATE_TOP = 2;
9006    // Process binding to top or a foreground service.
9007    PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
9008    // Processing running a foreground service.
9009    PROCESS_STATE_FGS = 4;
9010    // Important foreground process (ime, wallpaper, etc).
9011    PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
9012    // Important background process.
9013    PROCESS_STATE_BACKGROUND = 6;
9014    // Process running a receiver.
9015    PROCESS_STATE_RECEIVER = 7;
9016    // All kinds of cached processes.
9017    PROCESS_STATE_CACHED = 8;
9018}
9019
9020// Next tag: 13
9021message ProcessStatsStateProto {
9022    optional android.service.procstats.ScreenState screen_state = 1;
9023
9024    optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
9025
9026    // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
9027    // and not frameworks/base/core/java/android/app/ActivityManager.java
9028    optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
9029
9030    optional ProcessStateAggregated process_state_aggregated = 10;
9031
9032    // Millisecond uptime duration spent in this state
9033    optional int64 duration_millis = 4 [deprecated = true];
9034    // Same as above, but with minute resolution so it fits into an int32.
9035    optional int32 duration_minutes = 11;
9036
9037    // Millisecond elapsed realtime duration spent in this state
9038    optional int64 realtime_duration_millis = 9 [deprecated = true];
9039    // Same as above, but with minute resolution so it fits into an int32.
9040    optional int32 realtime_duration_minutes = 12;
9041
9042    // # of samples taken
9043    optional int32 sample_size = 5;
9044
9045    // PSS is memory reserved for this process
9046    optional AggStats pss = 6 [deprecated = true];
9047
9048    // USS is memory shared between processes, divided evenly for accounting
9049    optional AggStats uss = 7 [deprecated = true];
9050
9051    // RSS is memory resident for this process
9052    optional AggStats rss = 8;
9053}
9054
9055// Next Tag: 8
9056message ProcessStatsProto {
9057    // Name of process.
9058    optional string process = 1;
9059
9060    // Uid of the process.
9061    optional int32 uid = 2 [(is_uid) = true];
9062
9063    // Information about how often kills occurred
9064    message Kill {
9065        // Count of excessive CPU kills
9066        optional int32 cpu = 1;
9067
9068        // Count of kills when cached
9069        optional int32 cached = 2;
9070
9071        // PSS stats during cached kill
9072        optional AggStats cached_pss = 3;
9073    }
9074    optional Kill kill = 3 [deprecated = true];
9075
9076    // Time and memory spent in various states.
9077    repeated ProcessStatsStateProto states = 5;
9078
9079    // Total time process has been running...  screen_state, memory_state, and process_state
9080    // will not be set.
9081    optional ProcessStatsStateProto total_running_state = 6;
9082
9083    // Association data for this process in this state;
9084    // each entry here is one association.
9085    repeated ProcessStatsAssociationProto assocs = 7;
9086}
9087
9088// Next Tag: 6
9089message ProcessStatsAssociationProto {
9090    // Procss Name of the associated process (client process of service binding)
9091    optional string assoc_process_name = 1;
9092
9093    // Package Name of the associated package (client package of service binding)
9094    optional string assoc_package_name = 2 [deprecated = true];
9095
9096    // UID of the associated process/package (client package of service binding)
9097    optional int32 assoc_uid = 5 [(is_uid) = true];
9098
9099    // Total count of the times this association (service binding) appeared.
9100    optional int32 total_count = 3;
9101
9102    // Uptime total duration in seconds this association (service binding) was around.
9103    optional int32 total_duration_secs = 4;
9104}
9105
9106message PackageServiceOperationStatsProto {
9107    // Operate enum: Started, Foreground, Bound, Executing
9108    optional android.service.procstats.ServiceOperationState operation = 1;
9109
9110    // Number of times the service was in this operation.
9111    optional int32 count = 2;
9112
9113    // Information about a state the service can be in.
9114    message StateStats {
9115        // Screen state enum.
9116        optional android.service.procstats.ScreenState screen_state = 1;
9117        // Memory state enum.
9118        optional android.service.procstats.MemoryState memory_state = 2;
9119
9120        // duration in milliseconds.
9121        optional int64 duration_millis = 3;
9122        // Millisecond elapsed realtime duration spent in this state
9123        optional int64 realtime_duration_millis = 4;
9124    }
9125    repeated StateStats state_stats = 3;
9126}
9127
9128message PackageServiceStatsProto {
9129    // Name of service component.
9130    optional string service_name = 1;
9131
9132    // The operation stats.
9133    // The package_name, package_uid, package_version, service_name will not be set to save space.
9134    repeated PackageServiceOperationStatsProto operation_stats = 2;
9135}
9136
9137message PackageAssociationSourceProcessStatsProto {
9138    // Uid of the process.
9139    optional int32 process_uid = 1;
9140    // Process name.
9141    optional string process_name = 2;
9142    // Package name.
9143    optional string package_name = 7;
9144    // Total count of the times this association appeared.
9145    optional int32 total_count = 3;
9146
9147    // Millisecond uptime total duration this association was around.
9148    optional int64 total_duration_millis = 4;
9149
9150    // Total count of the times this association became actively impacting its target process.
9151    optional int32 active_count = 5;
9152
9153    // Information on one source in this association.
9154    message StateStats {
9155        // Process state enum.
9156        optional android.service.procstats.ProcessState process_state = 1;
9157        // Millisecond uptime duration spent in this state
9158        optional int64 duration_millis = 2;
9159        // Millisecond elapsed realtime duration spent in this state
9160        optional int64 realtime_duration_mmillis = 3;
9161    }
9162    repeated StateStats active_state_stats = 6;
9163}
9164
9165message PackageAssociationProcessStatsProto {
9166    // Name of the target component.
9167    optional string component_name = 1;
9168    // Information on one source in this association.
9169    repeated PackageAssociationSourceProcessStatsProto sources = 2;
9170}
9171
9172
9173message ProcessStatsPackageProto {
9174    // Name of package.
9175    optional string package = 1;
9176
9177    // Uid of the package.
9178    optional int32 uid = 2;
9179
9180    // Version of the package.
9181    optional int64 version = 3;
9182
9183    // Stats for each process running with the package loaded in to it.
9184    repeated ProcessStatsProto process_stats = 4;
9185
9186    // Stats for each of the package's services.
9187    repeated PackageServiceStatsProto service_stats = 5;
9188
9189    // Stats for each association with the package.
9190    repeated PackageAssociationProcessStatsProto association_stats = 6;
9191}
9192
9193message ProcessStatsSectionProto {
9194    // Elapsed realtime at start of report.
9195    optional int64 start_realtime_millis = 1;
9196
9197    // Elapsed realtime at end of report.
9198    optional int64 end_realtime_millis = 2;
9199
9200    // CPU uptime at start of report.
9201    optional int64 start_uptime_millis = 3;
9202
9203    // CPU uptime at end of report.
9204    optional int64 end_uptime_millis = 4;
9205
9206    // System runtime library. e.g. "libdvm.so", "libart.so".
9207    optional string runtime = 5;
9208
9209    // whether kernel reports swapped pss.
9210    optional bool has_swapped_pss = 6;
9211
9212    // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
9213    enum Status {
9214        STATUS_UNKNOWN = 0;
9215        STATUS_COMPLETE = 1;
9216        STATUS_PARTIAL = 2;
9217        STATUS_SHUTDOWN = 3;
9218        STATUS_SYSPROPS = 4;
9219    }
9220    repeated Status status = 7;
9221
9222    // Number of pages available of various types and sizes, representation fragmentation.
9223    repeated ProcessStatsAvailablePagesProto available_pages = 10;
9224
9225    // Stats for each process.
9226    repeated ProcessStatsProto process_stats = 8;
9227
9228    // Stats for each package.
9229    repeated ProcessStatsPackageProto package_stats = 9;
9230}
9231
9232message ProcessStatsAvailablePagesProto {
9233    // Node these pages are in (as per /proc/pagetypeinfo)
9234    optional int32 node = 1;
9235
9236    // Zone these pages are in (as per /proc/pagetypeinfo)
9237    optional string zone = 2;
9238
9239    // Label for the type of these pages (as per /proc/pagetypeinfo)
9240    optional string label = 3;
9241
9242    // Distribution of number of pages available by order size.  First entry in array is
9243    // order 0, second is order 1, etc.  Each order increase is a doubling of page size.
9244    repeated int32 pages_per_order = 4;
9245}
9246
9247/**
9248 * Pulled from ProcessStatsService.java
9249 */
9250message ProcStats {
9251    optional ProcessStatsSectionProto proc_stats_section = 1 [(log_mode) = MODE_BYTES];
9252    // Data pulled from device into this is sometimes sharded across multiple atoms to work around
9253    // a size limit. When this happens, this shard ID will contain an increasing 1-indexed integer
9254    // with the number of this shard.
9255    optional int32 shard_id = 2;
9256}
9257
9258/**
9259 * Pulled from ProcessStatsService.java
9260 */
9261message ProcStatsPkgProc {
9262    optional ProcessStatsSectionProto proc_stats_section = 1 [(log_mode) = MODE_BYTES];
9263}
9264
9265// Next Tag: 2
9266message PackageRemoteViewInfoProto {
9267    optional string package_name = 1;
9268    // add per-package additional info here (like channels)
9269}
9270
9271// Next Tag: 2
9272message NotificationRemoteViewsProto {
9273    repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
9274}
9275
9276/**
9277 * Pulled from NotificationManagerService.java
9278 */
9279message NotificationRemoteViews {
9280    optional NotificationRemoteViewsProto notification_remote_views = 1 [(log_mode) = MODE_BYTES];
9281}
9282
9283/**
9284 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
9285 */
9286message PackageNotificationPreferences {
9287    // Uid under which the package is installed.
9288    optional int32 uid = 1 [(is_uid) = true];
9289    // Notification importance, which specifies when and how a notification is displayed.
9290    // Specified under core/java/android/app/NotificationManager.java.
9291    optional int32 importance = 2;
9292    // Lockscreen visibility as set by the user.
9293    optional int32 visibility = 3;
9294    // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
9295    // PreferencesHelper.java)
9296    optional int32 user_locked_fields = 4;
9297    // Indicates if the package importance was set by the user (rather than system default).
9298    optional bool user_set_importance = 5;
9299    // State of the full screen intent permission for this package.
9300    enum FsiState {
9301        // This package did not declare the full screen intent permission in its manifest.
9302        NOT_REQUESTED = 0;
9303        // This package has the full screen intent permission.
9304        GRANTED = 1;
9305        // This package does not have the full screen intent permission.
9306        DENIED = 2;
9307    }
9308    optional FsiState fsi_state = 6;
9309    // True if the current full screen intent permission state for this package was set by the user.
9310    // This is only set when the FSI permission is requested by the app.
9311    optional bool is_fsi_permission_user_set = 7;
9312}
9313
9314/**
9315 * Atom that contains a list of a package's channel preferences, pulled from
9316 * NotificationManagerService.java.
9317 */
9318message PackageNotificationChannelPreferences {
9319    // Uid under which the package is installed.
9320    optional int32 uid = 1 [(is_uid) = true];
9321    // Channel's ID. Should always be available.
9322    optional string channel_id = 2;
9323    // Channel's name. Should always be available.
9324    optional string channel_name = 3;
9325    // Channel's description. Optionally set by the channel creator.
9326    optional string description = 4;
9327    // Notification importance, which specifies when and how a notification is displayed. Specified
9328    // under core/java/android/app/NotificationManager.java.
9329    optional int32 importance = 5;
9330    // Bitmask representing which fields have been set by the user. See field bitmask descriptions
9331    // at core/java/android/app/NotificationChannel.java
9332    optional int32 user_locked_fields = 6;
9333    // Indicates if the channel was deleted by the app.
9334    optional bool is_deleted = 7;
9335    // Indicates if the channel was marked as a conversation by the app.
9336    optional bool is_conversation = 8;
9337    // Indicates if the channel is a conversation that was demoted by the user.
9338    optional bool is_demoted_conversation = 9;
9339    // Indicates if the channel is a conversation that was marked as important by the user.
9340    optional bool is_important_conversation = 10;
9341}
9342
9343/**
9344 * Atom that contains a list of a package's channel group preferences, pulled from
9345 * NotificationManagerService.java.
9346 */
9347message PackageNotificationChannelGroupPreferences {
9348    // Uid under which the package is installed.
9349    optional int32 uid = 1 [(is_uid) = true];
9350    // Channel Group's ID. Should always be available.
9351    optional string group_id = 2;
9352    // Channel Group's name. Should always be available.
9353    optional string group_name = 3;
9354    // Channel Group's description. Optionally set by group creator.
9355    optional string description = 4;
9356    // Indicates if notifications from this channel group are blocked.
9357    optional bool is_blocked = 5;
9358    // Bitmask representing which fields have been set by the user. See field bitmask descriptions
9359    // at core/java/android/app/NotificationChannelGroup.java
9360    optional int32 user_locked_fields = 6;
9361}
9362
9363message PowerProfileProto {
9364    optional double cpu_suspend = 1;
9365
9366    optional double cpu_idle = 2;
9367
9368    optional double cpu_active = 3;
9369
9370    message CpuCluster {
9371        optional int32 id = 1;
9372        optional double cluster_power = 2;
9373        optional int32 cores = 3;
9374        repeated int64 speed = 4;
9375        repeated double core_power = 5;
9376    }
9377
9378    repeated CpuCluster cpu_cluster = 40;
9379
9380    optional double wifi_scan = 4;
9381
9382    optional double wifi_on = 5;
9383
9384    optional double wifi_active = 6;
9385
9386    optional double wifi_controller_idle = 7;
9387
9388    optional double wifi_controller_rx = 8;
9389
9390    optional double wifi_controller_tx = 9;
9391
9392    repeated double wifi_controller_tx_levels = 10;
9393
9394    optional double wifi_controller_operating_voltage = 11;
9395
9396    optional double bluetooth_controller_idle = 12;
9397
9398    optional double bluetooth_controller_rx = 13;
9399
9400    optional double bluetooth_controller_tx = 14;
9401
9402    optional double bluetooth_controller_operating_voltage = 15;
9403
9404    optional double modem_controller_sleep = 16;
9405
9406    optional double modem_controller_idle = 17;
9407
9408    optional double modem_controller_rx = 18;
9409
9410    repeated double modem_controller_tx = 19;
9411
9412    optional double modem_controller_operating_voltage = 20;
9413
9414    optional double gps_on = 21;
9415
9416    repeated double gps_signal_quality_based = 22;
9417
9418    optional double gps_operating_voltage = 23;
9419
9420    optional double bluetooth_on = 24;
9421
9422    optional double bluetooth_active = 25;
9423
9424    optional double bluetooth_at_cmd = 26;
9425
9426    optional double ambient_display = 27;
9427
9428    optional double screen_on = 28;
9429
9430    optional double radio_on = 29;
9431
9432    optional double radio_scanning = 30;
9433
9434    optional double radio_active = 31;
9435
9436    optional double screen_full = 32;
9437
9438    optional double audio = 33;
9439
9440    optional double video = 34;
9441
9442    optional double flashlight = 35;
9443
9444    optional double memory = 36;
9445
9446    optional double camera = 37;
9447
9448    optional double wifi_batched_scan = 38;
9449
9450    optional double battery_capacity = 39;
9451}
9452
9453/**
9454 * power_profile.xml and other constants for power model calculations.
9455 * Pulled from PowerProfile.java
9456 */
9457message PowerProfile {
9458    optional PowerProfileProto power_profile = 1 [(log_mode) = MODE_BYTES];
9459}
9460
9461/**
9462 * Logs when a user restriction was added or removed.
9463 *
9464 * Logged from:
9465 *   frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
9466 */
9467message UserRestrictionChanged {
9468    // The raw string of the user restriction as defined in UserManager.
9469    // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
9470    optional string restriction = 1;
9471    // Whether the restriction is enabled or disabled.
9472    optional bool enabled = 2;
9473}
9474
9475/**
9476 * Pulls process user time and system time. Puller takes a snapshot of all pids
9477 * in the system and returns cpu stats for those that are working at the time.
9478 * Dead pids will be dropped. Kernel processes are excluded.
9479 * Min cool-down is 5 sec.
9480 */
9481message ProcessCpuTime {
9482    optional int32 uid = 1 [(is_uid) = true];
9483
9484    optional string process_name = 2;
9485    // Process cpu time in user space, cumulative from boot/process start
9486    optional int64 user_time_millis = 3;
9487    // Process cpu time in system space, cumulative from boot/process start
9488    optional int64 system_time_millis = 4;
9489}
9490
9491/**
9492 * Pulls the CPU usage for each thread.
9493 *
9494 * Read from /proc/$PID/task/$TID/time_in_state files.
9495 *
9496 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
9497 * time_in_state files not being present on some phones, have not been addressed. These should be
9498 * considered before a public release.
9499 */
9500message CpuTimePerThreadFreq {
9501    // UID that owns the process.
9502    optional int32 uid = 1 [(is_uid) = true];
9503    // ID of the process.
9504    optional int32 process_id = 2;
9505    // ID of the thread.
9506    optional int32 thread_id = 3;
9507    // Name of the process taken from `/proc/$PID/cmdline`.
9508    optional string process_name = 4;
9509    // Name of the thread taken from `/proc/$PID/task/$TID/comm`
9510    optional string thread_name = 5;
9511
9512    // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
9513    // are given in KHz, and time is given in milliseconds since the thread started. All eight
9514    // frequencies are given here as the alternative is sending eight separate atoms. This method
9515    // significantly reduces the amount of data created
9516    optional int32 frequency1_khz = 6;
9517    optional int32 time1_millis = 7;
9518    optional int32 frequency2_khz = 8;
9519    optional int32 time2_millis = 9;
9520    optional int32 frequency3_khz = 10;
9521    optional int32 time3_millis = 11;
9522    optional int32 frequency4_khz = 12;
9523    optional int32 time4_millis = 13;
9524    optional int32 frequency5_khz = 14;
9525    optional int32 time5_millis = 15;
9526    optional int32 frequency6_khz = 16;
9527    optional int32 time6_millis = 17;
9528    optional int32 frequency7_khz = 18;
9529    optional int32 time7_millis = 19;
9530    optional int32 frequency8_khz = 20;
9531    optional int32 time8_millis = 21;
9532}
9533
9534/**
9535 * Pulls information about the device's build.
9536 */
9537message BuildInformation {
9538    // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
9539    // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
9540    optional string fingerprint = 1;
9541
9542    // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
9543    optional string brand = 2;
9544
9545    // Build.PRODUCT. The name of the overall product.
9546    optional string product = 3;
9547
9548    // Build.DEVICE. The name of the industrial design.
9549    optional string device = 4;
9550
9551    // Build.VERSION.RELEASE. The user-visible version string.  E.g., "1.0" or "3.4b5" or "bananas".
9552    optional string version_release = 5;
9553
9554    // Build.ID. E.g. a label like "M4-rc20".
9555    optional string id = 6;
9556
9557    // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
9558    // represent this build.
9559    optional string version_incremental = 7;
9560
9561    // Build.TYPE. The type of build, like "user" or "eng".
9562    optional string type = 8;
9563
9564    // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
9565    optional string tags = 9;
9566}
9567
9568/**
9569 * Logs information about mismatched caller for content capture.
9570 *
9571 * Logged from:
9572 *   frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
9573 */
9574message ContentCaptureCallerMismatchReported {
9575    optional string intended_package = 1;
9576    optional string calling_package = 2;
9577}
9578
9579/**
9580 * Logs information about content capture service events.
9581 *
9582 * Logged from:
9583 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
9584 */
9585message ContentCaptureServiceEvents {
9586    // The type of event.
9587    enum Event {
9588        UNKNOWN = 0;
9589        ON_CONNECTED = 1;
9590        ON_DISCONNECTED = 2;
9591        SET_WHITELIST = 3;
9592        SET_DISABLED = 4;
9593        ON_USER_DATA_REMOVED = 5;
9594        ON_DATA_SHARE_REQUEST = 6;
9595        ACCEPT_DATA_SHARE_REQUEST = 7;
9596        REJECT_DATA_SHARE_REQUEST = 8;
9597        DATA_SHARE_WRITE_FINISHED = 9;
9598        DATA_SHARE_ERROR_IOEXCEPTION = 10;
9599        DATA_SHARE_ERROR_EMPTY_DATA = 11;
9600        DATA_SHARE_ERROR_CLIENT_PIPE_FAIL = 12;
9601        DATA_SHARE_ERROR_SERVICE_PIPE_FAIL = 13;
9602        DATA_SHARE_ERROR_CONCURRENT_REQUEST = 14;
9603        DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED = 15;
9604        ON_REMOTE_SERVICE_DIED = 16;
9605    }
9606    optional Event event = 1;
9607    // component/package of content capture service.
9608    optional string service_info = 2;
9609    // component/package of target.
9610    // it's a concatenated list of component/package for SET_WHITELIST event
9611    // separated by " ".
9612    // Deprecated: should not log app package
9613    optional string target_info = 3 [deprecated = true];
9614    // The number of packages in the allow list
9615    optional int32 set_allowlist_package_count = 4;
9616    // The number of activities in the allow list
9617    optional int32 set_allowlist_activity_count = 5;
9618}
9619
9620/**
9621 * Logs information about content capture session events.
9622 *
9623 * Logged from:
9624 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
9625 */
9626message ContentCaptureSessionEvents {
9627    // The type of event.
9628    enum Event {
9629        UNKNOWN = 0;
9630        ON_SESSION_STARTED = 1;
9631        ON_SESSION_FINISHED = 2;
9632        SESSION_NOT_CREATED = 3;
9633    }
9634    optional int32 session_id = 1;
9635    optional Event event = 2;
9636    // (n/a on session finished)
9637    optional int32 state_flags = 3;
9638    // component/package of content capture service.
9639    optional string service_info = 4;
9640    // component/package of app.
9641    // (n/a on session finished)
9642    // Deprecated: should not log app package
9643    optional string app_info = 5 [deprecated = true];
9644    optional bool is_child_session = 6;
9645}
9646
9647/**
9648 * Logs information about session being flushed.
9649 *
9650 * Logged from:
9651 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
9652 */
9653message ContentCaptureFlushed {
9654    optional int32 session_id = 1;
9655    // component/package of content capture service.
9656    optional string service_info = 2;
9657    // component/package of app.
9658    // Deprecated: should not log app package
9659    optional string app_info = 3 [deprecated = true];
9660    // session start/finish events
9661    optional int32 child_session_started = 4;
9662    optional int32 child_session_finished = 5;
9663    // count of view events.
9664    optional int32 view_appeared_count = 6;
9665    optional int32 view_disappeared_count = 7;
9666    optional int32 view_text_changed_count = 8;
9667
9668    // Flush stats.
9669    optional int32 max_events = 9;
9670    optional int32 idle_flush_freq = 10;
9671    optional int32 text_flush_freq = 11;
9672    optional int32 flush_reason = 12;
9673}
9674
9675/**
9676 * Pulls on-device BatteryStats power use calculations for the overall device.
9677 */
9678message DeviceCalculatedPowerUse {
9679    // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
9680    // BatteryStats last reset (i.e. roughly since device was last significantly charged).
9681    // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
9682    optional int64 computed_power_nano_amp_secs = 1;
9683}
9684
9685// Keep in sync with frameworks/base/core/proto/android/os/batteryusagestats.proto
9686/**
9687 * Represents a device's BatteryUsageStats, with power usage information about the device
9688 * and each app.
9689 */
9690message BatteryUsageStatsAtomsProto {
9691
9692    // The session start timestamp in UTC milliseconds since January 1, 1970, per Date#getTime().
9693    // All data is no older than this time.
9694    optional int64 session_start_millis = 1;
9695
9696    // The session end timestamp in UTC milliseconds since January 1, 1970, per Date#getTime().
9697    // All data is no more recent than this time.
9698    optional int64 session_end_millis = 2;
9699
9700    // Length that the reported data covered. This usually will be equal to the entire session,
9701    // session_end_millis - session_start_millis, but may not be if some data during this time frame
9702    // is missing.
9703    optional int64 session_duration_millis = 3;
9704
9705    // Represents usage of a consumer, storing all of its power component usage.
9706    message BatteryConsumerData {
9707        // Total power consumed by this BatteryConsumer (including all of its PowerComponents).
9708        // May not equal the sum of the PowerComponentUsage due to under- or over-estimations.
9709        // Multiply by 1/36 to obtain mAh.
9710        optional int64 total_consumed_power_deci_coulombs = 1;
9711
9712        // Represents power and time usage of a particular power component.
9713        message PowerComponentUsage {
9714            // Holds android.os.PowerComponentEnum, or custom component value between 1000 and 9999.
9715            // Evidently, if one attempts to write an int to an enum field that is out of range, it
9716            // is treated as 0, so we must make this an int32.
9717            optional int32 component = 1;
9718
9719            // Power consumed by this component. Multiply by 1/36 to obtain mAh.
9720            optional int64 power_deci_coulombs = 2;
9721
9722            optional int64 duration_millis = 3;
9723        }
9724        repeated PowerComponentUsage power_components = 2;
9725
9726        // Represents a slice of power attribution, e.g. "cpu while in the background"
9727        // or "wifi when running a background service".  Queries that care about
9728        // PowerComponentUsage slices need to be aware of all supported dimensions.
9729        // There are no roll-ups included in the slices - it is up to the clients
9730        // of this data to aggregate values as needed.
9731        message PowerComponentUsageSlice {
9732            optional PowerComponentUsage power_component = 1;
9733
9734            enum ProcessState {
9735                UNSPECIFIED = 0;
9736                FOREGROUND = 1;
9737                BACKGROUND = 2;
9738                FOREGROUND_SERVICE = 3;
9739                // Keep in sync with BatteryUsageStatsPerUid.ProcessState.
9740            }
9741
9742            optional ProcessState process_state = 2;
9743        }
9744
9745        repeated PowerComponentUsageSlice slices = 3;
9746    }
9747
9748    // Total power usage for the device during this session.
9749    optional BatteryConsumerData device_battery_consumer = 4;
9750
9751    // Power usage by a uid during this session.
9752    message UidBatteryConsumer {
9753        optional int32 uid = 1 [(is_uid) = true];
9754        optional BatteryConsumerData battery_consumer_data = 2;
9755        // DEPRECATED Use time_in_state instead.
9756        optional int64 time_in_foreground_millis = 3 [deprecated = true];
9757        // DEPRECATED Use time_in_state instead.
9758        optional int64 time_in_background_millis = 4 [deprecated = true];
9759
9760        message TimeInState {
9761            enum ProcessState {
9762                UNSPECIFIED = 0;
9763                FOREGROUND = 1;
9764                BACKGROUND = 2;
9765                FOREGROUND_SERVICE = 3;
9766                // Keep in sync with BatteryUsageStatsPerUid.ProcessState.
9767            }
9768
9769            optional ProcessState process_state = 1;
9770            optional int64 time_in_state_millis = 2;
9771        }
9772
9773        repeated TimeInState time_in_state = 5;
9774    }
9775    repeated UidBatteryConsumer uid_battery_consumers = 5;
9776
9777    // Sum of all discharge percentage point drops during the reported session.
9778    optional int32 session_discharge_percentage = 6;
9779
9780    // Total amount of time battery was discharging during the reported session
9781    optional int64 discharge_duration_millis = 7;
9782
9783    // Notes the power model used for a power component.
9784    message PowerComponentModel {
9785        // Holds android.os.PowerComponentEnum, or custom component value between 1000 and 9999.
9786        optional int32 component = 1;
9787
9788        enum PowerModel {
9789            UNDEFINED = 0;
9790            POWER_PROFILE = 1;
9791            MEASURED_ENERGY = 2;
9792        }
9793
9794        optional PowerModel power_model = 2;
9795    }
9796
9797    // The power model used for each power component.
9798    repeated PowerComponentModel component_models = 8;
9799}
9800
9801/**
9802 * Pulls on-device BatteryStats on-battery power use calculations, in the form of BatteryUsageStats,
9803 * using the best data available.
9804 *
9805 * Includes the data since the last time statsd pulled this atom (i.e. since the
9806 * last-BatteryStats-reset-prior-to-last-statsd-pull) until the most recent BatteryStats reset.
9807 *
9808 * Does NOT include data after the most recent reset (use BatteryUsageStatsSinceReset too for that).
9809 *
9810 * Pulled from BatteryManager.getBatteryUsageStats().
9811 */
9812message BatteryUsageStatsBeforeReset {
9813    optional BatteryUsageStatsAtomsProto battery_usage_stats = 1 [(log_mode) = MODE_BYTES];
9814}
9815
9816/**
9817 * Pulls on-device BatteryStats on-battery power use calculations, in the form of BatteryUsageStats,
9818 * using the best data available.
9819 *
9820 * Includes all data since the most recent BatteryStats reset event, but none prior to it.
9821 *
9822 * Pulled from BatteryManager.getBatteryUsageStats().
9823 */
9824message BatteryUsageStatsSinceReset {
9825    optional BatteryUsageStatsAtomsProto battery_usage_stats = 1 [(log_mode) = MODE_BYTES];
9826}
9827
9828/**
9829 * Pulls on-device BatteryStats on-battery power use calculations, in the form of BatteryUsageStats,
9830 * using only PowerProfile Model data (even if better data is available).
9831 *
9832 * Includes all data since the most recent BatteryStats reset event, but none prior to it.
9833 *
9834 * @see android.os.BatteryUsageStatsQuery#FLAG_BATTERY_USAGE_STATS_POWER_PROFILE_MODEL
9835 * Pulled from BatteryManager.getBatteryUsageStats().
9836 */
9837message BatteryUsageStatsSinceResetUsingPowerProfileModel {
9838    optional BatteryUsageStatsAtomsProto battery_usage_stats = 1 [(log_mode) = MODE_BYTES];
9839}
9840
9841/**
9842 * Logs device policy features.
9843 *
9844 * Logged from:
9845 *   frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
9846 *   packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
9847 */
9848message DevicePolicyEvent {
9849    // The event id - unique for each event.
9850    optional android.stats.devicepolicy.EventId event_id = 1;
9851    // The admin package name.
9852    optional string admin_package_name = 2;
9853    // A generic integer parameter.
9854    optional int32 integer_value = 3;
9855    // A generic boolean parameter.
9856    optional bool boolean_value = 4;
9857    // A parameter specifying a time period in milliseconds.
9858    optional uint64 time_period_millis = 5;
9859    // A parameter specifying a list of package names, bundle extras or string parameters.
9860    optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
9861}
9862
9863/**
9864 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
9865 *
9866 * Logged from:
9867 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9868 */
9869message DocsUILaunchReported {
9870    optional android.stats.docsui.LaunchAction launch_action = 1;
9871    optional bool has_initial_uri = 2;
9872    optional android.stats.docsui.MimeType mime_type = 3;
9873    optional android.stats.docsui.Root initial_root = 4;
9874}
9875
9876/**
9877 * Logs root/app visited event in file managers/picker. Call this when the user
9878 * taps on root/app in hamburger menu.
9879 *
9880 * Logged from:
9881 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9882 */
9883message DocsUIRootVisitedReported {
9884    optional android.stats.docsui.ContextScope scope = 1;
9885    optional android.stats.docsui.Root root = 2;
9886}
9887
9888/**
9889 * Logs file operation stats. Call this when a file operation has completed.
9890 *
9891 * Logged from:
9892 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9893 */
9894message DocsUIFileOperationReported {
9895    optional android.stats.docsui.Provider provider = 1;
9896    optional android.stats.docsui.FileOperation file_op = 2;
9897}
9898
9899/**
9900 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
9901 * mode.
9902 *
9903 * Logged from:
9904 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9905 */
9906message DocsUIFileOperationCopyMoveModeReported {
9907    optional android.stats.docsui.FileOperation file_op = 1;
9908    optional android.stats.docsui.CopyMoveOpMode mode = 2;
9909}
9910
9911
9912/**
9913 * Logs file sub operation stats. Call this when a file operation has failed.
9914 *
9915 * Logged from:
9916 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9917 */
9918message DocsUIFileOperationFailureReported {
9919    optional android.stats.docsui.Authority authority = 1;
9920    optional android.stats.docsui.SubFileOperation sub_op = 2;
9921}
9922
9923/**
9924* Logs the cancellation of a file operation. Call this when a job is canceled
9925*
9926* Logged from:
9927*     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9928*/
9929message DocsUIFileOperationCanceledReported {
9930    optional android.stats.docsui.FileOperation file_op = 1;
9931}
9932
9933/**
9934 * Logs startup time in milliseconds.
9935 *
9936 * Logged from:
9937 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9938 */
9939message DocsUIStartupMsReported {
9940    optional int32 startup_millis = 1;
9941}
9942
9943/**
9944 * Logs the action that was started by user.
9945 *
9946 * Logged from:
9947 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9948 */
9949message DocsUIUserActionReported {
9950    optional android.stats.docsui.UserAction action = 1;
9951}
9952
9953/**
9954 * Logs the invalid type when invalid scoped access is requested.
9955 *
9956 * Logged from:
9957 *     package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
9958 */
9959message DocsUIInvalidScopedAccessRequestReported {
9960    optional android.stats.docsui.InvalidScopedAccess type = 1;
9961}
9962
9963/**
9964 * Logs the package name that launches docsui picker mode.
9965 *
9966 * Logged from:
9967 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9968 */
9969message DocsUIPickerLaunchedFromReported {
9970    optional string package_name = 1;
9971}
9972
9973/**
9974 * Logs the search type.
9975 *
9976 * Logged from:
9977 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9978 */
9979message DocsUISearchTypeReported {
9980    optional android.stats.docsui.SearchType search_type = 1;
9981}
9982
9983/**
9984 * Logs the search mode.
9985 *
9986 * Logged from:
9987 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9988 */
9989message DocsUISearchModeReported {
9990    optional android.stats.docsui.SearchMode search_mode = 1;
9991}
9992
9993/**
9994 * Logs the pick result information.
9995 *
9996 * Logged from:
9997 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9998 */
9999message DocsUIPickResultReported {
10000    optional int32 total_action_count = 1;
10001    optional int64 duration_millis = 2;
10002    optional int32 file_count= 3;
10003    optional bool is_searching = 4;
10004    optional android.stats.docsui.Root picked_from = 5;
10005    optional android.stats.docsui.MimeType mime_type = 6;
10006    optional int32 repeatedly_pick_times = 7;
10007}
10008
10009/** Logs the drag and drop of files.
10010
10011 * Logged from:
10012 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
10013 */
10014message DocsUIDragAndDropReported {
10015    optional bool drag_initiated_from_docsui = 1;
10016}
10017
10018/**
10019 * Logs when an app's memory is compacted.
10020 *
10021 * Logged from:
10022 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
10023 */
10024message AppCompacted {
10025  // The pid of the process being compacted.
10026  optional int32 pid = 1;
10027
10028  // The name of the process being compacted.
10029  optional string process_name = 2;
10030
10031  // The type of compaction.
10032  enum Action {
10033    UNKNOWN = 0;
10034    SOME = 1;
10035    FULL = 2;
10036    PERSISTENT = 3;
10037    BFGS = 4;
10038  }
10039  optional Action action = 3;
10040
10041  // Total RSS in kilobytes consumed by the process prior to compaction.
10042  optional int64 before_rss_total_kilobytes = 4;
10043
10044  // File RSS in kilobytes consumed by the process prior to compaction.
10045  optional int64 before_rss_file_kilobytes = 5;
10046
10047  // Anonymous RSS in kilobytes consumed by the process prior to compaction.
10048  optional int64 before_rss_anon_kilobytes = 6;
10049
10050  // Swap in kilobytes consumed by the process prior to compaction.
10051  optional int64 before_swap_kilobytes = 7;
10052
10053  // Total RSS in kilobytes consumed by the process after compaction.
10054  optional int64 after_rss_total_kilobytes = 8;
10055
10056  // File RSS in kilobytes consumed by the process after compaction.
10057  optional int64 after_rss_file_kilobytes = 9;
10058
10059  // Anonymous RSS in kilobytes consumed by the process after compaction.
10060  optional int64 after_rss_anon_kilobytes = 10;
10061
10062  // Swap in kilobytes consumed by the process after compaction.
10063  optional int64 after_swap_kilobytes = 11;
10064
10065  // The time taken to perform compaction in milliseconds.
10066  optional int64 time_to_compact_millis = 12;
10067
10068  // The last compaction action performed for this app.
10069  optional Action last_action = 13;
10070
10071  // The last time that compaction was attempted on this process in milliseconds
10072  // since boot, not including sleep (see SystemClock.uptimeMillis()).
10073  optional int64 last_compact_timestamp_ms_since_boot = 14;
10074
10075  // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
10076  optional int32 oom_score_adj = 15;
10077
10078  // The process state at the time of compaction.
10079  optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
10080
10081  // Free ZRAM in kilobytes before compaction.
10082  optional int64 before_zram_free_kilobytes = 17;
10083
10084  // Free ZRAM in kilobytes after compaction.
10085  optional int64 after_zram_free_kilobytes = 18;
10086}
10087
10088message AppCompactedV2 {
10089  // UID of the process being compacted
10090  optional int32 uid = 1 [(is_uid) = true];
10091
10092  // Process state for compacted process
10093  optional int32 proc_state = 2;
10094
10095  // Current OOM Adjust at the time of compaction, this would correspond to any newly set oom adj.
10096  optional int32 current_oom_adj = 3;
10097
10098  // Delta Anon RSS reduced with compaction computed as RSS Before - RSS After.
10099  optional int64 delta_anon_rss = 4;
10100
10101  // Physical ZRAM Consumed during compaction
10102  optional int64 zram_consumed = 5;
10103
10104  // CPU time spent compacting
10105  optional float compact_cpu_time = 6;
10106
10107  // Anon RSS of the process prior to being compacted
10108  optional int64 original_anon_rss = 7;
10109
10110  // Reason for the OOM adj change
10111  optional android.app.OomChangeReasonEnum oom_change_reason = 8;
10112}
10113
10114/**
10115 * Represents an event that logs information about a successful switch to an upstream network.
10116 */
10117message UpstreamEvent {
10118  // Indicates the transport type of network.
10119  optional android.stats.connectivity.UpstreamType upstream_type = 1;
10120
10121  // The duration of network usage.
10122  optional int64 duration_millis = 2;
10123
10124  // The amount of data received from tethered clients.
10125  optional int64 tx_bytes = 3;
10126
10127  // The amount of data received from remote.
10128  optional int64 rx_bytes = 4;
10129}
10130
10131message UpstreamEvents {
10132  repeated UpstreamEvent upstream_event = 1;
10133}
10134
10135/**
10136 * Logs when a Tethering event occurs.
10137 *
10138 */
10139message NetworkTetheringReported {
10140  // Tethering error code
10141  optional android.stats.connectivity.ErrorCode error_code = 1;
10142
10143  // Tethering downstream type
10144  optional android.stats.connectivity.DownstreamType downstream_type = 2;
10145
10146  // Transport type of upstream network
10147  optional android.stats.connectivity.UpstreamType upstream_type = 3 [deprecated = true];
10148
10149  // The user type of switching tethering
10150  optional android.stats.connectivity.UserType user_type= 4;
10151
10152  // Log each transport type of upstream network event
10153  optional UpstreamEvents upstream_events = 5  [(log_mode) = MODE_BYTES];
10154
10155  // A time period that a downstreams exists
10156  optional int64 duration_millis = 6;
10157}
10158
10159/**
10160 * Logs NSD(Network service discovery) client session
10161 *
10162 * Log from:
10163 *     packages/modules/Connectivity/service-t/src/com/android/server/NsdService
10164 */
10165message NetworkNsdReported {
10166  // Indicate if the device is using the legacy or the new implementation
10167  optional bool is_legacy = 1;
10168
10169  // It is a random number to represent different clients. Each client is an app on the device.
10170  optional int32 client_id = 2;
10171
10172  // It is a increment_number to represent different transactions.
10173  // Each transaction is a request from an app client.
10174  optional int32 transaction_id = 3;
10175
10176  // Indicate the service in resolution is a known service in the discovered services cache
10177  optional bool is_known_service = 4;
10178
10179  // Record each NSD session type
10180  optional android.stats.connectivity.NsdEventType type = 5;
10181
10182  // The process duration of the event in milli-second
10183  optional int64 event_duration_millisec = 6;
10184
10185  // Record each mdns query result
10186  optional android.stats.connectivity.MdnsQueryResult query_result = 7;
10187
10188  // Count of services in cache at the end of discovery
10189  optional int32 found_service_count = 8;
10190
10191  // Count of found callback when discovery is stopped
10192  optional int32 found_callback_count = 9;
10193
10194  // Count of lost callback when discovery is stopped
10195  optional int32 lost_callback_count = 10;
10196
10197  // Record query service count before unregistered service
10198  optional int32 replied_requests_count = 11;
10199
10200  // Record sent query count before stopped discovery
10201  optional int32 sent_query_count = 12;
10202
10203  // Record sent packet count before unregistered service
10204  optional int32 sent_packet_count = 13;
10205
10206  // Record number of conflict during probing
10207  optional int32 conflict_during_probing_count = 14;
10208
10209  // Record number of conflict after probing
10210  optional int32 conflict_after_probing_count = 15;
10211
10212  // The random number between 0 ~ 999 for sampling
10213  optional int32 random_number = 16;
10214}
10215
10216/**
10217 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
10218 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
10219 *
10220 * The NetworkDnsEventReported message represents the entire lookup operation, which may
10221 * result one or more queries to the recursive DNS resolvers. Those are individually logged
10222 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
10223 * broken up by query type, transport, network interface, etc.
10224 */
10225message NetworkDnsEventReported {
10226    optional android.stats.dnsresolver.EventType event_type = 1;
10227
10228    optional android.stats.dnsresolver.ReturnCode return_code = 2;
10229
10230    // The latency in microseconds of the entire DNS lookup operation.
10231    optional int32 latency_micros = 3;
10232
10233    // Only valid for event_type = EVENT_GETADDRINFO.
10234    optional int32 hints_ai_flags = 4;
10235
10236    // Flags passed to android_res_nsend() defined in multinetwork.h
10237    // Only valid for event_type = EVENT_RESNSEND.
10238    optional int32 res_nsend_flags = 5;
10239
10240    optional android.stats.dnsresolver.NetworkType network_type = 6;
10241
10242    // The DNS over TLS mode on a specific netId.
10243    optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
10244
10245    // Additional pass-through fields opaque to statsd.
10246    // The DNS resolver Mainline module can add new fields here without requiring an OS update.
10247    optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
10248
10249    // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
10250    optional int32 sampling_rate_denom = 9;
10251
10252    // UID sends the DNS query.
10253    optional int32 uid = 10 [(is_uid) = true];
10254}
10255
10256/**
10257 * logs the number of DNS servers supported by the protocol
10258 */
10259message NetworkDnsServerSupportReported {
10260    // The network type of the network
10261    optional android.stats.dnsresolver.NetworkType network_type = 1;
10262
10263    // The private DNS mode of the network
10264    optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 2;
10265
10266    // Stores the state of all DNS servers for this network
10267    optional android.stats.dnsresolver.Servers servers = 3 [(log_mode) = MODE_BYTES];
10268}
10269
10270/**
10271 * The NetworkDnsHandshakeReported message describes a DoT or DoH handshake operation along with
10272 * its result, cause, network latency, TLS version, etc.
10273 *
10274 */
10275message NetworkDnsHandshakeReported {
10276  optional android.stats.dnsresolver.Protocol protocol = 1;
10277
10278  optional android.stats.dnsresolver.HandshakeResult result = 2;
10279
10280  optional android.stats.dnsresolver.HandshakeCause cause = 3;
10281
10282  optional android.stats.dnsresolver.NetworkType network_type = 4;
10283
10284  optional android.stats.dnsresolver.PrivateDnsModes private_dns_mode = 5;
10285
10286  // The latency in microseconds of the entire handshake operation.
10287  optional int32 latency_micros = 6;
10288
10289  // Number of bytes sent in a handshake.
10290  optional int32 bytes_sent = 7;
10291
10292  // Number of bytes received in a handshake.
10293  optional int32 bytes_received = 8;
10294
10295  // Number of round-trips.
10296  optional int32 round_trips = 9;
10297
10298  // True if TLS session cache hit.
10299  optional bool tls_session_cache_hit = 10;
10300
10301  // 2 = TLS 1.2, 3 = TLS 1.3
10302  optional int32 tls_version = 11;
10303
10304  // True if the handshake requires verifying the private DNS provider hostname.
10305  optional bool hostname_verification = 12;
10306
10307  // Only present when protocol = PROTO_DOH.
10308  optional int32 quic_version = 13;
10309
10310  optional int32 server_index = 14;
10311
10312  // The sampling-rate of this event is 1/sampling_rate_denom.
10313  optional int32 sampling_rate_denom = 15;
10314}
10315
10316/**
10317 * logs the CapportApiData info
10318 * Logged from:
10319 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
10320 */
10321message CapportApiData {
10322    // The TTL of the network connection provided by captive portal
10323    optional int32 remaining_ttl_secs = 1;
10324
10325    // The limit traffic data of the network connection provided by captive portal
10326    optional int32 remaining_bytes = 2;
10327
10328    // Is portal url option included in the DHCP packet (Yes, No)
10329    optional bool has_portal_url = 3;
10330
10331    // Is venue info (e.g. store info, maps, flight status) included (Yes, No)
10332    optional bool has_venue_info = 4;
10333}
10334
10335/**
10336 * logs a network Probe Event
10337 * Logged from:
10338 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
10339 */
10340message ProbeEvent {
10341    // The probe type (http or https, or captive portal API...)
10342    optional android.stats.connectivity.ProbeType probe_type = 1;
10343
10344    // The latency in microseconds of the probe event
10345    optional int32 latency_micros = 2;
10346
10347    // The result of the probe event
10348    optional android.stats.connectivity.ProbeResult probe_result = 3;
10349
10350    // The CaptivePortal API info
10351    optional CapportApiData capport_api_data = 4;
10352}
10353
10354/**
10355 * log each ProbeEvent in ProbeEvents
10356 * Logged from:
10357 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
10358 */
10359message ProbeEvents {
10360    // Record probe event during the validation
10361    repeated ProbeEvent probe_event = 1;
10362}
10363
10364/**
10365 * The DHCP (Dynamic Host Configuration Protocol) session info
10366 * Logged from:
10367 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
10368 */
10369message DhcpSession {
10370    // The DHCP Feature(s) enabled in this session
10371    repeated android.stats.connectivity.DhcpFeature used_features = 1;
10372
10373    // The discover packet (re)transmit count
10374    optional int32 discover_count = 2;
10375
10376    // The request packet (re)transmit count
10377    optional int32 request_count = 3;
10378
10379    // The IPv4 address conflict count
10380    // (only be meaningful when duplicate address detection is enabled)
10381    optional int32 conflict_count = 4;
10382
10383    // The DHCP packet parsing error code in this session
10384    // (defined in android.net.metrics.DhcpErrorEvent)
10385    repeated android.stats.connectivity.DhcpErrorCode error_code = 5;
10386
10387    // The result of DHCP hostname transliteration
10388    optional android.stats.connectivity.HostnameTransResult ht_result = 6;
10389}
10390
10391/**
10392 * Logs Network IP provisioning event
10393 * Logged from:
10394 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpProvisioningMetrics.java
10395 */
10396message NetworkIpProvisioningReported {
10397    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
10398    optional android.stats.connectivity.TransportType transport_type = 1;
10399
10400    // The latency in microseconds of IP Provisioning over IPV4
10401    optional int32 ipv4_latency_micros = 2;
10402
10403    // The latency in microseconds of IP Provisioning over IPV6
10404    optional int32 ipv6_latency_micros = 3;
10405
10406    // The time duration between provisioning start and end (success or failure)
10407    optional int64 provisioning_duration_micros = 4;
10408
10409    // The specific disconnect reason for this IP provisioning
10410    optional android.stats.connectivity.DisconnectCode disconnect_code = 5;
10411
10412    // Log DHCP session info (Only valid for IPv4)
10413    optional DhcpSession dhcp_session = 6 [(log_mode) = MODE_BYTES];
10414
10415    // The random number between 0 ~ 999 for sampling
10416    optional int32 random_number = 7;
10417
10418    // Check which IPv6 provisioning mode is used for current connection
10419    optional android.stats.connectivity.Ipv6ProvisioningMode ipv6_provisioning_mode = 8;
10420}
10421
10422/**
10423 * Logs Network DHCP Renew event
10424 * Logged from:
10425 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
10426 */
10427message NetworkDhcpRenewReported {
10428    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
10429    optional android.stats.connectivity.TransportType transport_type = 1;
10430
10431    // The request packet (re)transmit count
10432    optional int32 request_count = 2;
10433
10434    // The latency in microseconds of DHCP Renew
10435    optional int32 latency_micros = 3;
10436
10437    // The DHCP error code is defined in android.net.metrics.DhcpErrorEvent
10438    optional android.stats.connectivity.DhcpErrorCode error_code = 4;
10439
10440    // The result of DHCP renew
10441    optional android.stats.connectivity.DhcpRenewResult renew_result = 5;
10442
10443    // The random number between 0 ~ 999 for sampling
10444    optional int32 random_number = 6;
10445}
10446
10447/**
10448 * Logs Network Validation event
10449 * Logged from:
10450 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
10451 */
10452message NetworkValidationReported {
10453    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
10454    optional android.stats.connectivity.TransportType transport_type = 1;
10455
10456    // Record each probe event
10457    optional ProbeEvents probe_events = 2 [(log_mode) = MODE_BYTES];
10458
10459    // The result of the network validation
10460    optional android.stats.connectivity.ValidationResult validation_result = 3;
10461
10462    // The latency in microseconds of network validation
10463    optional int32 latency_micros = 4;
10464
10465    // The validation index (the first validation attempt or second, third...)
10466    optional int32 validation_index = 5;
10467
10468    // The random number between 0 ~ 999 for sampling
10469    optional int32 random_number = 6;
10470}
10471
10472/**
10473 * Logs NetworkStack Quirk event
10474 * Logged from:
10475 * packages/modules/NetworkStack/src/com/android/networkstack/
10476 */
10477message NetworkStackQuirkReported {
10478    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
10479    optional android.stats.connectivity.TransportType transport_type = 1;
10480
10481    // Record each Quirk event
10482    optional android.stats.connectivity.NetworkQuirkEvent event = 2;
10483}
10484
10485/**
10486 * Logs Neighbor Unreachability Detection event
10487 * Logged from:
10488 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpReachabilityMonitorMetrics.java
10489 */
10490message NetworkIpReachabilityMonitorReported {
10491    // Neighbor Unreachability Detection event.
10492    optional android.stats.connectivity.NudEventType event_type = 1;
10493
10494    // NUD probe based on IPv4 ARP or IPv6 ND packet.
10495    optional android.stats.connectivity.IpType ip_type = 2;
10496
10497    // NUD neighbor type, default gateway, DNS server or both.
10498    optional android.stats.connectivity.NudNeighborType neighbor_type = 3;
10499}
10500
10501/**
10502 * Logs when system default network changes.
10503 */
10504message SystemDefaultNetworkChanged {
10505    // Active transport types encoded as a 32 bit integer.
10506    // The integer will have n-th bit set if there was an active transport type of value n.
10507    // See packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
10508    optional int32 transport_types = 1 [
10509        (state_field_option).exclusive_state = true,
10510        (state_field_option).nested = false
10511    ];
10512}
10513
10514/**
10515 * Logs when a data stall event occurs.
10516 *
10517 * Log from:
10518 *     packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
10519 */
10520message DataStallEvent {
10521    // Data stall evaluation type.
10522    // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
10523    // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
10524    optional int32 evaluation_type = 1;
10525    // See definition in data_stall_event.proto.
10526    optional com.android.server.connectivity.ProbeResult validation_result = 2;
10527    // See definition in data_stall_event.proto.
10528    optional android.net.Transport network_type = 3;
10529    // See definition in data_stall_event.proto.
10530    optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
10531    // See definition in data_stall_event.proto.
10532    optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
10533    // See definition in data_stall_event.proto.
10534    optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
10535    // The tcp packets fail rate from the latest tcp polling.
10536    optional int32 tcp_fail_rate = 7;
10537    // Number of packets sent since the last received packet.
10538    optional int32 tcp_sent_since_last_recv = 8;
10539}
10540
10541/*
10542 * Logs when RescueParty resets some set of experiment flags.
10543 *
10544 * Logged from:
10545 *     frameworks/base/services/core/java/com/android/server/RescueParty.java
10546 */
10547message RescuePartyResetReported {
10548    // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
10549    optional int32 rescue_level = 1;
10550    optional string rescue_level_string = 2;
10551}
10552
10553/**
10554 * Logs when signed config is received from an APK, and if that config was applied successfully.
10555 * Logged from:
10556 *   frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
10557 */
10558message SignedConfigReported {
10559    enum Type {
10560        UNKNOWN_TYPE = 0;
10561        GLOBAL_SETTINGS = 1;
10562    }
10563    optional Type type = 1;
10564
10565    // The final status of the signed config received.
10566    enum Status {
10567        UNKNOWN_STATUS = 0;
10568        APPLIED = 1;
10569        BASE64_FAILURE_CONFIG = 2;
10570        BASE64_FAILURE_SIGNATURE = 3;
10571        SECURITY_EXCEPTION = 4;
10572        INVALID_CONFIG = 5;
10573        OLD_CONFIG = 6;
10574        SIGNATURE_CHECK_FAILED = 7;
10575        NOT_APPLICABLE = 8;
10576        SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
10577    }
10578    optional Status status = 2;
10579
10580    // The version of the signed config processed.
10581    optional int32 version = 3;
10582
10583    // The package name that the config was extracted from.
10584    optional string from_package = 4;
10585
10586    enum Key {
10587        NO_KEY = 0;
10588        DEBUG = 1;
10589        PRODUCTION = 2;
10590    }
10591    // Which key was used to verify the config.
10592    optional Key verified_with = 5;
10593}
10594
10595/*
10596 * Logs GNSS Network-Initiated (NI) location events.
10597 *
10598 * Logged from:
10599 *   frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
10600 */
10601message GnssNiEventReported {
10602    // The type of GnssNiEvent.
10603    enum EventType {
10604        UNKNOWN = 0;
10605        NI_REQUEST = 1;
10606        NI_RESPONSE = 2;
10607    }
10608    optional EventType event_type = 1;
10609
10610    // An ID generated by HAL to associate NI notifications and UI responses.
10611    optional int32 notification_id = 2;
10612
10613    // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
10614    optional android.server.location.GnssNiType ni_type = 3;
10615
10616    // NI requires notification.
10617    optional bool need_notify = 4;
10618
10619    // NI requires verification.
10620    optional bool need_verify = 5;
10621
10622    // NI requires privacy override, no notification/minimal trace.
10623    optional bool privacy_override = 6;
10624
10625    // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
10626    // seconds.
10627    optional int32 timeout = 7;
10628
10629    // Default response when timeout.
10630    optional android.server.location.GnssUserResponseType default_response = 8;
10631
10632    // String representing the requester of the network inititated location request.
10633    optional string requestor_id = 9;
10634
10635    // Notification message text string representing the service(for eg. SUPL-service) who sent the
10636    // network initiated location request.
10637    optional string text = 10;
10638
10639    // requestorId decoding scheme.
10640    optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
10641
10642    // Notification message text decoding scheme.
10643    optional android.server.location.GnssNiEncodingType text_encoding = 12;
10644
10645    // True if SUPL ES is enabled.
10646    optional bool is_supl_es_enabled = 13;
10647
10648    // True if GNSS location is enabled.
10649    optional bool is_location_enabled = 14;
10650
10651    // GNSS NI responses which define the response in NI structures.
10652    optional android.server.location.GnssUserResponseType user_response = 15;
10653}
10654
10655/**
10656 * Logs GNSS non-framework (NFW) location notification.
10657 *
10658 * Logged from:
10659 *   frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
10660 */
10661message GnssNfwNotificationReported {
10662    // Package name of the Android proxy application representing the non-framework entity that
10663    // requested location. Set to empty string if unknown.
10664    optional string proxy_app_package_name = 1;
10665
10666    // Protocol stack that initiated the non-framework location request.
10667    optional android.server.location.NfwProtocolStack protocol_stack = 2;
10668
10669    // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
10670    // set to empty string. This field is opaque to the framework and used for logging purposes.
10671    optional string other_protocol_stack_name = 3;
10672
10673    // Source initiating/receiving the location information.
10674    optional android.server.location.NfwRequestor requestor = 4;
10675
10676    // Identity of the endpoint receiving the location information. For example, carrier name, OEM
10677    // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
10678    // and used for logging purposes.
10679    optional string requestor_id = 5;
10680
10681    // Indicates whether location information was provided for this request.
10682    optional android.server.location.NfwResponseType response_type = 6;
10683
10684    // True if the device is in user initiated emergency session.
10685    optional bool in_emergency_mode = 7;
10686
10687    // True if cached location is provided.
10688    optional bool is_cached_location = 8;
10689
10690    // True if proxy app permission mismatch between framework and GNSS HAL.
10691    optional bool is_permission_mismatched = 9;
10692}
10693
10694/**
10695 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
10696 *
10697 * Logged from:
10698 *   frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
10699 */
10700message GnssConfigurationReported {
10701    // SUPL host name.
10702    optional string supl_host = 1;
10703
10704    // SUPL port number.
10705    optional int32 supl_port = 2;
10706
10707    // C2K host name.
10708    optional string c2k_host = 3;
10709
10710    // C2K port number.
10711    optional int32 c2k_port = 4;
10712
10713    // The SUPL version requested by Carrier.
10714    optional int32 supl_ver = 5;
10715
10716    // The SUPL mode.
10717    optional android.server.location.SuplMode supl_mode = 6;
10718
10719    // True if NI emergency SUPL restrictions is enabled.
10720    optional bool supl_es = 7;
10721
10722    // LTE Positioning Profile settings
10723    optional android.server.location.LppProfile lpp_profile = 8;
10724
10725    // Positioning protocol on A-Glonass system.
10726    optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
10727
10728    // True if emergency PDN is used. Otherwise, regular PDN is used.
10729    optional bool use_emergency_pdn_for_emergency_supl= 10;
10730
10731    // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
10732    optional android.server.location.GpsLock gps_lock = 11;
10733
10734    // Number of seconds to extend the emergency session duration post emergency call.
10735    optional int32 es_extension_sec = 12;
10736
10737    // The full list of package names of proxy Android applications representing the non-framework
10738    // location access entities (on/off the device) for which the framework user has granted
10739    // non-framework location access permission. The package names are concatenated in one string
10740    // with spaces as separators.
10741    optional string enabled_proxy_app_package_name_list = 13;
10742}
10743
10744/**
10745 * Logs GNSS PSDS downloads as defined in IGnssPsds.aidl.
10746 *
10747 * Logged from:
10748 *   frameworks/base/services/core/java/com/android/server/location/gnss/GnssPsdsDownloader.java
10749 */
10750message GnssPsdsDownloadReported {
10751    // PSDS type as defined in PsdsType.aidl
10752    optional int32 psds_type = 1;
10753}
10754
10755/**
10756 * Logs when a NFC device's error occurred.
10757 * Logged from:
10758 *     system/nfc/src/nfc/nfc/nfc_ncif.cc
10759 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
10760 */
10761message NfcErrorOccurred {
10762    enum Type {
10763        UNKNOWN = 0;
10764        CMD_TIMEOUT = 1;
10765        ERROR_NOTIFICATION = 2;
10766        AID_OVERFLOW = 3;
10767        // HCE stands for Host Card Emulation
10768        HCE_LATE_BINDING = 4;
10769        NFC_ACCESS_CHECK_ERROR = 5;
10770        SE_INCORRECT_FORMAT = 6;
10771    }
10772    optional Type type = 1;
10773    // If it's nci cmd timeout, log the timeout command.
10774    optional uint32 nci_cmd = 2;
10775
10776    optional uint32 error_ntf_status_code = 3;
10777}
10778
10779/**
10780 * Logs when a NFC device's state changed event
10781 * Logged from:
10782 *     packages/apps/Nfc/src/com/android/nfc/NfcService.java
10783 */
10784message NfcStateChanged {
10785    enum State {
10786        UNKNOWN = 0;
10787        OFF = 1;
10788        ON = 2;
10789        ON_LOCKED = 3; // Secure Nfc enabled.
10790        CRASH_RESTART = 4; // NfcService watchdog timeout restart.
10791    }
10792    optional State state = 1 [
10793        (state_field_option).exclusive_state = true,
10794        (state_field_option).nested = false
10795    ];
10796}
10797
10798/**
10799 * Logs when a NFC Beam Transaction occurred.
10800 * Logged from:
10801 *     packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
10802 */
10803message NfcBeamOccurred {
10804    enum Operation {
10805        UNKNOWN = 0;
10806        SEND = 1;
10807        RECEIVE = 2;
10808    }
10809    optional Operation operation = 1;
10810}
10811
10812/**
10813 * Logs when a NFC Card Emulation Transaction occurred.
10814 * Logged from:
10815 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
10816 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
10817 */
10818message NfcCardemulationOccurred {
10819    enum Category {
10820        UNKNOWN = 0;
10821        // HCE stands for Host Card Emulation
10822        HCE_PAYMENT = 1;
10823        HCE_OTHER = 2;
10824        OFFHOST = 3;
10825        OFFHOST_PAYMENT = 4;
10826        OFFHOST_OTHER = 5;
10827        FAILED_NO_ROUTING = 6;
10828        FAILED_HCE_PAYMENT_WRONG_SETTING = 7;
10829        FAILED_HCE_OTHER_WRONG_SETTING = 8;
10830        FAILED_HCE_PAYMENT_DISCONNECTED_BEFORE_BOUND = 9;
10831        FAILED_HCE_OTHER_DISCONNECTED_BEFORE_BOUND = 10;
10832        FAILED_HCE_PAYMENT_DISCONNECTED_BEFORE_RESPONSE = 11;
10833        FAILED_HCE_OTHER_DISCONNECTED_BEFORE_RESPONSE = 12;
10834    }
10835    // Transaction belongs to HCE payment or HCE other category, or offhost.
10836    optional Category category = 1;
10837    // SeName from transaction: SIMx, eSEx, HCE, HCEF.
10838    optional string se_name = 2;
10839
10840    optional int32 uid = 3 [(is_uid) = true];
10841}
10842
10843/**
10844 * Logs when a NFC Tag event occurred.
10845 * Logged from:
10846 *     packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
10847 */
10848message NfcTagOccurred {
10849    enum Type {
10850        UNKNOWN = 0;
10851        URL = 1;
10852        BT_PAIRING = 2;
10853        PROVISION = 3;
10854        WIFI_CONNECT = 4;
10855        // Successful App Launch
10856        APP_LAUNCH = 5;
10857        // No suitable action found
10858        OTHERS = 6;
10859        // Dispatch event when service is in foreground
10860        FOREGROUND_DISPATCH = 7;
10861        // App Launch mute from android.nfc.action.NDEF_DISCOVERED
10862        APP_LAUNCH_NDEF_MUTE = 8;
10863        // App Launch mute from android.nfc.action.TECH_DISCOVERED
10864        APP_LAUNCH_TECH_MUTE = 9;
10865        // App Launch mute from android.nfc.action.TAG_DISCOVERED
10866        APP_LAUNCH_TAG_MUTE = 10;
10867    }
10868    optional Type type = 1;
10869
10870    optional int32 uid = 2 [(is_uid) = true];
10871    // Supported RF Technologies of the Tag
10872    repeated android.nfc.RFTechnologyType rf_types = 3;
10873    // Use for BT_PAIRING Type
10874    optional android.bluetooth.MajorClassEnum bt_device_type = 4;
10875    // Use for BT_PAIRING Type
10876    // Should be empty for HEALTH and UNKNOWN MajorClassEnum
10877    optional string bt_device_info = 5;
10878}
10879
10880/**
10881 * Logs NFC tag type when tag occurred
10882 * Logged from:
10883 *     packages/apps/Nfc/nci/jni/NfcTag.cpp
10884 */
10885message NfcTagTypeOccurred {
10886    optional android.nfc.NfcTagType type = 1;
10887}
10888
10889/**
10890 * Logs when Hce transaction triggered
10891 * Logged from:
10892 *     system/nfc/src/nfc/nfc/nfc_ncif.cc
10893 */
10894message NfcHceTransactionOccurred {
10895    // The latency period(in microseconds) it took for the first HCE data
10896    // exchange.
10897    optional uint32 latency_micros = 1;
10898}
10899
10900/**
10901 * Logs when AID conflict occurred
10902 * Logged from:
10903 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
10904*/
10905message NfcAIDConflictOccurred {
10906    optional string conflicting_aid = 1;
10907}
10908
10909/**
10910 * Logs when reader app conflict occurred
10911 * Logged from:
10912 *     packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
10913*/
10914message NfcReaderConflictOccurred {
10915}
10916
10917/**
10918 * Logs when user changed screen resolution
10919 * Logged from:
10920 *     packages/apps/Settings/src/com/android/settings/display/ScreenResolutionFragment.java
10921*/
10922message UserSelectedResolution {
10923    optional int32 display_id = 1;
10924    // display resolution
10925    optional int32 width = 2;
10926    optional int32 height = 3;
10927}
10928
10929/**
10930 * Logs when SecureElement state event changed
10931 * Logged from:
10932 *     packages/apps/SecureElement/src/com/android/se/Terminal.java
10933 */
10934message SeStateChanged {
10935    enum State {
10936        UNKNOWN = 0;
10937        INITIALIZED = 1;
10938        DISCONNECTED = 2;
10939        CONNECTED = 3;
10940        HALCRASH = 4;
10941    }
10942    optional State state = 1;
10943
10944    optional string state_change_reason = 2;
10945    // SIMx or eSEx.
10946    optional string terminal = 3;
10947}
10948
10949/**
10950 * Information about a permission grant request
10951 */
10952message PermissionGrantRequestResultReported {
10953    // unique value identifying an API call. A API call might result in multiple of these atoms
10954    optional int64 request_id = 1;
10955
10956    // UID of package requesting the permission grant
10957    optional int32 uid = 2 [(is_uid) = true];
10958
10959    // Name of package requesting the permission grant
10960    optional string package_name = 3;
10961
10962    // The permission to be granted
10963    optional string permission_name = 4;
10964
10965    // If the permission was explicitly requested via the API or added by the system
10966    optional bool is_implicit = 5;
10967
10968    enum Result {
10969        UNDEFINED = 0;
10970        // permission request was ignored
10971        IGNORED = 1;
10972        // permission request was ignored because it was user fixed
10973        IGNORED_USER_FIXED = 2;
10974        // permission request was ignored because it was policy fixed
10975        IGNORED_POLICY_FIXED = 3;
10976        // permission was granted by user action
10977        USER_GRANTED = 4;
10978        // permission was automatically granted
10979        AUTO_GRANTED = 5;
10980        // permission was denied by user action
10981        USER_DENIED = 6;
10982        // permission was denied with prejudice by the user
10983        USER_DENIED_WITH_PREJUDICE = 7;
10984        // permission was automatically denied
10985        AUTO_DENIED = 8;
10986        // permission request was ignored because permission is restricted
10987        IGNORED_RESTRICTED_PERMISSION = 9;
10988        // one time permission was granted by user action
10989        USER_GRANTED_ONE_TIME = 10;
10990        // user ignored request by leaving the request screen without choosing any option
10991        USER_IGNORED = 11;
10992        // user granted the permission after being linked to settings
10993        USER_GRANTED_IN_SETTINGS = 12;
10994        // user denied the permission after being linked to settings
10995        USER_DENIED_IN_SETTINGS = 13;
10996        // user denied the permission with prejudice after being linked to settings
10997        USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
10998        // permission was automatically revoked after one-time permission expired
10999        AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
11000        // permission was automatically revoked for unused app
11001        AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
11002        // the user selected media with the photo picker
11003        PHOTOS_SELECTED = 17;
11004    }
11005    // The result of the permission grant
11006    optional Result result = 6;
11007
11008    // Whether Permission Rationale was shown on grant dialog
11009    optional bool permission_rationale_shown = 7;
11010
11011    // Whether the package was restricted by ECM
11012    optional bool is_package_restricted_by_enhanced_confirmation = 8;
11013}
11014
11015/**
11016 * Logs when Omapi API used
11017 * Logged from:
11018 *     packages/apps/SecureElement/src/com/android/se/Terminal.java
11019 */
11020message SeOmapiReported {
11021    enum Operation {
11022        UNKNOWN = 0;
11023        OPEN_CHANNEL = 1;
11024    }
11025    optional Operation operation = 1;
11026    // SIMx or eSEx.
11027    optional string terminal = 2;
11028
11029    optional string package_name = 3;
11030}
11031
11032/**
11033  * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
11034  * The dispatch latency is the dispatchClockTime - enqueueClockTime.
11035  * Logged from:
11036  *   frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
11037  */
11038message BroadcastDispatchLatencyReported {
11039    optional int64 dispatch_latency_millis = 1;
11040}
11041
11042/**
11043   * Logs AttentionManagerService attention check result.
11044   *
11045   * Logged from:
11046   *   frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
11047   */
11048message AttentionManagerServiceResultReported {
11049    // See core/java/android/service/attention/AttentionService.java
11050    enum AttentionCheckResult {
11051        UNKNOWN = 20;
11052        ATTENTION_SUCCESS_ABSENT = 0;
11053        ATTENTION_SUCCESS_PRESENT = 1;
11054        ATTENTION_FAILURE_UNKNOWN = 2;
11055        ATTENTION_FAILURE_CANCELLED = 3;
11056        ATTENTION_FAILURE_PREEMPTED = 4;
11057        ATTENTION_FAILURE_TIMED_OUT = 5;
11058        ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
11059    }
11060    optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
11061}
11062
11063/**
11064 * Logs when an adb connection changes state.
11065 *
11066 * Logged from:
11067 *     frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
11068 */
11069message AdbConnectionChanged {
11070    // The last time this system connected via adb, or 0 if the 'always allow' option was not
11071    // previously selected for this system.
11072    optional int64 last_connection_time_millis = 1;
11073
11074    // The time in ms within which a subsequent connection from an 'always allow' system is allowed
11075    // to reconnect via adb without user interaction.
11076    optional int64 auth_window_millis = 2;
11077
11078    // The state of the adb connection from frameworks/proto_logging/stats/enums/debug/enums.proto.
11079    optional android.debug.AdbConnectionStateEnum state = 3;
11080
11081    // True if the 'always allow' option was selected for this system.
11082    optional bool always_allow = 4;
11083}
11084
11085/*
11086 * Logs the reported speech DSP status.
11087 *
11088 * Logged from:
11089 *  Vendor audio implementation.
11090 */
11091message SpeechDspStatReported {
11092    // The total Speech DSP uptime in milliseconds.
11093    optional int32 total_uptime_millis = 1;
11094    // The total Speech DSP downtime in milliseconds.
11095    optional int32 total_downtime_millis = 2;
11096    optional int32 total_crash_count = 3;
11097    optional int32 total_recover_count = 4;
11098}
11099
11100/**
11101 * Logs USB connector contaminant status.
11102 *
11103 * Logged from: USB Service.
11104 */
11105message UsbContaminantReported {
11106    optional string id = 1;
11107    optional android.service.ContaminantPresenceStatus status = 2;
11108}
11109
11110/**
11111 * This atom is for debugging purpose.
11112 */
11113message DebugElapsedClock {
11114    // Monotically increasing value for each pull.
11115    optional int64 pull_count = 1;
11116    // Time from System.elapsedRealtime.
11117    optional int64 elapsed_clock_millis = 2;
11118    // Time from System.elapsedRealtime.
11119    optional int64 same_elapsed_clock_millis = 3;
11120    // Diff between current elapsed time and elapsed time from previous pull.
11121    optional int64 elapsed_clock_diff_millis = 4;
11122
11123    enum Type {
11124      TYPE_UNKNOWN = 0;
11125      ALWAYS_PRESENT = 1;
11126      PRESENT_ON_ODD_PULLS = 2;
11127    }
11128    // Type of behavior for the pulled data.
11129    optional Type type = 5;
11130}
11131
11132/**
11133 * This atom is for debugging purpose.
11134 */
11135message DebugFailingElapsedClock {
11136    // Monotically increasing value for each pull.
11137    optional int64 pull_count = 1;
11138    // Time from System.elapsedRealtime.
11139    optional int64 elapsed_clock_millis = 2;
11140    // Time from System.elapsedRealtime.
11141    optional int64 same_elapsed_clock_millis = 3;
11142    // Diff between current elapsed time and elapsed time from previous pull.
11143    optional int64 elapsed_clock_diff_millis = 4;
11144}
11145
11146/** Logs System UI bubbles event changed.
11147 *
11148 * Logged from:
11149 *     frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen
11150 */
11151message SplitscreenUIChanged {
11152    // User interactions with splitscreen
11153    enum Action {
11154        UNKNOWN_ACTION = 0;
11155        ENTER = 1;
11156        EXIT = 2;
11157        APP_CHANGE = 3;
11158        RESIZE = 4;
11159        SWAP = 5;
11160    }
11161
11162    // The physical side on the device of the split
11163    enum Position {
11164        UNKNOWN_POSITION = 0;
11165        LEFT = 1;
11166        RIGHT = 2;
11167        TOP = 3;
11168        BOTTOM = 4;
11169    }
11170
11171    // The reason for entering splitscreen
11172    enum EnterReason {
11173        UNKNOWN_ENTER = 0;
11174        OVERVIEW = 1; // Deprecated, use LAUNCHER
11175        DRAG_LEFT = 2;
11176        DRAG_TOP = 3;
11177        DRAG_RIGHT = 4;
11178        DRAG_BOTTOM = 5;
11179        LAUNCHER = 6;
11180        MULTI_INSTANCE = 7;
11181        NOTIFICATIONS = 8;
11182    }
11183
11184    // The reason for exiting splitscreen
11185    enum ExitReason {
11186        UNKNOWN_EXIT = 0;
11187        DRAG_DIVIDER = 1;
11188        RETURN_HOME = 2;
11189        SCREEN_LOCKED = 3;
11190        SCREEN_LOCKED_SHOW_ON_TOP = 4;
11191        DEVICE_FOLDED = 5;
11192        ROOT_TASK_VANISHED = 6;
11193        APP_FINISHED = 7;
11194        APP_DOES_NOT_SUPPORT_MULTIWINDOW = 8;
11195        CHILD_TASK_ENTER_PIP = 9;
11196        RECREATE_SPLIT = 10;
11197        FULLSCREEN_SHORTCUT = 11;
11198        DESKTOP_MODE = 12;
11199        FULLSCREEN_REQUEST = 13;
11200    }
11201
11202    // The event action
11203    optional Action action = 1;
11204    // What triggered splitscreen (if the action is ENTER)
11205    optional EnterReason enter_reason = 2;
11206    // What triggered leaving splitscreen (if the action is EXIT)
11207    optional ExitReason exit_reason = 3;
11208    // The ratio of split between the main/side stages
11209    optional float split_ratio = 4;
11210    // Data about the main stage in split
11211    optional Position main_stage_position = 5;
11212    optional int32 main_stage_uid = 6 [(is_uid) = true];
11213    // Data about the side stage in split
11214    optional Position side_stage_position = 7;
11215    optional int32 side_stage_uid = 8 [(is_uid) = true];
11216    // The drag session id (if the enter_trigger was DRAG)
11217    optional int32 drag_instance_id = 9;
11218    // An identifier used to identify a splitscreen session
11219    optional int32 instance_id = 10;
11220}
11221
11222/** Logs System UI bubbles event changed.
11223 *
11224 * Logged from:
11225 *     frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles
11226 */
11227message BubbleUIChanged {
11228
11229    // The app package that is posting the bubble.
11230    optional string package_name = 1;
11231
11232    // The notification channel that is posting the bubble.
11233    optional string notification_channel = 2;
11234
11235    // The notification id associated with the posted bubble.
11236    optional int32 notification_id = 3;
11237
11238    // The position of the bubble within the bubble stack.
11239    optional int32 position = 4;
11240
11241    // The total number of bubbles within the bubble stack.
11242    optional int32 total_number = 5;
11243
11244    // User interactions with the bubble.
11245    enum Action {
11246        UNKNOWN = 0;
11247        POSTED = 1;
11248        UPDATED = 2;
11249        EXPANDED = 3;
11250        COLLAPSED = 4;
11251        DISMISSED = 5;
11252        STACK_DISMISSED = 6;
11253        STACK_MOVED = 7;
11254        HEADER_GO_TO_APP = 8;
11255        HEADER_GO_TO_SETTINGS = 9;
11256        PERMISSION_OPT_IN = 10;
11257        PERMISSION_OPT_OUT = 11;
11258        PERMISSION_DIALOG_SHOWN = 12;
11259        SWIPE_LEFT = 13;
11260        SWIPE_RIGHT = 14;
11261        STACK_EXPANDED = 15;
11262        FLYOUT = 16;
11263    }
11264    optional Action action = 6;
11265
11266    // Normalized screen position of the bubble stack. The range is between 0 and 1.
11267    optional float normalized_x_position = 7;
11268    optional float normalized_y_position = 8;
11269
11270    // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
11271    optional bool is_unread = 9;
11272
11273    // Whether the bubble is an on-going one.
11274    optional bool is_ongoing = 10;
11275
11276    // Whether the bubble is produced by an app running in foreground.
11277    // This is deprecated and the value should be ignored.
11278    optional bool is_foreground = 11 [deprecated = true];
11279}
11280
11281/**
11282  * Logs System UI bubbles developer errors.
11283  *
11284  * Logged from:
11285  *   frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
11286  */
11287message BubbleDeveloperErrorReported {
11288
11289    // The app package that is posting the bubble.
11290    optional string package_name = 1;
11291
11292    // Bubble developer error type enums.
11293    enum Error {
11294        UNKNOWN = 0;
11295        ACTIVITY_INFO_MISSING = 1;
11296        ACTIVITY_INFO_NOT_RESIZABLE = 2;
11297        DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
11298    }
11299    optional Error error = 2 [default = UNKNOWN];
11300}
11301
11302/**
11303 * Logs that a job-specific constraint for a scheduled job has changed.
11304 * DeviceWideJobConstraintChanged will cover constraints that are normally the same for all jobs.
11305 *
11306 * Logged from:
11307 *     frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
11308 */
11309message ScheduledJobConstraintChanged {
11310    repeated AttributionNode attribution_node = 1;
11311
11312    // Name of the job.
11313    optional string job_name = 2;
11314
11315    optional com.android.server.job.ConstraintEnum constraint = 3;
11316
11317    enum State {
11318        UNKNOWN = 0;
11319        UNSATISFIED = 1;
11320        SATISFIED = 2;
11321    }
11322    optional State state = 4;
11323}
11324
11325/**
11326 * Logs that a device-state-level JobScheduler constraint has changed. This doesn't take individual
11327 * job or app characteristics into account. Individual jobs may have a different satisfaction value
11328 * based on special policies. Individual job constraints (eg. connectivity or prefetch) are not
11329 * logged in this atom.
11330 *
11331 * Logged from:
11332 *     frameworks/base/services/core/java/com/android/server/job/controllers/<*>.java
11333 */
11334message DeviceWideJobConstraintChanged {
11335    optional com.android.server.job.ConstraintEnum constraint = 1 [
11336        (state_field_option).primary_field = true,
11337        (is_uid) = false
11338    ];
11339
11340    enum State {
11341        UNKNOWN = 0;
11342        UNSATISFIED = 1;
11343        SATISFIED = 2;
11344    }
11345    optional State state = 2 [
11346        (state_field_option).exclusive_state = true,
11347        (state_field_option).nested = false
11348    ];
11349}
11350
11351/**
11352 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
11353 * returns true.
11354 *
11355 * Logged from:
11356 *   frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
11357 */
11358message ScreenTimeoutExtensionReported {
11359    // Describes how many times in a row did the power manager reset the screen off timeout.
11360    optional uint32 consecutive_timeout_extended_count = 1;
11361}
11362
11363/*
11364* Logs number of milliseconds it takes to start a process.
11365* The definition of app process start time is from the app launch time to
11366* the time that Zygote finished forking the app process and loaded the
11367* application package's java classes.
11368
11369* This metric is different from AppStartOccurred which is for foreground
11370* activity only.
11371
11372* ProcessStartTime can report all processes (both foreground and background)
11373* start time.
11374*
11375* Logged from:
11376*   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
11377*/
11378message ProcessStartTime {
11379    // The uid of the ProcessRecord.
11380    optional int32 uid = 1 [(is_uid) = true];
11381
11382    // The process pid.
11383    optional int32 pid = 2;
11384
11385    // The process name.
11386    // Usually package name, "system" for system server.
11387    // Provided by ActivityManagerService.
11388    // Do not fetch this field from device to save storage space, use uid field induced
11389    // package name as process name.
11390    optional string process_name = 3;
11391
11392    enum StartType {
11393        UNKNOWN = 0;
11394        WARM = 1;
11395        HOT = 2;
11396        COLD = 3;
11397    }
11398
11399    // The start type.
11400    optional StartType type = 4;
11401
11402    // The elapsed realtime at the start of the process.
11403    optional int64 process_start_time_millis = 5;
11404
11405    // Number of milliseconds it takes to reach bind application.
11406    optional int32 bind_application_delay_millis = 6;
11407
11408    // Number of milliseconds it takes to finish start of the process.
11409    optional int32 process_start_delay_millis = 7;
11410
11411    // hostingType field in ProcessRecord, the component type such as "activity",
11412    // "service", "content provider", "broadcast" or other strings.
11413    // deprecatd by enum type field hosting_type_id to reduce storage space usage by
11414    // string type.
11415    // Do not fetch this field from device to save storage space.
11416    optional string hosting_type = 8 [deprecated = true];
11417
11418    // hostingNameStr field in ProcessRecord. The component class name that runs
11419    // in this process.
11420    // Do not fetch this field from device to save storage space.
11421    optional string hosting_name = 9;
11422
11423    // Broadcast action name.
11424    optional string broadcast_action_name = 10;
11425
11426    enum HostingTypeId {
11427        HOSTING_TYPE_UNKNOWN = 0;
11428        HOSTING_TYPE_ACTIVITY = 1;
11429        HOSTING_TYPE_ADDED_APPLICATION = 2;
11430        HOSTING_TYPE_BACKUP = 3;
11431        HOSTING_TYPE_BROADCAST = 4;
11432        HOSTING_TYPE_CONTENT_PROVIDER = 5;
11433        HOSTING_TYPE_LINK_FAIL = 6;
11434        HOSTING_TYPE_ON_HOLD = 7;
11435        HOSTING_TYPE_NEXT_ACTIVITY = 8;
11436        HOSTING_TYPE_NEXT_TOP_ACTIVITY = 9;
11437        HOSTING_TYPE_RESTART = 10;
11438        HOSTING_TYPE_SERVICE = 11;
11439        HOSTING_TYPE_SYSTEM = 12;
11440        HOSTING_TYPE_TOP_ACTIVITY = 13;
11441        HOSTING_TYPE_EMPTY = 14;
11442    }
11443
11444    optional HostingTypeId hosting_type_id = 11;
11445
11446    enum TriggerType {
11447        TRIGGER_TYPE_UNKNOWN = 0;
11448        TRIGGER_TYPE_ALARM = 1;
11449        TRIGGER_TYPE_PUSH_MESSAGE = 2;
11450        TRIGGER_TYPE_PUSH_MESSAGE_OVER_QUOTA = 3;
11451        TRIGGER_TYPE_JOB = 4;
11452    }
11453
11454    optional TriggerType trigger_type = 12;
11455}
11456
11457/**
11458 * Track Media Codec usage (nested proto version)
11459 *   This atom is being deprecated in favor of MediaCodecReported which has a
11460 *   flattened CodecData to enable field filtering. The data is identical
11461 *   except MediaCodecReported also has the playback_duration field.
11462 * Logged from:
11463 *   frameworks/av/media/libstagefright/MediaCodec.cpp
11464 *   frameworks/av/services/mediaanalytics/statsd_codec.cpp
11465 */
11466message MediametricsCodecReported {
11467    optional int64 timestamp_nanos = 1;
11468    optional string package_name = 2;
11469    optional int64 package_version_code = 3;
11470    optional int64 media_apex_version = 4;
11471
11472    optional android.stats.mediametrics_message.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11473}
11474
11475/**
11476 * Track Media Codec usage
11477 *   This atom is the new version of MediametricsCodecReported and has a
11478 *   flattened CodecData to enable field filtering. The data is identical
11479 *   except for the addition of the playback_duration field.
11480 * Logged from:
11481 *   frameworks/av/media/libstagefright/MediaCodec.cpp
11482 *   frameworks/av/services/mediaanalytics/statsd_codec.cpp
11483 *
11484 * Next Tag: 79
11485 */
11486message MediaCodecReported {
11487    optional int64 timestamp_nanos = 1;
11488    // The inclusion of package name in a metric should be carefully analyzed to
11489    // determine if it is absolutely necessary for system health. It is strongly
11490    // discouraged to collect the package name along with other metrics (e.g.
11491    // playback duration).
11492    optional string package_name = 2;
11493    optional int64 package_version_code = 3;
11494    optional int64 media_apex_version = 4;
11495    // The name of the codec.
11496    // eg. `OMX.google.aac.decoder`
11497    optional string codec = 5;
11498    // The mime type. e.g. "audio/vorbis"
11499    optional string mime = 6;
11500    // The codec mode. i.e. video or audio.
11501    optional string mode = 7;
11502    // 1 if this is an encoder, 0 if this is a decoder.
11503    optional int32 encoder = 8;
11504    // 0, 1
11505    optional int32 secure = 9;
11506    // The video width in pixels.
11507    optional int32 width = 10;
11508    // The video height in pixels.
11509    optional int32 height = 11;
11510    // The rotation of the video in degrees
11511    // 0, 90, 180, 270
11512    optional int32 rotation = 12;
11513    // 1 if the codec uses crypto/drm, 0 otherwise.
11514    optional int32 crypto = 13;
11515    // The codec profile. The values are dependent on the codec type.
11516    // 0..n
11517    optional int32 profile = 14;
11518    // The coding level. The values are dependent on the codec type.
11519    // 0..n
11520    optional int32 level = 15;
11521    // The maximum allowed width during a particular codec session.
11522    // 0..n
11523    optional int32 max_width = 16;
11524    // The maximum allowed height during a particular codec session.
11525    // 0..n
11526    optional int32 max_height = 17;
11527    // Indicating which error condition caused the codec to reset to an
11528    // uninitialized state.
11529    optional int32 error_code = 18;
11530    // The error state.
11531    // The emitted values are descriptive:  UNINITIALIZED, INITIALIZING,
11532    // INITIALIZED, CONFIGURING, CONFIGURED, STARTING, STARTED, FLUSHING, FLUSHED,
11533    // STOPPING, and RELEASING.
11534    // In the event of an internal codec error setting the state outside of these
11535    // values, the invalid value will be encoded as a string (e.g., “17”).
11536    optional string error_state = 19;
11537    // The max latency in us.
11538    // The latency is from the time when the MediaCodec sends the ‘raw’ frame to
11539    // the media codec service to when the decoded frame arrives back in
11540    // MediaCodec’s possession.
11541    optional int64 latency_max = 20;
11542    // The min latency in us.
11543    optional int64 latency_min = 21;
11544    // The average latency in us.
11545    optional int64 latency_avg = 22;
11546    // The number of buffers included in the avg/min/max calculation above.
11547    optional int64 latency_count = 23;
11548    // The number of packets received back from the code where a latency could not
11549    // be determined, and therefore they aren't included in the avg/min/max
11550    // calculations above.
11551    optional int64 latency_unknown = 24;
11552    // Error returned by queueInputBuffer.
11553    optional int32 queue_input_buffer_error = 25;
11554    // Error returned by queueSecureInputBuffer.
11555    optional int32 queue_secure_input_buffer_error = 26;
11556    // These modes are primarily for videos.
11557    // CQ = constant quality
11558    // CBR = constant bit rate
11559    // VBR = variable bitrate
11560    optional string bitrate_mode = 27;
11561    // The bitrate presented to the underlying codec, after any modifications by
11562    // the framework to ensure a minimum quality.
11563    // If the framework changed this, the app-requested bitrate is in
11564    // original_bitrate.
11565    optional int32 bitrate = 28;
11566    // 0..n
11567    optional int64 lifetime_millis = 29;
11568    optional int64 playback_duration_seconds = 30;
11569    optional string log_session_id = 31;
11570    optional int32 channel_count = 32;
11571    optional int32 sample_rate = 33;
11572    // Total bytes produced by an encoder. When divided by video_encode_duration_us
11573    // this yields the encoding's realized bitrate.
11574    optional int64 video_encode_bytes = 34;
11575    optional int64 video_encode_frames = 35;
11576    optional int64 video_input_bytes = 36;
11577    optional int64 video_input_frames = 37;
11578    // The duration of the encoded video; NOT the encoding process duration
11579    optional int64 video_encode_duration_us = 38;
11580    optional int32 color_format = 39;
11581    optional float frame_rate = 40;
11582    optional float capture_rate = 41;
11583    optional float operating_rate = 42;
11584    optional int32 priority = 43;
11585    optional int32 video_qp_i_min = 44;
11586    optional int32 video_qp_i_max = 45;
11587    optional int32 video_qp_p_min = 46;
11588    optional int32 video_qp_p_max = 47;
11589    optional int32 video_qp_b_min = 48;
11590    optional int32 video_qp_b_max = 49;
11591    // The app-requested bitrate, present only if the framework modified the
11592    // bitrate before passing it to the underlying codec.
11593    optional int32 original_bitrate = 50;
11594    optional int32 shaping_enhanced = 51;
11595    optional int32 original_video_qp_i_min = 52;
11596    optional int32 original_video_qp_i_max = 53;
11597    optional int32 original_video_qp_p_min = 54;
11598    optional int32 original_video_qp_p_max = 55;
11599    optional int32 original_video_qp_b_min = 56;
11600    optional int32 original_video_qp_b_max = 57;
11601    optional int32 config_color_standard = 58;
11602    optional int32 config_color_range = 59;
11603    optional int32 config_color_transfer = 60;
11604    optional int32 parsed_color_standard = 61;
11605    optional int32 parsed_color_range = 62;
11606    optional int32 parsed_color_transfer = 63;
11607    optional int32 hdr_static_info = 64;
11608    optional int32 hdr10_plus_info = 65;
11609    optional int32 hdr_format = 66;
11610    // Randomly generated Codec ID for:
11611    // - correlating MediaCodecStarted and MediaCodecStopped for
11612    // more codec configuration parameters.
11613    // @since U
11614    optional int64 codec_id = 67;
11615    optional int32 array_mode = 68;
11616    optional int32 operation_mode = 69;
11617    optional int32 output_surface = 70;
11618    optional int32 app_max_input_size = 71;
11619    optional int32 used_max_input_size = 72;
11620    optional int32 codec_max_input_size = 73;
11621    optional int32 flush_count = 74;
11622    optional int32 set_surface_count = 75;
11623    optional int32 resolution_change_count = 76;
11624    optional int32 component_color_format = 77;
11625    // caller_uid replaces packagename
11626    // @Since U-QPR2
11627    optional int32 caller_uid = 78 [(is_uid) = true];
11628    optional int64 pixel_format = 79;
11629    // !!! WARNING
11630    // Keep synchronized with MediametricsCodecReported.CodecData in
11631    // mediametrics_message.proto.
11632    // Also keep AStatsEvent serialization synchronized in statsd_codec.cpp
11633    // !!! WARNING
11634}
11635
11636/**
11637 * Track Media Extractor (pulling video/audio streams out of containers) usage
11638 * Logged from:
11639 *   frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
11640 *   frameworks/av/services/mediaanalytics/statsd_extractor.cpp
11641 */
11642message MediametricsExtractorReported {
11643    optional int64 timestamp_nanos = 1;
11644    optional string package_name = 2;
11645    optional int64 package_version_code = 3;
11646    optional int64 media_apex_version = 4;
11647
11648    optional android.stats.mediametrics_message.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11649}
11650
11651/**
11652 * Track MediaParser (parsing video/audio streams from containers) usage
11653 * Logged from:
11654 *
11655 *   frameworks/av/services/mediametrics/statsd_mediaparser.cpp
11656 *   frameworks/base/apex/media/framework/jni/android_media_MediaParserJNI.cpp
11657 */
11658message MediametricsMediaParserReported {
11659    optional int64 timestamp_nanos = 1;
11660    optional string package_name = 2;
11661    optional int64 package_version_code = 3;
11662
11663    // MediaParser specific data.
11664    /**
11665     * The name of the parser selected for parsing the media, or an empty string
11666     * if no parser was selected.
11667     */
11668    optional string parser_name = 4;
11669    /**
11670     * Whether the parser was created by name. 1 represents true, and 0
11671     * represents false.
11672     */
11673    optional int32 created_by_name = 5;
11674    /**
11675     * The parser names in the sniffing pool separated by "|".
11676     */
11677    optional string parser_pool = 6;
11678    /**
11679     * The fully qualified name of the last encountered exception, or an empty
11680     * string if no exception was encountered.
11681     */
11682    optional string last_exception = 7;
11683    /**
11684     * The size of the parsed media in bytes, or -1 if unknown. Note this value
11685     * contains intentional random error to prevent media content
11686     * identification.
11687     */
11688    optional int64 resource_byte_count = 8;
11689    /**
11690     * The duration of the media in milliseconds, or -1 if unknown. Note this
11691     * value contains intentional random error to prevent media content
11692     * identification.
11693     */
11694    optional int64 duration_millis = 9;
11695    /**
11696     * The MIME types of the tracks separated by "|".
11697     */
11698    optional string track_mime_types = 10;
11699    /**
11700     * The tracks' RFC 6381 codec strings separated by "|".
11701     */
11702    optional string track_codecs = 11;
11703    /**
11704     * Concatenation of the parameters altered by the client, separated by "|".
11705     */
11706    optional string altered_parameters = 12;
11707    /**
11708     * The video width in pixels, or -1 if unknown or not applicable.
11709     */
11710    optional int32 video_width = 13;
11711    /**
11712     * The video height in pixels, or -1 if unknown or not applicable.
11713     */
11714    optional int32 video_height = 14;
11715    /**
11716     * Session id for correlating playback metrics.
11717     */
11718    optional string log_session_id = 15;
11719}
11720
11721/**
11722 * Track how we arbitrate between microphone/input requests.
11723 * Logged from
11724 *   frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
11725 *   frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
11726 */
11727message MediametricsAudiopolicyReported {
11728    optional int64 timestamp_nanos = 1;
11729    optional string package_name = 2;
11730    optional int64 package_version_code = 3;
11731    optional int64 media_apex_version = 4;
11732
11733    optional android.stats.mediametrics_message.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11734}
11735
11736/**
11737 * Track how we arbitrate between microphone requests.
11738 * Logged from
11739 *   frameworks/av/media/libaudioclient/AudioRecord.cpp
11740 *   frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
11741 */
11742message MediametricsAudiorecordReported {
11743    optional int64 timestamp_nanos = 1;
11744    optional string package_name = 2;
11745    optional int64 package_version_code = 3;
11746    optional int64 media_apex_version = 4;
11747
11748    optional android.stats.mediametrics_message.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11749
11750    // Android S
11751    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
11752    // An empty string means no session id is set.
11753    optional string log_session_id = 6;
11754}
11755
11756/**
11757 * Track how we arbitrate between microphone/input requests.
11758 * Logged from
11759 *   frameworks/av/media/libnblog/ReportPerformance.cpp
11760 *   frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
11761 */
11762message MediametricsAudiothreadReported {
11763    optional int64 timestamp_nanos = 1;
11764    optional string package_name = 2;
11765    optional int64 package_version_code = 3;
11766    optional int64 media_apex_version = 4;
11767
11768    optional android.stats.mediametrics_message.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11769}
11770
11771/**
11772 * Track how we arbitrate between microphone/input requests.
11773 * Logged from
11774 *   frameworks/av/media/libaudioclient/AudioTrack.cpp
11775 *   frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
11776 */
11777message MediametricsAudiotrackReported {
11778    optional int64 timestamp_nanos = 1;
11779    optional string package_name = 2;
11780    optional int64 package_version_code = 3;
11781    optional int64 media_apex_version = 4;
11782
11783    optional android.stats.mediametrics_message.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11784
11785    // Android S
11786    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
11787    // An empty string means no session id is set.
11788    optional string log_session_id = 6;
11789}
11790
11791/**
11792 * Track information about a MIDI Device.
11793 * This is logged when device connections close or devices are disconnected.
11794 * This is used to evaluate MIDI activity.
11795 *
11796 * Logged from
11797 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
11798 */
11799message MediametricsMidiDeviceCloseReported {
11800    // The UID of the app or service that disconnects the device
11801    optional int32 uid = 1 [(is_uid) = true];
11802    // Device Id from MidiDeviceInfo. After a restart, this starts at 1 for the first device.
11803    // This increments each time a new MIDI device is added.
11804    // See Id in frameworks/base/media/java/android/media/midi/MidiDeviceInfo.java
11805    optional int32 midi_device_id = 2;
11806    // Input port count as defined in MidiDeviceInfo.java
11807    optional int32 input_port_count = 3;
11808    // Output port count as defined in MidiDeviceInfo.java
11809    optional int32 output_port_count = 4;
11810    // Type of device (USB, Virtual, Bluetooth)
11811    optional android.media.midi.MidiDeviceInfoType device_type = 5;
11812    // Whether the device is shared to other apps. Uses MidiDeviceInfo.isPrivate().
11813    optional bool is_shared = 6;
11814    // Whether Universal MIDI Packets are used for this device by default.
11815    // Uses MidiDeviceInfo.getDefaultProtocol()
11816    optional bool supports_ump = 7;
11817    // Whether ALSA is used by this device.
11818    // Checks whether MidiDeviceInfo.getProperties() contains PROPERTY_ALSA_CARD.
11819    optional bool using_alsa = 8;
11820    // Duration in nanoseconds in which there was an open device connection.
11821    optional int64 duration_ns = 9;
11822    // Number of times this device had an add device connection attempt.
11823    optional int32 opened_count = 10;
11824    // Number of times this device had a remove device connection attempt.
11825    optional int32 closed_count = 11;
11826    // Whether the device has disconnected.
11827    optional bool device_disconnected = 12;
11828    // Number of bytes passed from the input ports of the device.
11829    optional int32 total_input_bytes = 13;
11830    // Number of bytes passed from the output ports of the device.
11831    optional int32 total_output_bytes = 14;
11832}
11833
11834/**
11835 * Track information about DRM framework performance
11836 * Logged from
11837 *   frameworks/av/drm/libmediadrm/DrmHal.cpp
11838 *   frameworks/av/services/mediaanalytics/statsd_drm.cpp
11839 */
11840message MediametricsMediadrmReported {
11841    optional int64 timestamp_nanos = 1;
11842    optional string package_name = 2;
11843    optional int64 package_version_code = 3;
11844    optional int64 media_apex_version = 4;
11845
11846    // vendor+description tell about which DRM plugin is in use on this device
11847    optional string vendor = 5;
11848    optional string description = 6;
11849    // from frameworks/av/drm/libmediadrm/protos/metrics.proto
11850    optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
11851}
11852
11853/**
11854 * Track information about the widevine DRM plugin performance
11855 * Logged from
11856 *   vendor/widevine/libwvdrmengine/cdm/metrics
11857 *   frameworks/av/services/mediaanalytics/statsd_drm.cpp
11858 *
11859 * TODO b/182382094 -remove after migrated mediadrm metrics
11860 * reporting to statsd.
11861 */
11862message MediametricsDrmWidevineReported {
11863    optional int64 timestamp_nanos = 1;
11864    optional string package_name = 2;
11865    optional int64 package_version_code = 3;
11866    optional int64 media_apex_version = 4;
11867
11868    optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11869}
11870
11871/**
11872 * Track information about recordings (e.g. camcorder)
11873 * Logged from
11874 *   frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
11875 *   frameworks/av/services/mediaanalytics/statsd_recorder.cpp
11876 */
11877message MediametricsRecorderReported {
11878    optional int64 timestamp_nanos = 1;
11879    optional string package_name = 2;
11880    optional int64 package_version_code = 3;
11881    optional int64 media_apex_version = 4;
11882
11883    optional android.stats.mediametrics_message.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11884}
11885
11886/**
11887 * Track Media Player usage
11888 * Logged from:
11889 *   frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
11890 *   frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
11891 */
11892message MediametricsNuPlayerReported {
11893    optional int64 timestamp_nanos = 1;
11894    optional string package_name = 2;
11895    optional int64 package_version_code = 3;
11896    optional int64 media_apex_version = 4;
11897
11898    optional android.stats.mediametrics_message.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11899}
11900
11901/**
11902 * Track Legacy DRM usage
11903 * Logged from
11904 *   frameworks/av/drm/drmserver/DrmManager.cpp
11905 */
11906message MediametricsDrmManagerReported {
11907    optional int64 timestamp_nanos = 1;
11908    optional string package_name = 2;
11909    optional int64 package_version_code = 3;
11910    optional int64 media_apex_version = 4;
11911
11912    enum Method {
11913        METHOD_NOT_FOUND       = -1;
11914        GET_CONSTRAINTS        =  0;
11915        GET_METADATA           =  1;
11916        CAN_HANDLE             =  2;
11917        PROCESS_DRM_INFO       =  3;
11918        ACQUIRE_DRM_INFO       =  4;
11919        SAVE_RIGHTS            =  5;
11920        GET_ORIGINAL_MIME_TYPE =  6;
11921        GET_DRM_OBJECT_TYPE    =  7;
11922        CHECK_RIGHTS_STATUS    =  8;
11923        REMOVE_RIGHTS          =  9;
11924        REMOVE_ALL_RIGHTS      = 10;
11925        OPEN_CONVERT_SESSION   = 11;
11926        OPEN_DECRYPT_SESSION   = 12;
11927    }
11928
11929    // plugin_id+description inform which Legacy DRM plugins are still in use on device
11930    optional string plugin_id = 5;
11931    optional string description = 6;
11932    optional Method method = 7;
11933    optional string mime_types = 8;
11934
11935    optional int64 get_constraints_count =  9;
11936    optional int64 get_metadata_count = 10;
11937    optional int64 can_handle_count = 11;
11938    optional int64 process_drm_info_count = 12;
11939    optional int64 acquire_drm_info_count = 13;
11940    optional int64 save_rights_count = 14;
11941    optional int64 get_original_mime_type_count = 15;
11942    optional int64 get_drm_object_type_count = 16;
11943    optional int64 check_rights_status_count = 17;
11944    optional int64 remove_rights_count = 18;
11945    optional int64 remove_all_rights_count = 19;
11946    optional int64 open_convert_session_count = 20;
11947    optional int64 open_decrypt_session_count = 21;
11948}
11949
11950/**
11951 * State of a all permission requested by a all package
11952 * Pulled from: StatsCompanionService
11953*/
11954message DangerousPermissionState {
11955    // Name of the permission
11956    optional string permission_name = 1;
11957
11958    // Uid of the package
11959    optional int32 uid = 2 [(is_uid) = true];
11960
11961    // Package requesting the permission
11962    optional string package_name = 3;
11963
11964    // If the permission is granted to the uid
11965    optional bool is_granted = 4;
11966
11967    // Permission flags as per android.content.pm.PermissionFlags
11968    optional int32 permission_flags = 5;
11969
11970    // Permission protection flags as per android.content.pm.PermissionInfo.ProtectionFlags
11971    optional int32 protection_flags = 6;
11972}
11973
11974/**
11975 * Logs when a package is denied access to a device identifier based on the new access requirements.
11976 *
11977 * Logged from:
11978 *     frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
11979 */
11980message DeviceIdentifierAccessDenied {
11981    // The name of the package denied access to the requested device identifier.
11982    optional string package_name = 1;
11983
11984    // The name of the device identifier method the package attempted to invoke.
11985    optional string method_name = 2;
11986
11987    // True if the package is preinstalled.
11988    // Starting from Android 11, this boolean is not set and will always be false.
11989    optional bool is_preinstalled = 3 [deprecated = true];
11990
11991    // True if the package is privileged.
11992    // Starting from Android 11, this boolean is not set and will always be false.
11993    optional bool is_priv_app = 4 [deprecated = true];
11994}
11995
11996/**
11997 * Pulls the ongoing mainline install train version code.
11998 * Pulled from StatsCompanionService
11999 */
12000message TrainInfo {
12001    optional int64 train_version_code = 1;
12002
12003    optional TrainExperimentIds train_experiment_id = 2 [(log_mode) = MODE_BYTES];
12004
12005    optional string train_name = 3;
12006
12007    enum Status {
12008        UNKNOWN = 0;
12009        INSTALL_REQUESTED = 1;
12010        INSTALL_STARTED = 2;
12011        INSTALL_STAGED_NOT_READY = 3;
12012        INSTALL_STAGED_READY = 4;
12013        INSTALL_SUCCESS = 5;
12014        // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
12015        // and INSTALL_FAILURE_COMMIT.
12016        INSTALL_FAILURE = 6  [deprecated = true];
12017        // This enum is for installs that are manually cancelled via the Manual Update UI.
12018        INSTALL_CANCELLED = 7;
12019        INSTALLER_ROLLBACK_REQUESTED = 8;
12020        INSTALLER_ROLLBACK_INITIATED = 9;
12021        INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
12022        INSTALLER_ROLLBACK_STAGED = 11;
12023        INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
12024        INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
12025        INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
12026        INSTALLER_ROLLBACK_SUCCESS = 15;
12027        INSTALLER_ROLLBACK_FAILURE = 16;
12028        INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
12029        INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
12030        INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
12031        INSTALL_STAGED_CANCEL_REQUESTED = 20;
12032        INSTALL_STAGED_CANCEL_SUCCESS = 21;
12033        INSTALL_STAGED_CANCEL_FAILURE = 22;
12034        INSTALL_FAILURE_DOWNLOAD = 23;
12035        INSTALL_FAILURE_STATE_MISMATCH = 24;
12036        INSTALL_FAILURE_COMMIT = 25;
12037        REBOOT_TRIGGERED = 26;
12038    }
12039    optional Status status = 4;
12040}
12041
12042/*
12043 * Information about the time zone data on a device.
12044 */
12045message TimeZoneDataInfo {
12046    // A version identifier for the data set on device. e.g. "2018i"
12047    optional string tzdb_version = 1;
12048}
12049
12050/**
12051 * Logs the GPU stats global health information.
12052 *
12053 * Logged from:
12054 *   frameworks/native/services/gpuservice/gpustats/
12055 */
12056message GpuStatsGlobalInfo {
12057    // Package name of the gpu driver.
12058    optional string driver_package_name = 1;
12059
12060    // Version name of the gpu driver.
12061    optional string driver_version_name = 2;
12062
12063    // Version code of the gpu driver.
12064    optional int64 driver_version_code = 3;
12065
12066    // Build time of the gpu driver in UTC as seconds since January 1, 1970.
12067    optional int64 driver_build_time = 4;
12068
12069    // Total count of the gl driver gets loaded.
12070    optional int64 gl_loading_count = 5;
12071
12072    // Total count of the gl driver fails to be loaded.
12073    optional int64 gl_loading_failure_count = 6;
12074
12075    // Total count of the Vulkan driver gets loaded.
12076    optional int64 vk_loading_count = 7;
12077
12078    // Total count of the Vulkan driver fails to be loaded.
12079    optional int64 vk_loading_failure_count = 8;
12080
12081    // Api version of the system Vulkan driver.
12082    optional int32 vulkan_version = 9;
12083
12084    // Api version of the system CPU Vulkan driver.
12085    optional int32 cpu_vulkan_version = 10;
12086
12087    // Api version of the system GLES driver.
12088    optional int32 gles_version = 11;
12089
12090    // Total count of the angle driver gets loaded.
12091    optional int64 angle_loading_count = 12;
12092
12093    // Total count of the angle driver fails to be loaded.
12094    optional int64 angle_loading_failure_count = 13;
12095}
12096
12097/**
12098 * GPU driver loading time info.
12099 */
12100message GpuDriverLoadingTime {
12101    // List of all the driver loading times for this app. The list size is
12102    // capped at 16 (GpuStats::MAX_NUM_LOADING_TIMES).
12103    repeated int64 driver_loading_time = 1;
12104}
12105
12106/**
12107 * Logs the GPU stats per app health information.
12108 *
12109 * Logged from:
12110 *   frameworks/native/services/gpuservice/gpustats/
12111 */
12112message GpuStatsAppInfo {
12113    // Package name of the application that loads the gpu driver. Total number
12114    // of different packages is capped at 100.
12115    optional string app_package_name = 1;
12116
12117    // Version code of the gpu driver this app loads.
12118    optional int64 driver_version_code = 2;
12119
12120    // gl driver loading time info.
12121    optional GpuDriverLoadingTime gl_driver_loading_time = 3
12122            [(android.os.statsd.log_mode) = MODE_BYTES];
12123
12124    // Vulkan driver loading time info.
12125    optional GpuDriverLoadingTime vk_driver_loading_time = 4
12126            [(android.os.statsd.log_mode) = MODE_BYTES];
12127
12128    // Angle driver loading time info.
12129    optional GpuDriverLoadingTime angle_driver_loading_time = 5
12130            [(android.os.statsd.log_mode) = MODE_BYTES];
12131
12132    // CPU Vulkan implementation is in use.
12133    optional bool cpu_vulkan_in_use = 6;
12134
12135    // App is not doing pre-rotation correctly.
12136    optional bool false_prerotation = 7;
12137
12138    // App creates GLESv1 context.
12139    optional bool gles_1_in_use = 8;
12140
12141    // ANGLE in use for the app.
12142    optional bool angle_in_use = 9;
12143
12144    // App created a GLES context.
12145    // Introduced in Android 14.
12146    optional bool created_gles_context = 10;
12147
12148    // App created a Vulkan device.
12149    // Introduced in Android 14.
12150    optional bool created_vulkan_device = 11;
12151
12152    // App created a Vulkan swapchain.
12153    // Introduced in Android 14.
12154    optional bool created_vulkan_swapchain = 12;
12155
12156    // Vulkan API version information from applicationInfo.
12157    // Introduced in Android 14.
12158    optional int32 vulkan_api_version = 13;
12159
12160    // Bitmask of enabled features when creating Vulkan devices.
12161    // Introduced in Android 14.
12162    optional int64 vulkan_device_features_enabled = 14;
12163
12164    // Hash values of enabled Vulkan instance extensions.
12165    // The list size is capped at 100 (GpuStatsAppInfo::MAX_NUM_EXTENSIONS).
12166    // Introduced in Android 14.
12167    repeated int32 vulkan_instance_extensions_enabled = 15;
12168
12169    // Hash values of enabled Vulkan device extensions.
12170    // The list size is capped at 100 (GpuStatsAppInfo::MAX_NUM_EXTENSIONS).
12171    // Introduced in Android 14.
12172    repeated int32 vulkan_device_extensions_enabled = 16;
12173
12174    // Hash values of engine name from VkApplicationInfo
12175    repeated string vulkan_engine_names = 17;
12176}
12177
12178/*
12179 * Logs the size of the system ion heap.
12180 *
12181 * Pulled from StatsCompanionService.
12182 */
12183message SystemIonHeapSize {
12184    // Deprecated due to limited support of ion stats in debugfs.
12185    // Use `IonHeapSize` instead.
12186    option deprecated = true;
12187
12188    // Size of the system ion heap in bytes.
12189    // Read from debugfs.
12190    optional int64 size_in_bytes = 1;
12191}
12192
12193/*
12194 * Logs the total size of the ion heap.
12195 *
12196 * Pulled from StatsCompanionService.
12197 */
12198message IonHeapSize {
12199    // Total size of all ion heaps in kilobytes.
12200    // Read from: /sys/kernel/ion/total_heaps_kb.
12201    optional int32 total_size_kb = 1;
12202}
12203
12204/*
12205 * Logs the per-process size of the system ion heap.
12206 *
12207 * Pulled from StatsCompanionService.
12208 */
12209message ProcessSystemIonHeapSize {
12210    // The uid if available. -1 means not available.
12211    optional int32 uid = 1 [(is_uid) = true];
12212
12213    // The process name (from /proc/PID/cmdline).
12214    optional string process_name = 2;
12215
12216    // Sum of sizes of all allocations.
12217    optional int32 total_size_in_kilobytes = 3;
12218
12219    // Number of allocations.
12220    optional int32 allocation_count = 4;
12221
12222    // Size of the largest allocation.
12223    optional int32 max_size_in_kilobytes = 5;
12224}
12225
12226/*
12227 * Logs system-wide (primarily kernel) memory stats. Sourced from
12228 * /proc/meminfo unless explicitly stated otherwise.
12229 *
12230 * Pulled from StatsCompanionService.
12231 */
12232message SystemMemory {
12233    // /proc/meminfo SUnreclaim
12234    optional int32 unreclaimable_slab_kb = 1;
12235
12236    // /proc/meminfo VmallocUsed
12237    optional int32 vmalloc_used_kb = 2;
12238
12239    // /proc/meminfo PageTables
12240    optional int32 page_tables_kb = 3;
12241
12242    // /proc/meminfo KernelStack
12243    optional int32 kernel_stack_kb = 4;
12244
12245    // Total unreclaimable ion.
12246    // Reported from os.Debug.getIonHeapsSizeKb (R+)
12247    optional int32 total_ion_kb = 5;
12248
12249    // Measures for the amount of memory we could not account for.
12250    // Essentially points to kernel allocations (as all userspace allocs are
12251    // already tracked).
12252    // Device-specific.
12253    optional int32 unaccounted_kb = 6;
12254
12255    // GPU kernel driver allocations.
12256    // Can overlap with ion memory.
12257    // Reported from os.Debug.getGpuTotalUsageKb (S+)
12258    optional int32 gpu_total_usage_kb = 7;
12259
12260    // GPU kernel driver private allocations.
12261    // Does not overlap with ion memory
12262    // Computed as total usage - Debug.getGpuDmaBufUsageKb()
12263    // Only available on supported kernel versions (5.4+)
12264    optional int32 gpu_private_usage_kb = 8;
12265
12266    // Total DMABUF memory allocations
12267    // Reported from os.Debug.getDmabufTotalExportedKb (S+)
12268    optional int32 dmabuf_total_exported_kb = 9;
12269
12270    // Total shmem allocations
12271    optional int32 shmem_kb = 10;
12272
12273    // Total usable memory
12274    optional int32 total_kb = 11;
12275
12276    // Memory not in use
12277    optional int32 free_kb = 12;
12278
12279    // Memory available for starting new applications without swapping
12280    optional int32 available_kb = 13;
12281
12282    // Memory in active use
12283    optional int32 active_kb = 14;
12284
12285    // Memory not in active use (swappable/reclaimable)
12286    optional int32 inactive_kb = 15;
12287
12288    // Anonymous memory in active use
12289    optional int32 active_anon_kb = 16;
12290
12291    // Anonymous memory not in active use
12292    optional int32 inactive_anon_kb = 17;
12293
12294    // Page cache memory in active use
12295    optional int32 active_file_kb = 18;
12296
12297    // Page cache memory not in active use
12298    optional int32 inactive_file_kb = 19;
12299
12300    // Total swap
12301    optional int32 swap_total_kb = 20;
12302
12303    // Free swap
12304    optional int32 swap_free_kb = 21;
12305
12306    // Total amount of CMA reserved for the kernel
12307    optional int32 cma_total_kb = 22;
12308
12309    // CMA free for the kernel to use
12310    optional int32 cma_free_kb = 23;
12311}
12312
12313/*
12314 * Log dmabuf memory retained by userspace processes.
12315 * Pulled from StatsPullAtomService.
12316 */
12317 message ProcessDmabufMemory {
12318  // The uid if available. -1 means not available.
12319  optional int32 uid = 1 [(is_uid) = true];
12320
12321  // The process name (from ActivityManager).
12322  optional string process_name = 2;
12323
12324  // OOM adj score.
12325  optional int32 oom_adj_score = 3;
12326
12327  // Size of dmabufs retained by the process. The buffers are either mapped,
12328  // retained via an fd, or both.
12329  // Only available on supported kernel versions (5.4+). When unavailable, set
12330  // to -1.
12331  optional int32 retained_dmabuf_kb = 4;
12332
12333  // Number of buffers retained by the process (mapped / fd).
12334  // Only available on supported kernel versions (5.4+). When unavailable, set
12335  // to -1.
12336  optional int32 retained_dmabuf_count = 5;
12337
12338  // Size of dmabufs mapped to the process address space.
12339  optional int32 mapped_dmabuf_kb = 6 [deprecated = true];
12340
12341  // Number of dmabufs mapped to the process address space.
12342  optional int32 mapped_dmabuf_count = 7 [deprecated = true];
12343
12344  // Size of dmabufs mapped to the process address space that are also
12345  // mapped to the SurfaceFlinger address space. This indicates memory
12346  // being used by graphics compositing layers. If this data row pertains
12347  // to SurfaceFlinger itself, then the below field holds the size of all
12348  // dmabuifs that are shared with any other process. The delta between
12349  // this field and retained_dmabuf_kb, above, is private dmabufs that
12350  // SurfaceFlinger is holding but are not shared with other processes.
12351  optional int32 surfaceflinger_shared_dmabuf_kb = 8;
12352  // As above, but total number of all dmabufs shared with SurfaceFlinger.
12353  optional int32 surfaceflinger_shared_dmabuf_count = 9;
12354}
12355
12356/**
12357 * Push network stack events.
12358 *
12359 * Log from:
12360 *     frameworks/base/packages/NetworkStack/
12361 */
12362message NetworkStackReported {
12363    // The id that indicates the event reported from NetworkStack.
12364    optional int32 event_id = 1;
12365    // The data for the reported events.
12366    optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
12367}
12368
12369/**
12370 * Logs the apps that are installed on the external storage.
12371 * Pulled from:
12372 *   StatsCompanionService
12373 */
12374message AppsOnExternalStorageInfo {
12375    // The type of the external storage.
12376    optional android.stats.storage.ExternalStorageType external_storage_type = 1;
12377    // The name of the package that is installed on the external storage.
12378    optional string package_name = 2;
12379}
12380
12381/**
12382 * Logs the settings related to Face.
12383 * Logged from:
12384 *   frameworks/base/services/core/java/com/android/server/stats
12385 */
12386message FaceSettings {
12387    // Whether or not face unlock is allowed on Keyguard.
12388    optional bool unlock_keyguard_enabled = 1;
12389    // Whether or not face unlock dismisses the Keyguard.
12390    optional bool unlock_dismisses_keyguard = 2;
12391    // Whether or not face unlock requires attention.
12392    optional bool unlock_attention_required = 3;
12393    // Whether or not face unlock is allowed for apps (through BiometricPrompt).
12394    optional bool unlock_app_enabled = 4;
12395    // Whether or not face unlock always requires user confirmation.
12396    optional bool unlock_always_require_confirmation = 5;
12397    // Whether or not a diverse set of poses are required during enrollment.
12398    optional bool unlock_diversity_required = 6;
12399}
12400
12401/**
12402 * Logs cooling devices maintained by the kernel.
12403 *
12404 * Pulled from StatsCompanionService.java
12405 */
12406message CoolingDevice {
12407    // The type of cooling device being reported. Eg. CPU, GPU...
12408    optional android.os.CoolingTypeEnum device_location = 1;
12409    // The name of the cooling device source. Eg. CPU0
12410    optional string device_name = 2;
12411    // Current throttle state of the cooling device. The value can any unsigned
12412    // integer between 0 and max_state defined in its driver. 0 means device is
12413    // not in throttling, higher value means deeper throttling.
12414    optional int32 state = 3;
12415}
12416
12417/**
12418 * Intelligence has several counter-type events that don't warrant a
12419 * full separate atom. These are primarily API call counters but also include
12420 * counters for feature usage and specific failure modes.
12421 *
12422 * Logged from the Intelligence mainline module.
12423 */
12424message IntelligenceEventReported {
12425  // The event type.
12426  optional android.stats.intelligence.EventType event_id = 1;
12427  // Success, failure.
12428  optional android.stats.intelligence.Status status = 2;
12429  // How many times the event occured (to report a batch of high frequency events).
12430  optional int32 count = 3;
12431  // How long the event took (sum of durations if count > 1)
12432  optional int64 duration_millis = 4;
12433}
12434
12435/**
12436 * Logs when Car Power state changed.
12437 *
12438 * Logged from:
12439 *   packages/services/Car/service/src/com/android/car/CarStatsLog.java
12440 */
12441message CarPowerStateChanged {
12442    // States come from CpmsState in CarPowerManagementService.java.
12443    enum State {
12444       WAIT_FOR_VHAL = 0;
12445       ON = 1;
12446       SHUTDOWN_PREPARE = 2;
12447       WAIT_FOR_FINISH = 3;
12448       SUSPEND = 4;
12449       SIMULATE_SLEEP = 5;
12450       SIMULATE_HIBERNATION = 6;
12451    }
12452    optional State state = 1;
12453}
12454
12455/**
12456 * Logs when Car User Hal is requested to switch/create/remove user.
12457 *
12458 * Logged from:
12459 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
12460 */
12461message CarUserHalModifyUserRequestReported {
12462    // Request id for the request.
12463    optional int32 request_id = 1;
12464    // Request type.
12465    enum RequestType {
12466        UNKNOWN = 0;
12467        // Car user manager requested user switch.
12468        SWITCH_REQUEST_ANDROID = 1;
12469        // OEM requested User switch.
12470        SWITCH_REQUEST_OEM = 2;
12471        // Hal switch requested after android switch using activity manager.
12472        SWITCH_REQUEST_LEGACY = 3;
12473        // Create User
12474        CREATE_REQUEST = 4;
12475        // Remove User
12476        REMOVE_REQUEST = 5;
12477    }
12478    optional RequestType request_type = 2;
12479    // Android User id of the current user which can only be 0, 10, 11 and so on.
12480    // -1 if not available.
12481    optional int32 user_id = 3;
12482    // VHAL flags of the current user. (-1 if not available)
12483    optional int32 user_flags = 4;
12484    // Android User id of the target user for switch/create/remove. It can only
12485    // be 0, 10, 11 and so on. -1 if not available.
12486    optional int32 target_user_id = 5;
12487    // VHAL flags of the target user for switch/create/remove. (-1 if not available)
12488    optional int32 target_user_flags = 6;
12489    // Request timeout Milliseconds (-1 if not available)
12490    optional int32 timeout_millis = 7;
12491}
12492
12493/**
12494 * Logs when Car User Hal responds to switch/create user request.
12495 *
12496 * Logged from:
12497 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
12498 */
12499message CarUserHalModifyUserResponseReported {
12500    // Request id of the request associated with the response.
12501    optional int32 request_id = 1;
12502    // Car user hal callback status.
12503    enum CallbackStatus {
12504        UNKNOWN = 0;
12505        // Hal response was invalid.
12506        INVALID = 1;
12507        // Hal response was ok.
12508        OK = 2;
12509        // Hal timeout during set call.
12510        HAL_SET_TIMEOUT = 3;
12511        // Hal response timeout.
12512        HAL_RESPONSE_TIMEOUT = 4;
12513        // Hal responded with wrong info.
12514        WRONG_HAL_RESPONSE = 5;
12515        // Hal is processing multiple requests simultaneously.
12516        CONCURRENT_OPERATION = 6;
12517    }
12518    optional CallbackStatus callback_status = 2;
12519
12520    // Hal request status for user switch/create/remove.
12521    enum HalRequestStatus {
12522        UNSPECIFIED = 0;
12523        // Hal request for user switch/create is successful.
12524        SUCCESS = 1;
12525        // Hal request for user switch/create failed.
12526        FAILURE = 2;
12527    }
12528    optional HalRequestStatus request_status = 3;
12529}
12530
12531/**
12532 * Logs when post switch response is posted to Car User Hal.
12533 *
12534 * Logged from:
12535 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
12536 */
12537message CarUserHalPostSwitchResponseReported {
12538    // Request id.
12539    optional int32 request_id = 1;
12540
12541    // Android user switch status.
12542    enum UserSwitchStatus {
12543        UNKNOWN = 0;
12544        // Android user switch is successful.
12545        SUCCESS = 1;
12546        // Android user switch failed.
12547        FAILURE = 2;
12548    }
12549    optional UserSwitchStatus switch_status = 2;
12550}
12551
12552/**
12553 * Logs when initial user information is requested from Car User Hal.
12554 *
12555 * Logged from:
12556 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
12557 */
12558message CarUserHalInitialUserInfoRequestReported {
12559    // Request id for the request.
12560    optional int32 request_id = 1;
12561
12562    // Request type for initial user information.
12563    enum InitialUserInfoRequestType {
12564        UNKNOWN = 0;
12565        // At the first time Android was booted (or after a factory reset).
12566        FIRST_BOOT = 1;
12567        // At the first time Android was booted after the system was updated.
12568        FIRST_BOOT_AFTER_OTA = 2;
12569        // When Android was booted "from scratch".
12570        COLD_BOOT = 3;
12571        // When Android was resumed after the system was suspended to memory.
12572        RESUME = 4;
12573    }
12574    optional InitialUserInfoRequestType request_type = 2;
12575    // Request timeout Milliseconds (-1 if not available)
12576    optional int32 timeout_millis = 3;
12577}
12578
12579/**
12580 * Logs when Car User Hal responds to initial user information requests.
12581 *
12582 * Logged from:
12583 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
12584 */
12585message CarUserHalInitialUserInfoResponseReported {
12586    // Request id of the request associated with the response.
12587    optional int32 request_id = 1;
12588    // Car user hal callback status.
12589    enum CallbackStatus {
12590        UNKNOWN = 0;
12591        // Hal response was invalid.
12592        INVALID = 1;
12593        // Hal response was ok.
12594        OK = 2;
12595        // Hal timeout during set call.
12596        HAL_SET_TIMEOUT = 3;
12597        // Hal response timeout.
12598        HAL_RESPONSE_TIMEOUT = 4;
12599        // Hal responded with wrong info.
12600        WRONG_HAL_RESPONSE = 5;
12601        // Hal is processing multiple requests simultaneously.
12602        CONCURRENT_OPERATION = 6;
12603    }
12604    optional CallbackStatus callback_status = 2;
12605    // Response for initial user information request.
12606    enum InitialUserInfoResponseAction {
12607        UNSPECIFIED = 0;
12608        // Let the Android System decide what to do.
12609        DEFAULT = 1;
12610        // Switch to an existing Android user.
12611        SWITCH = 2;
12612        // Create a new Android user (and switch to it).
12613        CREATE = 3;
12614    }
12615    optional InitialUserInfoResponseAction response_action = 3;
12616    // Android User id of the target user which can only be 0, 10, 11 and so on.
12617    // -1 if not available.
12618    optional int32 target_user = 4;
12619    // VHAL flags of the current user. (-1 if not available)
12620    optional int32 target_user_flags = 5;
12621    // User locales
12622    optional string user_locales = 6;
12623}
12624
12625/**
12626 * Logs when set user association is requested from Car User Hal.
12627 *
12628 * Logged from:
12629 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
12630 */
12631message CarUserHalUserAssociationRequestReported {
12632    // Request id for the request.
12633    optional int32 request_id = 1;
12634    // Request type.
12635    enum RequestType {
12636        UNKNOWN = 0;
12637        // For setting user association information.
12638        SET = 1;
12639        // For getting user association information.
12640        GET = 2;
12641    }
12642    optional RequestType request_type = 2;
12643    // Android User id of the current user which can only be 0, 10, 11 and so on.
12644    // -1 if not available.
12645    optional int32 current_user_id = 3;
12646    // VHAL flags of the current user. (-1 if not available)
12647    optional int32 current_user_flags = 4;
12648    // Number of the set associations requested.
12649    optional int32 number_associations = 5;
12650    // Concatenated string for the types from set associations request.
12651    // This is a string converted from an array of integers.
12652    optional string user_identification_association_types = 6;
12653    // Concatenated string for the values from set associations request.
12654    // This is a string converted from an array of integers.
12655    optional string user_identification_association_values = 7;
12656}
12657
12658/**
12659 * Logs when Car User Hal responds to set user association requests.
12660 *
12661 * Logged from:
12662 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
12663 */
12664message CarUserHalSetUserAssociationResponseReported {
12665    // Request id of the request associated with the response.
12666    optional int32 request_id = 1;
12667    // Car user hal callback status.
12668    enum CallbackStatus {
12669        UNKNOWN = 0;
12670        // Hal response was invalid.
12671        INVALID = 1;
12672        // Hal response was ok.
12673        OK = 2;
12674        // Hal timeout during set call.
12675        HAL_SET_TIMEOUT = 3;
12676        // Hal response timeout.
12677        HAL_RESPONSE_TIMEOUT = 4;
12678        // Hal responded with wrong info.
12679        WRONG_HAL_RESPONSE = 5;
12680        // Hal is processing multiple requests simultaneously.
12681        CONCURRENT_OPERATION = 6;
12682    }
12683    optional CallbackStatus callback_status = 2;
12684    // Number of the set associations in the response.
12685    optional int32 number_associations = 3;
12686    // Concatenated string for the types from set associations request.
12687    // This is a string converted from an array of integers.
12688    optional string user_identification_association_types = 4;
12689    // Concatenated string for the values from set associations request.
12690    // This is a string converted from an array of integers.
12691    optional string user_identification_association_values = 5;
12692}
12693
12694/**
12695 * Logs whether GarageMode is entered.
12696 *
12697 * Logged from:
12698 *   packages/services/Car/service/src/com/android/car/CarStatsLog.java
12699 */
12700message GarageModeInfo {
12701    // Whether GarageMode is entered.
12702    optional bool is_garage_mode = 1;
12703}
12704
12705/**
12706 * Historical app ops data per package.
12707 */
12708message AppOps {
12709    // Uid of the package requesting the op
12710    optional int32 uid = 1 [(is_uid) = true];
12711
12712    // Name of the package performing the op
12713    optional string package_name = 2;
12714
12715    // operation id
12716    optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
12717
12718    // The number of times the op was granted while the app was in the
12719    // foreground (only for trusted requests)
12720    optional int64 trusted_foreground_granted_count = 4;
12721
12722    // The number of times the op was granted while the app was in the
12723    // background (only for trusted requests)
12724    optional int64 trusted_background_granted_count = 5;
12725
12726    // The number of times the op was rejected while the app was in the
12727    // foreground (only for trusted requests)
12728    optional int64 trusted_foreground_rejected_count = 6;
12729
12730    // The number of times the op was rejected while the app was in the
12731    // background (only for trusted requests)
12732    optional int64 trusted_background_rejected_count = 7;
12733
12734    // For long-running operations, total duration of the operation
12735    // while the app was in the foreground (only for trusted requests)
12736    optional int64 trusted_foreground_duration_millis = 8;
12737
12738    // For long-running operations, total duration of the operation
12739    // while the app was in the background (only for trusted requests)
12740    optional int64 trusted_background_duration_millis = 9;
12741
12742    // Whether AppOps is guarded by Runtime permission
12743    optional bool is_runtime_permission = 10;
12744}
12745
12746/**
12747 * Historical app ops data per package and attribution tag.
12748 */
12749message AttributedAppOps {
12750    // Uid of the package requesting the op
12751    optional int32 uid = 1 [(is_uid) = true];
12752
12753    // Name of the package performing the op
12754    optional string package_name = 2;
12755
12756    // tag; provided by developer when accessing related API, limited at 50 chars by API.
12757    // Attributions must be provided through manifest using <attribution> tag available in R and
12758    // above.
12759    optional string tag = 3;
12760
12761    // operation id
12762    optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
12763
12764    // The number of times the op was granted while the app was in the
12765    // foreground (only for trusted requests)
12766    optional int64 trusted_foreground_granted_count = 5;
12767
12768    // The number of times the op was granted while the app was in the
12769    // background (only for trusted requests)
12770    optional int64 trusted_background_granted_count = 6;
12771
12772    // The number of times the op was rejected while the app was in the
12773    // foreground (only for trusted requests)
12774    optional int64 trusted_foreground_rejected_count = 7;
12775
12776    // The number of times the op was rejected while the app was in the
12777    // background (only for trusted requests)
12778    optional int64 trusted_background_rejected_count = 8;
12779
12780    // For long-running operations, total duration of the operation
12781    // while the app was in the foreground (only for trusted requests)
12782    optional int64 trusted_foreground_duration_millis = 9;
12783
12784    // For long-running operations, total duration of the operation
12785    // while the app was in the background (only for trusted requests)
12786    optional int64 trusted_background_duration_millis = 10;
12787
12788    // Whether AppOps is guarded by Runtime permission
12789    optional bool is_runtime_permission = 11;
12790
12791    // Sampling rate used on device, from 0 to 100
12792    optional int32 sampling_rate = 12;
12793}
12794
12795/**
12796 * Location Manager API Usage information(e.g. API under usage,
12797 * API call's parameters).
12798 * Logged from:
12799 *  frameworks/base/services/core/java/com/android/server/LocationManagerService.java
12800 */
12801message LocationManagerApiUsageReported {
12802
12803    // Indicating if usage starts or usage ends.
12804    optional android.stats.location.UsageState state = 1;
12805
12806    // LocationManagerService's API in use.
12807    // We can identify which API from LocationManager is
12808    // invoking current LMS API by the combination of
12809    // API parameter(e.g. is_listener_null, is_intent_null,
12810    // is_location_request_null)
12811    optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
12812
12813    // Name of the package calling the API.
12814    optional string calling_package_name = 3;
12815
12816    // Type of the location provider.
12817    optional android.stats.location.ProviderType provider = 4;
12818
12819    // Quality of the location request
12820    optional android.stats.location.LocationRequestQuality quality = 5;
12821
12822    // The desired interval for active location updates, in milliseconds.
12823    // Bucketized to reduce cardinality.
12824    optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
12825
12826    // Minimum distance between location updates, in meters.
12827    // Bucketized to reduce cardinality.
12828    optional android.stats.location.SmallestDisplacementBucket
12829            bucketized_smallest_displacement = 7;
12830
12831    // The number of location updates.
12832    optional int64 num_updates = 8;
12833
12834    // The request expiration time, in millisecond since boot.
12835    // Bucketized to reduce cardinality.
12836    optional android.stats.location.ExpirationBucket
12837            bucketized_expire_in = 9;
12838
12839    // Type of Callback passed in for this API.
12840    optional android.stats.location.CallbackType callback_type = 10;
12841
12842    // The radius of the central point of the alert
12843    // region, in meters. Only for API REQUEST_GEOFENCE.
12844    // Bucketized to reduce cardinality.
12845    optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
12846
12847    // Activity Importance of API caller.
12848    // Categorized to 3 types that are interesting from location's perspective.
12849    optional android.stats.location.ActivityImportance activiy_importance = 12;
12850
12851    // Attribution tag passed to this API.
12852    optional string attribution_tag = 13;
12853}
12854
12855/**
12856 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
12857 */
12858message ReviewPermissionsFragmentResultReported {
12859    // unique value identifying a permission group change. A permission group change might result
12860    // in multiple of these atoms
12861    optional int64 change_id = 1;
12862
12863    // UID of package the permission belongs to
12864    optional int32 uid = 2 [(is_uid) = true];
12865
12866    // Name of package the permission belongs to
12867    optional string package_name = 3;
12868
12869    // The permission to be granted
12870    optional string permission_name = 4;
12871
12872    // The result of the permission grant
12873    optional bool permission_granted = 5;
12874}
12875
12876/**
12877* Information about results of permission upgrade by RuntimePermissionsUpgradeController
12878* Logged from: RuntimePermissionUpdgradeController
12879*/
12880message RuntimePermissionsUpgradeResult {
12881    // Permission granted as result of upgrade
12882    optional string permission_name = 1;
12883
12884    // UID of package granted permission
12885    optional int32 uid = 2 [(is_uid) = true];
12886
12887    // Name of package granted permission
12888    optional string package_name = 3;
12889}
12890
12891/**
12892* Information about a buttons presented in GrantPermissionsActivity and choice made by user
12893*/
12894message GrantPermissionsActivityButtonActions {
12895    // Permission granted as result of upgrade
12896    optional string permission_group_name = 1;
12897
12898    // UID of package granted permission
12899    optional int32 uid = 2 [(is_uid) = true];
12900
12901    // Name of package requesting permission
12902    optional string package_name = 3;
12903
12904    // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
12905    // LABEL_ constants in GrantPermissionActivity.java
12906    optional int32 buttons_presented = 4;
12907
12908    // Button clicked by user - same as bit flags in buttons_presented with only single bit set
12909    optional int32 button_clicked = 5;
12910
12911    // id which identifies single session of user interacting with permission controller
12912    optional int64 session_id = 6;
12913
12914    // Target SDK of the package
12915    optional int32 target_sdk = 7;
12916
12917    // Selected precision of the location permission - bit flags indicate which
12918    // locations were chosen
12919    optional int32 selected_precision = 8;
12920
12921    // Whether Permission Rationale was shown on grant permission activity
12922    optional bool permission_rationale_shown = 9;
12923}
12924
12925/**
12926 * Information about LocationAccessCheck notification presented to user
12927 */
12928message LocationAccessCheckNotificationAction {
12929
12930    // id which identifies single session of user interacting with permission controller
12931    optional int64 session_id = 1;
12932
12933    // Uid of package for which location access check is presented
12934    optional int32 package_uid = 2 [(is_uid) = true];
12935
12936    // Name of package for which location access check is presented
12937    optional string package_name = 3;
12938
12939    enum Result {
12940        UNDEFINED = 0;
12941        // notification was presented to the user
12942        NOTIFICATION_PRESENTED = 1;
12943        // notification was declined by the user
12944        NOTIFICATION_DECLINED = 2;
12945        // notification was clicked by the user
12946        NOTIFICATION_CLICKED = 3;
12947    }
12948
12949    // View / interaction recorded
12950    optional Result result = 4;
12951}
12952
12953/**
12954 * Information about a permission grant or revoke made by user inside AppPermissionFragment
12955 */
12956message AppPermissionFragmentActionReported {
12957    // id which identifies single session of user interacting with permission controller
12958    optional int64 session_id = 1;
12959
12960    // unique value identifying a permission group change. A permission group change might result
12961    // in multiple of these atoms
12962    optional int64 change_id = 2;
12963
12964    // UID of package the permission belongs to
12965    optional int32 uid = 3 [(is_uid) = true];
12966
12967    // Name of package the permission belongs to
12968    optional string package_name = 4;
12969
12970    // The permission to be granted
12971    optional string permission_name = 5;
12972
12973    // The result of the permission grant
12974    optional bool permission_granted = 6;
12975
12976    // State of Permission Flags after grant as per android.content.pm.PermissionFlags
12977    optional int32 permission_flags = 7;
12978
12979    enum Button {
12980        UNDEFINED = 0;
12981        // Allow button
12982        ALLOW = 1;
12983        // Deny button
12984        DENY = 2;
12985        // Ask every time button
12986        ASK_EVERY_TIME = 3;
12987        // Allow all the time button
12988        ALLOW_ALWAYS = 4;
12989        // Allow only while using the app button
12990        ALLOW_FOREGROUND = 5;
12991        // Same is Deny button but shown in while in use dialog
12992        DENY_FOREGROUND = 6;
12993        // Switch button set to ON for location accuracy
12994        GRANT_FINE_LOCATION = 7;
12995        // Switch button set to OFF for location accuracy
12996        REVOKE_FINE_LOCATION = 8;
12997        // The user has selected photos/videos from the photo picker
12998        PHOTOS_SELECTED = 9;
12999        // User selects Permission Rationale label
13000        PERMISSION_RATIONALE = 10;
13001    }
13002
13003    // Button pressed in the dialog
13004    optional Button button_pressed = 8;
13005}
13006
13007/**
13008* Information about a AppPermissionFragment viewed by user
13009*/
13010message AppPermissionFragmentViewed {
13011    // id which identifies single session of user interacting with permission controller
13012    optional int64 session_id = 1;
13013
13014    // UID of package for which permissions are viewed
13015    optional int32 uid = 2 [(is_uid) = true];
13016
13017    // Name of package for which permissions are viewed
13018    optional string package_name = 3;
13019
13020    // Permission group viewed
13021    optional string permission_group_name = 4;
13022
13023    // Whether Permission Rationale was shown on app permission fragment
13024    optional bool permission_rationale_shown = 5;
13025}
13026
13027/**
13028* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
13029* the log retains the old fragment name.
13030*/
13031message AppPermissionsFragmentViewed {
13032    // id which identifies single session of user interacting with permission controller
13033    optional int64 session_id = 1;
13034
13035    // id which identifies single view as every view might have several logging records
13036    // with different package information attached
13037    optional int64 view_id = 2;
13038
13039    // Permission group viewed
13040    optional string permission_group_name = 3;
13041
13042    // UID of package for which permissions are viewed
13043    optional int32 uid = 4 [(is_uid) = true];
13044
13045    // Name of package for which permissions are viewed
13046    optional string package_name = 5;
13047
13048    // Category in which permission is included
13049    enum Category {
13050      UNDEFINED = 0;
13051      ALLOWED = 1;
13052      ALLOWED_FOREGROUND = 2;
13053      DENIED = 3;
13054    }
13055    optional Category category = 6;
13056}
13057/**
13058* Information about a PermissionAppsFragment viewed by user.
13059* Logged from ui/handheld/PermissionAppsFragment.java
13060*/
13061message PermissionAppsFragmentViewed {
13062    // id which identifies single session of user interacting with permission controller
13063    optional int64 session_id = 1;
13064
13065    // id which identifies single view as every view might have several logging records
13066    // with different package information attached
13067    optional int64 view_id = 2;
13068
13069    // Permission group viewed
13070    optional string permission_group_name = 3;
13071
13072    // UID of package for which permissions are viewed
13073    optional int32 uid = 4 [(is_uid) = true];
13074
13075    // Name of package for which permissions are viewed
13076    optional string package_name = 5;
13077
13078    // Category in which app is included
13079    enum Category {
13080        UNDEFINED = 0;
13081        ALLOWED = 1;
13082        ALLOWED_FOREGROUND = 2;
13083        DENIED = 3;
13084    }
13085    optional Category category = 6;
13086}
13087
13088/**
13089* Log that the Auto Revoke notification has been clicked
13090* Logged from ui/ManagePermissionsActivity
13091*/
13092message AutoRevokeNotificationClicked {
13093    // id which identifies single session of user interacting with permission controller
13094    optional int64 session_id = 1;
13095}
13096
13097/**
13098* Log that an app has been displayed on the auto revoke page, and lists one permission that was
13099* auto revoked for it.
13100* Logged from ui/handheld/AutoRevokeFragment
13101*/
13102message AutoRevokeFragmentAppViewed {
13103    // id which identifies single session of user interacting with permission controller
13104    optional int64 session_id = 1;
13105
13106    // UID of package for which permissions are viewed
13107    optional int32 uid = 2 [(is_uid) = true];
13108
13109    // Name of package for which permissions are viewed
13110    optional string package_name = 3;
13111
13112    // The name of a permission group that has been revoked
13113    optional string permission_group_name = 4;
13114
13115    // The age of the app- more than three months old, or more than six months
13116    enum Age {
13117        UNDEFINED = 0;
13118        NEWER_BUCKET = 1;
13119        OLDER_BUCKET = 2;
13120    }
13121
13122    // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
13123    optional Age age = 5;
13124}
13125
13126/**
13127* Log that the user has interacted with an app on the auto revoke fragment
13128* Logged from ui/handheld/AutoRevokeFragment
13129*/
13130message AutoRevokedAppInteraction {
13131    // id which identifies single session of user interacting with permission controller
13132    optional int64 session_id = 1;
13133
13134    // UID of package for which permissions are viewed
13135    optional int32 uid = 2 [(is_uid) = true];
13136
13137    // Name of package for which permissions are viewed
13138    optional string package_name = 3;
13139
13140    enum Action {
13141        UNDEFINED = 0;
13142        REMOVE = 1;
13143        OPEN = 2;
13144        APP_INFO = 3;
13145        PERMISSIONS = 4;
13146        REMOVE_IN_SETTINGS = 5;
13147        OPEN_IN_SETTINGS = 6;
13148    }
13149
13150    // The action the user took to interact with the app
13151    optional Action action = 4;
13152}
13153
13154/**
13155* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
13156* auto revoke, or that the auto revoke switch has been changed
13157* Logged from ui/handheld/AppPermissionGroupsFragment
13158 */
13159message AppPermissionGroupsFragmentAutoRevokeAction {
13160    // id which identifies single session of user interacting with permission controller
13161    optional int64 session_id = 1;
13162
13163    // UID of package for which permissions are viewed
13164    optional int32 uid = 2 [(is_uid) = true];
13165
13166    // Name of package for which permissions are viewed
13167    optional string package_name = 3;
13168
13169    enum Action {
13170        UNDEFINED = 0;
13171        OPENED_FOR_AUTO_REVOKE = 1;
13172        OPENED_FROM_INTENT = 2;
13173        SWITCH_ENABLED = 3;
13174        SWITCH_DISABLED = 4;
13175    }
13176
13177    // The action the user took to interact with the fragment
13178    optional Action action = 4;
13179}
13180
13181/**
13182 * Logs when there is a smart selection related event.
13183 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
13184 * Logged from: TextClassifierEventLogger.java
13185 */
13186message TextSelectionEvent {
13187    // A session ID.
13188    optional string session_id = 1;
13189
13190    // Event type of this event.
13191    optional android.stats.textclassifier.EventType event_type = 2;
13192
13193    // Name of the annotator model that is involved in this event.
13194    optional string model_name = 3;
13195
13196    // Type of widget that was involved in triggering this event.
13197    optional android.stats.textclassifier.WidgetType widget_type = 4;
13198
13199    // Index of this event in a session.
13200    optional int32 event_index = 5;
13201
13202    // Entity type that is involved.
13203    optional string entity_type = 6;
13204
13205    // Relative word index of the start of the selection.
13206    optional int32 relative_word_start_index = 7;
13207
13208    // Relative word (exclusive) index of the end of the selection.
13209    optional int32 relative_word_end_index = 8;
13210
13211    // Relative word index of the start of the smart selection.
13212    optional int32 relative_suggested_word_start_index = 9;
13213
13214    // Relative word (exclusive) index of the end of the smart selection.
13215    optional int32 relative_suggested_word_end_index = 10;
13216
13217    // Name of source package.
13218    optional string package_name = 11;
13219
13220    // Name of the LangID model that is involved in this event.
13221    optional string langid_model_name = 12;
13222}
13223
13224/**
13225 * Logs when there is a smart linkify related event.
13226 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
13227 * Logged from: TextClassifierEventLogger.java
13228 */
13229message TextLinkifyEvent {
13230    // A session ID.
13231    optional string session_id = 1;
13232
13233    // Event type of this event.
13234    optional android.stats.textclassifier.EventType event_type = 2;
13235
13236    // Name of the annotator model that is involved in this event.
13237    optional string model_name = 3;
13238
13239    // Type of widget that was involved in triggering this event.
13240    optional android.stats.textclassifier.WidgetType widget_type = 4;
13241
13242    // Index of this event in a session.
13243    optional int32 event_index = 5;
13244
13245    // Entity type that is involved.
13246    optional string entity_type = 6;
13247
13248    // Number of links detected.
13249    optional int32 num_links = 7;
13250
13251    // The total length of all links.
13252    optional int32 linked_text_length = 8;
13253
13254    // Length of input text.
13255    optional int32 text_length = 9;
13256
13257    // Time spent on generating links in ms.
13258    optional int64 latency_millis = 10;
13259
13260    // Name of source package.
13261    optional string package_name = 11;
13262
13263    // Name of the LangID model that is involved in this event.
13264    optional string langid_model_name = 12;
13265}
13266
13267/**
13268 * Logs when there is a conversation actions related event.
13269 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
13270 * Logged from: TextClassifierEventLogger.java
13271 */
13272message ConversationActionsEvent {
13273    // A session ID.
13274    optional string session_id = 1;
13275
13276    // Event type of this event.
13277    optional android.stats.textclassifier.EventType event_type = 2;
13278
13279    // Name of the actions model that is involved in this event.
13280    optional string model_name = 3;
13281
13282    // Type of widget that was involved in triggering this event.
13283    optional android.stats.textclassifier.WidgetType widget_type = 4;
13284
13285    // The first entity type that is involved.
13286    optional string first_entity_type = 5;
13287
13288    // The second entity type that is involved.
13289    optional string second_entity_type = 6;
13290
13291    // The third entity type that is involved.
13292    optional string third_entity_type = 7;
13293
13294    // The score of the first entity type.
13295    optional float score = 8;
13296
13297    // Name of source package.
13298    optional string package_name = 9;
13299
13300    // Name of the annotator model that is involved in this event.
13301    optional string annotator_model_name = 10;
13302
13303    // Name of the LangID model that is involved in this event.
13304    optional string langid_model_name = 11;
13305}
13306
13307/**
13308 * Logs when there is a language detection related event.
13309 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
13310 * Logged from: TextClassifierEventLogger.java
13311 */
13312message LanguageDetectionEvent {
13313    // A session ID.
13314    optional string session_id = 1;
13315
13316    // Event type of this event.
13317    optional android.stats.textclassifier.EventType event_type = 2;
13318
13319    // Name of the language detection model that is involved in this event.
13320    optional string model_name = 3;
13321
13322    // Type of widget that was involved in triggering this event.
13323    optional android.stats.textclassifier.WidgetType widget_type = 4;
13324
13325    // Detected language.
13326    optional string language_tag = 5;
13327
13328    // Score of the detected language.
13329    optional float score = 6;
13330
13331    // Position of this action.
13332    optional int32 action_index = 7;
13333
13334    // Name of source package.
13335    optional string package_name = 8;
13336}
13337
13338/**
13339 * Information about an OTA update attempt by update_engine.
13340 * Logged from platform/system/update_engine/metrics_reporter_android.cc
13341 */
13342message UpdateEngineUpdateAttemptReported {
13343    // The number of attempts for the update engine to apply a given payload.
13344    optional int32 attempt_number = 1;
13345
13346    optional android.stats.otaupdate.PayloadType payload_type = 2;
13347
13348    // The total time in minutes for the update engine to apply a given payload.
13349    // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
13350    // it's increased when the system is sleeping.
13351    optional int32 duration_boottime_in_minutes = 3;
13352
13353    // The total time in minutes for the update engine to apply a given payload.
13354    // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
13355    // and it's not increased when the system is sleeping.
13356    optional int32 duration_monotonic_in_minutes = 4;
13357
13358    // The size of the payload in MiBs.
13359    optional int32 payload_size_mib = 5;
13360
13361    // The attempt result reported by the update engine for an OTA update.
13362    optional android.stats.otaupdate.AttemptResult attempt_result = 6;
13363
13364    // The error code reported by the update engine after an OTA update attempt
13365    // on A/B devices.
13366    optional android.stats.otaupdate.ErrorCode error_code = 7;
13367
13368    // The build fingerprint of the source system. The value is read from a
13369    // system property when the device takes the update. e.g.
13370    // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
13371    optional string source_fingerprint = 8;
13372
13373    // Size of super partition.
13374    optional int64 super_partition_size_bytes = 9;
13375
13376    // Size of current slot within the super partition.
13377    optional int64 slot_size_bytes = 10;
13378
13379    // Free space available in the super partition.
13380    optional int64 super_free_space_bytes = 11;
13381
13382    // Whether the device enables Virtual A/B compression.
13383    optional bool vab_compression_enabled = 12;
13384
13385    // Whether this update attempt uses Virtual A/B compression.
13386    optional bool vab_compression_used = 13;
13387}
13388
13389/**
13390 * Information about all the attempts the device make before finishing the
13391 * successful update.
13392 * Logged from platform/system/update_engine/metrics_reporter_android.cc
13393 */
13394message UpdateEngineSuccessfulUpdateReported {
13395    // The number of attempts for the update engine to apply the payload for a
13396    // successful update.
13397    optional int32 attempt_count = 1;
13398
13399    optional android.stats.otaupdate.PayloadType payload_type = 2;
13400
13401    optional int32 payload_size_mib = 3;
13402
13403    // The total number of bytes downloaded by update_engine since the last
13404    // successful update.
13405    optional int32 total_bytes_downloaded_mib = 4;
13406
13407    // The ratio in percentage of the over-downloaded bytes compared to the
13408    // total bytes needed to successfully install the update. e.g. 200 if we
13409    // download 200MiB in total for a 100MiB package.
13410    optional int32 download_overhead_percentage = 5;
13411
13412    // The total time in minutes for the update engine to apply the payload for a
13413    // successful update.
13414    optional int32 total_duration_minutes = 6;
13415
13416    // The number of reboot of the device during a successful update.
13417    optional int32 reboot_count = 7;
13418
13419    // Whether on device verity computation is enabled
13420    optional bool fec_enabled = 8;
13421
13422    // Whether on device hash tree computation is enabled
13423    optional bool hash_tree_enabled = 9;
13424
13425}
13426
13427/**
13428 * Reported when a client requests to prepare for resume on reboot.
13429 *
13430 * Logged from:
13431 *   frameworks/base/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
13432 */
13433message RebootEscrowPreparationReported {
13434  enum Result {
13435    ROR_NEED_PREPARATION = 0;
13436    ROR_SKIP_PREPARATION_AND_NOTIFY = 1;
13437    ROR_SKIP_PREPARATION_NOT_NOTIFY = 2;
13438  }
13439
13440  // The uid of the client who requests ror.
13441  optional int32 requesting_uid = 1 [(is_uid) = true];
13442
13443  optional Result result = 2;
13444
13445  // The number of clients who has requested ror, including the current caller.
13446  optional int32 requested_client_count = 3;
13447}
13448
13449/**
13450 * Reported when the lock screen knowledge factor is captured, while there are clients of
13451 * resume on reboot to notify.
13452 *
13453 * Logged from:
13454 *   frameworks/base/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
13455 */
13456message RebootEscrowLskfCaptureReported {
13457  // The uid of the client to notify about the Lskf capture.
13458  optional int32 uid_to_notify = 1 [(is_uid) = true];
13459
13460  // The total number of clients who have requested ror.
13461  optional int32 requested_client_count = 2;
13462
13463  // The duration between RoR request - current LSKF capture event.
13464  optional int32 duration_ror_requested_to_lskf_captured_seconds = 3;
13465}
13466
13467/* Reported when a client (e.g. gmscore) requests to reboot with Resume on Reboot.
13468 *
13469 * Logged from:
13470 *   frameworks/base/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
13471 */
13472message RebootEscrowRebootReported {
13473  optional int32 error_code = 1;
13474
13475  // The uid of clients who requested the reboot
13476  optional int32 request_uid = 2 [(is_uid) = true];
13477
13478  // All clients that have prepared for RoR before this reboot
13479  optional int32 prepared_clients_count = 3;
13480
13481  // The RoR request count for the client who requests reboot.
13482  optional int32 request_count = 4;
13483
13484  // Whether the reboot request assumes a slot switch on a/b devices.
13485  optional bool slot_switch = 5;
13486
13487  // True if the DeviceConfig shows the device is using server based RoR.
13488  optional bool server_based = 6;
13489
13490  // The duration between last LSKF captured - reboot requests
13491  optional int32 duration_lskf_captured_to_reboot_seconds = 7;
13492
13493  // The count of LSKF captured since preparation
13494  optional int32 lskf_captured_counts = 8;
13495}
13496
13497/**
13498 * Logs stats for AppSearch function calls
13499 */
13500message AppSearchCallStatsReported {
13501    // The sampling interval for this specific type of stats
13502    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
13503    optional int32 sampling_interval = 1;
13504
13505    // # of previous skipped sample for this specific type of stats
13506    // We can't push atoms too closely, so some samples might be skipped
13507    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
13508    // For example, the true count of an event could be estimated as:
13509    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
13510    optional int32 num_skipped_sample = 2;
13511
13512    // Package UID of the application.
13513    optional int32 uid = 3 [(is_uid) = true];
13514
13515    // Hash of the database name within AppSearch
13516    optional int32 database = 4;
13517
13518    // The status code for the call or internal state.
13519    // Needs to be sync with AppSearchResult#ResultCode in
13520    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13521    optional int32 status_code = 5;
13522
13523    // Overall time used for the end-to-end function call in AppSearch.
13524    // It doesn't include binder latency
13525    optional int32 total_latency_millis = 6;
13526
13527    // Type of the function call value is in sync with
13528    // frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/stats/CallStats.java
13529    optional int32 call_type = 7;
13530
13531    // Estimated binder latency (estimated as single-trip time * 2)
13532    optional int32 estimated_binder_latency_millis = 8;
13533
13534    // Number of operations succeeded for batch operations.
13535    optional int32 num_operations_succeeded = 9;
13536
13537    // Number of operations failed for batch operations.
13538    optional int32 num_operations_failed = 10;
13539
13540    // Number of actual API calls reported in this atom.
13541    optional int32 num_reported_calls = 11;
13542}
13543
13544/**
13545 * Logs detailed stats for putting a single document in AppSearch
13546 */
13547message AppSearchPutDocumentStatsReported {
13548    // The sampling interval for this specific type of stats
13549    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
13550    optional int32 sampling_interval = 1;
13551
13552    // # of previous skipped sample for this specific type of stats
13553    // We can't push atoms too closely, so some samples might be skipped
13554    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
13555    // For example, the true count of an event could be estimated as:
13556    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
13557    optional int32 num_skipped_sample = 2;
13558
13559    // Package UID of the application.
13560    optional int32 uid = 3 [(is_uid) = true];
13561
13562    // Hash of the database name within AppSearch
13563    optional int32 database = 4;
13564
13565    // Needs to be sync with AppSearchResult#ResultCode in
13566    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13567    optional int32 status_code = 5;
13568
13569    // Overall time used for a put_document
13570    optional int32 total_latency_millis = 6;
13571
13572    // Time used to generate a document proto from a Bundle.
13573    optional int32 generate_document_proto_latency_millis = 7;
13574
13575    // Time used to rewrite types and namespaces in the document.
13576    optional int32 rewrite_document_types_latency_millis = 8;
13577
13578    // Overall time used for the native function call.
13579    optional int32 native_latency_millis = 9;
13580
13581    // Time used to store the document.
13582    optional int32 native_document_store_latency_millis = 10;
13583
13584    // Time used to index the document. It doesn't include the time to
13585    // merge indices.
13586    optional int32 native_index_latency_millis = 11;
13587
13588    // Time used to merge the indices.
13589    optional int32 native_index_merge_latency_millis = 12;
13590
13591    // Document size in bytes.
13592    optional int32 native_document_size_bytes = 13;
13593
13594    // Number of tokens added to the index.
13595    optional int32 native_num_tokens_indexed = 14;
13596
13597    // Whether the max number of tokens exceeded.
13598    optional bool native_exceeded_max_num_tokens = 15;
13599}
13600
13601/**
13602 * Logs detailed stats for AppSearch Initialize
13603 */
13604message AppSearchInitializeStatsReported {
13605    // The sampling interval for this specific type of stats
13606    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
13607    optional int32 sampling_interval = 1;
13608
13609    // # of previous skipped sample for this specific type of stats
13610    // We can't push atoms too closely, so some samples might be skipped
13611    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
13612    // For example, the true count of an event could be estimated as:
13613    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
13614    optional int32 num_skipped_sample = 2;
13615
13616    // Package UID of the application.
13617    optional int32 uid = 3 [(is_uid) = true];
13618
13619    // Initialize status code
13620    // Needs to be sync with AppSearchResult#ResultCode in
13621    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13622    optional int32 status_code = 4;
13623
13624    // Overall time used for initialization, not including binder latency.
13625    optional int32 total_latency_millis = 5;
13626
13627    // Whether the initialize() detects desyncs.
13628    // Desync happens if we lose the visibility doc.
13629    optional bool has_desync = 6;
13630
13631    // Time used to read and process the schema and namespaces.
13632    optional int32 prepare_schema_and_namespaces_latency_millis = 7;
13633
13634    // Time used to read and process the visibility file.
13635    optional int32 prepare_visibility_file_latency_millis = 8;
13636
13637    // Overall time used for the native function call.
13638    optional int32 native_latency_millis = 9;
13639
13640    // Needs to be sync with RecoveryCause in google3/third_party/icing/proto/logging.proto
13641    optional int32 native_document_store_recovery_cause = 10;
13642
13643    // Needs to be sync with RecoveryCause in google3/third_party/icing/proto/logging.proto
13644    optional int32 native_index_restoration_cause = 11;
13645
13646    // Needs to be sync with RecoveryCause in google3/third_party/icing/proto/logging.proto
13647    optional int32 native_schema_store_recovery_cause = 12;
13648
13649    // Time used to recover the document store.
13650    optional int32 native_document_store_recovery_latency_millis = 13;
13651
13652    // Time used to restore the index.
13653    optional int32 native_index_restoration_latency_millis = 14;
13654
13655    // Time used to recover the schema store.
13656    optional int32 native_schema_store_recovery_latency_millis = 15;
13657
13658    // Needs to be sync with DocumentStoreDataStatus in google3/third_party/icing/proto/logging.proto
13659    optional int32 native_document_store_data_status = 16;
13660
13661    // Number of documents currently in document store. Those may
13662    // include alive, deleted, and expired documents.
13663    optional int32 native_num_documents = 17;
13664
13665    // Number of schema types currently in the schema store.
13666    optional int32 native_num_schema_types = 18;
13667
13668    // Whether we had to reset the index, losing all data, during initialization.
13669    optional bool has_reset = 19;
13670
13671    // The status code of the reset operation if has_reset is true.
13672    // Needs to be sync with AppSearchResult#ResultCode in
13673    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13674    optional int32 reset_status_code = 20;
13675}
13676
13677/**
13678 * Logs detailed stats for querying in AppSearch
13679 *
13680 * Next tag: 34
13681 */
13682message AppSearchQueryStatsReported {
13683    // The sampling interval for this specific type of stats
13684    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
13685    optional int32 sampling_interval = 1;
13686
13687    // # of previous skipped sample for this specific type of stats
13688    // We can't push atoms too closely, so some samples might be skipped
13689    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
13690    // For example, the true count of an event could be estimated as:
13691    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
13692    optional int32 num_skipped_sample = 2;
13693
13694    // Package UID of the application.
13695    optional int32 uid = 3 [(is_uid) = true];
13696
13697    // Hash of the database name within AppSearch
13698    optional int32 database = 4;
13699
13700    // Needs to be sync with AppSearchResult#ResultCode in
13701    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13702    optional int32 status_code = 5;
13703
13704    // Overall time used for query which doesn't include estimated binder latency
13705    optional int32 total_latency_millis = 6;
13706
13707    // Time used to rewrite the search spec.
13708    optional int32 rewrite_search_spec_latency_millis = 7;
13709
13710    // Time used to rewrite the search results.
13711    optional int32 rewrite_search_result_latency_millis = 8;
13712
13713    // Whether it is a global query.
13714    // Needs to be sync with QueryStats#VisibilityScope in
13715    // frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/stats/QueryStats.java
13716    optional int32 visibility_scope = 9;
13717
13718    // Overall time used for the native function call.
13719    optional int32 native_latency_millis = 10;
13720
13721    // Number of terms in the query string.
13722    optional int32 native_num_terms = 11;
13723
13724    // Length of the query string.
13725    optional int32 native_query_length = 12;
13726
13727    // Number of namespaces filtered.
13728    optional int32 native_num_namespaces_filtered = 13;
13729
13730    // Number of schema types filtered.
13731    optional int32 native_num_schema_types_filtered = 14;
13732
13733    // The requested number of results in one page.
13734    optional int32 native_requested_page_size = 15;
13735
13736    // The actual number of results returned in the current page.
13737    optional int32 native_num_results_returned_current_page = 16;
13738
13739    // Whether the function call is querying the first page. If it's
13740    // not, Icing will fetch the results from cache so that some steps
13741    // may be skipped.
13742    optional bool native_is_first_page = 17;
13743
13744    // Time used to parse the query, including 2 parts: tokenizing and
13745    // transforming tokens into an iterator tree.
13746    optional int32 native_parse_query_latency_millis = 18;
13747
13748    // Strategy of scoring and ranking.
13749    // Needs to be sync with RankingStrategy.Code in google3/third_party/icing/proto/scoring.proto
13750    optional int32 native_ranking_strategy = 19;
13751
13752    // Number of documents scored.
13753    optional int32 native_num_documents_scored = 20;
13754
13755    // Time used to score the raw results.
13756    optional int32 native_scoring_latency_millis = 21;
13757
13758    // Time used to rank the scored results.
13759    optional int32 native_ranking_latency_millis = 22;
13760
13761    // Time used to fetch the document protos. Note that it includes the
13762    // time to snippet if "native_num_results_with_snippets" is NOT zero.
13763    optional int32 native_document_retrieval_latency_millis = 23;
13764
13765    // How many snippets are calculated.
13766    optional int32 native_num_results_with_snippets = 24;
13767
13768    // Time passed while waiting to acquire the lock during Java function calls.
13769    optional int32 java_lock_acquisition_latency_millis = 25;
13770
13771    // Time spent on ACL checking. This is the time spent filtering namespaces
13772    // based on package permissions and Android permission access.
13773    optional int32 acl_check_latency_millis = 26;
13774
13775    // Time passed while waiting to acquire the lock during native function calls.
13776    optional int32 native_lock_acquisition_latency_millis = 27;
13777
13778    // Time used to send data across the JNI boundary from java to native side.
13779    optional int32 java_to_native_jni_latency_millis = 28;
13780
13781    // Time used to send data across the JNI boundary from native to java side.
13782    optional int32 native_to_java_jni_latency_millis = 29;
13783
13784    // The type of the join query.
13785    //
13786    // Needs to be sync with AppSearchSchema#JoinableValueType in
13787    // packages/modules/AppSearch/framework/java/external/android/app/appsearch/AppSearchSchema.java
13788    optional int32 join_type = 30;
13789
13790    // How many total documents were joined to the parent documents.
13791    optional int32 native_num_joined_results_current_page = 31;
13792
13793    // Time taken to join child documents to parent documents.
13794    optional int32 native_join_latency_millis = 32;
13795
13796    //  The Hash of the tag to indicate the query source of this search
13797    optional int32 query_source_log_tag = 33;
13798}
13799
13800/**
13801 * Logs detailed stats for remove in AppSearch
13802 */
13803message AppSearchRemoveStatsReported {
13804    // The sampling interval for this specific type of stats
13805    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
13806    optional int32 sampling_interval = 1;
13807
13808    // # of previous skipped sample for this specific type of stats
13809    // We can't push atoms too closely, so some samples might be skipped
13810    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
13811    // For example, the true count of an event could be estimated as:
13812    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
13813    optional int32 num_previous_skipped_sample = 2;
13814
13815    // Package UID of the application.
13816    optional int32 uid = 3 [(is_uid) = true];
13817
13818    // Hash of the database name within AppSearch
13819    optional int32 database = 4;
13820
13821    // Needs to be sync with AppSearchResult#ResultCode in
13822    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13823    optional int32 status_code = 5;
13824
13825    // Overall time used for remove including the binder latency
13826    optional int32 total_latency_millis = 6;
13827
13828    // Overall time used for the native function call.
13829    optional int32 native_latency_millis = 7;
13830
13831    // Used to indicate what kind of delete(namespace, schemaType etc) calls deleteByQuery here.
13832    // Needs to be sync with external/icing/proto/icing/proto/logging.proto#DeleteStatsProto
13833    optional int32 native_delete_type = 8;
13834
13835    // Number of documents deleted by this call.
13836    optional int32 native_num_documents_deleted = 9;
13837}
13838
13839/**
13840 * Logs detailed stats for optimization in AppSearch.
13841 *
13842 * stats pushed from:
13843 *   frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
13844 *
13845 * Next tag: 14
13846 */
13847message AppSearchOptimizeStatsReported {
13848    // The sampling interval for this specific type of stats
13849    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
13850    optional int32 sampling_interval = 1;
13851
13852    // # of previous skipped sample for this specific type of stats
13853    // We can't push atoms too closely, so some samples might be skipped
13854    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
13855    // For example, the true count of an event could be estimated as:
13856    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
13857    optional int32 num_previous_skipped_sample = 2;
13858
13859    // Needs to be sync with AppSearchResult#ResultCode in
13860    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13861    optional int32 status_code = 3;
13862
13863    // Overall time used for remove including the binder latency
13864    optional int32 total_latency_millis = 4;
13865
13866    // Overall time used for the native function call.
13867    optional int32 native_latency_millis = 5;
13868
13869    // Time used to optimize the document store in millis.
13870    optional int32 native_document_store_optimize_latency_millis = 6;
13871
13872    // Time used to restore the index in millis.
13873    optional int32 native_index_restoration_latency_millis = 7;
13874
13875    // Number of documents before the optimization.
13876    optional int32 native_num_original_documents = 8;
13877
13878    // Number of documents deleted during the optimization.
13879    optional int32 native_num_deleted_documents = 9;
13880
13881    // Number of documents expired during the optimization.
13882    optional int32 native_num_expired_documents = 10;
13883
13884    // Size of storage in bytes before the optimization.
13885    optional int64 native_storage_size_before_bytes = 11;
13886
13887    // Size of storage in bytes after the optimization.
13888    optional int64 native_storage_size_after_bytes = 12;
13889
13890    // The amount of time in millis since the last optimization ran.
13891    optional int64 native_time_since_last_optimize_millis = 13;
13892}
13893
13894// Reports information in external/icing/proto/icing/proto/storage.proto#DocumentStorageInfoProto
13895// Next tag: 15
13896message AppSearchDocumentStorageInfo {
13897    // Total number of alive documents.
13898    optional int32 num_alive_documents = 1;
13899
13900    // Total number of deleted documents.
13901    optional int32 num_deleted_documents = 2;
13902
13903    // Total number of expired documents.
13904    optional int32 num_expired_documents = 3;
13905
13906    // Total size of the document store in bytes. Will be set to -1 if an IO error
13907    // is encountered while calculating this field.
13908    optional int64 document_store_size_bytes = 4;
13909
13910    // Total size of the ground truth in bytes. The ground truth may
13911    // include deleted or expired documents. Will be set to -1 if an IO error is
13912    // encountered while calculating this field.
13913    optional int64 document_log_size_bytes = 5;
13914
13915    // Size of the key mapper in bytes. Will be set to -1 if an IO error is
13916    // encountered while calculating this field.
13917    optional int64 key_mapper_size_bytes = 6;
13918
13919    // Size of the document id mapper in bytes. Will be set to -1 if an IO error
13920    // is encountered while calculating this field.
13921    optional int64 document_id_mapper_size_bytes = 7;
13922
13923    // Size of the score cache in bytes. Will be set to -1 if an IO error is
13924    // encountered while calculating this field.
13925    optional int64 score_cache_size_bytes = 8;
13926
13927    // Size of the filter cache in bytes. Will be set to -1 if an IO error is
13928    // encountered while calculating this field.
13929    optional int64 filter_cache_size_bytes = 9;
13930
13931    // Size of the corpus mapper in bytes. Will be set to -1 if an IO error is
13932    // encountered while calculating this field.
13933    optional int64 corpus_mapper_size_bytes = 10;
13934
13935    // Size of the corpus score cache in bytes. Will be set to -1 if an IO error
13936    // is encountered while calculating this field.
13937    optional int64 corpus_score_cache_size_bytes = 11;
13938
13939    // Size of the namespace id mapper in bytes. Will be set to -1 if an IO error
13940    // is encountered while calculating this field.
13941    optional int64 namespace_id_mapper_size_bytes = 12;
13942
13943    // Number of namespaces seen from the current documents.
13944    optional int32 num_namespaces = 13;
13945
13946    // Storage information of each namespace is not included due to that it has string field.
13947
13948    reserved 14;
13949}
13950
13951// Reports information in external/icing/proto/icing/proto/storage.proto#SchemaStoreStorageInfoProto
13952// Next tag: 5
13953message AppSearchSchemaStoreStorageInfo {
13954    // Size of the schema store in bytes. Will be set to -1 if an IO error is
13955    // encountered while calculating this field.
13956    optional int64 schema_store_size_bytes = 1;
13957
13958    // Total number of schema types.
13959    optional int32 num_schema_types = 2;
13960
13961    // Total number of all sections across all types
13962    optional int32 num_total_sections = 3;
13963
13964    // Total number of types at the current section limit.
13965    optional int32 num_schema_types_sections_exhausted = 4;
13966}
13967
13968// Reports information in external/icing/proto/icing/proto/storage.proto#IndexStorageInfoProto
13969// Next tag: 9
13970message AppSearchIndexStorageInfo {
13971    // Total size of the index in bytes. Will be set to -1 if an IO error is
13972    // encountered while calculating this field.
13973    optional int64 index_size_bytes = 1;
13974
13975    // Size of the lite index lexicon in bytes. Will be set to -1 if an IO error
13976    // is encountered while calculating this field.
13977    optional int64 lite_index_lexicon_size_bytes = 2;
13978
13979    // Size of the lite index hit buffer in bytes. Will be set to -1 if an IO
13980    // error is encountered while calculating this field.
13981    optional int64 lite_index_hit_buffer_size_bytes = 3;
13982
13983    // Size of the main index lexicon in bytes. Will be set to -1 if an IO error
13984    // is encountered while calculating this field.
13985    optional int64 main_index_lexicon_size_bytes = 4;
13986
13987    // Size of the main index storage in bytes. Will be set to -1 if an IO error
13988    // is encountered while calculating this field.
13989    optional int64 main_index_storage_size_bytes = 5;
13990
13991    // Size of one main index block in bytes.
13992    optional int64 main_index_block_size_bytes = 6;
13993
13994    // Number of main index blocks.
13995    optional int32 num_blocks = 7;
13996
13997    // Percentage of the main index blocks that are free, assuming
13998    // allocated blocks are fully used.
13999    optional float min_free_fraction = 8;
14000}
14001
14002/**
14003 * Pulls information about storage information per user from AppSearch
14004 *
14005 * Pulled from:
14006 *   frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
14007 *
14008 * Next tag: 6
14009 */
14010message AppSearchStorageInfo {
14011    // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
14012    // This is mainly used as a dimension for the metric, but it can also tell us if
14013    // the StorageInfo is for a primary user or secondary user.
14014    optional int32 user = 1;
14015
14016    // Total size of Icing’s storage in bytes. Will be set to -1 if an IO error is
14017    // encountered while calculating this field.
14018    optional int64 total_storage_size_bytes = 2;
14019
14020    // Storage information of the document store.
14021    optional AppSearchDocumentStorageInfo document_storage_info = 3
14022        [(android.os.statsd.log_mode) = MODE_BYTES];
14023
14024    // Storage information of the schema store.
14025    optional AppSearchSchemaStoreStorageInfo schema_store_storage_info = 4
14026        [(android.os.statsd.log_mode) = MODE_BYTES];
14027
14028    // Storage information of the index.
14029    optional AppSearchIndexStorageInfo index_storage_info = 5
14030        [(android.os.statsd.log_mode) = MODE_BYTES];
14031}
14032
14033
14034/**
14035 * Reported when AppSearch Contacts Indexer syncs the contacts data from CP2 to AppSearch
14036 *
14037 * Reported from:
14038 *   packages/modules/AppSearch/service/java/com/android/server/appsearch/contactsindexer/ContactsIndexerManagerService.java
14039 *
14040 * Next tag: 18
14041 */
14042message ContactsIndexerUpdateStatsReported {
14043    enum UpdateType {
14044      UNKNOWN = 0;
14045      DELTA = 1;
14046      FULL = 2;
14047    }
14048
14049    // Type of the update
14050    optional UpdateType update_type = 1;
14051
14052    // Latency for the update in millis
14053    optional int32 total_latency_millis = 2;
14054
14055    // Status code to indicate whether the insert new contacts, or update
14056    // existing contacts succeeds, or fails and why
14057    // In case of success, it only contains OK.
14058    // In case of failures, it contains all the possible errors we get.
14059    repeated int32 update_status_codes = 3;
14060
14061    // Status code to indicate whether the delete succeeds, or fails and why
14062    // In case of success, it only contains OK.
14063    // In case of failures, it contains all the possible errors we get.
14064    repeated int32 delete_status_codes = 4;
14065
14066    // Number of new contacts to be updated.
14067    optional int32 number_of_new_contacts_to_be_updated = 5;
14068
14069    // Number of old and new contacts has been successfully updated.
14070    optional int32 number_of_contacts_update_succeeded = 6;
14071
14072    // Number of old contacts has been successfully deleted.
14073    optional int32 number_of_contacts_delete_succeeded = 7;
14074
14075    // Number of old contacts skipped during this update due to no
14076    // significant change.
14077    optional int32 number_of_contacts_update_skipped = 8;
14078
14079    // Number of old and new contacts failed to be updated
14080    optional int32 number_of_contacts_update_failed = 9;
14081
14082    // Number of old contacts failed to be deleted
14083    optional int32 number_of_contacts_delete_failed = 10;
14084
14085    // Number of old contacts to be deleted that were not found
14086    optional int32 number_of_contacts_delete_not_found = 11;
14087
14088    // Start timestamp of the update in millis
14089    optional int64 update_start_timestamp_millis = 12;
14090
14091    // Timestamp of the last full update in millis (not including this update)
14092    optional int64 last_full_update_timestamp_millis = 13;
14093
14094    // Timestamp of the last delta update in millis (not including this update)
14095    optional int64 last_delta_update_timestamp_millis = 14;
14096
14097    // Timestamp of the last contact to be updated from CP2 in millis
14098    optional int64 last_contact_updated_timestamp_millis = 15;
14099
14100    // Timestamp of the last contact to be deleted from CP2 in millis
14101    optional int64 last_contact_deleted_timestamp_millis = 16;
14102
14103    // The previous update's last_contact_updated_timestamp_millis
14104    // This field is only set for a full update and expected to match
14105    // last_contacted_update_timestamp_millis. If the fields do not match, then we
14106    // were unexpectedly not synced up with CP2 at the time of the update.
14107    optional int64 previous_last_contact_updated_timestamp_millis = 17;
14108}
14109
14110/**
14111 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
14112 * key to indicate whether it was successful or not.
14113 *
14114 * Logged from:
14115 *   frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
14116 */
14117message RebootEscrowRecoveryReported {
14118    // Type of the resume on reboot backend provider.
14119    enum ServiceType {
14120        UNKNOWN = 0;
14121        HAL = 1;
14122        SERVER_BASED = 2;
14123    }
14124
14125    // Whether the vbmeta digest of the current slot matches a precomputed value before reboot.
14126    enum VbmetaDigestStatus {
14127        MATCH_EXPECTED_SLOT = 0;
14128        MATCH_FALLBACK_SLOT = 1;
14129        MISMATCH = 2;
14130    }
14131
14132    optional bool successful = 1;
14133    // The error code for escrow data recovery failure
14134    optional int32 error_code = 2;
14135
14136    optional ServiceType type = 3;
14137
14138    // Number of retries to unwrap the escrow key asynchronously.
14139    optional int32 get_escrow_key_retry_count = 4;
14140
14141    // The duration between storing of reboot escrow key ->
14142    // use of reboot escrow key to unlock CE after reboot
14143    optional int32 duration_escrow_key_storage_to_unlock_seconds = 5;
14144
14145    optional VbmetaDigestStatus vbmeta_digest_status = 6;
14146
14147    // The duration between boot complete -> CE unlock
14148    optional int32 duration_boot_complete_to_unlock_seconds = 7;
14149}
14150
14151/**
14152 * Global display pipeline metrics reported by SurfaceFlinger.
14153 * Metrics exist beginning in Android 11.
14154 * There is a copy of this proto in timestats_atoms.proto in SurfaceFlinger.
14155 * That proto must be updated if this atom is updated.
14156 *
14157 * Pulled from:
14158 *    frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
14159 */
14160message SurfaceflingerStatsGlobalInfo {
14161    // Aggregated refresh rate buckets that layers were presenting at. Buckets
14162    // are defined in SurfaceFlinger and are tracked per device.
14163    // Introduced in Android 12.
14164    // This is intended to be used as a dimenstion in collecting per-refresh rate
14165    // jank statistics.
14166    optional int32 display_refresh_rate_bucket = 18;
14167    // Aggregated render rate buckets that layers were overridden to run at.
14168    // Buckets are defined in SurfaceFlinger and are tracked per device.
14169    // Introduced in Android 12.
14170    // This is intended to be used as a dimension in collecting per-render rate
14171    // jank statistics.
14172    optional int32 render_rate_bucket = 21;
14173    // Total number of frames presented during the tracing period
14174    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
14175    // using render_rate_bucket as a dimension.
14176    optional int64 total_frames = 1;
14177    // Total number of frames missed
14178    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
14179    // using render_rate_bucket as a dimension.
14180    optional int64 missed_frames = 2;
14181    // Total number of frames that fell back to client composition
14182    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
14183    // using render_rate_bucket as a dimension.
14184    optional int64 client_composition_frames = 3;
14185    // Total time the display was turned on
14186    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
14187    // using render_rate_bucket as a dimension.
14188    optional int64 display_on_millis = 4;
14189    // Total time that was spent performing animations.
14190    // This is derived from the present-to-present layer histogram.
14191    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
14192    // using render_rate_bucket as a dimension.
14193    optional int64 animation_millis = 5;
14194    // Total number of event connections tracked by SurfaceFlinger at the time
14195    // of this pull. If this number grows prohibitively large, then this can
14196    // cause jank due to resource contention.
14197    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
14198    // using render_rate_bucket as a dimension.
14199    optional int32 event_connection_count = 6;
14200    // Set of timings measured from when SurfaceFlinger began compositing a
14201    // frame, until the frame was requested to be presented to the display. This
14202    // measures SurfaceFlinger's total CPU walltime on the critical path per
14203    // frame.
14204    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
14205    // using render_rate_bucket as a dimension.
14206    optional FrameTimingHistogram frame_duration = 7
14207        [(android.os.statsd.log_mode) = MODE_BYTES];
14208    // Set of timings measured from when SurfaceFlinger first began using the
14209    // GPU to composite a frame, until the GPU has finished compositing that
14210    // frame. This measures the total additional time SurfaceFlinger needed to
14211    // perform due to falling back into GPU composition.
14212    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
14213    // using render_rate_bucket as a dimension.
14214    optional FrameTimingHistogram render_engine_timing = 8
14215        [(android.os.statsd.log_mode) = MODE_BYTES];
14216    // Number of frames where SF saw a frame, based on its frame timeline.
14217    // Frame timelines may include transactions without updating buffer contents.
14218    // Introduced in Android 12.
14219    optional int32 total_timeline_frames = 9;
14220    // Number of frames where SF saw a janky frame.
14221    // Introduced in Android 12.
14222    optional int32 total_janky_frames = 10;
14223    // Number of janky frames where SF spent a long time on the CPU.
14224    // Introduced in Android 12.
14225    optional int32 total_janky_frames_with_long_cpu = 11;
14226    // Number of janky frames where SF spent a long time on the GPU.
14227    // Introduced in Android 12.
14228    optional int32 total_janky_frames_with_long_gpu = 12;
14229    // Number of janky frames where SF missed the frame deadline, but there
14230    // was not an attributed reason (e.g., maybe HWC missed?)
14231    // Introduced in Android 12.
14232    optional int32 total_janky_frames_sf_unattributed = 13;
14233    // Number of janky frames where the app missed the frame deadline, but
14234    // there was not an attributed reason
14235    // Introduced in Android 12.
14236    optional int32 total_janky_frames_app_unattributed = 14;
14237    // Number of janky frames that were caused because of scheduling errors in
14238    // SF that resulted in early present (e.g., SF sending a buffer to the
14239    // composition engine earlier than expected, resulting in a present that is
14240    // one vsync early)
14241    // Introduced in Android 12.
14242    optional int32 total_janky_frames_sf_scheduling = 15;
14243    // Number of frames that were classified as jank because of possible drift in
14244    // vsync predictions.
14245    // Introduced in Android 12.
14246    optional int32 total_jank_frames_sf_prediction_error = 16;
14247    // Number of janky frames where the app was in a buffer stuffed state (more
14248    // than one buffer ready to be presented at the same vsync). Usually caused
14249    // when the first frame is unusually long, the following frames enter into a
14250    // stuffed state.
14251    // Introduced in Android 12.
14252    optional int32 total_jank_frames_app_buffer_stuffing = 17;
14253    // Buckets of timings in ms by which SurfaceFlinger's deadline was missed
14254    // while latching and presenting frames.
14255    // Introduced in Android 12.
14256    optional FrameTimingHistogram sf_deadline_misses = 19
14257        [(android.os.statsd.log_mode) = MODE_BYTES];
14258    // Buckets of timings in ms by which the Vsync prediction drifted, when
14259    // compared to the actual hardware vsync.
14260    // Introduced in Android 12.
14261    optional FrameTimingHistogram sf_prediction_errors = 20
14262        [(android.os.statsd.log_mode) = MODE_BYTES];
14263
14264    // Next ID: 22
14265}
14266
14267/**
14268 * Per-layer display pipeline metrics reported by SurfaceFlinger.
14269 * Metrics exist beginning in Android 11.
14270 * The number of layers uploaded may be restricted due to size limitations.
14271 * There is a copy of this proto in timestats_atoms.proto in SurfaceFlinger.
14272 * That proto must be updated if this atom is updated.
14273 *
14274 * Pulled from:
14275 *    frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
14276 */
14277message SurfaceflingerStatsLayerInfo {
14278    // UID of the application who submitted this layer for presentation
14279    // This is intended to be used as a dimension for surfacing rendering
14280    // statistics to applications.
14281    // Introduced in Android 12.
14282    optional int32 uid = 12 [(is_uid) = true];
14283    // Refresh rate bucket that the layer was presenting at. Buckets are
14284    // defined in SurfaceFlinger and are tracked per device.
14285    // Introduced in Android 12.
14286    // This is intended to be used as a dimension in collecting per-refresh rate
14287    // jank statistics
14288    optional int32 display_refresh_rate_bucket = 22;
14289    // Render rate bucket that the layer was submitting frames at. Buckets are
14290    // defined in SurfaceFlinger and are tracked per device.
14291    // Introduced in Android 12.
14292    // This is intended to be used as a dimension in collecting per-render rate
14293    // jank statistics.
14294    optional int32 render_rate_bucket = 23;
14295
14296    // Game modes are used only for integrating with GameManager.
14297    enum GameMode {
14298         GAME_MODE_UNSPECIFIED = 0;
14299         GAME_MODE_UNSUPPORTED = 1;
14300         GAME_MODE_STANDARD = 2;
14301         GAME_MODE_PERFORMANCE = 3;
14302         GAME_MODE_BATTERY = 4;
14303         GAME_MODE_CUSTOM = 5;
14304    }
14305
14306    // Game mode that the layer was running at. Used to track user engagement
14307    // in different modes. The modes are defined in GameManager.java
14308    // All non-game layers will have this field set to UNSUPPORTED.
14309    // Introduced in Android 12
14310    // This is intended to be used as a dimension in collecting per-game mode
14311    // fps and frame related metrics.
14312    optional GameMode game_mode = 26;
14313    // The layer for this set of metrics
14314    // In many scenarios the package name is included in the layer name, e.g.,
14315    // layers created by Window Manager. But this is not a guarantee - in the
14316    // general case layer names are arbitrary debug names.
14317    optional string layer_name = 1;
14318    // Total number of frames presented
14319    optional int64 total_frames = 2;
14320    // Total number of dropped frames while latching a buffer for this layer.
14321    optional int64 dropped_frames = 3;
14322    // Set of timings measured between successive presentation timestamps.
14323    optional FrameTimingHistogram present_to_present = 4
14324        [(android.os.statsd.log_mode) = MODE_BYTES];
14325    // Variability histogram of present_to_present timings.
14326    optional FrameTimingHistogram present_to_present_delta = 27
14327        [(android.os.statsd.log_mode) = MODE_BYTES];
14328    // Set of timings measured from when an app queued a buffer for
14329    // presentation, until the buffer was actually presented to the
14330    // display.
14331    optional FrameTimingHistogram post_to_present = 5
14332        [(android.os.statsd.log_mode) = MODE_BYTES];
14333    // Set of timings measured from when a buffer is ready to be presented,
14334    // until the buffer was actually presented to the display.
14335    optional FrameTimingHistogram acquire_to_present = 6
14336        [(android.os.statsd.log_mode) = MODE_BYTES];
14337    // Set of timings measured from when a buffer was latched by
14338    // SurfaceFlinger, until the buffer was presented to the display
14339    optional FrameTimingHistogram latch_to_present = 7
14340        [(android.os.statsd.log_mode) = MODE_BYTES];
14341    // Set of timings measured from the desired presentation to the actual
14342    // presentation time
14343    optional FrameTimingHistogram desired_to_present = 8
14344        [(android.os.statsd.log_mode) = MODE_BYTES];
14345    // Set of timings measured from when an app queued a buffer for
14346    // presentation, until the buffer was ready to be presented.
14347    optional FrameTimingHistogram post_to_acquire = 9
14348        [(android.os.statsd.log_mode) = MODE_BYTES];
14349    // Frames missed latch because the acquire fence didn't fire
14350    optional int64 late_acquire_frames = 10;
14351    // Frames latched early because the desired present time was bad
14352    optional int64 bad_desired_present_frames = 11;
14353    // Number of frames where SF saw a frame, based on its frame timeline.
14354    // Frame timelines may include transactions without updating buffer contents.
14355    // Introduced in Android 12.
14356    optional int32 total_timeline_frames = 13;
14357    // Number of frames where SF saw a janky frame.
14358    // Introduced in Android 12.
14359    optional int32 total_janky_frames = 14;
14360    // Number of janky frames where SF spent a long time on the CPU.
14361    // Introduced in Android 12.
14362    optional int32 total_janky_frames_with_long_cpu = 15;
14363    // Number of janky frames where SF spent a long time on the GPU.
14364    // Introduced in Android 12.
14365    optional int32 total_janky_frames_with_long_gpu = 16;
14366    // Number of janky frames where SF missed the frame deadline, but there
14367    // was not an attributed reason (e.g., maybe HWC missed?)
14368    // Introduced in Android 12.
14369    optional int32 total_janky_frames_sf_unattributed = 17;
14370    // Number of janky frames where the app missed the frame deadline, but
14371    // there was not an attributed reason
14372    // Introduced in Android 12.
14373    optional int32 total_janky_frames_app_unattributed = 18;
14374    // Number of janky frames that were caused because of scheduling errors in
14375    // SF that resulted in early present (e.g., SF sending a buffer to the
14376    // composition engine earlier than expected, resulting in a present that is
14377    // one vsync early)
14378    // Introduced in Android 12.
14379    optional int32 total_janky_frames_sf_scheduling = 19;
14380    // Number of frames that were classified as jank because of possible drift in
14381    // vsync predictions.
14382    // Introduced in Android 12.
14383    optional int32 total_jank_frames_sf_prediction_error = 20;
14384    // Number of janky frames where the app was in a buffer stuffed state (more
14385    // than one buffer ready to be presented at the same vsync). Usually caused
14386    // when the first frame is unusually long, the following frames enter into a
14387    // stuffed state.
14388    // Introduced in Android 12.
14389    optional int32 total_jank_frames_app_buffer_stuffing = 21;
14390
14391    /**
14392     * Encapsulates the FrameRateVote information sent by the application while
14393     * calling setFrameRate.
14394     * Metrics exist beginning in Android 12.
14395     */
14396    message SetFrameRateVote {
14397        // The desired frame rate the application wishes to run on.
14398        optional float frame_rate = 1;
14399
14400        enum FrameRateCompatibility {
14401            FRAME_RATE_UNDEFINED = 0;
14402            FRAME_RATE_DEFAULT = 1;
14403            FRAME_RATE_EXACT_OR_MULTIPLE = 2;
14404        }
14405
14406        // Specifies how to interpret the frame rate associated with the layer.
14407        // Defined in Layer.h
14408        optional FrameRateCompatibility frame_rate_compatibility = 2;
14409
14410        enum Seamlessness {
14411            SEAMLESS_UNDEFINED = 0;
14412            SEAMLESS_SHOULD_BE_SEAMLESS = 1;
14413            SEAMLESS_NOT_REQUIRED = 2;
14414        }
14415        // Indicates whether seamless refresh rate switch is required or not.
14416        optional Seamlessness seamlessness = 3;
14417    }
14418
14419    // The last frame rate vote set by the application.
14420    // Introduced in Android 12.
14421    optional SetFrameRateVote set_frame_rate_vote = 24
14422        [(android.os.statsd.log_mode) = MODE_BYTES];
14423    // Buckets of timings in ms by which the app deadline was missed while
14424    // submitting work for a frame.
14425    // Introduced in Android 12.
14426    optional FrameTimingHistogram app_deadline_misses = 25
14427        [(android.os.statsd.log_mode) = MODE_BYTES];
14428
14429    // Next ID: 28
14430}
14431
14432/**
14433 * Histogram of frame counts bucketed by time in milliseconds.
14434 * Because of size limitations, we hard-cap the number of buckets, with
14435 * buckets for corresponding to larger milliseconds being less precise.
14436 */
14437message FrameTimingHistogram {
14438    // Timings in milliseconds that describes a set of histogram buckets
14439    repeated int32 time_millis_buckets = 1;
14440    // Number of frames that match to each time_millis, i.e. the bucket
14441    // contents
14442    // It's required that len(time_millis) == len(frame_count)
14443    repeated int64 frame_counts = 2;
14444}
14445
14446/**
14447 * Janky event as reported by SurfaceFlinger.
14448 * This event is intended to be consumed by a Perfetto subscriber for
14449 * automated trace collection.
14450 *
14451 * Logged from:
14452 *    frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
14453 */
14454message DisplayJankReported {
14455    // Informational field for how long the janky event lasted in milliseconds
14456    optional int64 event_duration_millis = 1;
14457    // Number of frame deadlines missed, where SurfaceFlinger failed to update
14458    // the display on time.
14459    optional int32 present_deadlines_missed = 2;
14460}
14461
14462message CameraStreamProto {
14463    // The stream width (in pixels)
14464    optional int32 width = 1;
14465    // The stream height (in pixels)
14466    optional int32 height = 2;
14467    // The format of the stream
14468    optional int32 format = 3;
14469    // The dataspace of the stream
14470    optional int32 data_space = 4;
14471    // The usage flag of the stream
14472    optional int64 usage = 5;
14473
14474    // The number of requests for this stream
14475    optional int64 request_count = 6;
14476    // The number of buffer error for this stream
14477    optional int64 error_count = 7;
14478    // The capture latency of first request for this stream
14479    optional int32 first_capture_latency_millis = 8;
14480
14481    // The maximum number of hal buffers
14482    optional int32 max_hal_buffers = 9;
14483    // The maximum number of app buffers
14484    optional int32 max_app_buffers = 10;
14485
14486    // Type of stream histogram
14487    // 1: Capture latency: bin size in milliseconds
14488    enum HistogramType {
14489        UNKNOWN = 0;
14490        CAPTURE_LATENCY = 1;
14491    }
14492    optional HistogramType histogram_type = 11;
14493    // The boundary values between histogram bins
14494    // Expected number of fields: 9
14495    repeated float histogram_bins = 12;
14496    // The frame counts for each histogram bins
14497    // Expected number of fields: 10
14498    repeated int64 histogram_counts = 13;
14499    // The dynamic range profile of the stream
14500    optional int64 dynamic_range_profile = 14;
14501    // The stream use case
14502    optional int64 stream_use_case = 15;
14503    // The color space
14504    optional int32 color_space = 16;
14505}
14506
14507/**
14508 * Information about camera facing and API level usage.
14509 * Logged from:
14510 *   frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
14511 */
14512message CameraActionEvent {
14513    // Camera session duration in milliseconds if action is SESSION.
14514    // 0 if action is OPEN or CLOSE.
14515    optional int64 duration_millis = 1;
14516
14517    // Camera API level used.
14518    // 1 for camera1 API, and 2 for camera2 API.
14519    optional int32 api_level = 2;
14520
14521    // Name of client package
14522    optional string package_name = 3;
14523
14524    // Camera facing
14525    enum Facing {
14526        UNKNOWN = 0;
14527        BACK = 1;
14528        FRONT = 2;
14529        EXTERNAL = 3;
14530    }
14531    optional Facing facing = 4;
14532
14533    // Camera ID
14534    optional string camera_id = 5;
14535
14536    // Camera action type
14537    enum Action {
14538        UNKNOWN_ACTION = 0;
14539        OPEN = 1;
14540        CLOSE = 2;
14541        SESSION = 3;
14542    }
14543    optional Action action = 6;
14544
14545    // Whether the client is accessing camera using ndk
14546    optional bool is_ndk = 7;
14547
14548    // Action OPEN: Open latency
14549    // Action CLOSE: Close latency
14550    // Action SESSION: Camera session creation duration.
14551    //                 If this entry is reusing an existing session, the value is -1.
14552    optional int32 latency_millis = 8;
14553
14554    // session type: 0 for normal mode, 1 for constrained high speed mode
14555    optional int32 operating_mode = 9;
14556
14557    // If actioh is SESSION: number of internal reconfigurations
14558    // Else: 0
14559    optional int32 internal_reconfig = 10;
14560
14561    // Number of requests for this capture session. Only applicable to SESSION
14562    // action.
14563    optional int64 request_count = 11;
14564    // Number of result errors. Only applicable to SESSION action.
14565    optional int64 result_error_count = 12;
14566    // Whether the device runs into error state.
14567    optional bool device_error = 13;
14568
14569    // If action is SESSION: Stream states
14570    // Else: stream_count = 0
14571    optional int32 stream_count = 14;
14572    optional CameraStreamProto stream_1 = 15 [(log_mode) = MODE_BYTES];
14573    optional CameraStreamProto stream_2 = 16 [(log_mode) = MODE_BYTES];
14574    optional CameraStreamProto stream_3 = 17 [(log_mode) = MODE_BYTES];
14575    optional CameraStreamProto stream_4 = 18 [(log_mode) = MODE_BYTES];
14576    optional CameraStreamProto stream_5 = 19 [(log_mode) = MODE_BYTES];
14577
14578    // User tag string for this session
14579    optional string user_tag = 20;
14580
14581    // Video stabilization mode
14582    // Original type: uint8_t
14583    optional int32 video_stabilization_mode = 21 [default = -1];
14584
14585    // Identifier to correlate different Action events to each other
14586    // Not unique. Must be used with build fingerprint to generate a
14587    // good enough identifier.
14588    optional int64 log_id = 22;
14589
14590    // 0 for OPEN and CLOSE
14591    // ordinal of the SESSION between OPEN and CLOSE
14592    optional int32 session_idx = 23;
14593
14594    // Start: Extension metrics.
14595    // These will only be set for SESSION which use camera2 extensions
14596
14597    // Should match CameraExtensionCharacteristics#EXTENSION_*
14598    enum ExtensionSessionType {
14599        EXTENSION_NONE = -1;
14600        EXTENSION_AUTOMATIC = 0;
14601        EXTENSION_FACE_RETOUCH = 1;
14602        EXTENSION_BOKEH = 2;
14603        EXTENSION_HDR = 3;
14604        EXTENSION_NIGHT = 4;
14605
14606    }
14607
14608    // Type of camera extension being used
14609    optional ExtensionSessionType ext_type = 24 [default = EXTENSION_NONE];
14610
14611    // Whether advanced extensions session is being used
14612    optional bool ext_is_advanced = 25;
14613    // End: Extension Metrics
14614
14615    optional bool used_ultrawide = 26;
14616
14617    optional bool used_zoom_override = 27;
14618
14619    optional int32 most_requested_fps_range_min = 28;
14620    optional int32 most_requested_fps_range_max = 29;
14621
14622    // Extension metric
14623    optional int32 ext_capture_format = 30;
14624}
14625
14626/**
14627 * Logs when a compatibility change is affecting an app.
14628 *
14629 * Logged from:
14630 *   frameworks/base/core/java/android/app/AppCompatCallbacks.java and
14631 *   frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
14632 */
14633message AppCompatibilityChangeReported {
14634    // The UID of the app being affected by the compatibilty change.
14635    optional int32 uid = 1 [(is_uid) = true];
14636
14637    // The ID of the change affecting the app.
14638    optional int64 change_id = 2;
14639
14640    enum State {
14641        UNKNOWN_STATE = 0;
14642        ENABLED = 1;
14643        DISABLED = 2;
14644        LOGGED = 3;
14645    }
14646
14647    // The state of the change - if logged from gating whether it was enabled or disabled, or just
14648    // logged otherwise.
14649    optional State state = 3;
14650
14651    enum Source {
14652        UNKNOWN_SOURCE = 0;
14653        APP_PROCESS = 1;
14654        SYSTEM_SERVER = 2;
14655    }
14656
14657    // Where it was logged from.
14658    optional Source source = 4;
14659
14660}
14661
14662/**
14663 * Logged from
14664 *     external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
14665 *     external/perfetto/src/tracing/service/tracing_service_impl.cc
14666 */
14667message PerfettoUploaded {
14668    // TODO(lalitm): many of the atoms below should be renamed to have a
14669    // "PERFETTO_CMD" prefix to make clear they are specific to perfetto_cmd.
14670    // This state exists because of legacy reasons (i.e. these values existed
14671    // before go/perfetto-monitoring was a thing).
14672    // Next id: 60.
14673    enum Event {
14674        PERFETTO_UNDEFINED = 0;
14675
14676        // Checkpoints inside perfetto_cmd before tracing is finished.
14677        PERFETTO_TRACE_BEGIN = 1;
14678        PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
14679        PERFETTO_CMD_CLONE_TRACE_BEGIN = 55;
14680        PERFETTO_CMD_CLONE_TRIGGER_TRACE_BEGIN = 56;
14681        PERFETTO_ON_CONNECT = 3;
14682        PERFETTO_CMD_ON_SESSION_CLONE = 58;
14683        PERFETTO_CMD_ON_TRIGGER_CLONE = 59;
14684
14685        // Guardrails inside perfetto_cmd before tracing is finished.
14686        PERFETTO_ON_TIMEOUT = 16;
14687        PERFETTO_CMD_USER_BUILD_TRACING_NOT_ALLOWED = 43;
14688
14689        // Checkpoints inside traced.
14690        PERFETTO_TRACED_ENABLE_TRACING = 37;
14691        PERFETTO_TRACED_START_TRACING = 38;
14692        PERFETTO_TRACED_DISABLE_TRACING = 39;
14693        PERFETTO_TRACED_NOTIFY_TRACING_DISABLED = 40;
14694
14695        // Trigger checkpoints inside traced.
14696        // These atoms are special because, along with the UUID,
14697        // they log the trigger name.
14698        PERFETTO_TRACED_TRIGGER_START_TRACING = 41;
14699        PERFETTO_TRACED_TRIGGER_STOP_TRACING = 42;
14700        PERFETTO_TRACED_TRIGGER_CLONE_SNAPSHOT = 53;
14701
14702        // Guardrails inside traced.
14703        PERFETTO_TRACED_ENABLE_TRACING_EXISTING_TRACE_SESSION = 18;
14704        PERFETTO_TRACED_ENABLE_TRACING_TOO_LONG_TRACE = 19;
14705        PERFETTO_TRACED_ENABLE_TRACING_INVALID_TRIGGER_TIMEOUT = 20;
14706        PERFETTO_TRACED_ENABLE_TRACING_DURATION_WITH_TRIGGER = 21;
14707        PERFETTO_TRACED_ENABLE_TRACING_STOP_TRACING_WRITE_INTO_FILE = 22;
14708        PERFETTO_TRACED_ENABLE_TRACING_DUPLICATE_TRIGGER_NAME = 23;
14709        PERFETTO_TRACED_ENABLE_TRACING_INVALID_DEFERRED_START = 24;
14710        PERFETTO_TRACED_ENABLE_TRACING_INVALID_BUFFER_SIZE = 25;
14711        PERFETTO_TRACED_ENABLE_TRACING_BUFFER_SIZE_TOO_LARGE = 26;
14712        PERFETTO_TRACED_ENABLE_TRACING_TOO_MANY_BUFFERS = 27;
14713        PERFETTO_TRACED_ENABLE_TRACING_DUPLICATE_SESSION_NAME = 28;
14714        PERFETTO_TRACED_ENABLE_TRACING_SESSION_NAME_TOO_RECENT = 29;
14715        PERFETTO_TRACED_ENABLE_TRACING_TOO_MANY_SESSIONS_FOR_UID = 30;
14716        PERFETTO_TRACED_ENABLE_TRACING_TOO_MANY_CONCURRENT_SESSIONS = 31;
14717        PERFETTO_TRACED_ENABLE_TRACING_INVALID_FD_OUTPUT_FILE = 32;
14718        PERFETTO_TRACED_ENABLE_TRACING_FAILED_TO_CREATE_FILE = 33;
14719        PERFETTO_TRACED_ENABLE_TRACING_OOM = 34;
14720        PERFETTO_TRACED_ENABLE_TRACING_UNKNOWN_ERROR = 35;
14721        PERFETTO_TRACED_START_TRACING_INVALID_SESSION_STATE = 36;
14722        PERFETTO_TRACED_ENABLE_TRACING_INVALID_FILTER = 47;
14723        PERFETTO_TRACED_ENABLE_TRACING_OOB_TARGET_BUFFER = 48;
14724        PERFETTO_TRACED_ENABLE_TRACING_INVALID_TRIGGER_MODE = 52;
14725        PERFETTO_TRACED_ENABLE_TRACING_INVALID_BR_FILENAME = 54;
14726        PERFETTO_TRACED_ENABLE_TRACING_FAILED_SESSION_SEMAPHORE_CHECK = 57;
14727
14728        // Checkpoints inside perfetto_cmd after tracing has finished.
14729        PERFETTO_ON_TRACING_DISABLED = 4;
14730        PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
14731        PERFETTO_CMD_FW_REPORT_BEGIN = 49;
14732        // Will be removed once incidentd is no longer used.
14733        PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
14734
14735        // Guardrails inside perfetto_cmd after tracing has finished.
14736        PERFETTO_CMD_FW_REPORT_EMPTY_TRACE = 50;
14737        // Will be removed once incidentd is no longer used.
14738        PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
14739        PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
14740
14741        // "Successful" terminal states inside perfetto_cmd.
14742        PERFETTO_CMD_FW_REPORT_HANDOFF = 51;
14743
14744        // Deprecated as "success" is misleading; it simply means we were
14745        // able to communicate with incidentd. Will be removed once
14746        // incidentd is no longer used.
14747        PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9 [deprecated = true];
14748
14749        // Contained trigger begin/success/failure. Replaced by
14750        // |PerfettoTriggerAtom| to allow aggregation using a count metric
14751        // and reduce spam.
14752        reserved 12, 13, 14;
14753
14754        // Contained that a guardrail in perfetto_cmd was hit. Replaced with
14755        // kCmd* guardrails.
14756        reserved 15;
14757
14758        // Contained status of Dropbox uploads. Removed as Perfetto no
14759        // longer supports uploading traces using Dropbox.
14760        reserved 5, 6, 7;
14761
14762        // Contained status of guardrail state initialization and upload limit
14763        // in perfetto_cmd. Removed as perfetto no longer manages stateful
14764        // guardrails
14765        reserved 44, 45, 46;
14766    }
14767
14768    // Which stage of the pipeline we are reporting from.
14769    optional Event event = 1;
14770
14771    // UUID matching the one set inside the SystemInfo trace packet.
14772    optional int64 trace_uuid_lsb = 2;
14773    optional int64 trace_uuid_msb = 3;
14774
14775    // For trigger checkpoints inside traced, contains the trigger name
14776    // associated with this trace UUID.
14777    optional string trigger_name = 4;
14778}
14779
14780/**
14781 * Logged from
14782 *     external/perfetto/src/tracing/service/tracing_service_impl.cc
14783 */
14784message PerfettoTrigger {
14785    enum Event {
14786        PERFETTO_UNDEFINED = 0;
14787
14788        PERFETTO_TRACED_LIMIT_PROBABILITY = 5;
14789        PERFETTO_TRACED_LIMIT_MAX_PER_24_H = 6;
14790
14791        PERFETTO_TRACED_TRIGGER = 9;
14792
14793        // Contained events of logging triggers through perfetto_cmd, probes and
14794        // trigger_perfetto. Obsolete because of logging dirctly in traced instead.
14795        // Removed in W (Oct 2024) and replaced by |kTracedTrigger|.
14796        PERFETTO_CMD_TRIGGER = 1 [deprecated = true];
14797        PERFETTO_CMD_TRIGGER_FAIL = 2 [deprecated = true];
14798
14799        PERFETTO_TRIGGER_PERFETTO_TRIGGER = 3 [deprecated = true];
14800        PERFETTO_TRIGGER_PERFETTO_TRIGGER_FAIL = 4 [deprecated = true];
14801
14802        PERFETTO_PROBES_PRODUCER_TRIGGER = 7 [deprecated = true];
14803        PERFETTO_PROBES_PRODUCER_TRIGGER_FAIL = 8 [deprecated = true];
14804    }
14805
14806    // The event which fired.
14807    optional Event event = 1;
14808
14809    // The name of the trigger which fired.
14810    optional string trigger_name = 2;
14811}
14812
14813/**
14814 * Pulls client metrics on data transferred via Vehicle Maps Service.
14815 * Metrics are keyed by uid + layer.
14816 *
14817 * Pulled from:
14818 *   packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
14819 */
14820message VmsClientStats {
14821    // UID of the VMS client app
14822    optional int32 uid = 1 [(is_uid) = true];
14823
14824    // VMS layer definition
14825    optional int32 layer_type = 2;
14826    optional int32 layer_channel = 3;
14827    optional int32 layer_version = 4;
14828
14829    // Bytes and packets sent by the client for the layer
14830    optional int64 tx_bytes = 5;
14831    optional int64 tx_packets = 6;
14832
14833    // Bytes and packets received by the client for the layer
14834    optional int64 rx_bytes = 7;
14835    optional int64 rx_packets = 8;
14836
14837    // Bytes and packets dropped due to client error
14838    optional int64 dropped_bytes = 9;
14839    optional int64 dropped_packets = 10;
14840}
14841
14842/**
14843 * State of a all permission requested by a package - sampled
14844 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
14845*/
14846message DangerousPermissionStateSampled {
14847    // Name of the permission
14848    optional string permission_name = 1;
14849
14850    // Uid of the package
14851    optional int32 uid = 2 [(is_uid) = true];
14852
14853    // If the permission is granted to the uid
14854    optional bool is_granted = 3;
14855
14856    // Permission flags as per android.content.pm.PermissionFlags
14857    optional int32 permission_flags = 4;
14858
14859    // Permission protection flags as per android.content.pm.PermissionInfo.ProtectionFlags
14860    optional int32 protection_flags = 5;
14861}
14862
14863/**
14864 * HWUI stats for a given app.
14865 */
14866message GraphicsStats {
14867    // The package name of the app
14868    optional string package_name = 1;
14869
14870    // The version code of the app
14871    optional int64 version_code = 2;
14872
14873    // The uid of the app
14874    optional int32 uid = 17 [(is_uid) = true];
14875
14876    // The start & end timestamps in UTC as
14877    // milliseconds since January 1, 1970
14878    // Compatible with java.util.Date#setTime()
14879    optional int64 start_millis = 3;
14880
14881    optional int64 end_millis = 4;
14882
14883    // HWUI renders pipeline type: GL (1) or Vulkan (2).
14884    enum PipelineType {
14885        UNKNOWN = 0;
14886        GL = 1;
14887        VULKAN = 2;
14888    }
14889
14890    // HWUI renders pipeline type: GL or Vulkan.
14891    optional PipelineType pipeline = 5;
14892
14893    // Distinct frame count.
14894    optional int32 total_frames = 6;
14895
14896    // Number of "missed vsync" events.
14897    optional int32 missed_vsync_count = 7;
14898
14899    // Number of frames in triple-buffering scenario (high input latency)
14900    optional int32 high_input_latency_count = 8;
14901
14902    // Number of "slow UI thread" events.
14903    optional int32 slow_ui_thread_count = 9;
14904
14905    // Number of "slow bitmap upload" events.
14906    optional int32 slow_bitmap_upload_count = 10;
14907
14908    // Number of "slow draw" events.
14909    optional int32 slow_draw_count = 11;
14910
14911    // Number of frames that missed their deadline (aka, visibly janked)
14912    optional int32 missed_deadline_count = 12;
14913
14914    // The frame time histogram for the package
14915    optional FrameTimingHistogram cpu_histogram = 13
14916    [(android.os.statsd.log_mode) = MODE_BYTES];
14917
14918    // The gpu frame time histogram for the package
14919    optional FrameTimingHistogram gpu_histogram = 14
14920    [(android.os.statsd.log_mode) = MODE_BYTES];
14921
14922    // UI mainline module version.
14923    optional int64 version_ui_module = 15;
14924
14925    // If true, these are HWUI stats for up to a 24h period for a given app from today.
14926    // If false, these are HWUI stats for a 24h period for a given app from the last complete
14927    // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
14928    // more apps are running / rendering.
14929    optional bool is_today = 16;
14930
14931    // next id = 18
14932}
14933
14934/**
14935 * Message related to dangerous (runtime) app ops access
14936 */
14937message RuntimeAppOpAccess {
14938    // Uid of the package accessing app op
14939    optional int32 uid = 1 [(is_uid) = true];
14940
14941    // Name of the package accessing app op
14942    optional string package_name = 2;
14943
14944    // deprecated - set to empty string
14945    optional string op_deprecated = 3 [deprecated = true];
14946
14947    // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
14948    // API. Attributions must be provided through manifest using <attribution> tag available in R
14949    // and above.
14950    optional string attribution_tag = 4;
14951
14952    // message related to app op access, limited to 600 chars by API
14953    optional string message = 5;
14954
14955    enum SamplingStrategy {
14956        DEFAULT = 0;
14957        UNIFORM = 1;
14958        RARELY_USED = 2;
14959        BOOT_TIME_SAMPLING = 3;
14960        UNIFORM_OPS = 4;
14961    }
14962
14963    // sampling strategy used to collect this message
14964    optional SamplingStrategy sampling_strategy = 6;
14965
14966    // operation id
14967    optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
14968}
14969
14970/*
14971 * Logs userspace reboot outcome and duration.
14972 *
14973 * Logged from:
14974 *   frameworks/base/core/java/com/android/server/BootReceiver.java
14975 */
14976message UserspaceRebootReported {
14977    // Possible outcomes of userspace reboot.
14978    enum Outcome {
14979        // Default value in case platform failed to determine the outcome.
14980        OUTCOME_UNKNOWN = 0;
14981        // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
14982        SUCCESS = 1;
14983        // Userspace reboot shutdown sequence was aborted.
14984        FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
14985        // Remounting userdata into checkpointing mode failed.
14986        FAILED_USERDATA_REMOUNT = 3;
14987        // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
14988        // reboot.
14989        FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
14990    }
14991    // Outcome of userspace reboot. Always set.
14992    optional Outcome outcome = 1;
14993    // Duration of userspace reboot in case it has a successful outcome.
14994    // Duration is measured as time between userspace reboot was initiated and until boot completed
14995    // (e.g. sys.boot_completed=1).
14996    optional int64 duration_millis = 2;
14997    // State of primary user's (user0) credential encryption storage.
14998    enum UserEncryptionState {
14999        // Default value.
15000        USER_ENCRYPTION_STATE_UNKNOWN = 0;
15001        // Credential encrypted storage is unlocked.
15002        UNLOCKED = 1;
15003        // Credential encrypted storage is locked.
15004        LOCKED = 2;
15005    }
15006    // State of primary user's encryption storage at the moment boot completed. Always set.
15007    optional UserEncryptionState user_encryption_state = 3;
15008}
15009
15010/*
15011 * Logs integrity check information during each install.
15012 *
15013 * Logged from:
15014 *   frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
15015 */
15016message IntegrityCheckResultReported {
15017    optional string package_name = 1;
15018    optional string app_certificate_hash = 2;
15019    optional int64 version_code = 3;
15020    optional string installer_package_name = 4;
15021    enum Response {
15022        UNKNOWN = 0;
15023        ALLOWED = 1;
15024        REJECTED = 2;
15025        FORCE_ALLOWED = 3;
15026    }
15027    optional Response response = 5;
15028    // An estimate on the cause of the response. This will only be populated for
15029    // REJECTED and FORCE_ALLOWED
15030    optional bool caused_by_app_cert_rule = 6;
15031    optional bool caused_by_installer_rule = 7;
15032}
15033
15034/**
15035 * Logs the information about the rules and the provider whenever rules are
15036 * pushed into AppIntegrityManager.
15037 *
15038 * Logged from:
15039 *   frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
15040 */
15041message IntegrityRulesPushed {
15042    optional bool success = 1;
15043    // Package name of the app that pushed the rules.
15044    optional string rule_provider = 2;
15045    // Version string of arbitrary format provided by the rule provider to
15046    // identify the rules.
15047    optional string rule_version = 3;
15048}
15049
15050/**
15051 * Logs when a cell broadcast message is received on the device.
15052 *
15053 * Logged from Cell Broadcast module and platform:
15054 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
15055 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
15056 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
15057 */
15058message CellBroadcastMessageReported {
15059    // The type of Cell Broadcast message
15060    enum CbType {
15061        UNKNOWN_TYPE = 0;
15062        GSM = 1;
15063        CDMA = 2;
15064        CDMA_SPC = 3;
15065    }
15066
15067    // The parts of the cell broadcast message pipeline
15068    enum ReportSource {
15069        UNKNOWN_SOURCE = 0;
15070        FRAMEWORK = 1;
15071        CB_SERVICE = 2;
15072        CB_RECEIVER_APP = 3;
15073    }
15074
15075    // GSM, CDMA, CDMA-SCP
15076    optional CbType type = 1;
15077    // The source of the report
15078    optional ReportSource source = 2;
15079    // The Message Identifier, as defined in 3GPP 23.041 clause 9.4.1.2.1
15080    optional int32 serial_number = 3 [ deprecated = true ];
15081    // The Message Identifier, as defined in 3GPP 23.041 clause 9.4.1.2.2
15082    optional int32 message_id = 4;
15083    // The roaming case will show mcc value, if not empty string
15084    optional string roaming_mcc_mnc = 5;
15085    // The language indicator, as defined in ISO 639 language codes set 1
15086    optional string language_indicator = 6;
15087}
15088
15089/**
15090 * Logs when a cell broadcast message is filtered out,
15091 * or otherwise intentionally not sent to CBR, or not shown to users for reason
15092 *
15093 * Logged from Cell Broadcast module:
15094 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
15095 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
15096 */
15097message CellBroadcastMessageFiltered {
15098    enum FilterReason {
15099        // shown message to the user
15100        NOT_FILTERED = 0;
15101        // filtered message due to duplication (message body, service category, cross sim)
15102        DUPLICATE_MESSAGE = 1;
15103        // filtered message due to outside of coordinate range
15104        GEOFENCED_MESSAGE = 2;
15105        // filtered message due to not using for emergency alert but for update cell information on Setting Menu
15106        AREA_INFO_MESSAGE = 3;
15107        // filtered message due to OEM set config value ‘filtered message for duplication’ as ‘true’
15108        DISABLED_BY_OEM = 4;
15109        // when in ECBM(Emergency CallBack Mode) status
15110        NOTSHOW_ECBM = 5;
15111        // when user turn off preference of channel
15112        NOTSHOW_USER_PREF = 6;
15113        // when Empty content or Unsupported charset
15114        NOTSHOW_EMPTY_BODY = 7;
15115        // when language code in message is not same with preference of second language
15116        NOTSHOW_MISMATCH_PREF_SECOND_LANG = 8;
15117        // when user turn off preference of second language
15118        NOTSHOW_PREF_SECONDLANG_OFF = 9;
15119        // when language code in message is not same with device language setting
15120        NOTSHOW_MISMATCH_DEVICE_LANG_SETTING = 10;
15121        // when channel has feature ‘testing_mode = true’ and device is not in cb test_mode
15122        NOTSHOW_MESSAGE_FOR_TESTMODE = 11;
15123        // when the message contains ‘filter’ string from properties
15124        NOTSHOW_FILTER_STRING = 12;
15125    }
15126
15127    // GSM, CDMA, CDMA-SCP
15128    optional CellBroadcastMessageReported.CbType type = 1;
15129    // The source of the report
15130    optional FilterReason filter = 2;
15131    // The Message Identifier, as defined in 3GPP 23.041 clause 9.4.1.2.1
15132    optional int32 serial_number = 3 [ deprecated = true ];
15133    // The Message Identifier, as defined in 3GPP 23.041 clause 9.4.1.2.2
15134    optional int32 message_id = 4;
15135}
15136
15137/**
15138 * Logs when an error occurs while handling a cell broadcast message;
15139 *
15140 * Logged from CellBroadcastService module:
15141 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
15142 */
15143message CellBroadcastMessageError {
15144    // The type of error raised when trying to handle a cell broadcast message
15145    enum ErrorType {
15146        UNKNOWN_TYPE = 0;
15147        CDMA_DECODING_ERROR = 1;
15148        CDMA_SCP_EMPTY = 2;
15149        CDMA_SCP_HANDLING_ERROR = 3;
15150        GSM_INVALID_HEADER_LENGTH = 4;
15151        GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
15152        GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
15153        GSM_INVALID_PDU = 7;
15154        GSM_INVALID_GEO_FENCING_DATA = 8;
15155        GSM_UMTS_INVALID_WAC = 9;
15156        FAILED_TO_INSERT_TO_DB = 10;
15157        UNEXPECTED_GEOMETRY_FROM_FWK = 11;
15158        UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
15159        UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
15160        UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
15161        NO_CONNECTION_TO_CB_SERVICE = 15;
15162    }
15163
15164    // What kind of error occurred
15165    optional ErrorType type = 1;
15166    // Exception message (or log message) associated with the error (max 1000 chars)
15167    optional string exception_message = 2;
15168}
15169
15170/**
15171 * CellBroadcast channel range
15172 * Refer from CellBroadcastConfigUpdated, CellBroadcastReceiverFeature
15173 * Logged from Cell Broadcast module:
15174 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
15175 */
15176message CellBroadcastChannelRange {
15177    optional int32 start = 1;
15178    optional int32 end = 2;
15179}
15180/**
15181 * CellBroadcast channel ranges
15182 * Nested field for repeated
15183 * Logged from Cell Broadcast module:
15184 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
15185 */
15186message CellBroadcastChannelRanges {
15187    repeated CellBroadcastChannelRange channel_ranges = 1;
15188}
15189
15190/**
15191 * Logs when an channel configuration is updated with mcc-mnc
15192 *
15193 * Logged from Cell Broadcast module:
15194 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
15195 */
15196message CellBroadcastConfigUpdated  {
15197    // mcc_mnc value of Network operator for the roaming case
15198    optional string roaming_mcc_mnc = 1;
15199    // The channel ranges to be updated logged as bytes
15200    optional CellBroadcastChannelRanges channel_ranges = 2 [(log_mode) = MODE_BYTES];
15201}
15202
15203/**
15204 * Logs when a cell broadcast message is activated with the feature below
15205 * or when channel configuration is changed with the feature below
15206 *
15207 * Logged from Cell Broadcast module:
15208 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice
15209 */
15210message CellBroadcastServiceFeatureChanged {
15211    // Not for mainline devices, but for android-go devices, OEM can register package names.
15212    // if there is a data then true otherwise false
15213    optional bool overlay_additional_cbr_packages = 1;
15214    // package name which will get area info message
15215    // if there is a data except “com.android.settings” then true, or false
15216    optional bool overlay_area_info_packages = 2;
15217    // Reset Area Info when device goes out of service
15218    optional bool reset_area_info = 3;
15219}
15220
15221/**
15222 * Logs when a cell broadcast message is activated with the feature below
15223 * or when channel configuration is changed with the feature below
15224 *
15225 * Logged from Cell Broadcast module:
15226 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
15227 */
15228message CellBroadcastReceiverFeatureChanged {
15229    // Whether to enable alert handling during active voice call
15230    optional bool alert_during_call = 1;
15231    // Play alert sound in full volume regardless DND is on
15232    // [none:0][all:Integer.MAX_VALUE][partial:4370 4380 50]
15233    optional CellBroadcastChannelRanges override_dnd = 2 [(log_mode) = MODE_BYTES];
15234    // Whether to Support roaming for attached network operator
15235    optional bool roaming_support = 3;
15236    // Whether to save alerts to sms inbox database
15237    optional bool store_sms = 4;
15238    // whether the device is in test mode through *#*#CMAS#*#*
15239    optional bool testing_mode = 5;
15240    // whether Text To Speech is on/off
15241    optional bool tts_mode = 6;
15242    // whether the device is able to enter test mode even on user build
15243    optional bool testing_mode_on_user_build = 7;
15244}
15245
15246/**
15247 * Logs when exception is occurred in the device
15248 *
15249 * Logged from Cell Broadcast module:
15250 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
15251 *   packages/apps/CellBroadcastReceiver/
15252 */
15253message CellBroadcastModuleErrorReported {
15254    enum ErrorType {
15255        ERROR_UNKNOWN = 0;
15256        ERROR_BAD_CONFIG = 1;
15257        ERROR_DB_MIGRATION = 2;
15258        ERROR_DEFAULT_RES = 3;
15259        ERROR_ENABLE_CHANNEL = 4;
15260        ERROR_GET_LOCATION = 5;
15261        ERROR_MISSING_RES = 6;
15262        ERROR_PLAY_FLASH = 7;
15263        ERROR_PLAY_SOUND = 8;
15264        ERROR_PLAY_TTS = 9;
15265        ERROR_PREF_MIGRATION = 10;
15266        ERROR_PROVIDER_INIT = 11;
15267        ERROR_RESET_CHANNEL_R = 12;
15268        ERROR_STATUS_BAR = 13;
15269        ERROR_REMINDER_INTERVAL = 14;
15270        ERROR_ICON_RESOURCE = 15;
15271        ERROR_CHANNEL_RANGE_PARSE = 16;
15272        ERROR_DB_INIT = 17;
15273        ERROR_NOT_FOUND_DEFAULT_CBR_PKGS = 18;
15274        ERROR_FOUND_MULTIPLE_CBR_PKGS = 19;
15275    }
15276
15277    // The source of the report
15278    optional CellBroadcastMessageReported.ReportSource source = 1;
15279
15280    // The error type
15281    optional ErrorType type = 2;
15282}
15283
15284/**
15285 * Logs when a TV Input Service Session changes tune state
15286 * This is atom ID 327.
15287 *
15288 * Logged from:
15289 *   frameworks/base/services/core/java/com/android/server/tv/TvInputManagerService.java
15290 */
15291message TifTuneStateChanged {
15292
15293    // Tv Input Service uid, TV Player uid
15294    repeated AttributionNode attribution_node = 1 [
15295        (state_field_option).primary_field_first_uid = true
15296    ];
15297    optional android.stats.tv.TifTuneState state = 2 [
15298        (state_field_option).exclusive_state = true,
15299        (state_field_option).default_state_value = 0,
15300        (state_field_option).nested = false
15301    ];
15302    // This a globally unique 128 bit random number created by TvInputManagerService when
15303    // android.media.tv.TvInputManager#createSession is called.
15304    // It is has no device or user association.
15305    // See android.media.tv.TvInputService.onCreateSession(java.lang.String, java.lang.String)
15306    // WARNING: Any changes to this field should be carefully reviewed for privacy.
15307    //          Inspect the code at
15308    //          framework/base/cmds/statsd/src/atoms.proto
15309    //               TifTuneState
15310    //          frameworks/base/services/core/java/com/android/server/tv/TvInputManagerService.java
15311    //              logTuneStateChanged
15312    //              BinderService.createSession
15313    //              SessionState.sessionId
15314    optional string tif_session_id = 3 [(state_field_option).primary_field = true];
15315    optional android.stats.tv.TifInputType type = 4;
15316    // The id of this TV Input, only unique to a given TV Input Service.
15317    // This is specifically NOT android.media.tv.TvInputInfo.getId()
15318    // which is a string that contains the package name of its TvInputService.
15319    optional int32 input_id = 5  [(state_field_option).primary_field = true];
15320    // The HDMI port id
15321    // Only valid when type == HDMI
15322    optional int32 hdmi_port = 6  [(state_field_option).primary_field = true];
15323}
15324
15325/**
15326 * Logs when a tune occurs through device's Frontend.
15327 * This is atom ID 276.
15328 *
15329 * Logged from:
15330 *   frameworks/base/media/java/android/media/tv/tuner/Tuner.java
15331 */
15332message TvTunerStateChanged {
15333    enum State {
15334        UNKNOWN = 0;
15335        TUNING = 1; // Signal is tuned
15336        LOCKED = 2;    // the signal is locked
15337        NOT_LOCKED = 3; // the signal isn’t locked.
15338        SIGNAL_LOST = 4; // the signal was locked, but is lost now.
15339        SCANNING = 5; // the signal is scanned
15340        SCAN_STOPPED = 6; // the scan is stopped.
15341    }
15342    // The uid of the application that sent this custom atom.
15343    optional int32 uid = 1 [(is_uid) = true];
15344    //  new state
15345    optional State state = 2;
15346}
15347
15348/**
15349 * Logs the status of a dvr playback or record.
15350 * This is atom ID 279.
15351 *
15352 * Logged from:
15353 *   frameworks/base/media/java/android/media/tv/tuner/dvr
15354 */
15355message TvTunerDvrStatus {
15356    enum Type {
15357        UNKNOWN_TYPE = 0;
15358        PLAYBACK = 1; // is a playback
15359        RECORD = 2; // is a record
15360    }
15361    enum State {
15362        UNKNOWN_STATE = 0;
15363        STARTED = 1; // DVR is started
15364        STOPPED = 2; // DVR is stopped
15365    }
15366    // The uid of the application that sent this custom atom.
15367    optional int32 uid = 1 [(is_uid) = true];
15368    // DVR type
15369    optional Type type = 2;
15370    //  DVR state
15371    optional State state = 3;
15372    //  Identify the segment of a record or playback
15373    optional int32 segment_id = 4;
15374    // indicate how many overflow or underflow happened between started to stopped
15375    optional int32 overflow_underflow_count = 5;
15376}
15377
15378/**
15379 * Logs when a cas session opened through MediaCas.
15380 * This is atom ID 280.
15381 *
15382 * Logged from:
15383 *   frameworks/base/media/java/android/media/MediaCas.java
15384 */
15385message TvCasSessionOpenStatus {
15386    enum State {
15387        UNKNOWN = 0;
15388        SUCCEEDED = 1; // indicate that the session is opened successfully.
15389        FAILED = 2; // indicate that the session isn’t opened successfully.
15390    }
15391    // The uid of the application that sent this custom atom.
15392    optional int32 uid = 1 [(is_uid) = true];
15393    //  Cas system Id
15394    optional int32 cas_system_id = 2;
15395    // State of the session
15396    optional State state = 3;
15397}
15398
15399/**
15400 * Logs for ContactsProvider general usage.
15401 * This is atom ID 301.
15402 *
15403 * Logged from:
15404 *   packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
15405 */
15406message ContactsProviderStatusReported {
15407    enum ApiType {
15408        UNKNOWN_API = 0;
15409        QUERY = 1;
15410        // INSERT includes insert and bulkInsert, and inserts triggered by applyBatch.
15411        INSERT = 2;
15412        // UPDATE and DELETE includes update/delete and the ones triggered by applyBatch.
15413        UPDATE = 3;
15414        DELETE = 4;
15415        CALL = 5;
15416
15417        // Call from CP2 to a GAL provider.
15418        GAL_CALL = 6;
15419    }
15420
15421    // Method called for ApiType.CALL
15422    enum MethodCall {
15423        UNKNOWN_METHOD = 0;
15424        ADD_SIM_ACCOUNTS = 1;
15425        REMOVE_SIM_ACCOUNTS = 2;
15426        GET_SIM_ACCOUNTS = 3;
15427    }
15428
15429    enum ResultType {
15430        UNKNOWN_RESULT = 0;
15431        SUCCESS = 1;
15432        FAIL = 2;
15433        ILLEGAL_ARGUMENT = 3;
15434        UNSUPPORTED_OPERATION = 4;
15435    }
15436
15437    enum CallerType {
15438        UNSPECIFIED_CALLER_TYPE = 0;
15439        CALLER_IS_SYNC_ADAPTER = 1;
15440        CALLER_IS_NOT_SYNC_ADAPTER = 2;
15441    }
15442
15443    enum TaskType {
15444        UNKNOWN_TASK = 0;
15445        DANGLING_CONTACTS_CLEANUP_TASK = 1;
15446    }
15447
15448    optional ApiType api_type = 1;
15449    // Defined in
15450    // packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
15451    optional int32 uri_type = 2;
15452    optional CallerType caller_type = 3;
15453    optional ResultType result_type = 4;
15454    optional int32 result_count = 5;
15455    optional int64 latency_micros = 6;
15456    optional TaskType task_type = 7;
15457    // Set when api_type == CALL
15458    optional MethodCall method_called = 8;
15459
15460    // Normally, it's the binder calling UID. (this could be CP2, for work profile or cloned
15461    // profile cases.)
15462    // For GAL_CALL, it's the GAL provider UID.
15463    optional int32 uid = 9 [(is_uid) = true];
15464}
15465
15466/**
15467 * Logs when an app is frozen or unfrozen.
15468 *
15469 * Logged from:
15470 *   frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
15471 */
15472message AppFreezeChanged {
15473    // The type of event.
15474    enum Action {
15475        UNKNOWN = 0;
15476        FREEZE_APP = 1;
15477        UNFREEZE_APP = 2;
15478    }
15479    optional Action action = 1;
15480
15481    // Pid of the process being frozen.
15482    optional int32 pid = 2;
15483
15484    // Name of the process being frozen.
15485    optional string process_name = 3;
15486
15487    // Time since last unfrozen.
15488    optional int64 time_unfrozen_millis = 4;
15489
15490    // The list of reason should be kept in sync with @OomAdjReason in OomAdjuster.java.
15491    enum OomAdjReason {
15492        NONE = 0;
15493        ACTIVITY = 1;
15494        FINISH_RECEIVER = 2;
15495        START_RECEIVER = 3;
15496        BIND_SERVICE = 4;
15497        UNBIND_SERVICE = 5;
15498        START_SERVICE = 6;
15499        GET_PROVIDER = 7;
15500        REMOVE_PROVIDER = 8;
15501        UI_VISIBILITY = 9;
15502        ALLOWLIST = 10;
15503        PROCESS_BEGIN = 11;
15504        PROCESS_END = 12;
15505    }
15506
15507    // Deprecated, use unfreeze_reason_v2.
15508    optional OomAdjReason unfreeze_reason = 5 [ deprecated = true ];
15509
15510    // The list of reason should be kept in sync with @UnfreezeReason in CachedAppOptimizer.java.
15511    enum UnfreezeReason {
15512        UFR_NONE = 0;
15513        UFR_ACTIVITY = 1;
15514        UFR_FINISH_RECEIVER = 2;
15515        UFR_START_RECEIVER = 3;
15516        UFR_BIND_SERVICE = 4;
15517        UFR_UNBIND_SERVICE = 5;
15518        UFR_START_SERVICE = 6;
15519        UFR_GET_PROVIDER = 7;
15520        UFR_REMOVE_PROVIDER = 8;
15521        UFR_UI_VISIBILITY = 9;
15522        UFR_ALLOWLIST = 10;
15523        UFR_PROCESS_BEGIN = 11;
15524        UFR_PROCESS_END = 12;
15525        UFR_TRIM_MEMORY = 13;
15526        UFR_PING = 15;
15527        UFR_FILE_LOCKS = 16;
15528        UFR_FILE_LOCK_CHECK_FAILURE = 17;
15529        UFR_BINDER_TXNS = 18;
15530        UFR_FEATURE_FLAGS = 19;
15531        UFR_SHORT_FGS_TIMEOUT = 20;
15532        UFR_SYSTEM_INIT = 21;
15533        UFR_BACKUP = 22;
15534        UFR_SHELL = 23;
15535        UFR_REMOVE_TASK = 24;
15536        UFR_UID_IDLE = 25;
15537        UFR_STOP_SERVICE = 26;
15538        UFR_EXECUTING_SERVICE = 27;
15539        UFR_RESTRICTION_CHANGE = 28;
15540        UFR_COMPONENT_DISABLED = 29;
15541    }
15542
15543    optional UnfreezeReason unfreeze_reason_v2 = 6;
15544}
15545
15546/**
15547 * Pulls information for a single voice call.
15548 *
15549 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
15550 *
15551 * Pulled from:
15552 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15553 */
15554message VoiceCallSession {
15555    // Bearer (IMS or CS) when the call started.
15556    optional android.telephony.CallBearerEnum bearer_at_start = 1;
15557
15558    // Bearer (IMS or CS) when the call ended.
15559    // The bearer may change during the call, e.g. due to SRVCC.
15560    optional android.telephony.CallBearerEnum bearer_at_end = 2;
15561
15562    // Direction of the call (incoming or outgoing).
15563    optional android.telephony.CallDirectionEnum direction = 3;
15564
15565    // Deprecated by setup_duration_millis
15566    optional android.telephony.CallSetupDurationEnum setup_duration = 4 [ deprecated = true ];
15567
15568    // Whether the call ended before the setup was completed.
15569    optional bool setup_failed = 5;
15570
15571    // IMS reason code or CS disconnect cause.
15572    // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
15573    // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
15574    optional int32 disconnect_reason_code = 6;
15575
15576    // IMS extra code or CS precise disconnect cause.
15577    // For IMS, this code is vendor-specific
15578    // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
15579    optional int32 disconnect_extra_code = 7;
15580
15581    // IMS extra message or CS vendor cause.
15582    optional string disconnect_extra_message = 8;
15583
15584    // Radio access technology (RAT) used when call started.
15585    optional android.telephony.NetworkTypeEnum rat_at_start = 9;
15586
15587    // Radio access technology (RAT) used when call terminated.
15588    optional android.telephony.NetworkTypeEnum rat_at_end = 10;
15589
15590    // Number of times RAT changed during the call.
15591    optional int64 rat_switch_count = 11;
15592
15593    // A bitmask of all codecs used during the call.
15594    // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
15595    optional int64 codec_bitmask = 12;
15596
15597    // Number of other calls going on during call setup, for the same SIM slot.
15598    optional int32 concurrent_call_count_at_start = 13;
15599
15600    // Number of other calls going on during call termination, for the same SIM slot.
15601    optional int32 concurrent_call_count_at_end = 14;
15602
15603    // Index of the SIM used, 0 for single-SIM devices.
15604    optional int32 sim_slot_index = 15;
15605
15606    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
15607    optional bool is_multi_sim = 16;
15608
15609    // Whether the call was made with an eSIM profile.
15610    optional bool is_esim = 17;
15611
15612    // Carrier ID of the SIM card.
15613    // See https://source.android.com/devices/tech/config/carrierid.
15614    optional int32 carrier_id = 18;
15615
15616    // Whether an SRVCC has been completed successfully for this call.
15617    optional bool srvcc_completed = 19;
15618
15619    // Number of SRVCC failures.
15620    optional int64 srvcc_failure_count = 20;
15621
15622    // Number of SRVCC cancellations.
15623    optional int64 srvcc_cancellation_count = 21;
15624
15625    // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
15626    // enabled in the dialer's settings).
15627    optional bool rtt_enabled = 22;
15628
15629    // Whether this was an emergency call.
15630    optional bool is_emergency = 23;
15631
15632    // Whether the call was performed while roaming.
15633    optional bool is_roaming = 24;
15634
15635    // A random number used as the dimension field to pull multiple atoms.
15636    optional int32 dimension = 25;
15637
15638    // Signal strength at the end of the call. This value is applicable to both cellular and WiFi.
15639    optional android.telephony.SignalStrengthEnum signal_strength_at_end = 26;
15640
15641    // Band at the end of the call. Value 0 is used if the band is unknown.
15642    // See GeranBands, UtranBands and EutranBands in IRadio interface, depending on the RAT at
15643    // the end of the call.
15644    optional int32 band_at_end = 27;
15645
15646    // Time spent setting up the call in milliseconds.
15647    // The time is measured from dial to ringing for outgoing calls, and from answer to connected
15648    // for incoming calls.
15649    optional int32 setup_duration_millis = 28;
15650
15651    // Main codec quality. The codec quality was equal to or greater than this value for at least
15652    // 70% of the call.
15653    optional android.telephony.CodecQuality main_codec_quality = 29;
15654
15655    // Whether video was enabled at any point during the call.
15656    optional bool video_enabled = 30;
15657
15658    // Radio access technology (RAT) used when call is connected.
15659    optional android.telephony.NetworkTypeEnum rat_at_connected = 31;
15660
15661    // Whether the call was a conference call (applicable only for calls over IMS).
15662    optional bool is_multiparty = 32;
15663
15664    // Duration after the call was connected.
15665    optional android.telephony.CallDuration call_duration = 33;
15666
15667    // Last known Radio access technology (RAT).
15668    optional android.telephony.NetworkTypeEnum last_known_rat = 34;
15669
15670    // Fold state of the device
15671    optional android.telephony.FoldState fold_state = 35;
15672
15673    // Number of times RAT changed after call connection
15674    optional int64 rat_switch_count_after_connected = 36;
15675
15676    // Handover state of the device
15677    optional bool handover_in_progress = 37;
15678
15679    // When the RAT is IWLAN, if it used cross-SIM calling when call started.
15680    optional bool is_iwlan_cross_sim_at_start = 38;
15681
15682    // When the RAT is IWLAN, if it used cross-SIM calling when call ended.
15683    optional bool is_iwlan_cross_sim_at_end = 39;
15684
15685    // When the RAT is IWLAN, if it used cross-SIM calling when call connected.
15686    optional bool is_iwlan_cross_sim_at_connected = 40;
15687
15688    // Whether Vonr is enabled
15689    optional bool vonr_enabled = 41;
15690
15691    // Whether the call is over non-terrestrial networks.
15692    optional bool is_ntn = 42;
15693
15694    // config supports_business_call_composer_bool which controls b2c feature
15695    optional bool supports_business_call_composer = 43;
15696
15697    // The user-set status for enriched calling with call composer
15698    optional android.telephony.CallComposerStatus call_composer_status = 44;
15699
15700    // The call state on call setup
15701    optional android.telephony.CallState call_state_on_setup = 45;
15702
15703}
15704
15705/**
15706 * Pulls voice call radio access technology (RAT) usage.
15707 *
15708 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
15709 * time. The atom will be skipped if not enough data is available.
15710 *
15711 * Pulled from:
15712 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15713 */
15714message VoiceCallRatUsage {
15715    // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
15716    optional int32 carrier_id = 1;
15717
15718    // Radio access technology.
15719    optional android.telephony.NetworkTypeEnum rat = 2;
15720
15721    // Total duration that voice calls spent on this carrier and RAT, rounded to 5 minutes.
15722    optional int64 total_duration_seconds = 3;
15723
15724    // Total number of calls using this carrier and RAT.
15725    // A call is counted once even if it used the RAT multiple times.
15726    optional int64 call_count = 4;
15727}
15728
15729/**
15730 * Pulls amount of time spend in each cellular service state.
15731 *
15732 * Each pull creates multiple atoms, one for each SIM slot/carrier/RAT(including ENDC), the order of
15733 * which is irrelevant to time. If multi SIM settings changes during the period, durations will be
15734 * counted separately before and after the change. Airplane mode does not count towards durations.
15735 *
15736 * Pulled from:
15737 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15738 */
15739message CellularServiceState {
15740    // Radio access technology (RAT) for voice.
15741    // NETWORK_TYPE_UNKNOWN when the device is not in-service.
15742    // NETWORK_TYPE_IWLAN when the device is using VoWiFi.
15743    optional android.telephony.NetworkTypeEnum voice_rat = 1;
15744
15745    // Radio access technology (RAT) for data.
15746    // NETWORK_TYPE_UNKNOWN when the device is not in-service.
15747    // Only cellular RATs are valid and show where the device is camped.
15748    optional android.telephony.NetworkTypeEnum data_rat = 2;
15749
15750    // Whether the device was in roaming (domestic or international) for voice.
15751    optional android.telephony.RoamingTypeEnum voice_roaming_type = 3;
15752
15753    // Whether the device was in roaming (domestic or international) for data.
15754    optional android.telephony.RoamingTypeEnum data_roaming_type = 4;
15755
15756    // Whether the device is on LTE and has access to NR NSA, i.e. cell supports 5G (ENDC) and UE
15757    // registration (attach/TAU) indicates ENDC is not restricted.
15758    optional bool is_endc = 5;
15759
15760    // Index of the SIM used, 0 for single-SIM devices.
15761    optional int32 sim_slot_index = 6;
15762
15763    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
15764    optional bool is_multi_sim = 7;
15765
15766    // Carrier ID of the SIM card.
15767    // See https://source.android.com/devices/tech/config/carrierid.
15768    optional int32 carrier_id = 8;
15769
15770    // Total time spent in this service state, rounded to 5 minutes.
15771    optional int32 total_time_seconds = 9;
15772
15773    // Whether the device is in limited service (only emergency voice
15774    // call available). Voice and data RAT will be recorded as
15775    // NETWORK_TYPE_UNKNOWN in this case.
15776    optional bool is_emergency_only = 10;
15777
15778    // Whether internet pdn is up.
15779    optional bool is_internet_pdn_up = 11;
15780
15781    // Fold state of the device.
15782    optional android.telephony.FoldState fold_state = 12;
15783
15784    // Whether the voice service state is overridden by voice calling capability.
15785    optional bool override_voice_service = 13;
15786
15787    // Whether mobile data is enable.
15788    optional bool is_data_enabled = 14;
15789
15790    // When the voice RAT is NETWORK_TYPE_IWLAN, determines whether it is over
15791    // cross-SIM calling (WiFi calling over other SIM's cellular data).
15792    optional bool is_iwlan_cross_sim = 15;
15793
15794    // Whether the device is using non-terrestrial networks.
15795    optional bool is_ntn = 16;
15796}
15797
15798/**
15799 * Pulls the number of times cellular data service state switches.
15800 *
15801 * Each pull creates multiple atoms, one for each RAT combination, the order of which is irrelevant
15802 * to time. Switches for different SIM slots, carrier IDs, or multi-SIM settings are counted
15803 * separately.
15804 *
15805 * Pulled from:
15806 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15807 */
15808message CellularDataServiceSwitch {
15809    // Cellular RAT of the DATA domain from where the switch occurred.
15810    optional android.telephony.NetworkTypeEnum rat_from = 1;
15811
15812    // Cellular RAT of the DATA domain to where the switch occurred.
15813    optional android.telephony.NetworkTypeEnum rat_to = 2;
15814
15815    // Index of the SIM used, 0 for single-SIM devices.
15816    optional int32 sim_slot_index = 3;
15817
15818    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
15819    optional bool is_multi_sim = 4;
15820
15821    // Carrier ID of the SIM card.
15822    // See https://source.android.com/devices/tech/config/carrierid.
15823    optional int32 carrier_id = 5;
15824
15825    // Number of switches from rat_from to rat_to.
15826    optional int32 switch_count = 6;
15827}
15828
15829/**
15830 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
15831 *
15832 * Pulled from:
15833 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15834 */
15835message SimSlotState {
15836    // Number of active SIM slots (both physical and eSIM profiles) in the device.
15837    optional int32 active_slot_count = 1;
15838
15839    // Number of SIM cards (both physical and active eSIM profiles).
15840    // This number may be greater than the number of active SIM slots, if multiple profiles are
15841    // enabled on the same eUICC.
15842    optional int32 sim_count = 2;
15843
15844    // Number of active eSIM profiles.
15845    // This number is always equal to or less than the number of SIMs.
15846    optional int32 esim_count = 3;
15847
15848    // Number of active eSIM slots in the device.
15849    optional int32 active_esim_slot_count = 4;
15850
15851    // Number of active slots using Multiple Enabled Profiles in the device.
15852    optional int32 active_mep_slot_count = 5;
15853}
15854
15855/**
15856 * Pulls supported cellular radio access technologies.
15857 *
15858 * This atom reports the capabilities of the device, rather than the network it has access to.
15859 *
15860 * Pulled from:
15861 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15862 */
15863message SupportedRadioAccessFamily {
15864    // A bitmask of supported radio technologies.
15865    // See android.telephony.TelephonyManager.NetworkTypeBitMask.
15866    optional int64 network_type_bitmask = 1;
15867}
15868
15869/**
15870 * Pulls the status of device-level telephony properties.
15871 *
15872 * Pulled from:
15873 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15874 */
15875message DeviceTelephonyProperties {
15876    // True if the device adopts the data stack came out in T
15877    // Deprecated since U, where legacy stack has been removed
15878    optional bool using_t_data_stack = 1 [deprecated = true];
15879    // True if auto data switch is enabled on the device
15880    optional bool auto_data_switch_enabled = 2;
15881    // Number of time the user toggled the data switch feature since the last collection
15882    optional int32 auto_data_switch_toggle_count = 3;
15883    // True if work profile is enabled on the device
15884    optional bool has_managed_profile_dedicated_sub = 4;
15885    // Number of SIM slots with support for Multiple Enabled Profiles on the device
15886    optional int32 mep_supported_slot_count = 5;
15887}
15888
15889/**
15890 * This atom is deprecated starting in T, use TelephonyNetworkRequestsV2 instead.
15891 *
15892 * Pulls information about network requests.
15893 *
15894 * Pulled from:
15895 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15896 */
15897message TelephonyNetworkRequests {
15898    // Carrier ID of the SIM card.
15899    // See https://source.android.com/devices/tech/config/carrierid.
15900    optional int32 carrier_id = 1;
15901    // Number of times the enterprise capability was requested.
15902    optional int32 enterprise_request_count = 2;
15903    // Number of times the enterprise capability was released.
15904    optional int32 enterprise_release_count = 3;
15905}
15906
15907/**
15908 * Pulls information about network requests.
15909 *
15910 * Pulled from:
15911 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15912 */
15913message TelephonyNetworkRequestsV2 {
15914    enum NetworkCapability {
15915        // Unknown capability was requested.
15916        UNKNOWN = 0;
15917        // Low latency capability (URLLC) was requested.
15918        PRIORITIZE_LATENCY = 1;
15919        // High bandwidth capability (EMBB) was requested.
15920        PRIORITIZE_BANDWIDTH = 2;
15921        // CBS (Carrier Branded Services) capability was requested.
15922        CBS = 3;
15923        // Enterprise capability was requested.
15924        ENTERPRISE = 4;
15925        //Satellite internet restricted capability was requested.
15926        SATELLITE_INTERNET_RESTRICTED = 5;
15927        //Satellite mms restricted capability was requested.
15928        SATELLITE_MMS_RESTRICTED = 6;
15929        //Satellite ims restricted capability was requested.
15930        SATELLITE_IMS_RESTRICTED = 7;
15931        //Satellite xcap restricted capability was requested.
15932        SATELLITE_XCAP_RESTRICTED = 8;
15933        //Satellite eims restricted capability was requested.
15934        SATELLITE_EIMS_RESTRICTED = 9;
15935        //Satellite supl restricted capability was requested.
15936        SATELLITE_SUPL_RESTRICTED =10;
15937    }
15938    // Carrier ID of the SIM card.
15939    // See https://source.android.com/devices/tech/config/carrierid.
15940    optional int32 carrier_id = 1;
15941    // The capability that was requested.
15942    optional NetworkCapability capability = 2;
15943    // Number of times the capability was requested.
15944    optional int32 request_count = 3;
15945}
15946
15947/**
15948 * Pulls information for a single incoming SMS.
15949 *
15950 * Each pull creates multiple atoms, one for each SMS. The sequence is randomized when pulled.
15951 *
15952 * Pulled from:
15953 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15954 */
15955message IncomingSms {
15956    // Format of the SMS (3GPP or 3GPP2).
15957    optional android.telephony.SmsFormatEnum sms_format = 1;
15958
15959    // Technology of the SMS (CS or IMS).
15960    optional android.telephony.SmsTechEnum sms_tech = 2;
15961
15962    // Radio access technology (RAT) used for the SMS. It can be IWLAN in case of IMS.
15963    optional android.telephony.NetworkTypeEnum rat = 3;
15964
15965    // Type the SMS.
15966    optional android.telephony.SmsTypeEnum sms_type = 4;
15967
15968    // Number of total parts.
15969    optional int32 total_parts = 5;
15970
15971    // Number of received parts (if smaller than total parts, the SMS was dropped).
15972    optional int32 received_parts = 6;
15973
15974    // Indicates if the incoming SMS was blocked.
15975    optional bool blocked = 7;
15976
15977    // Indicate a specific error handling the SMS
15978    optional android.telephony.SmsIncomingErrorEnum error = 8;
15979
15980    // Whether the SMS was received while roaming.
15981    optional bool is_roaming = 9;
15982
15983    // Index of the SIM used, 0 for single-SIM devices.
15984    optional int32 sim_slot_index = 10;
15985
15986    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
15987    optional bool is_multi_sim = 11;
15988
15989    // Whether the message was received with an eSIM profile.
15990    optional bool is_esim = 12;
15991
15992    // Carrier ID of the SIM card used for the SMS.
15993    // See https://source.android.com/devices/tech/config/carrierid.
15994    optional int32 carrier_id = 13;
15995
15996    // Random message ID.
15997    // If the value of count is greater than 1, the message_id represents only one of the messages.
15998    optional int64 message_id = 14;
15999
16000    // Number of messages with the same properties (see message_id for exception)
16001    optional int32 count = 15;
16002
16003    // Whether the message was received with an enterprise profile.
16004    optional bool is_managed_profile = 16;
16005
16006    // Whether the message was received over non-terrestrial networks.
16007    optional bool is_ntn = 17;
16008
16009    // Whether the message is an emergency or not.
16010    optional bool is_emergency = 18;
16011}
16012
16013/**
16014 * Pulls information for a single outgoing SMS.
16015 *
16016 * Each pull creates multiple atoms, one for each SMS. The sequence is randomized when pulled.
16017 *
16018 * Pulled from:
16019 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
16020 */
16021message OutgoingSms {
16022    // Format of the SMS (3GPP or 3GPP2).
16023    optional android.telephony.SmsFormatEnum sms_format = 1;
16024
16025    // Technology of the SMS (CS or IMS).
16026    optional android.telephony.SmsTechEnum sms_tech = 2;
16027
16028    // Radio access technology (RAT) used for the SMS. It can be IWLAN in case of IMS.
16029    optional android.telephony.NetworkTypeEnum rat = 3;
16030
16031    // Result of the SMS sending.
16032    optional android.telephony.SmsSendResultEnum send_result = 4;
16033
16034    // Error code
16035    // For IMS technology, see @SmsManager.Result in
16036    // http://cs/android/frameworks/base/telephony/java/android/telephony/SmsManager.java
16037    // For CS technology:
16038    //  - GSM format: see GsmSmsErrorCode (3GPP 27.005 clause 3.2.5)
16039    //  - CDMA format: see CdmaSmsErrorCode (3GPP2 N.S0005 (IS-41-C) Table 171)
16040    // The field error_code is used for up-to-Android-13 devices. From Android 14,
16041    // network_error_code will be used. The field error_code will be deprecated when most devices
16042    // use Android 14 or higher versions.
16043    optional int32 error_code = 5;
16044
16045    // Whether the SMS was sent while roaming.
16046    optional bool is_roaming = 6;
16047
16048    // Whether the default SMS application generated the SMS (regardless of which application).
16049    optional bool is_from_default_app = 7;
16050
16051    // Index of the SIM used, 0 for single-SIM devices.
16052    optional int32 sim_slot_index = 8;
16053
16054    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
16055    optional bool is_multi_sim = 9;
16056
16057    // Whether the message was sent with an eSIM profile.
16058    optional bool is_esim = 10;
16059
16060    // Carrier ID of the SIM card used for the SMS.
16061    // See https://source.android.com/devices/tech/config/carrierid.
16062    optional int32 carrier_id = 11;
16063
16064    // Random message ID.
16065    // If the value of count is greater than 1, the message_id represents only one of the messages.
16066    optional int64 message_id = 12;
16067
16068    // Retry count: 0 for the first attempt and then increasing for each attempt.
16069    // If the value of count is greater than 1, the retry_id represents the value associated with
16070    // the message defined by message_id.
16071    optional int32 retry_id = 13;
16072
16073    // Time in milliseconds to complete the SMS send to the network.
16074    // If the value of count is greater than 1, this field measures the average time interval.
16075    optional int64 interval_millis = 14;
16076
16077    // Number of messages with the same properties (see message_id, retry_id and latency_millis for
16078    // exceptions)
16079    optional int32 count = 15;
16080
16081    // Internal send error code
16082    optional android.telephony.SmsSendErrorEnum send_error_code = 16;
16083
16084    // Network error code
16085    // - SMS_FORMAT_3GPP format: see GsmSmsErrorCode (3GPP 27.005 clause 3.2.5)
16086    // - SMS_FORMAT_3GPP2 format: see CdmaSmsErrorCode (3GPP2 N.S0005 (IS-41-C) Table 171)
16087    optional int32 network_error_code = 17;
16088
16089    // Whether the message was sent with an enterprise profile.
16090    optional bool is_managed_profile = 18;
16091
16092    // Whether the message is an emergency or not.
16093    optional bool is_emergency = 19;
16094
16095    // Whether the message was sent over non-terrestrial networks.
16096    optional bool is_ntn = 20;
16097}
16098
16099/**
16100 * Logs information about usage of airplane mode.
16101 *
16102 * Logged from:
16103 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/AirplaneModeStats.java
16104 */
16105message AirplaneMode {
16106    // Status of airplane mode
16107    optional bool is_enabled = 1;
16108
16109    // When is_enabled is false, indicates if this was a very short airplane mode toggle
16110    // (i.e. airplane mode was disabled after less than 10 seconds from enablement).
16111    optional bool short_toggle = 2;
16112
16113    // Carrier ID of the SIM card.
16114    // See https://source.android.com/devices/tech/config/carrierid.
16115    optional int32 carrier_id = 3;
16116}
16117
16118/**
16119 * Logs information about modem restarts.
16120 *
16121 * Logged from:
16122 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/ModemRestartStats.java
16123 */
16124message ModemRestart {
16125    // Software version of the modem, as provided by android.os.Build.getRadioVersion().
16126    optional string baseband_version = 1;
16127
16128    // Reason of the modem restart, as provided in the modemReset indication of IRadio HAL.
16129    optional string reason = 2;
16130
16131    // Carrier ID of the first SIM card.
16132    // See https://source.android.com/devices/tech/config/carrierid.
16133    optional int32 carrier_id = 3;
16134}
16135
16136/**
16137 * Logs the SIM card details when the carrier ID match is not complete.
16138 *
16139 * The atom is pushed when a SIM card is initialized and the MCC/MNC is not present in the
16140 * carrier ID table, or the SIM card contains a GID1 value that is not present in the carrier ID
16141 * table. This atom is pushed only once for each type of SIM card.
16142 *
16143 * Logged from:
16144 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/CarrierIdMatchStats.java
16145 */
16146message CarrierIdMismatchReported {
16147    // Matched carrier ID. The value -1 is used if no match is found.
16148    optional int32 carrier_id = 1;
16149
16150    // MCC/MNC of the SIM card.
16151    optional string mcc_mnc = 2;
16152
16153    // Group identifier (level 1) of the SIM card.
16154    optional string gid1 = 3;
16155
16156    // SPN value of the SIM card.
16157    optional string spn = 4;
16158
16159    // First record of the PNN in the SIM card. This field is populated only if the SPN is missing
16160    // or empty.
16161    optional string pnn = 5;
16162}
16163
16164/**
16165 * Logs the version of the carrier ID matching table at first power up and when it is updated.
16166 *
16167 * Logged from:
16168 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/CarrierIdMatchStats.java
16169 */
16170message CarrierIdTableUpdated {
16171    // Version of the CarrierId matching table.
16172    optional int32 table_version = 1;
16173}
16174
16175/**
16176 * Pulls the version of the carrier ID matching table.
16177 *
16178 * Logged from:
16179 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
16180 */
16181message CarrierIdTableVersion {
16182    // Version of the CarrierId matching table.
16183    optional int32 table_version = 1;
16184}
16185
16186/**
16187 * Pulls information for a single data call session
16188 *
16189 * Each pull creates multiple atoms, one for each data call session.
16190 * The sequence is randomized when pulled.
16191 *
16192 * Pulled from:
16193 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
16194 */
16195message DataCallSession {
16196    // A random number to be used as dimension to capture multiple atoms
16197    optional int32 dimension = 1;
16198
16199    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
16200    optional bool is_multi_sim = 2;
16201
16202    // Whether the call was made with an eSIM profile.
16203    optional bool is_esim = 3;
16204
16205    // Data profile of this call (for what purpose this call was made)
16206    optional android.telephony.DataProfileEnum profile = 4 [deprecated = true];
16207
16208    // APN type bitmask of the APN used:
16209    // @ApnType in frameworks/base/telephony/java/android/telephony/Annotation.java.
16210    optional int32 apn_type_bitmask = 5;
16211
16212    // Carrier ID of the SIM
16213    // See https://source.android.com/devices/tech/config/carrierid.
16214    optional int32 carrier_id = 6;
16215
16216    // Whether the subscription is roaming
16217    optional bool is_roaming = 7;
16218
16219    // Data RAT when the call ended, can be IWLAN for IMS/MMS, otherwise should be WWAN PS RAT.
16220    // In the case that the connection hasn't ended yet, this field holds the current RAT.
16221    // In the case the call ended due to Out Of Service (OOS),
16222    // this field should be the last known RAT.
16223    optional android.telephony.NetworkTypeEnum rat_at_end = 8;
16224
16225    // Was the data call ended due to OOS
16226    optional bool oos_at_end = 9;
16227
16228    // Number of RAT switches during the data call
16229    optional int64 rat_switch_count = 10;
16230
16231    // Whether the call is on an opportunistic subscription
16232    optional bool is_opportunistic = 11;
16233
16234    // Packet data protocol used
16235    optional android.telephony.ApnProtocolEnum ip_type = 12;
16236
16237    // Whether the data call terminated before being established
16238    optional bool setup_failed = 13;
16239
16240    // Reason why the data call terminated, as in RIL_DataCallFailCause from ril.h
16241    optional int32 failure_cause = 14;
16242
16243    // Suggested retry back-off timer value from RIL
16244    optional int32 suggested_retry_millis = 15;
16245
16246    // Why the data call was deactivated
16247    // Set by telephony for MO deactivations (unrelated to failure_cause)
16248    optional android.telephony.DataDeactivateReasonEnum deactivate_reason = 16;
16249
16250    // Duration of the data call, rounded into the closest 5 minutes.
16251    optional int64 duration_minutes = 17;
16252
16253    // Whether the data call is still connected when the atom is collected.
16254    optional bool ongoing = 18;
16255
16256    // Band at the end of the data call. Value 0 is used if the band is unknown.
16257    // See GeranBands, UtranBands and EutranBands in IRadio interface, depending
16258    // on the RAT at the end of the data call.
16259    optional int32 band_at_end = 19;
16260
16261    // Reason why the data call handover failed, as in RIL_DataCallFailCause from ril.h
16262    repeated int32 handover_failure_causes = 20;
16263
16264    // For each int32, the lower 16 bits represent the source RAT while the upper 16 bits indicate
16265    // the target RAT of the failed handover.
16266    repeated int32 handover_failure_rat = 21;
16267
16268    // Whether the call is for internet on nonDDS due to auto data switch feature
16269    optional bool is_non_dds = 22;
16270
16271    // When the 'rat_at_end' field is IWLAN, determines if the data call setup was
16272    // over cross-SIM calling (Wifi calling over cellular data).
16273    optional bool is_iwlan_cross_sim = 23;
16274
16275    // Whether the call is over non-terrestrial networks.
16276    optional bool is_ntn = 24;
16277
16278    // Determines if current data call was over satellite transport
16279    optional bool is_satellite_transport = 25;
16280
16281    // Determines if current data call was over provisioning profile or not
16282    optional bool is_provisioning_profile = 26;
16283}
16284
16285/**
16286 * Logs data stall recovery event
16287 *
16288 * Logged from:
16289 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/data/
16290 *   DataStallRecoveryManager.java
16291 */
16292message DataStallRecoveryReported {
16293    // Carrier ID of the SIM
16294    // See https://source.android.com/devices/tech/config/carrierid.
16295    optional int32 carrier_id = 1;
16296
16297    // Data RAT when the stall happened
16298    optional android.telephony.NetworkTypeEnum rat = 2;
16299
16300    // Signal strength when stall happened
16301    optional android.telephony.SignalStrengthEnum signal_strength = 3;
16302
16303    // Action taken to recover
16304    optional android.telephony.DataStallRecoveryActionEnum action = 4;
16305
16306    // Whether the subscription is opportunistic
16307    optional bool is_opportunistic = 5;
16308
16309    // Whether the device is in multi-SIM mode
16310    optional bool is_multi_sim = 6;
16311
16312    // Band used when the stall/recovery took place.
16313    // Value 0 is used if the band is unknown.
16314    // See GeranBands, UtranBands and EutranBands in IRadio interface, depending
16315    // on the RAT used at the time.
16316    optional int32 band = 7;
16317
16318    // Whether the data stall is recovered.
16319    optional bool recovered = 8;
16320
16321    // The elapsed time between start of the data stall and result of current action.
16322    optional int32 duration_millis = 9;
16323
16324    // The data stall recovered reason. Available from Android T.
16325    optional android.telephony.DataStallRecoveredReason reason = 10;
16326
16327    // Signal strength of the other phone if DSDS when stall happened.
16328    // SIGNAL_STRENGTH_NONE_OR_UNKNOWN(0) if single SIM.
16329    optional android.telephony.SignalStrengthEnum other_phone_signal_strength = 11;
16330
16331    // PS WWAN Network Registration state of the other phone if DSDS when stall happened.
16332    // REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING(0) if single SIM.
16333    optional android.telephony.NetworkRegistrationState other_phone_reg_state = 12;
16334
16335    // PS WWAN Network Registration state of the default phone when data stall.
16336    optional android.telephony.NetworkRegistrationState phone_reg_state = 13;
16337
16338    // collect the first validation after recovery when data stall occurs.
16339    optional bool is_first_validation_after_recovery = 14;
16340
16341    // The phone id when doing the recovery action.
16342    optional int32 phone_id = 15;
16343
16344    // The elapsed time of current action.
16345    optional int32 duration_millis_of_current_action = 16;
16346
16347    // Link status of the data network.
16348    optional int32 link_status = 17;
16349
16350    // The link up bandwidth of the data network.
16351    optional int32 link_up_bandwidth = 18;
16352
16353    // The link down bandwidth of the data network.
16354    optional int32 link_down_bandwidth = 19;
16355}
16356
16357/**
16358 * Pulls IMS registration terminations.
16359 *
16360 * Each pull generates multiple atoms, one for each termination condition happened during the day.
16361 *
16362 * Pulled from:
16363 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
16364 */
16365message ImsRegistrationTermination {
16366    // Carrier ID of the SIM used for IMS registration.
16367    // See https://source.android.com/devices/tech/config/carrierid.
16368    optional int32 carrier_id = 1;
16369
16370    // Whether the device is in multi-SIM mode when the registration terminated.
16371    optional bool is_multi_sim = 2;
16372
16373    // Radio access technology (RAT) used by the registration when it terminated.
16374    // This can be IWLAN if IMS was registered over Wifi.
16375    optional android.telephony.NetworkTypeEnum rat_at_end = 3;
16376
16377    // Whether the IMS registration failed before it was established.
16378    optional bool setup_failed = 4;
16379
16380    // IMS reason code indicating the termination reason.
16381    // See: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
16382    optional int32 reason_code = 5;
16383
16384    // IMS extra code indicating the termination reason.
16385    optional int32 extra_code = 6;
16386
16387    // IMS extra message indicating the termination reason.
16388    // This string is truncated to 128 characters if its length exceeds the limit.
16389    optional string extra_message = 7;
16390
16391    // Total number of instances of registration termination that matches the above conditions.
16392    optional int32 count = 8;
16393
16394    // When the 'rat_at_end' field is IWLAN, indicates whether the ImsRegistrationTech is
16395    // REGISTRATION_TECH_CROSS_SIM.
16396    optional bool is_iwlan_cross_sim = 9;
16397}
16398
16399/**
16400 * Pulls IMS registration statistics.
16401 *
16402 * Each pull generates multiple atoms, one for each carrier, SIM slot, and radio access technology
16403 * (RAT) combination. Durations are aggregated from all registrations with matching criteria,
16404 * including ones that are currently active.
16405 *
16406 * Pulled from:
16407 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
16408 */
16409message ImsRegistrationStats {
16410    // Carrier ID of the SIM used for IMS registration.
16411    // See https://source.android.com/devices/tech/config/carrierid.
16412    optional int32 carrier_id = 1;
16413
16414    // Index of the SIM used, 0 for single-SIM devices.
16415    optional int32 sim_slot_index = 2;
16416
16417    // Radio access technology (RAT) used by the registration.
16418    // This can be IWLAN if IMS was registered over Wifi.
16419    optional android.telephony.NetworkTypeEnum rat = 3;
16420
16421    // Total time IMS was registered (connected time), rounded to 5 minutes.
16422    optional int32 registered_seconds = 4;
16423
16424    // Durations that each feature (Voice, Video, UT, SMS) is capable (supported/enabled by the
16425    // network/device) and available (registered and ready to use).
16426    // All durations are rounded to 5 minutes and should be equal to or shorter than
16427    // registered_seconds.
16428    optional int32 voice_capable_seconds = 5;
16429    optional int32 voice_available_seconds = 6;
16430    optional int32 sms_capable_seconds = 7;
16431    optional int32 sms_available_seconds = 8;
16432    optional int32 video_capable_seconds = 9;
16433    optional int32 video_available_seconds = 10;
16434    optional int32 ut_capable_seconds = 11;
16435    optional int32 ut_available_seconds = 12;
16436
16437    // Total time IMS was registering (connecting time), rounded to 5 minutes
16438    optional int32 registering_seconds = 13;
16439    // Total time IMS was unregistered (unconnected time), rounded to 5 minutes
16440    optional int32 unregistered_seconds = 14;
16441
16442    // When the 'rat' field is IWLAN, indicates whether the ImsRegistrationTech is
16443    // REGISTRATION_TECH_CROSS_SIM.
16444    optional bool is_iwlan_cross_sim = 15;
16445
16446    // How many times IMS is registered
16447    optional int32 registered_times = 16;
16448}
16449
16450/*
16451 * Logs information related to PIN storage and automatic PIN operations.
16452 *
16453 * Logged from:
16454 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/uicc/PinStorage.java
16455 */
16456message PinStorageEvent {
16457    // The type of event.
16458    enum Event {
16459        UNKNOWN = 0;
16460        // The PIN was verified automatically successfully.
16461        PIN_VERIFICATION_SUCCESS = 1;
16462        // The PIN was verified automatically unsuccessfully.
16463        PIN_VERIFICATION_FAILURE = 2;
16464        // The PIN(s) was cached, but discarded after reboot (e.g. SIM not present after reboot).
16465        CACHED_PIN_DISCARDED = 3;
16466        // The PIN(s) was stored to be used after unattended reboot.
16467        PIN_STORED_FOR_VERIFICATION = 4;
16468        // The PIN(s) is not available for storage and will be required after unattended reboot.
16469        PIN_REQUIRED_AFTER_REBOOT = 5;
16470        // The PIN was not verified automatically because the SIM card did not match.
16471        PIN_VERIFICATION_SKIPPED_SIM_CARD_MISMATCH = 6;
16472        // The available PINs after reboot does not match the number of stored PINs before reboot.
16473        PIN_COUNT_NOT_MATCHING_AFTER_REBOOT = 7;
16474        // Error while decrypting the PIN
16475        PIN_DECRYPTION_ERROR = 8;
16476        // Error while encrypting the PIN
16477        PIN_ENCRYPTION_ERROR = 9;
16478        // Attempted to decrypt the PIN with a null/missing encryption key.
16479        PIN_ENCRYPTION_KEY_MISSING = 10;
16480    }
16481    optional Event event = 1;
16482
16483    // Number of PINs stored or discarded.
16484    optional int32 number_of_pins = 2;
16485
16486    // The caller package name
16487    optional string package_name = 3;
16488}
16489
16490/**
16491 * Logs flip to screen off events.
16492 *
16493 * Logged from:
16494 *   frameworks/opt/telephony/src/java/com/android/server/power/FaceDownDetector.java
16495 */
16496message FaceDownReported {
16497    enum Response{
16498        UNKNOWN = 1;
16499        // The phone was flipped before the screen turns off.
16500        UNFLIP = 2;
16501        // User interacts with the screen after a face down is detected.
16502        USER_INTERACTION = 3;
16503        // A flip leads to screen turning off. This is the expected outcome.
16504        SCREEN_OFF = 4;
16505    }
16506
16507    // Logs the action that occurs from a flip event, whether by user or system
16508    // action.
16509    optional Response face_down_response = 1;
16510
16511    // After a flip is detected, how long until a system or user action occurs.
16512    optional int64 millis_since_flip = 2;
16513
16514    // Difference between the flip time and when the timeout would otherwise
16515    // occur.
16516    optional int64 millis_until_normal_timeout = 3;
16517
16518    // How quickly the user turns the screen back on after a flip event.
16519    // A low value may indicate a false negative. Logged only when Response is
16520    // SCREEN_OFF.
16521    optional int64 millis_until_next_screen_on = 4;
16522}
16523
16524/**
16525 * Logs timeout extended events which occur from consecutive undims.
16526 *
16527 * Logged from:
16528 *   frameworks/opt/telephony/src/java/com/android/server/power/ScreenUndimDetector.java
16529 */
16530message TimeoutAutoExtendedReported {
16531    enum Outcome {
16532        UNKNOWN = 0;
16533        POWER_BUTTON = 1;
16534        TIMEOUT = 2;
16535    }
16536
16537    // Logs the action that occurs after timeout is extended from undim.
16538    optional Outcome outcome = 1;
16539    // Time from timeout extension to the outcome.
16540    optional int64 time_to_outcome_millis = 2;
16541    // Time of first interaction after undim if an interaction occurs.
16542    // -1 if no interaction occurs before screen turns off.
16543    optional int64 time_to_first_interaction_millis = 3;
16544}
16545
16546/**
16547 * Logs gnss stats from location service provider
16548 *
16549 * Pulled from:
16550 *  frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
16551 */
16552message GnssStats {
16553    // Number of location reports since boot
16554    optional int64 location_reports = 1;
16555
16556    // Total pulled reports of Location failures since boot
16557    optional int64 location_failure_reports = 2;
16558
16559    // Number of time to first fix reports since boot
16560    optional int64 time_to_first_fix_reports = 3;
16561
16562    // Total pulled reported time to first fix (in milli-seconds) since boot
16563    optional int64 time_to_first_fix_millis = 4;
16564
16565    // Number of position accuracy reports since boot
16566    optional int64 position_accuracy_reports = 5;
16567
16568    // Total pulled reported position accuracy (in meters) since boot
16569    optional int64 position_accuracy_meters = 6;
16570
16571    // Number of top 4 average CN0 reports since boot
16572    optional int64 top_four_average_cn0_reports = 7;
16573
16574    // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
16575    optional int64 top_four_average_cn0_db_mhz = 8;
16576
16577    // Number of l5 top 4 average CN0 reports since boot
16578    optional int64 l5_top_four_average_cn0_reports = 9;
16579
16580    // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
16581    optional int64 l5_top_four_average_cn0_db_mhz = 10;
16582
16583    // Total number of sv status messages reports since boot
16584    optional int64 sv_status_reports = 11;
16585
16586    // Total number of sv status messages reports, where sv is used in fix since boot
16587    optional int64 sv_status_reports_used_in_fix = 12;
16588
16589    // Total number of L5 sv status messages reports since boot
16590    optional int64 l5_sv_status_reports = 13;
16591
16592    // Total number of L5 sv status messages reports, where sv is used in fix since boot
16593    optional int64 l5_sv_status_reports_used_in_fix = 14;
16594}
16595
16596/**
16597 * Logs power usage data from GNSS subsystem.
16598 *
16599 * Logged from:
16600 *   /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
16601 */
16602message GnssPowerStats {
16603    // Relative precision of the alignment of the reported power stats measurement.
16604    optional int64 elapsed_realtime_uncertainty_nanos = 1;
16605
16606    // Total GNSS energy consumption in micro-joules (or micro Watt-seconds).
16607    optional int64 total_energy_micro_joule = 2;
16608
16609    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
16610    // tracking signals of a single frequency band.
16611    optional int64 singleband_tracking_mode_energy_micro_joule = 3;
16612
16613    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
16614    // tracking signals of multiple frequency bands.
16615    optional int64 multiband_tracking_mode_energy_micro_joule = 4;
16616
16617    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
16618    // acquiring signals of a single frequency band.
16619    optional int64 singleband_acquisition_mode_energy_micro_joule = 5;
16620
16621    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
16622    // acquiring signals of multiple frequency bands.
16623    optional int64 multiband_acquisition_mode_energy_micro_joule = 6;
16624
16625    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16626    // operating in each of the vendor-specific power modes. (Index 0)
16627    optional int64 vendor_specific_power_modes_energy_micro_joule_0 = 7;
16628
16629    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16630    // operating in each of the vendor-specific power modes. (Index 1)
16631    optional int64 vendor_specific_power_modes_energy_micro_joule_1 = 8;
16632
16633    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16634    // operating in each of the vendor-specific power modes. (Index 2)
16635    optional int64 vendor_specific_power_modes_energy_micro_joule_2 = 9;
16636
16637    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16638    // operating in each of the vendor-specific power modes. (Index 3)
16639    optional int64 vendor_specific_power_modes_energy_micro_joule_3 = 10;
16640
16641    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16642    // operating in each of the vendor-specific power modes. (Index 4)
16643    optional int64 vendor_specific_power_modes_energy_micro_joule_4 = 11;
16644
16645    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16646    // operating in each of the vendor-specific power modes. (Index 5)
16647    optional int64 vendor_specific_power_modes_energy_micro_joule_5 = 12;
16648
16649    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16650    // operating in each of the vendor-specific power modes. (Index 6)
16651    optional int64 vendor_specific_power_modes_energy_micro_joule_6 = 13;
16652
16653    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16654    // operating in each of the vendor-specific power modes. (Index 7)
16655    optional int64 vendor_specific_power_modes_energy_micro_joule_7 = 14;
16656
16657    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16658    // operating in each of the vendor-specific power modes. (Index 8)
16659    optional int64 vendor_specific_power_modes_energy_micro_joule_8 = 15;
16660
16661    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16662    // operating in each of the vendor-specific power modes. (Index 9)
16663    optional int64 vendor_specific_power_modes_energy_micro_joule_9 = 16;
16664}
16665
16666/**
16667 * Logs when an app is moved to a different standby bucket.
16668 *
16669 * Logged from:
16670 *   frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
16671 */
16672message AppStandbyBucketChanged {
16673    optional string package_name = 1;
16674
16675    // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
16676    optional int32 user_id = 2;
16677
16678    // These enum values match the constants defined in UsageStatsManager.java.
16679    enum Bucket {
16680        BUCKET_UNKNOWN = 0;
16681        BUCKET_EXEMPTED = 5;
16682        BUCKET_ACTIVE = 10;
16683        BUCKET_WORKING_SET = 20;
16684        BUCKET_FREQUENT = 30;
16685        BUCKET_RARE = 40;
16686        BUCKET_RESTRICTED = 45;
16687        BUCKET_NEVER = 50;
16688    }
16689    optional Bucket bucket = 3;
16690
16691    enum MainReason {
16692        MAIN_UNKNOWN = 0;
16693        MAIN_DEFAULT = 0x0100;
16694        MAIN_TIMEOUT = 0x0200;
16695        MAIN_USAGE = 0x0300;
16696        MAIN_FORCED_BY_USER = 0x0400;
16697        MAIN_PREDICTED = 0x0500;
16698        MAIN_FORCED_BY_SYSTEM = 0x0600;
16699    }
16700    optional MainReason main_reason = 4;
16701
16702    // A more detailed reason for the standby bucket change. The sub reason name is dependent on
16703    // the main reason. Values are one of the REASON_SUB_XXX constants defined in
16704    // UsageStatsManager.java.
16705    optional int32 sub_reason = 5;
16706}
16707
16708/**
16709* Reports a started sharesheet transaction.
16710*
16711* Logged from:
16712*   frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
16713*   packages/modules/IntentResolver/java/src/com/android/intentresolver/ChooserActivity.java
16714*/
16715message SharesheetStarted {
16716    // The event_id (as for UiEventReported).
16717    optional int32 event_id = 1;
16718    // The calling app's package name.
16719    optional string package_name = 2;
16720    // An identifier to tie together multiple logs relating to the same share event
16721    optional int32 instance_id = 3;
16722    // The mime type of the share
16723    optional string mime_type = 4;
16724    // The number of direct targets the calling app is providing that will be shown.
16725    optional int32 num_app_provided_direct_targets = 5;
16726    // The number of app targets the calling app is providing that will be shown.
16727    optional int32 num_app_provided_app_targets = 6;
16728    // True if the share originates from the workprofile
16729    optional bool is_workprofile = 7;
16730
16731    enum SharesheetPreviewType {  // Constants from ChooserActivity.java
16732        CONTENT_PREVIEW_TYPE_UNKNOWN = 0;  // Default for proto 2 / 3 compatibility.
16733        CONTENT_PREVIEW_IMAGE = 1;  // The preview shown in the sharesheet is an image.
16734        CONTENT_PREVIEW_FILE = 2;  // The preview shown in the sharesheet is a file.
16735        CONTENT_PREVIEW_TEXT = 3;  // The preview shown in the sharesheet is text.
16736        // Preview is toggleable media items (Shareousel):
16737        CONTENT_PREVIEW_TOGGLEABLE_MEDIA = 4;
16738    }
16739    // How the sharesheet preview is presented.
16740    optional SharesheetPreviewType preview_type = 8;
16741
16742    enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
16743        INTENT_DEFAULT = 0;
16744        INTENT_ACTION_VIEW = 1;
16745        INTENT_ACTION_EDIT = 2;
16746        INTENT_ACTION_SEND = 3;
16747        INTENT_ACTION_SENDTO = 4;
16748        INTENT_ACTION_SEND_MULTIPLE = 5;
16749        INTENT_ACTION_IMAGE_CAPTURE = 6;
16750        INTENT_ACTION_MAIN = 7;
16751    }
16752    // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
16753    optional ResolverActivityIntent intent_type = 9;
16754    // The number of custom actions that the calling app has provided.
16755    optional int32 num_provided_custom_actions = 10;
16756    // True if the calling app has provided an action for share modification.
16757    optional bool modify_share_action_provided = 11;
16758}
16759
16760/**
16761 * Reports a ranking selection event.
16762 *
16763 * Logged from:
16764 *   frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
16765 *   packages/modules/IntentResolver/java/src/com/android/intentresolver/ChooserActivity.java
16766 */
16767message RankingSelected {
16768    // The event_id (as for UiEventReported).
16769    optional int32 event_id = 1;
16770    // The relevant app's package name (can be source or picked package).
16771    optional string package_name = 2;
16772    // An identifier to tie together multiple logs relating to the same share event.
16773    optional int32 instance_id = 3;
16774    // Which of the ranked targets got picked, default starting position 0.
16775    optional int32 position_picked = 4;
16776    // Whether the selected target is pinned.
16777    optional bool is_pinned = 5;
16778}
16779
16780/**
16781 * Logs when TvSettings UI is interacted at.
16782 *
16783 * Logged from: packages/apps/TvSettings
16784 */
16785message TvSettingsUIInteracted {
16786
16787    /** The UI action category */
16788    optional android.app.tvsettings.Action action = 1;
16789
16790    /** The ID of the entry that the users actioned on */
16791    optional android.app.tvsettings.ItemId item_id = 2;
16792}
16793
16794/**
16795 * Logs information about a package installation using package installer V2 APIs.
16796 *
16797 * Logged from:
16798 *      frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
16799 */
16800message PackageInstallerV2Reported {
16801    // Whether this installation uses Incremental File System
16802    optional bool is_incremental = 1;
16803    // Name of the package that is intended to be installed
16804    optional string package_name = 2;
16805    // The duration between when the install was requested to when the install has completed
16806    optional int64 duration_millis = 3;
16807    // Installation result in final integer, which are SystemApi's.
16808    // Return_code 1 indicates success.
16809    // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
16810    optional int32 return_code  = 4;
16811    // Total size of the APKs installed for this package
16812    optional int64 apks_size_bytes = 5;
16813    // UID of the package. -1 if the installation failed.
16814    optional int32 uid = 6 [(is_uid) = true];
16815}
16816
16817/**
16818 * Logs settings provider values.
16819 *
16820 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
16821 * then write the value to proto.
16822 *
16823 */
16824message SettingSnapshot {
16825
16826    // Setting key
16827    optional string name = 1;
16828
16829    enum SettingsValueType {
16830        NOTASSIGNED = 0;
16831        ASSIGNED_BOOL_TYPE = 1;
16832        ASSIGNED_INT_TYPE = 2;
16833        ASSIGNED_FLOAT_TYPE = 3;
16834        ASSIGNED_STRING_TYPE = 4;
16835    };
16836    // Setting value type
16837    optional SettingsValueType type = 2;
16838
16839    optional bool bool_value = 3;
16840
16841    optional int32 int_value = 4;
16842
16843    optional float float_value = 5;
16844
16845    optional string str_value = 6;
16846
16847    // Android user index. 0 for primary user, 10, 11 for secondary or profile user
16848    optional int32 user_id = 7;
16849}
16850
16851/**
16852 * An event logged to indicate that a user journey is about to be performed. This atom includes
16853 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
16854 * will immediately follow this atom which will describe the event(s) and its state.
16855 *
16856 * Logged from:
16857 *   frameworks/base/services/core/java/com/android/server/am/UserController.java
16858 *   frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
16859 */
16860message UserLifecycleJourneyReported {
16861    // An identifier to track a chain of user lifecycle events occurring (referenced in the
16862    // UserLifecycleEventOccurred atom)
16863    optional int64 session_id = 1;
16864
16865    // Indicates what type of user journey this session is related to
16866    enum Journey {
16867        UNKNOWN = 0; // Undefined user lifecycle journey
16868        USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
16869        USER_SWITCH_FG = 2; // A user switch journey without a UI shown
16870        USER_START = 3; // A user start journey
16871        USER_CREATE = 4; // A user creation journey
16872        USER_STOP = 5; // A user stop journey
16873        USER_REMOVE = 6; // A user removal journey
16874        GRANT_ADMIN = 7; // An admin grant journey
16875        REVOKE_ADMIN = 8; // An admin revocation journey
16876        USER_LIFECYCLE = 9; // User journey from creation to deletion
16877    }
16878    optional Journey journey = 2;
16879    // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
16880    // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
16881    optional int32 origin_user = 3;
16882    // Which user the journey is targeting
16883    // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
16884    optional int32 target_user = 4;
16885
16886    // What is the user type of the target user
16887    // These should be in sync with USER_TYPE_* flags defined in UserManager.java
16888    enum UserType {
16889        TYPE_UNKNOWN = 0;
16890        FULL_SYSTEM = 1;
16891        FULL_SECONDARY = 2;
16892        FULL_GUEST = 3;
16893        FULL_DEMO = 4;
16894        FULL_RESTRICTED = 5;
16895        PROFILE_MANAGED = 6;
16896        SYSTEM_HEADLESS = 7;
16897        PROFILE_CLONE = 8;
16898        PROFILE_PRIVATE = 9;
16899    }
16900    optional UserType user_type = 5;
16901    // What are the flags attached to the target user
16902    optional int32 user_flags = 6;
16903    optional int32 error_code = 7;
16904    optional int64 elapsed_time = 8;
16905}
16906
16907/**
16908 * An event logged when a specific user lifecycle event is performed. These events should be
16909 * correlated with a UserLifecycleJourneyReported atom via the session_id.
16910 * Note: journeys can span over multiple events, hence some events may share a single session id.
16911 *
16912 * Logged from:
16913 *   frameworks/base/services/core/java/com/android/server/am/UserController.java
16914 *   frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
16915 */
16916message UserLifecycleEventOccurred {
16917    // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
16918    optional int64 session_id = 1;
16919    // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
16920    // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
16921    optional int32 user_id = 2;
16922
16923    enum Event {
16924        UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
16925        SWITCH_USER = 1; // Indicates that this is a user switch event
16926        START_USER = 2; // Indicates that this is a user start event
16927        CREATE_USER = 3; // Indicates that this is a user create event
16928        USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
16929        UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
16930        UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
16931        STOP_USER = 7; // Indicates that this is a user stop event
16932        REMOVE_USER = 8; // Indicates that this is a user removal event
16933        GRANT_ADMIN = 9; // Indicates that this is an admin privileges grant event
16934        REVOKE_ADMIN = 10; // Indicates that this is an admin privileges revocation event
16935    }
16936    optional Event event = 3;
16937
16938    enum State {
16939        NONE = 0; // Indicates the associated event has no start/end defined
16940        BEGIN = 1;
16941        FINISH = 2;
16942        CANCEL = 3;
16943        ERROR = 4;
16944    }
16945    optional State state = 4; // Represents the state of an event (beginning/ending)
16946    optional int32 error_code = 5;
16947}
16948
16949/**
16950 * The UserInfo information about an Android user (as used in UserManager multiuser).
16951 *
16952 * Currently, we do not include information about user 0, since it is uninteresting.
16953 *
16954 * This will be pulled from
16955 *     frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
16956 */
16957message UserInfo {
16958    // The @UserIdInt userId of the user
16959    optional int32 user_id = 1;
16960
16961    // The type of user, if AOSP-defined, such as {@link UserManager#USER_TYPE_PROFILE_MANAGED}
16962    optional UserLifecycleJourneyReported.UserType user_type = 2;
16963
16964    // The type of user if not AOSP-defined. Will be empty if user_type is not TYPE_UNKNOWN.
16965    optional string user_type_custom = 3;
16966
16967    // The @UserInfoFlag UserInfo flags of user.
16968    optional int32 user_flags = 4;
16969
16970    // Wall-clock time in milliseconds when user was created, according to System.currentTimeMillis
16971    optional int64 creation_time_millis = 5;
16972
16973    // Wall-clock time in milliseconds when user last entered the state of STATE_RUNNING_UNLOCKED,
16974    // according to System.currentTimeMillis
16975    optional int64 last_logged_in_time_millis = 6;
16976
16977    // True if user is currently running and unlocked.
16978    // Note that this is NOT synonymous with being the 'current' user. Multiple users may be
16979    // running unlocked, with one in the foreground and others running in the background.
16980    optional bool is_user_running_unlocked = 7;
16981}
16982
16983
16984/**
16985 * The MultiUserInfo information about maximum supported users on the device.
16986 *
16987 * This will be pulled from
16988 *     frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
16989 */
16990message MultiUserInfo {
16991    // Maximum users supported on the device
16992    optional int32 max_supported_users = 1;
16993    // Whether multi user setting is on.
16994    optional bool multi_user_setting_on = 2;
16995    // Whether device supports multiuser and owner have no restriction in adding users.
16996    optional bool supports_adding_full_users = 3;
16997}
16998
16999/**
17000 * Logs when accessibility shortcut clicked.
17001 *
17002 * Logged from:
17003 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
17004 */
17005message AccessibilityShortcutReported {
17006    // The accessibility feature(including installed a11y service, framework a11y feature,
17007    // and installed a11y activity) package name that is assigned to the accessibility shortcut.
17008    optional string package_name = 1;
17009
17010    // The definition of the accessibility shortcut.
17011    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
17012    optional android.stats.accessibility.ShortcutType shortcut_type = 2;
17013
17014    // The definition of the service status.
17015    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
17016    optional android.stats.accessibility.ServiceStatus service_status = 3;
17017}
17018
17019/**
17020 * Logs when accessibility service status changed.
17021 *
17022 * Logged from:
17023 *   packages/apps/Settings/src/com/android/settings/accessibility
17024 */
17025message AccessibilityServiceReported {
17026    // The accessibility service package name.
17027    optional string package_name = 1;
17028
17029    // The definition of the service status.
17030    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
17031    optional android.stats.accessibility.ServiceStatus service_status = 2;
17032}
17033
17034/**
17035 * Pulls accessibility shortcuts status.
17036 *
17037 * Pulled from:
17038 *   StatsPullAtomService
17039 */
17040message AccessibilityShortcutStats {
17041    // The definition of the accessibility software shortcut.
17042    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
17043    optional android.stats.accessibility.ShortcutType software_shortcut_type = 1;
17044    // Number of accessibility services in accessibility software shortcut.
17045    optional int32 software_shortcut_service_num = 2;
17046
17047    // The definition of the accessibility hardware shortcut.
17048    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
17049    optional android.stats.accessibility.ShortcutType hardware_shortcut_type = 3;
17050    // Number of accessibility services in accessibility hardware shortcut.
17051    optional int32 hardware_shortcut_service_num = 4;
17052
17053    // The definition of the accessibility gesture shortcut.
17054    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
17055    optional android.stats.accessibility.ShortcutType gesture_shortcut_type = 5;
17056    // Number of accessibility services in accessibility gesture shortcut.
17057    optional int32 gesture_shortcut_service_num = 6;
17058
17059    // The definition of the accessibility quick settings shortcut.
17060    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
17061    optional android.stats.accessibility.ShortcutType qs_shortcut_type = 7;
17062    // Boolean indicating whether the user turns on qs shortcut for any
17063    // accessibility feature that support qs shortcut.
17064    optional bool use_qs_shortcut = 8;
17065}
17066
17067/**
17068 * Pulls accessibility floating menu status.
17069 *
17070 * Pulled from:
17071 *   StatsPullAtomService
17072 */
17073message AccessibilityFloatingMenuStats {
17074    // Size of the accessibility floating menu.
17075    optional int32 size = 1;
17076    // Icon shape of the accessibility floating menu.
17077    optional int32 icon_type = 2;
17078    // Whether the accessibility floating menu is enable auto fade ability.
17079    optional bool fade_enabled = 3;
17080    // Opacity of the accessibility floating menu. The range is between 0 and 1.
17081    optional float opacity = 4;
17082}
17083
17084/**
17085 * Logs when display wake up.
17086 *
17087 * Logged from:
17088 *   services/core/java/com/android/server/power/Notifier.java
17089 */
17090
17091message DisplayWakeReported {
17092    // Wake_up_reason code
17093    // If LOWORD(wake_up_reason) = 0
17094    //     reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
17095    //     else reference wake_up_reason to
17096    //     services/core/java/com/android/server/power/Notifier.java#onWakeUp
17097    optional int32 wake_up_reason = 1;
17098    // UID that caused the display to wake
17099    optional int32 uid = 2 [(is_uid) = true];
17100}
17101
17102/**
17103 * Logs app usage events.
17104 *
17105 * Logged from:
17106 *  frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
17107 */
17108message AppUsageEventOccurred {
17109    optional int32 uid = 1 [(is_uid) = true];
17110    optional string package_name = 2;
17111    optional string class_name = 3;
17112
17113    // Usage event types please refer to below file:
17114    // frameworks/base/core/java/android/app/usage/UsageEvents.java
17115    enum EventType {
17116        NONE = 0;
17117        MOVE_TO_FOREGROUND       = 1;
17118        MOVE_TO_BACKGROUND       = 2;
17119        USER_INTERACTION         = 7;
17120        SHORTCUT_INVOCATION      = 8;
17121        CHOOSER_ACTION           = 9;
17122        STANDBY_BUCKET_CHANGED   = 11;
17123        FOREGROUND_SERVICE_START = 19;
17124        FOREGROUND_SERVICE_STOP  = 20;
17125    }
17126    optional EventType event_type = 4;
17127}
17128
17129/*
17130 * Quality metrics logged when EVS cameras are active.
17131 *
17132 * Logged from:
17133 *  packages/services/Car/evs/manager/1.1/Enumerator.cpp
17134 */
17135message EvsUsageStatsReported {
17136
17137    // Camera identifier to distinguish the source camera device.  This is not
17138    // globally unique and therefore cannot be used to identify the user and/or
17139    // the device.
17140    optional int32 device_id = 1;
17141
17142    // Peak number of clients during the service
17143    optional int32 peak_num_clients = 2;
17144
17145    // Number of erroneous events during the service
17146    optional int32 num_errors = 3;
17147
17148    // Round trip latency of the very first frame
17149    optional int64 first_latency_millis = 4;
17150
17151    // Average frame round trip latency
17152    optional float avg_latency_millis = 5;
17153
17154    // Peak frame round trip latency
17155    optional int64 peak_latency_millis = 6;
17156
17157    // Total number of frames received
17158    optional int64 total_frames = 7;
17159
17160    // Number of frames ignored
17161    optional int64 ignored_frames = 8;
17162
17163    // Number of dropped frames to synchronize camera devices
17164    optional int64 dropped_frames_to_sync = 9;
17165
17166    // The duration of the service
17167    optional int64 duration_millis = 10;
17168}
17169
17170/**
17171 * Logs audio power usage stats.
17172 *
17173 * Pushed from:
17174 *  frameworks/av/services/mediametrics/AudioPowerUsage.cpp
17175 */
17176message AudioPowerUsageDataReported {
17177    /**
17178     * Device used for input/output
17179     *
17180     * All audio devices please refer to below file:
17181     * system/media/audio/include/system/audio-base.h
17182     *
17183     * Define our own enum values because we don't report all audio devices.
17184     * Currently, we only report built-in audio devices such as handset, speaker,
17185     * built-in mics, common audio devices such as wired headset, usb headset
17186     * and bluetooth devices.
17187     */
17188    enum AudioDevice {
17189        OUTPUT_EARPIECE         = 0x1; // handset
17190        OUTPUT_SPEAKER          = 0x2; // dual speaker
17191        OUTPUT_WIRED_HEADSET    = 0x4; // 3.5mm headset
17192        OUTPUT_USB_HEADSET      = 0x8; // usb headset
17193        OUTPUT_BLUETOOTH_SCO    = 0x10; // bluetooth sco
17194        OUTPUT_BLUETOOTH_A2DP   = 0x20; // a2dp
17195        OUTPUT_SPEAKER_SAFE     = 0x40; // bottom speaker
17196        OUTPUT_BLUETOOTH_BLE    = 0x80; // ble
17197        OUTPUT_DOCK             = 0x100; // dock
17198        OUTPUT_HDMI             = 0x200; // hdmi
17199
17200        INPUT_DEVICE_BIT        = 0x40000000; // non-negative positive int32.
17201        INPUT_BUILTIN_MIC       = 0x40000001; // buildin mic
17202        INPUT_BUILTIN_BACK_MIC  = 0x40000002; // buildin back mic
17203        INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
17204        INPUT_USB_HEADSET_MIC   = 0x40000008; // usb headset mic
17205        INPUT_BLUETOOTH_SCO     = 0x40000010; // bluetooth sco mic
17206        INPUT_BLUETOOTH_BLE     = 0x40000020; // ble mic
17207    }
17208    optional AudioDevice audio_device = 1;
17209
17210    // Duration of the audio in seconds
17211    optional int32 duration_secs = 2;
17212
17213    // Average volume (0 ... 1.0)
17214    optional float average_volume = 3;
17215
17216    enum AudioType {
17217        UNKNOWN_TYPE = 0;
17218        VOICE_CALL_TYPE = 1; // voice call
17219        VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
17220        MEDIA_TYPE = 3; // music and system sound
17221        RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
17222        ALARM_TYPE = 5; // alarm type
17223        // record type
17224        CAMCORDER_TYPE = 6; // camcorder
17225        RECORD_TYPE = 7;  // other recording
17226    }
17227    optional AudioType type = 4;
17228
17229    // Minimum volume duration of the audio in seconds
17230    optional int32 minimum_volume_duration_secs = 5;
17231
17232    // Minimum volume (0 ... 1.0)
17233    optional float minimum_volume = 6;
17234
17235    // Maximum volume duration of the audio in seconds
17236    optional int32 maximum_volume_duration_secs = 7;
17237
17238    // Maximum volume (0 ... 1.0)
17239    optional float maximum_volume = 8;
17240}
17241
17242/**
17243 * Logs the Spatializer capability when the Spatializer is created.
17244 *
17245 * We expect this to occur only once on a healthy system,
17246 * when audioserver is initialized.
17247 *
17248 * On devices that do not support spatialization,
17249 * SpatializerLevel returns SPATIALIZER_LEVEL_NONE only.
17250 *
17251 * Logged from:
17252 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17253 */
17254message MediametricsSpatializerCapabilitiesReported {
17255    // Available head tracking modes
17256    repeated android.media.audio.HeadTrackingMode head_tracking_modes = 1;
17257
17258    // Available spatializer levels
17259    repeated android.media.audio.SpatializerLevel spatializer_levels = 2;
17260
17261    // Available spatializer modes
17262    repeated android.media.audio.SpatializerMode spatializer_modes = 3;
17263
17264    // Available channel masks, with each channel position bitwise ORed.
17265    // One or more bits from
17266    // system/media/audio/include/system/audio-hal-enums.h
17267    // audio_channel_mask_t, representing the channel configuration
17268    // of AudioTrack data.
17269    //
17270    // Generally the most populated channel_mask is selected for use.
17271    repeated int64 channel_masks = 4;
17272}
17273
17274/**
17275 * Logs when Spatializer is enabled or disabled for a device.
17276 *
17277 * The event field indicates the reason for enabling or disabling:
17278 * through the Settings UI, startup/boot, or new device detection.
17279 *
17280 * The presence of this message indicates that the audio device type
17281 * supports Spatialization; this is generally a fixed
17282 * property of the platform and depends if the device type is considered
17283 * BINAURAL or TRANSAURAL, and the Spatializer support for it.
17284 *
17285 * This logs existing saved state on BOOT and changes afterwards.
17286 * Due to rpc to the MediaMetrics service which generates the atom,
17287 * the timestamp of the atom may have a slight delay.
17288 *
17289 * Logged from:
17290 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17291 */
17292message MediametricsSpatializerDeviceEnabledReported {
17293    // Device type enumeration, e.g. BUILTIN_SPEAKER, BT_A2DP, etc.
17294    optional android.media.audio.AudioDeviceInfoType type = 1;
17295
17296    // The event field indicates the reason for enabling or disabling:
17297    // NORMAL: from Settings UI.
17298    // BOOT: on startup/boot.
17299    // FIRST: on new device detection.
17300    optional android.media.audio.SpatializerSettingEvent event = 2;
17301
17302    // Whether the spatializer is enabled on that device.
17303    // This triggers only on a change of state.
17304    // If multiple devices share the same type (e.g. bluetooth headsets),
17305    // they will register separate messages.
17306    optional bool enabled = 3;
17307}
17308
17309/**
17310 * Logs whether the HeadTracker is enabled for a device.
17311 *
17312 * This only changes if there is a HeadTracker associated with the device.
17313 *
17314 * This logs existing saved state on BOOT and changes afterwards.
17315 * Due to rpc to the MediaMetrics service which generates the atom,
17316 * the timestamp of the atom may have a slight delay.
17317 *
17318 * Logged from:
17319 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17320 */
17321message MediametricsHeadTrackerDeviceEnabledReported {
17322    // Device type enumeration, e.g. BUILTIN_SPEAKER, BT_A2DP, etc.
17323    optional android.media.audio.AudioDeviceInfoType type = 1;
17324
17325    // The event field indicates the reason for enabling or disabling:
17326    // NORMAL: from Settings UI.
17327    // BOOT: on startup/boot.
17328    // FIRST: on new device detection.
17329    optional android.media.audio.SpatializerSettingEvent event = 2;
17330
17331    // Whether the head tracker was enabled or disabled on that device.
17332    // This triggers only on a change of state.
17333    // If multiple devices share the same type (e.g. bluetooth headsets),
17334    // they will register separate messages.
17335    optional bool enabled = 3;
17336}
17337
17338/**
17339 * Logs whether the HeadTracker is supported for a device.
17340 *
17341 * Generally a fixed property of the device, but it is possible
17342 * that the HeadTracker sensor might be turned off
17343 * or be temporarily unavailable.
17344 *
17345 * This logs existing saved state on BOOT and changes afterwards.
17346 * Due to rpc to the MediaMetrics service which generates the atom,
17347 * the timestamp of the atom may have a slight delay.
17348 *
17349 * Logged from:
17350 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17351 */
17352message MediametricsHeadTrackerDeviceSupportedReported {
17353    // Device type enumeration, e.g. BUILTIN_SPEAKER, BT_A2DP, etc.
17354    optional android.media.audio.AudioDeviceInfoType type = 1;
17355
17356    // The event field indicates the reason for enabling or disabling:
17357    // NORMAL: on sensor change.
17358    // BOOT: on startup/boot.
17359    // FIRST: on new device detection.
17360    optional android.media.audio.SpatializerSettingEvent event = 2;
17361
17362    // Whether the head tracker is supported on that device.
17363    // This triggers only on a change of state.
17364    // If multiple devices share the same type (e.g. bluetooth headsets),
17365    // they will register separate messages.
17366    optional bool supported = 3;
17367}
17368
17369/**
17370  * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
17371  *
17372  * Pulled from:
17373  *   StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
17374  */
17375message BytesTransferByTagAndMetered {
17376    optional int32 uid = 1 [(is_uid) = true];
17377
17378    optional bool is_metered = 2;
17379
17380    optional int32 tag = 3;
17381
17382    optional int64 rx_bytes = 4;
17383
17384    optional int64 rx_packets = 5;
17385
17386    optional int64 tx_bytes = 6;
17387
17388    optional int64 tx_packets = 7;
17389
17390    // Radio Access Technology (RAT) type of this record, should be one of
17391    // TelephonyManager#NETWORK_TYPE_* constants, or
17392    // NetworkTemplate#NETWORK_TYPE_ALL to indicate the record is for all rat
17393    // types combined.
17394    optional int32 rat_type = 8;
17395}
17396
17397/**
17398 * Logs when the Assistant is invoked.
17399 *
17400 * Logged from:
17401 *   frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
17402 */
17403message AssistantInvocationReported {
17404
17405    // The event_id (as for UiEventReported).
17406    optional int32 event_id = 1;
17407
17408    // The registered Assistant's uid and package (as for UiEventReported).
17409    optional int32 uid = 2 [(is_uid) = true];
17410    optional string package_name = 3;
17411
17412    // An identifier used to disambiguate which logs refer to a particular invocation of the
17413    // Assistant  (as for UiEventReported).
17414    optional int32 instance_id = 4;
17415
17416    // The state of the device at the time of invocation.
17417    enum DeviceState {
17418        UNKNOWN_DEVICE_STATE = 0;
17419        AOD1 = 1;
17420        AOD2 = 2;
17421        BOUNCER = 3;
17422        UNLOCKED_LOCKSCREEN = 4;
17423        LAUNCHER_HOME = 5;
17424        LAUNCHER_OVERVIEW = 6;
17425        LAUNCHER_ALL_APPS = 7;
17426        APP_DEFAULT = 8;
17427        APP_IMMERSIVE = 9;
17428        APP_FULLSCREEN = 10;
17429    }
17430    optional DeviceState device_state = 5;
17431
17432    // Whether the Assistant handles were showing at the time of invocation.
17433    optional bool assistant_handles_showing = 6;
17434}
17435
17436/**
17437 * Logs when an AudioRecord finishes running on an audio device
17438 *
17439 * Logged from:
17440 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17441 */
17442message MediametricsAudioRecordDeviceUsageReported {
17443    // The devices connected to this AudioRecord.
17444    // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
17445    // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
17446    // See audio_device_t in system/media/audio/include/system/audio-base.h
17447    optional string devices = 1;
17448
17449    // The name of the remote device attached to the device, typically available for USB or BT.
17450    // This may be empty for a fixed device, or separated by "|" if more than one.
17451    optional string device_names = 2;
17452
17453    // The amount of time spent in the device as measured by the active track in AudioFlinger.
17454    optional int64 device_time_nanos = 3;
17455
17456    // The audio data format used for encoding.
17457    // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
17458    optional string encoding = 4;
17459
17460    // The client-server buffer framecount.
17461    // The framecount is generally between 960 - 48000 for PCM encoding.
17462    // The framecount represents raw buffer size in bytes for non-PCM encoding.
17463    optional int32 frame_count = 5;
17464
17465    // The number of audio intervals (contiguous, continuous playbacks).
17466    optional int32 interval_count = 6;
17467
17468    // The sample rate of the AudioRecord.
17469    // A number generally between 8000-96000 (frames per second).
17470    optional int32 sample_rate = 7;
17471
17472    // The audio input flags used to construct the AudioRecord.
17473    // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
17474    optional string flags = 8;
17475
17476    // The santized package name of the audio client associated with the AudioRecord.
17477    // See getSanitizedPackageNameAndVersionCode() in
17478    // frameworks/av/services/mediametrics/MediaMetricsService.cpp
17479    optional string package_name = 9;
17480
17481    // The selected device id (nonzero if a non-default device is selected)
17482    optional int32 selected_device_id = 10;
17483
17484    // The caller of the AudioRecord.
17485    // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
17486    optional string caller = 11;
17487
17488    // The audio source for AudioRecord.
17489    // An enumeration from system/media/audio/include/system/audio-base.h audio_source_t
17490    optional string source = 12;
17491
17492    // Android S
17493    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
17494    // An empty string means no session id is set.
17495    optional string log_session_id = 13;
17496}
17497
17498/**
17499 * Logs when an AudioThread finishes running on an audio device
17500 *
17501 * Logged from:
17502 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17503 */
17504message MediametricsAudioThreadDeviceUsageReported {
17505    // The devices connected to this audio thread.
17506    // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
17507    // (for record threads):
17508    // See lookup<INPUT_DEVICE> in frameworks/av/services/mediametrics/AudioTypes.cpp
17509    // (for playback threads):
17510    // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
17511    // See audio_device_t in system/media/audio/include/system/audio-base.h
17512    optional string devices = 1;
17513
17514    // The name of the remote device attached to the device, typically available for USB or BT.
17515    // This may be empty for a fixed device, or separated by "|" if more than one.
17516    optional string device_names = 2;
17517
17518    // The amount of time spent in the device as measured by the active track in AudioFlinger.
17519    optional int64 device_time_nanos = 3;
17520
17521    // The audio data format used for encoding.
17522    // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
17523    optional string encoding = 4;
17524
17525    // The framecount of the buffer delivered to (or from) the HAL.
17526    // The framecount is generally ~960 for PCM encoding.
17527    // The framecount represents raw buffer size in bytes for non-PCM encoding.
17528    optional int32 frame_count = 5;
17529
17530    // The number of audio intervals (contiguous, continuous playbacks).
17531    optional int32 interval_count = 6;
17532
17533    // The sample rate of the audio thread.
17534    // A number generally between 8000-96000 (frames per second).
17535    optional int32 sample_rate = 7;
17536
17537    // The audio flags used to construct the thread
17538    // (for record threads):
17539    // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
17540    // (for playback threads):
17541    // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
17542    optional string flags = 8;
17543
17544    // The number of underruns encountered for a playback thread or the
17545    // number of overruns encountered for a capture thread.
17546    optional int32 xruns = 9;
17547
17548    // The type of thread
17549    // A thread type enumeration from
17550    // frameworks/av/mediametrics/services/Translate.h
17551    optional string type = 10;
17552}
17553
17554/**
17555 * Logs when an AudioTrack finishes running on an audio device
17556 *
17557 * Logged from:
17558 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17559 */
17560message MediametricsAudioTrackDeviceUsageReported {
17561    // The output devices connected to this AudioTrack.
17562    // A string OR of various output device categories, e.g. "DEVICE1|DEVICE2".
17563    // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
17564    // See audio_device_t in system/media/audio/include/system/audio-base.h
17565    optional string devices = 1;
17566
17567    // The name of the remote device attached to the device, typically available for USB or BT.
17568    // This may be empty for a fixed device, or separated by "|" if more than one.
17569    optional string device_names = 2;
17570
17571    // The amount of time spent in the device as measured by the active track in AudioFlinger.
17572    optional int64 device_time_nanos = 3;
17573
17574    // The audio data format used for encoding.
17575    // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
17576    optional string encoding = 4;
17577
17578    // The client-server buffer framecount.
17579    // The framecount is generally between 960 - 48000 for PCM encoding.
17580    // The framecount represents raw buffer size in bytes for non-PCM encoding.
17581    // A static track (see traits) may have a very large framecount.
17582    optional int32 frame_count = 5;
17583
17584    // The number of audio intervals (contiguous, continuous playbacks).
17585    optional int32 interval_count = 6;
17586
17587    // The sample rate of the AudioTrack.
17588    // A number generally between 8000-96000 (frames per second).
17589    optional int32 sample_rate = 7;
17590
17591    // The audio flags used to construct the AudioTrack.
17592    // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
17593    optional string flags = 8;
17594
17595    // The number of underruns encountered.
17596    optional int32 xruns = 9;
17597
17598    // The santized package name of the audio client associated with the AudioTrack.
17599    // See getSanitizedPackageNameAndVersionCode() in
17600    // frameworks/av/services/mediametrics/MediaMetricsService.cpp
17601    optional string package_name = 10;
17602
17603    // The latency of the last sample in the buffer in milliseconds.
17604    optional float device_latency_millis = 11;
17605
17606    // The startup time in milliseconds from start() to sample played.
17607    optional float device_startup_millis = 12;
17608
17609    // The average volume of the track on the device [ 0.f - 1.f ]
17610    optional float device_volume = 13;
17611
17612    // The selected device id (nonzero if a non-default device is selected)
17613    optional int32 selected_device_id = 14;
17614
17615    // The stream_type category for the AudioTrack.
17616    // An enumeration from system/media/audio/include/system/audio-base.h audio_stream_type_t
17617    optional string stream_type = 15;
17618
17619    // The usage for the AudioTrack.
17620    // An enumeration from system/media/audio/include/system/audio-base.h audio_usage_t
17621    optional string usage = 16;
17622
17623    // The content type of the AudioTrack.
17624    // An enumeration from system/media/audio/include/system/audio-base.h audio_content_type_t
17625    optional string content_type = 17;
17626
17627    // The caller of the AudioTrack.
17628    // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
17629    optional string caller = 18;
17630
17631    // The traits of the AudioTrack.
17632    // A string OR of different traits, may be empty string.
17633    // Only "static" is supported for R.
17634    // See lookup<TRACK_TRAITS>() in frameworks/av/services/mediametrics/AudioTypes.cpp
17635    optional string traits = 19;
17636
17637    // Android S
17638    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
17639    // An empty string means no session id is set.
17640    optional string log_session_id = 20;
17641}
17642
17643/**
17644 * Logs the status of an audio device connection attempt.
17645 *
17646 * Logged from:
17647 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17648 */
17649message MediametricsAudioDeviceConnectionReported {
17650    // The input devices represented by this report.
17651    // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
17652    // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
17653    // See audio_device_t in system/media/audio/include/system/audio-base.h
17654    optional string input_devices = 1;
17655
17656    // The output devices represented by this report.
17657    // A string OR of various output device categories.
17658    // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
17659    // See audio_device_t in system/media/audio/include/system/audio-base.h
17660    optional string output_devices = 2;
17661
17662    // The name of the remote device attached to the device, typically available for USB or BT.
17663    // This may be empty for a fixed device, or separated by "|" if more than one.
17664    optional string device_names = 3;
17665
17666    // The result of the audio device connection.
17667    // 0 indicates success: connection verified.
17668    // 1 indicates unknown: connection not verified or not known if diverted properly.
17669    // Other values indicate specific status.
17670    // See DeviceConnectionResult in frameworks/av/services/mediametrics/AudioTypes.h
17671    optional int32 result = 4;
17672
17673    // Average milliseconds of time to connect
17674    optional float time_to_connect_millis = 5;
17675
17676    // Number of connections if aggregated statistics, otherwise 1.
17677    optional int32 connection_count = 6;
17678}
17679
17680/**
17681 * Logs the status of an AudioRecord operation.
17682 *
17683 * Logged from:
17684 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17685 */
17686message MediametricsAudioRecordStatusReported {
17687    // General status code for categorization of status.
17688    optional android.media.Status status = 1;
17689
17690    // Status or error message, e.g. logcat.
17691    optional string debug_message = 2;
17692
17693    // Supplemental status subcode for AudioRecord.
17694    optional int32 status_subcode = 3;
17695
17696    // Uid associated with the AudioRecord.
17697    optional int32 uid = 4 [(is_uid) = true];
17698
17699    // The AudioRecord event.
17700    optional android.media.audio.AudioRecordEvent event = 5;
17701
17702    // Requested AudioRecord flags, with each flag bitwise ORed.
17703    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
17704    // audio_input_flags_t
17705    optional int32 input_flags = 6;
17706
17707    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
17708    // audio_source_t, representing the input source for the AudioRecord.
17709    optional android.media.audio.Source source = 7;
17710
17711    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
17712    // audio_format_t, representing the encoding of the AudioRecord data.
17713    optional android.media.audio.Encoding encoding = 8;
17714
17715    // Channel mask, with each channel position bitwise ORed.
17716    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
17717    // audio_channel_mask_t, representing the input channel configuration
17718    // of AudioRecord data.
17719    optional int64 channel_mask = 9;
17720
17721    // The size of the AudioRecord buffer in frames.
17722    // If an error occurs during creation, this may be a small integer requested size
17723    // as AudioFlinger is entitled to increase this as required.
17724    optional int32 buffer_frame_count = 10;
17725
17726    // Sample rate in Hz.
17727    optional int32 sample_rate = 11;
17728}
17729
17730/**
17731 * Logs the status of an AudioTrack operation.
17732 *
17733 * Logged from:
17734 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17735 */
17736message MediametricsAudioTrackStatusReported {
17737    // General status code for categorization of status.
17738    optional android.media.Status status = 1;
17739
17740    // Status or error message, e.g. logcat.
17741    optional string debug_message = 2;
17742
17743    // Supplemental status subcode for AudioTrack.
17744    optional int32 status_subcode = 3;
17745
17746    // Uid associated with track
17747    optional int32 uid = 4 [(is_uid) = true];
17748
17749    // The AudioTrack event.
17750    optional android.media.audio.AudioTrackEvent event = 5;
17751
17752    // Requested AudioTrack flags, with each flag bitwise ORed.
17753    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
17754    // audio_output_flags_t
17755    optional int32 output_flags = 6;
17756
17757    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
17758    // audio_content_type_t, representing the content type of the AudioTrack.
17759    optional android.media.audio.ContentType content_type = 7;
17760
17761    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
17762    // audio_usage_t, representing the use case for the AudioTrack.
17763    optional android.media.audio.Usage usage = 8;
17764
17765    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
17766    // audio_format_t, representing the encoding of the AudioTrack data.
17767    optional android.media.audio.Encoding encoding = 9;
17768
17769    // Channel mask, with each channel position bitwise ORed.
17770    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
17771    // audio_channel_mask_t, representing the channel configuration of AudioTrack data.
17772    optional int64 channel_mask = 10;
17773
17774    // The size of the AudioTrack buffer in frames.
17775    // If an error occurs during creation, this may be a small integer requested size
17776    // as AudioFlinger is entitled to increase this as required.
17777    optional int32 buffer_frame_count = 11;
17778
17779    // Sample rate in Hz.
17780    optional int32 sample_rate = 12;
17781
17782    // Playback speed, nominal 1.f representing 1x.
17783    optional float speed = 13;
17784
17785    // Playback pitch, nominal 1.f representing 1x.
17786    optional float pitch = 14;
17787}
17788
17789/**
17790 * Logs: i) creation of different types of cryptographic keys in the keystore,
17791 * ii) operations performed using the keys,
17792 * iii) attestation of the keys
17793 * Logged from: system/security/keystore/key_event_log_handler.cpp
17794 */
17795message KeystoreKeyEventReported {
17796
17797    enum Algorithm {
17798        /** Asymmetric algorithms. */
17799        RSA = 1;
17800        // 2 removed, do not reuse.
17801        EC = 3;
17802        /** Block cipher algorithms */
17803        AES = 32;
17804        TRIPLE_DES = 33;
17805        /** MAC algorithms */
17806        HMAC = 128;
17807    };
17808    /** Algorithm associated with the key */
17809    optional Algorithm algorithm = 1;
17810
17811    /** Size of the key */
17812    optional int32 key_size = 2;
17813
17814    enum KeyOrigin {
17815        /** Generated in keymaster.  Should not exist outside the TEE. */
17816        GENERATED = 0;
17817        /** Derived inside keymaster.  Likely exists off-device. */
17818        DERIVED = 1;
17819        /** Imported into keymaster.  Existed as cleartext in Android. */
17820        IMPORTED = 2;
17821        /** Keymaster did not record origin. */
17822        UNKNOWN = 3;
17823        /** Securely imported into Keymaster. */
17824        SECURELY_IMPORTED = 4;
17825    };
17826    /* Logs whether the key was generated, imported, securely imported, or derived.*/
17827    optional KeyOrigin key_origin = 3;
17828
17829    enum HardwareAuthenticatorType {
17830        NONE = 0;
17831        PASSWORD = 1;
17832        FINGERPRINT = 2;
17833        // Additional entries must be powers of 2.
17834    };
17835    /**
17836     * What auth types does this key require? If none,
17837     * then no auth required.
17838     */
17839    optional HardwareAuthenticatorType user_auth_type = 4;
17840
17841    /**
17842     * If user authentication is required, is the requirement time based? If it
17843     * is not time based then this field will not be used and the key is per
17844     * operation. Per operation keys must be user authenticated on each usage.
17845     */
17846    optional int32 user_auth_key_timeout_secs = 5;
17847
17848    /**
17849     * padding mode, digest, block_mode and purpose should ideally be repeated
17850     * fields. However, since statsd does not support repeated fields in
17851     * pushed atoms, they are represented using bitmaps.
17852     */
17853
17854    /** Track which padding mode is being used.*/
17855    optional int32 padding_mode_bitmap = 6;
17856
17857    /** Track which digest is being used. */
17858    optional int32 digest_bitmap = 7;
17859
17860    /** Track what block mode is being used (for encryption). */
17861    optional int32 block_mode_bitmap = 8;
17862
17863    /** Track what purpose is this key serving. */
17864    optional int32 purpose_bitmap = 9;
17865
17866    enum EcCurve {
17867        P_224 = 0;
17868        P_256 = 1;
17869        P_384 = 2;
17870        P_521 = 3;
17871    };
17872    /** Which ec curve was selected if elliptic curve cryptography is in use **/
17873    optional EcCurve ec_curve = 10;
17874
17875    enum KeyBlobUsageRequirements {
17876        STANDALONE = 0;
17877        REQUIRES_FILE_SYSTEM = 1;
17878    };
17879    /** Standalone or is a file system required */
17880    optional KeyBlobUsageRequirements key_blob_usage_reqs = 11;
17881
17882    enum Type {
17883        key_operation = 0;
17884        key_creation = 1;
17885        key_attestation = 2;
17886    }
17887    /** Key creation event, operation event or attestation event? */
17888    optional Type type = 12;
17889
17890    /** Was the key creation, operation, or attestation successful? */
17891    optional bool was_successful = 13;
17892
17893    /** Response code or error code */
17894    optional int32 error_code = 14;
17895}
17896
17897/**
17898 * Logs: key creation events with Algorithm, Origin, Error and Attestation info.
17899 * Logged from: system/security/keystore2/metrics.rs
17900 */
17901message Keystore2KeyCreationWithGeneralInfo {
17902
17903    // Algorithm associated with the key
17904    optional android.system.security.keystore2.Algorithm algorithm = 1;
17905
17906    // Size of the key, based on the algorithm used.
17907    optional int32 key_size = 2;
17908
17909    enum EcCurve {
17910        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
17911        EC_CURVE_UNSPECIFIED = 0;
17912        P_224 = 1;
17913        P_256 = 2;
17914        P_384 = 3;
17915        P_521 = 4;
17916        CURVE_25519 = 5;
17917    };
17918    // Which ec curve was selected if elliptic curve cryptography is in use
17919    optional EcCurve ec_curve = 3;
17920
17921    enum KeyOrigin {
17922        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
17923        ORIGIN_UNSPECIFIED = 0;
17924        // Generated in keymaster.  Should not exist outside the TEE.
17925        GENERATED = 1;
17926        // Derived inside keymaster.  Likely exists off-device.
17927        DERIVED = 2;
17928        // Imported into keymaster.  Existed as cleartext in Android.
17929        IMPORTED = 3;
17930        // Previously used for another purpose that is now obsolete.
17931        RESERVED = 4;
17932        // Securely imported into Keymaster.
17933        SECURELY_IMPORTED = 5;
17934    };
17935    // Logs whether the key was generated, imported, securely imported, or derived.
17936    optional KeyOrigin key_origin = 4;
17937
17938    /**
17939     * Response code (system/hardware/interfaces/keystore2/aidl/../ResponseCode.aidl)
17940     * or
17941     * error code (hardware/interfaces/security/keymint/aidl/../ErrorCode.aidl)
17942     */
17943    optional int32 error_code = 5;
17944
17945    // Indicates whether key attestation is requested in creation
17946    optional bool attestation_requested = 6;
17947
17948    // Count of a particular combination of field values of this atom
17949    optional int32 count = 7;
17950}
17951
17952/**
17953 * Logs: key creation events with authentication info.
17954 * Logged from: system/security/keystore2/metrics.rs
17955 */
17956message Keystore2KeyCreationWithAuthInfo {
17957
17958    enum HardwareAuthenticatorType {
17959        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
17960        AUTH_TYPE_UNSPECIFIED = 0;
17961        NONE = 1;
17962        PASSWORD = 2;
17963        FINGERPRINT = 3;
17964        ANY = 5;
17965    };
17966    /**
17967     * What auth types does this key require? If none,
17968     * then no auth required.
17969     */
17970    optional HardwareAuthenticatorType user_auth_type = 1;
17971
17972    /**
17973     * If user authentication is required, is the requirement time based? If it
17974     * is time based then this field indicates the base 10 logarithm of time out in seconds.
17975     * Logarithm is taken in order to reduce the cardinaltiy.
17976     */
17977    optional int32 log_auth_timeout_seconds = 2;
17978
17979    // Security level of the Keymint instance which creates the key.
17980    optional android.system.security.keystore2.SecurityLevelEnum security_level = 3;
17981
17982    // Count of a particular combination of field values of this atom
17983    optional int32 count = 4;
17984}
17985
17986/**
17987 * Logs: key creation events with purpose and modes info.
17988 * Logged from: system/security/keystore2/metrics.rs
17989 */
17990message Keystore2KeyCreationWithPurposeAndModesInfo {
17991    // Algorithm associated with the key
17992    optional android.system.security.keystore2.Algorithm algorithm = 1;
17993
17994	/**
17995     * Track which purpose is being used.
17996     * Bitmap composition is given by KeyPurposeBitPosition enum
17997     * defined in system/security/keystore2/metrics.rs.
17998     */
17999    optional int32 purpose_bitmap = 2;
18000
18001    /**
18002     * Track which padding mode is being used.
18003     * Bitmap composition is given by PaddingModeBitPosition enum
18004     * defined in system/security/keystore2/metrics.rs.
18005     */
18006    optional int32 padding_mode_bitmap = 3;
18007
18008    /**
18009     * Track which digest is being used.
18010     * Bitmap composition is given by DigestBitPosition enum
18011     * defined in system/security/keystore2/metrics.rs.
18012     */
18013    optional int32 digest_bitmap = 4;
18014
18015    /**
18016     * Track which block mode is being used.
18017     * Bitmap composition is given by BlockModeBitPosition enum
18018     * defined in system/security/keystore2/metrics.rs.
18019     */
18020    optional int32 block_mode_bitmap = 5;
18021
18022    // Count of a particular combination of field values of this atom
18023    optional int32 count = 6;
18024}
18025
18026/**
18027 * Logs the atom id of the atoms associated with key creation/operation events, that have reached
18028 * the maximum storage limit allocated for different atom objects of that atom,
18029 * in keystore in-memory store.
18030 *
18031 * Size of the storage bucket for each atom is limited considering their expected cardinaltity.
18032 * This limit may exceed if the dimensions of the atoms take a large number of unexpected
18033 * combinations. This atom is used to track such cases.
18034 */
18035message Keystore2AtomWithOverflow {
18036
18037    // Atom id as defined in atoms.proto
18038    optional int32 atom_id = 1;
18039
18040    // Count of the objects of this atom type that have overflowed.
18041    optional int32 count = 2;
18042}
18043
18044/**
18045 * Logs: key operations events with purpose and modes info.
18046 * Logged from: system/security/keystore2/metrics.rs
18047 */
18048message Keystore2KeyOperationWithPurposeAndModesInfo {
18049
18050    enum KeyPurpose {
18051        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
18052        KEY_PURPOSE_UNSPECIFIED = 0;
18053
18054        // Usable with RSA, 3DES and AES keys.
18055        ENCRYPT = 1;
18056
18057        // Usable with RSA, 3DES and AES keys.
18058        DECRYPT = 2;
18059
18060        // Usable with RSA, EC and HMAC keys.
18061        SIGN = 3;
18062
18063        // Usable with RSA, EC and HMAC keys.
18064        VERIFY = 4;
18065
18066        // 5 is reserved
18067        // Usable with RSA keys.
18068        WRAP_KEY = 6;
18069
18070        // Key Agreement, usable with EC keys.
18071        AGREE_KEY = 7;
18072
18073        // Usable as an attestation signing key.
18074        ATTEST_KEY = 8;
18075    }
18076    // Purpose of the key operation
18077    optional KeyPurpose purpose = 1;
18078
18079    /**
18080     * Track which padding mode is being used.
18081     * Bitmap composition is given by PaddingModeBitPosition enum
18082     * defined in system/security/keystore2/metrics.rs.
18083     */
18084    optional int32 padding_mode_bitmap = 2;
18085
18086    /**
18087     * Track which digest is being used.
18088     * Bitmap composition is given by DigestBitPosition enum
18089     * defined in system/security/keystore2/metrics.rs.
18090     */
18091    optional int32 digest_bitmap = 3;
18092
18093    /**
18094     * Track which block mode is being used.
18095     * Bitmap composition is given by BlockModeBitPosition enum
18096     * defined in system/security/keystore2/metrics.rs.
18097     */
18098    optional int32 block_mode_bitmap = 4;
18099
18100    // Count of a particular combination of field values of this atom
18101    optional int32 count = 5;
18102}
18103
18104/**
18105 * Logs key operations events with outcome, error_code, security level and whether the key is
18106 * upgraded during the operation.
18107 * Logged from: system/security/keystore2/metrics.rs
18108 */
18109message Keystore2KeyOperationWithGeneralInfo {
18110
18111    enum Outcome {
18112        OUTCOME_UNSPECIFIED = 0;
18113        DROPPED = 1;
18114        SUCCESS = 2;
18115        ABORT = 3;
18116        PRUNED = 4;
18117        ERROR = 5;
18118    }
18119    // Outcome of the operation
18120    optional Outcome outcome = 1;
18121
18122    // Response code or error code in case of error outcome
18123    optional int32 error_code = 2;
18124
18125    // Indicates whether the key was upgraded during the operation
18126    optional bool key_upgraded = 3;
18127
18128    // Security level of the Keymint instance which performs the operation.
18129    optional android.system.security.keystore2.SecurityLevelEnum security_level = 4;
18130
18131    // Count of a particular combination of field values of this atom
18132    optional int32 count = 5;
18133}
18134
18135/**
18136 * Logs: Keystore 2 storage statistics.
18137 * Logged from: system/security/keystore2
18138 */
18139message Keystore2StorageStats {
18140    enum Storage {
18141       STORAGE_UNSPECIFIED = 0;
18142       KEY_ENTRY = 1;
18143       KEY_ENTRY_ID_INDEX = 2;
18144       KEY_ENTRY_DOMAIN_NAMESPACE_INDEX = 3;
18145       BLOB_ENTRY = 4;
18146       BLOB_ENTRY_KEY_ENTRY_ID_INDEX = 5;
18147       KEY_PARAMETER = 6;
18148       KEY_PARAMETER_KEY_ENTRY_ID_INDEX = 7;
18149       KEY_METADATA = 8;
18150       KEY_METADATA_KEY_ENTRY_ID_INDEX = 9;
18151       GRANT = 10;
18152       AUTH_TOKEN = 11;
18153       BLOB_METADATA = 12;
18154       BLOB_METADATA_BLOB_ENTRY_ID_INDEX =13;
18155       METADATA = 14;
18156       DATABASE = 15;
18157       LEGACY_STORAGE = 16;
18158    }
18159    // Type of the storage (database table or legacy storage) of which the size is reported.
18160    optional Storage storage_type = 1;
18161    // Storage size in bytes
18162    optional int64 size = 2;
18163    // Unused space, in bytes. The total storage size may be larger, indicating
18164    // inefficiencies in the packing of data in the database.
18165    optional int64 unused_size = 3;
18166}
18167
18168/**
18169 * Logs Remote Key Provisioning (RKP) related error events.
18170 * Logged from: system/security/keystore2
18171 */
18172message RkpErrorStats {
18173
18174    enum RkpError {
18175        RKP_ERROR_UNSPECIFIED = 0;
18176        // The key pool is out of keys.
18177        OUT_OF_KEYS = 1;
18178        // Falling back to factory provisioned keys during hybrid mode.
18179        FALL_BACK_DURING_HYBRID = 2;
18180    }
18181    // Type of the error event
18182    optional RkpError rkp_error = 1;
18183
18184    // Count of a particular error occurred.
18185    optional int32 count = 2;
18186
18187    /**
18188     * Security level of the IRemotelyProvisionedComponent.
18189     */
18190    optional android.system.security.keystore2.SecurityLevelEnum security_level = 3;
18191}
18192
18193
18194/**
18195 * Deprecated in U. Use RkpdPoolStats instead.
18196 *
18197 * Logs: Status of the attestation key pool related to
18198 * Remote Key Provisioning (RKP).
18199 * Logged from: system/security/keystore2
18200 */
18201message RkpPoolStats {
18202    /**
18203     * Security level of the Keymint instance associated with the
18204     * attestation pool status.
18205     */
18206    optional android.system.security.keystore2.SecurityLevelEnum security_level = 1;
18207
18208    /**
18209     * The number of signed attestation certificate chains which are
18210     * expired.
18211     */
18212    optional int32 expiring = 2;
18213
18214    /**
18215     * The number of signed attestation certificate chains which have
18216     * not yet been assigned to an app.
18217     */
18218    optional int32 unassigned = 3;
18219
18220    /**
18221     * The number of signed attestation keys.
18222     */
18223    optional int32 attested = 4;
18224
18225    /**
18226     * The total number of attestation keys.
18227     */
18228    optional int32 total = 5;
18229}
18230
18231/**
18232 * Logs: Number of keystore2 crashes per-boot cycle.
18233 * Logged from: system/security/keystore2
18234 */
18235message Keystore2CrashStats {
18236    optional int32 count_of_crash_events = 1;
18237}
18238
18239// Blob Committer stats
18240// Keep in sync between:
18241//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
18242//     frameworks/base/cmds/statsd/src/atoms.proto
18243message BlobCommitterProto {
18244    // Committer app's uid
18245    optional int32 uid = 1 [(is_uid) = true];
18246
18247    // Unix epoch timestamp of the commit in milliseconds
18248    optional int64 commit_timestamp_millis = 2;
18249
18250    // Flags of what access types the committer has set for the Blob
18251    optional int32 access_mode = 3;
18252
18253    // Number of packages that have been whitelisted for ACCESS_TYPE_WHITELIST
18254    optional int32 num_whitelisted_package = 4;
18255}
18256
18257// Blob Leasee stats
18258// Keep in sync between:
18259//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
18260//     frameworks/base/cmds/statsd/src/atoms.proto
18261message BlobLeaseeProto {
18262    // Leasee app's uid
18263    optional int32 uid = 1 [(is_uid) = true];
18264
18265    // Unix epoch timestamp for lease expiration in milliseconds
18266    optional int64 lease_expiry_timestamp_millis = 2;
18267}
18268
18269// List of Blob Committers
18270// Keep in sync between:
18271//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
18272//     frameworks/base/cmds/statsd/src/atoms.proto
18273message BlobCommitterListProto {
18274    repeated BlobCommitterProto committer = 1;
18275}
18276
18277// List of Blob Leasees
18278// Keep in sync between:
18279//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
18280//     frameworks/base/cmds/statsd/src/atoms.proto
18281message BlobLeaseeListProto {
18282    repeated BlobLeaseeProto leasee = 1;
18283}
18284
18285/**
18286 * Logs the current state of a Blob committed with BlobStoreManager
18287 *
18288 * Pulled from:
18289 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
18290 */
18291message BlobInfo {
18292    // Id of the Blob
18293    optional int64 blob_id = 1;
18294
18295    // Size of the Blob data
18296    optional int64 size = 2;
18297
18298    // Unix epoch timestamp of the Blob's expiration in milliseconds
18299    optional int64 expiry_timestamp_millis = 3;
18300
18301    // List of committers of this Blob
18302    optional BlobCommitterListProto committers = 4 [(log_mode) = MODE_BYTES];
18303
18304    // List of leasees of this Blob
18305    optional BlobLeaseeListProto leasees = 5 [(log_mode) = MODE_BYTES];
18306}
18307
18308/**
18309 * Logs when the HDMI CEC active source changes.
18310 *
18311 * Logged from:
18312 *   frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecAtomWriter.java
18313 */
18314message HdmiCecActiveSourceChanged {
18315    // The logical address of the active source.
18316    optional android.stats.hdmi.LogicalAddress active_source_logical_address = 1;
18317
18318    // The physical address of the active source. Consists of four hexadecimal nibbles.
18319    // Examples: 0x1234, 0x0000 (root device). 0xFFFF represents an unknown or invalid address.
18320    // See section 8.7 in the HDMI 1.4b spec for details.
18321    optional int32 active_source_physical_address = 2;
18322
18323    // The relationship between this device and the active source.
18324    optional android.stats.hdmi.PathRelationship local_relationship = 3;
18325}
18326
18327/**
18328 * Logs when an HDMI CEC message is sent or received.
18329 *
18330 * Logged from:
18331 *   frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecAtomWriter.java
18332 */
18333message HdmiCecMessageReported {
18334    // The calling uid of the application that caused this atom to be written.
18335    optional int32 uid = 1 [(is_uid) = true];
18336
18337    // Whether a HDMI CEC message is sent from this device, to this device, or neither.
18338    optional android.stats.hdmi.MessageDirection direction = 2;
18339
18340    // The HDMI CEC logical address of the initiator.
18341    optional android.stats.hdmi.LogicalAddress initiator_logical_address = 3;
18342
18343    // The HDMI CEC logical address of the destination.
18344    optional android.stats.hdmi.LogicalAddress destination_logical_address = 4;
18345
18346    // The opcode of the message. Ranges from 0x00 to 0xFF.
18347    // For all values, see section "CEC 15 Message Descriptions" in the HDMI CEC 1.4b spec.
18348    optional int32 opcode = 5;
18349
18350    // The result of attempting to send the message on its final retransmission attempt.
18351    // Only applicable to outgoing messages; set to SEND_MESSAGE_RESULT_UNKNOWN otherwise.
18352    optional android.stats.hdmi.SendMessageResult send_message_result = 6;
18353
18354    // Fields specific to <User Control Pressed> messages
18355
18356    // The user control command that was received.
18357    optional android.stats.hdmi.UserControlPressedCommand user_control_pressed_command = 7;
18358
18359    // Fields specific to <Feature Abort> messages
18360
18361    // The opcode of the message that was feature aborted.
18362    // Set to 0x100 when unknown or not applicable.
18363    optional int32 feature_abort_opcode = 8;
18364
18365    // The reason for the feature abort.
18366    optional android.stats.hdmi.FeatureAbortReason feature_abort_reason = 9;
18367
18368    // The physical address in <Report Physical Address> messages. Consists of
18369    // four hexadecimal nibbles. Examples: 0x1234, 0x0000 (root device). 0xFFFF
18370    // represents an unknown or invalid address.
18371    //
18372    // Physical address is assigned to each device through a discovery process.
18373    // It indicates the connection hierarchy, for example, 1:2:0:0 is under
18374    // 1:0:0:0, which is under 0:0:0:0.
18375    //
18376    // See section 8.7 in the HDMI 1.4b spec for details.
18377    optional int32 physical_address = 10;
18378}
18379
18380/**
18381 * Logs when an auto rotate event occurs while smart auto rotate is enabled.
18382 */
18383message AutoRotateReported {
18384    enum Orientation {
18385        UNKNOWN = 0;
18386        DEPRECATED = 1;
18387        ROTATION_0 = 2;
18388        ROTATION_90 = 3;
18389        ROTATION_180 = 4;
18390        ROTATION_270 = 5;
18391        DISABLED = 6;
18392        UNAVAILABLE = 7;
18393        FAILURE = 8;
18394    }
18395
18396    // Orientation of the device when a rotation was detected.
18397    optional Orientation current_orientation = 1;
18398    // The orientation of the phone after rotation before going through the recommendation service.
18399    optional Orientation proposed_orientation = 2;
18400    // Orientation recommended by the smart autorotate service component outside of the platform. It
18401    // may or may not match the proposed_orientation. Can be disabled or unavailable if the
18402    // recommendation service is disabled or unavailable. Will be unknown if the service failed.
18403    optional Orientation recommended_orientation = 3;
18404    // Time taken to calculate the rotation recommendation.
18405    optional int64 recommendation_process_duration_millis = 4;
18406}
18407
18408/**
18409 * Logs when sensors only autorotate is triggered. Associated event can be a rotation preindication,
18410 * actual event or a "data ready to be pulled" indication. More info: go/autorotate-logging.
18411 *
18412 * Logged from:
18413 *    platform/vendor/unbundled_google/packages/SystemUIGoogle/src/com/google/android/systemui/autorotate/DataLogger.java
18414 */
18415
18416message DeviceRotated {
18417  // Timestamp of the event in millis. We log the timestamp explicitly since
18418  // data logging will follow the event logging and all these
18419  // will be joined with other logs such as rotation button clicked.
18420  optional int64 timestamp_millis = 1;
18421  // Device orientation
18422  optional android.stats.wm.Orientation proposed_orientation = 2;
18423
18424  enum RotationEventType{
18425    UNKNOWN = 0;
18426    // An early indication of device might be rotated.
18427    PREINDICATION = 1;
18428    // Device rotation is detected.
18429    ACTUAL_EVENT = 2;
18430    // Device rotated and the data associated with it is ready to be pulled.
18431    // This happens after the ACTUAL_EVENT since some data after the event is
18432    // also useful.
18433    DATA_READY = 3;
18434  }
18435  optional RotationEventType rotation_event_type = 3;
18436}
18437
18438/**
18439 * Records the raw sensor data published by the device orientation debug sensor. The pull will be
18440 * configured to be conditioned on the {@code DeviceRotated} atom.
18441 *
18442 * Logged from:
18443 *     platform/vendor/unbundled_google/packages/SystemUIGoogle/src/com/google/android/systemui/autorotate/DataLogger.java
18444 */
18445message DeviceRotatedData {
18446  // All the sensor data and timestamps used to calculate the orientation
18447  optional DeviceRotatedSensorData snapshot = 1 [(log_mode) = MODE_BYTES];
18448  // Resulting orientation
18449  optional android.stats.wm.Orientation proposed_orientation = 2;
18450}
18451
18452message DeviceRotatedSensorData {
18453  optional DeviceRotatedSensorHeader header = 1 [(log_mode) = MODE_BYTES];
18454  repeated DeviceRotatedSensorSample sample = 2 [(log_mode) = MODE_BYTES];
18455}
18456
18457message DeviceRotatedSensorHeader {
18458  optional int64 timestamp_base_millis = 1;
18459}
18460
18461message DeviceRotatedSensorSample{
18462  optional int32 timestamp_offset_millis = 1;
18463  enum SensorType {
18464    UNKNOWN = 0;
18465    ACCEL = 1;
18466    GYRO = 2;
18467  }
18468  optional SensorType sensor_type = 2;
18469  optional float x_value = 3;
18470  optional float y_value = 4;
18471  optional float z_value = 5;
18472}
18473
18474/**
18475  * Pushes TLS handshake counters from Conscrypt.
18476  * Pulled from:
18477  *   external/conscrypt/common/src/main/java/org/conscrypt/ConscryptEngineSocket.java
18478  *   external/conscrypt/common/src/main/java/org/conscrypt/ConscryptFileDescriptorSocket.java
18479  */
18480message TlsHandshakeReported {
18481    optional bool success = 1;
18482
18483    optional android.stats.tls.Protocol protocol = 2;
18484
18485    optional android.stats.tls.CipherSuite cipher_suite = 3;
18486
18487    optional int32 handshake_duration_millis = 4;
18488
18489    optional android.stats.tls.Source source = 5;
18490
18491    repeated int32 uid = 6 [(is_uid) = true];
18492}
18493
18494/**
18495 * Logs when a TextClassifier API is invoked.
18496 *
18497 * See frameworks/base/core/java/android/view/textclassifier/TextClassifier.java
18498 * Logged from: external/libtextclassifier/java/
18499 */
18500message TextClassifierApiUsageReported {
18501    enum ApiType {
18502        UNKNOWN_API = 0;
18503        SUGGEST_SELECTION = 1;
18504        CLASSIFY_TEXT = 2;
18505        GENERATE_LINKS = 3;
18506        DETECT_LANGUAGES = 4;
18507        SUGGEST_CONVERSATION_ACTIONS = 5;
18508    }
18509    optional ApiType api_type = 1;
18510
18511    enum ResultType {
18512        UNKNOWN_RESULT = 0;
18513        SUCCESS = 1;
18514        FAIL = 2;
18515    }
18516    optional ResultType result_type = 2;
18517    optional int64 latency_millis = 3;
18518    optional string session_id = 4;
18519}
18520
18521/**
18522 * Logs when TextClassifier Model Downloader finishes a download task.
18523 *
18524 * Currently we create a downlaod task for each new manifest to download.
18525 *
18526 * Logged from: external/libtextclassifier/java/
18527 */
18528message TextClassifierDownloadReported {
18529    // The model type to download
18530    enum ModelType {
18531        UNKNOWN_MODEL_TYPE = 0;
18532        ANNOTATOR = 1;
18533        LANG_ID = 2;
18534        ACTIONS_SUGGESTIONS = 3;
18535    }
18536    optional ModelType model_type = 1;
18537    // The file type to download
18538    enum FileType {
18539        UNKNOWN_FILE_TYPE = 0;
18540        MANIFEST = 1;
18541        MODEL = 2;
18542    }
18543    // Deprecated: now manifest and model files are downloaded together.
18544    optional FileType file_type = 2;
18545    // The status of the download
18546    enum DownloadStatus {
18547        UNKNOWN_STATUS = 0;
18548        SCHEDULED = 1;
18549        SUCCEEDED = 2;
18550        FAILED_AND_RETRY = 3;
18551        FAILED_AND_ABORT = 4;
18552    }
18553    optional DownloadStatus download_status = 3;
18554    // The public GStatic url we used to download the model. Contains locale info.
18555    optional string url_suffix = 4;
18556    // Failure reason, only set if this is for a failure status
18557    enum FailureReason {
18558        reserved 1, 8, 9;
18559
18560        UNKNOWN_FAILURE_REASON = 0;
18561        FAILED_TO_DOWNLOAD_SERVICE_CONN_BROKEN = 2;
18562        FAILED_TO_DOWNLOAD_404_ERROR = 3;
18563        FAILED_TO_DOWNLOAD_OTHER = 4;
18564        DOWNLOADED_FILE_MISSING = 5;
18565        FAILED_TO_PARSE_MANIFEST = 6;
18566        FAILED_TO_VALIDATE_MODEL = 7;
18567    }
18568    optional FailureReason failure_reason = 5;
18569    // How many attempts we have tried for the same task at a terminal status (i.e. SUCCEEDED or
18570    // FAILED_AND_ABORT).
18571    optional int32 run_attempt_count = 6;
18572
18573    // Custom failure code for downloader lib internal failures (E.g. 404 error).
18574    optional int32 downloader_lib_failure_code = 7;
18575
18576    // Time elapsed for the whole download task
18577    optional int64 download_duration_millis = 8;
18578
18579    // The id of the WorkManager work that launched this download.
18580    optional int64 work_id = 9;
18581}
18582
18583/**
18584 * Logs when TextClassifier Model Downloader schedules a WorkManager work.
18585 *
18586 * Logged from: external/libtextclassifier/java/
18587 */
18588message TextClassifierDownloadWorkScheduled {
18589    optional int64 work_id = 1;
18590
18591    enum ReasonToSchedule {
18592        UNKNOWN_REASON_TO_SCHEDULE = 0;
18593        TCS_STARTED = 1;
18594        LOCALE_SETTINGS_CHANGED = 2;
18595        DEVICE_CONFIG_UPDATED = 3;
18596    }
18597    optional ReasonToSchedule reason_to_schedule = 2;
18598
18599    optional bool failed_to_schedule = 3;
18600}
18601
18602/**
18603 * Logs when TextClassifier Model Downloader finishes a WorkManager work.
18604 *
18605 * A WorkManager work includes one or more downlad tasks. We log this atom when
18606 * all tasks finished. The work_id can be used to join work log and task logs.
18607 *
18608 * Logged from: external/libtextclassifier/java/
18609 */
18610message TextClassifierDownloadWorkCompleted {
18611    optional int64 work_id = 1;
18612
18613    enum WorkResult {
18614        UNKNOWN_WORK_RESULT = 0;
18615        SUCCESS_MODEL_DOWNLOADED = 1;
18616        SUCCESS_NO_UPDATE_AVAILABLE = 2;
18617        FAILURE_MODEL_DOWNLOADER_DISABLED = 3;
18618        FAILURE_MAX_RUN_ATTEMPT_REACHED = 4;
18619        RETRY_MODEL_DOWNLOAD_FAILED = 5;
18620        RETRY_RUNTIME_EXCEPTION = 6;
18621        RETRY_STOPPED_BY_OS = 7;
18622    }
18623    optional WorkResult work_result = 2;
18624
18625    // How many attempts we have tried for this work.
18626    optional int32 run_attempt_count = 3;
18627
18628    optional int64 work_scheduled_to_started_duration_millis = 4;
18629    optional int64 work_started_to_ended_duration_millis = 5;
18630}
18631
18632/**
18633 * Logs telemetry for Android Virtualization framework
18634 *
18635 * On CreateVM requests, an atom is pushed that records what hypervisor is being used.
18636 * the protected status of the new VM, and if the VM creation succeeded
18637 * Logged from: packages/modules/Virtualization/
18638 */
18639message VmCreationRequested {
18640    enum Hypervisor {
18641        UNKNOWN = 0;
18642        PKVM = 1;
18643        OTHER = 2;
18644    }
18645
18646    enum ConfigType {
18647        UNKNOWN_CONFIG = 0;
18648        VIRTUAL_MACHINE_APP_CONFIG = 1;
18649        VIRTUAL_MACHINE_RAW_CONFIG = 2;
18650    }
18651
18652    optional Hypervisor hypervisor = 1;
18653    // Is the VM started in protected mode?
18654    optional bool is_protected = 2;
18655    // Did the VM creation succeed
18656    optional bool creation_succeeded = 3;
18657    // Binder exception Code thrown by createVm request
18658    optional int32 binder_exception_code = 4;
18659
18660    optional int32 uid = 5 [(is_uid) = true];
18661    optional string vm_identifier = 6;
18662
18663    optional ConfigType config_type = 7;
18664    optional int32 num_cpus = 8;
18665    optional string cpu_affinity = 9 [deprecated = true];
18666    optional int32 memory_mib = 10;
18667    optional string apexes = 11;
18668
18669    // TODO(seungjaeyoo) Fill information about task_profile
18670    // TODO(seungjaeyoo) Fill information about disk_image for raw config
18671
18672}
18673
18674/**
18675 * Logs telemetry for Android Virtualization framework
18676 *
18677 * When VM is booted successfully, an atom is pushed that records information about VM.
18678 * Logged from: packages/modules/Virtualization/
18679 */
18680message VmBooted {
18681    optional int32 uid = 1 [(is_uid) = true];
18682    optional string vm_identifier = 2;
18683    // Elapsed time between start and boot completion of a VM
18684    optional int64 elapsed_time_millis = 3;
18685}
18686
18687/**
18688 * Logs telemetry for Android Virtualization framework
18689 *
18690 * When VM is exited, an atom is pushed that records information about VM.
18691 * Logged from: packages/modules/Virtualization/
18692 */
18693message VmExited {
18694    enum DeathReason {
18695        UNKNOWN = 0;
18696        INFRASTRUCTURE_ERROR = 1;
18697        KILLED = 2;
18698        SHUTDOWN = 3;
18699        ERROR = 4;
18700        REBOOT = 5;
18701        CRASH = 6;
18702        PVM_FIRMWARE_PUBLIC_KEY_MISMATCH = 7;
18703        PVM_FIRMWARE_INSTANCE_IMAGE_CHANGED = 8;
18704        BOOTLOADER_PUBLIC_KEY_MISMATCH = 9;
18705        BOOTLOADER_INSTANCE_IMAGE_CHANGED = 10;
18706        MICRODROID_FAILED_TO_CONNECT_TO_VIRTUALIZATION_SERVICE = 11;
18707        MICRODROID_PAYLOAD_HAS_CHANGED = 12;
18708        MICRODROID_PAYLOAD_VERIFICATION_FAILED = 13;
18709        MICRODROID_INVALID_PAYLOAD_CONFIG = 14;
18710        MICRODROID_UNKNOWN_RUNTIME_ERROR = 15;
18711        HANGUP = 16;
18712    }
18713    optional int32 uid = 1 [(is_uid) = true];
18714    optional string vm_identifier = 2;
18715
18716    optional DeathReason death_reason = 3;
18717    // Exit signal when VM was KILLED
18718    optional int32 exit_signal = 8;
18719
18720    // Elapsed time between start and termination of a VM
18721    optional int64 elapsed_time_millis = 4;
18722
18723    // Guest time for CPU usage
18724    optional int64 guest_time_millis = 5;
18725
18726    // RSS for memory usage
18727    optional int64 rss_vm_kb = 6;
18728    optional int64 rss_crosvm_kb = 7;
18729}
18730
18731/**
18732 * (Deprecated)
18733 * Logs telemetry for Android Virtualization framework
18734 *
18735 * For every second while VM is running, an atom is pushed that records CPU time information of VM.
18736 * Logged from: packages/modules/Virtualization/
18737 */
18738message VmCpuStatusReported {
18739    option deprecated = true;
18740
18741    optional int32 uid = 1 [(is_uid) = true];
18742    optional string vm_identifier = 2;
18743
18744    optional int64 cpu_time_user_millis = 3;
18745    optional int64 cpu_time_nice_millis = 4;
18746    optional int64 cpu_time_sys_millis = 5;
18747    optional int64 cpu_time_idle_millis = 6;
18748}
18749
18750/**
18751 * (Deprecated)
18752 * Logs telemetry for Android Virtualization framework
18753 *
18754 * For every second while VM is running, an atom is pushed that records memory information of VM.
18755 * Logged from: packages/modules/Virtualization/
18756 */
18757message VmMemStatusReported {
18758    option deprecated = true;
18759
18760    optional int32 uid = 1 [(is_uid) = true];
18761    optional string vm_identifier = 2;
18762
18763    optional int64 mem_total_kb = 3;
18764    optional int64 mem_free_kb = 4;
18765    optional int64 mem_available_kb = 5;
18766    optional int64 mem_buffer_kb = 6;
18767    optional int64 mem_cached_kb = 7;
18768}
18769
18770/**
18771 * Logs telemetry for Early boot CompOsArtifacts checks (done by odsign)
18772 *
18773 * odsign is a binary that runs during early boot. One of its responsibility is
18774 * to check if the device can use compOS and check if so, validate the compos
18775 * generated artifacts. An atom is pushed on each such check. Note: We only
18776 * push an atom from devices/configurations that can use compOs.
18777 */
18778message EarlyBootCompOsArtifactsCheckReported {
18779  // Are the current Artifacts okay (This check is done by odrefresh).
18780  // (current_artifacts_ok == true) => compilationRequired is false
18781  optional bool current_artifacts_ok = 1;
18782  // Has CompOs generated any Artifacts
18783  optional bool comp_os_pending_artifacts_exists = 2;
18784  // The device will be using CompOs generated artifacts. Note: the value of
18785  // this is meaningless if current_artifacts_ok = true
18786  optional bool use_comp_os_generated_artifacts = 3;
18787}
18788
18789/**
18790 * Logs telemetry when Isolation compilation job is scheduled.
18791 *
18792 * The atoms are sent by IsolatedCompilationService (fragment of system_server)
18793 * when apex are staged and need compilation.
18794 */
18795message IsolatedCompilationScheduled {
18796    enum Result {
18797        SCHEDULING_RESULT_UNKNOWN = 0;
18798        SCHEDULING_FAILURE = 1;
18799        SCHEDULING_SUCCESS = 2;
18800    }
18801    optional Result scheduling_result = 1;
18802}
18803
18804/**
18805 * Logs telemetry Isolation compilation completion.
18806 *
18807 * The atoms is sent by IsolatedCompilationService by compilation ends
18808 * and contain results/timings of compilation
18809 */
18810message IsolatedCompilationEnded {
18811    enum Result {
18812        RESULT_UNKNOWN = 0;
18813        RESULT_SUCCESS = 1;
18814        RESULT_UNKNOWN_FAILURE = 2;
18815        RESULT_FAILED_TO_START = 3;
18816        RESULT_JOB_CANCELED = 4;
18817        RESULT_COMPILATION_FAILED = 5;
18818        RESULT_UNEXPECTED_COMPILATION_RESULT = 6;
18819        RESULT_COMPOSD_DIED = 7;
18820        RESULT_FAILED_TO_ENABLE_FSVERITY = 8;
18821    }
18822    // Time between compilation job starts to when it ends.
18823    // Note: this does not include the time between compilation job being scheduled (or when apex is staged)
18824    // and it actually starting
18825    optional int64 compilation_time_millis = 1;
18826    // Result of compilation
18827    optional Result compilation_result = 2;
18828    // In case the job scheduler cancels the job, this will be the reason code
18829    // Codes are used from https://source.corp.google.com/android/frameworks/base/apex/jobscheduler/framework/java/android/app/job/JobParameters.java
18830    // Note: this field only makes sense when compilation_result = RESULT_JOB_CANCELED
18831    optional int32 compilation_job_stop_reason = 3;
18832}
18833
18834/**
18835 * Logs the current state of an application/process before it is killed.
18836 *
18837 * Keep in sync with proto file at
18838 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18839 *
18840 * Pushed from:
18841 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18842 */
18843message CarWatchdogKillStatsReported {
18844    // Linux process uid for the package.
18845    optional int32 uid = 1 [(is_uid) = true];
18846
18847    // State of the uid when it was killed.
18848    enum UidState {
18849        UNKNOWN_UID_STATE = 0;
18850        BACKGROUND_MODE = 1;
18851        FOREGROUND_MODE = 2;
18852    }
18853    optional UidState uid_state = 2;
18854
18855    // System state indicating whether the system was in normal mode or garage mode.
18856    enum SystemState {
18857        UNKNOWN_SYSTEM_STATE = 0;
18858        USER_INTERACTION_MODE = 1;
18859        USER_NO_INTERACTION_MODE = 2;
18860        GARAGE_MODE = 3;
18861    }
18862    optional SystemState system_state = 3;
18863
18864    // Reason for killing the application.
18865    // Keep in sync with proto file at packages/services/Car/cpp/watchdog/proto
18866    enum KillReason {
18867        UNKNOWN_KILL_REASON = 0;
18868        KILLED_ON_ANR = 1;
18869        KILLED_ON_IO_OVERUSE = 2;
18870        KILLED_ON_MEMORY_OVERUSE = 3;
18871    }
18872    optional KillReason kill_reason = 4;
18873
18874    // Stats of the processes owned by the application when the application was killed.
18875    // The process stack traces are not collected when the application was killed due to IO_OVERUSE.
18876    optional CarWatchdogProcessStats process_stats = 5 [(log_mode) = MODE_BYTES];
18877
18878    // The application's I/O overuse stats logged only when the kill reason is KILLED_ON_IO_OVERUSE.
18879    optional CarWatchdogIoOveruseStats io_overuse_stats = 6 [(log_mode) = MODE_BYTES];
18880}
18881
18882/**
18883 * Logs the I/O overuse stats for an application on detecting I/O overuse.
18884 *
18885 * Keep in sync with proto file at
18886 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18887 *
18888 * Pushed from:
18889 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18890 */
18891message CarWatchdogIoOveruseStatsReported {
18892    // Linux process uid for the package.
18893    optional int32 uid = 1 [(is_uid) = true];
18894
18895    // The application's I/O overuse stats.
18896    optional CarWatchdogIoOveruseStats io_overuse_stats = 2 [(log_mode) = MODE_BYTES];
18897}
18898
18899/**
18900 * Logs I/O overuse stats for a package.
18901 *
18902 * Keep in sync with proto file at
18903 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18904 *
18905 * Logged from:
18906 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18907 */
18908message CarWatchdogIoOveruseStats {
18909    enum Period {
18910        UNKNOWN_PERIOD = 0;
18911        DAILY = 1;
18912        WEEKLY = 2;
18913    }
18914
18915    // Threshold and usage stats period.
18916    optional Period period = 1;
18917
18918    // Threshold in-terms of write bytes defined for the package.
18919    optional CarWatchdogPerStateBytes threshold = 2;
18920
18921    // Number of write bytes in each state for the specified period.
18922    optional CarWatchdogPerStateBytes written_bytes = 3;
18923
18924    // Application or service uptime during the aforementioned period.
18925    optional uint64 uptime_millis = 4;
18926};
18927
18928/**
18929 * Logs bytes attributed to each application and system states.
18930 *
18931 * Keep in sync with proto file at
18932 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18933 *
18934 * Logged from:
18935 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18936 */
18937message CarWatchdogPerStateBytes {
18938    // Number of bytes attributed to the application foreground.
18939    optional int64 foreground_bytes = 1;
18940
18941    // Number of bytes attributed to the application background.
18942    optional int64 background_bytes = 2;
18943
18944    // Number of bytes attributed to the garage mode.
18945    optional int64 garage_mode_bytes = 3;
18946}
18947
18948/**
18949 * Logs each CarWatchdogProcessStat in CarWatchdogProcessStats.
18950 *
18951 * Keep in sync with proto file at
18952 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18953 *
18954 * Logged from:
18955 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18956 */
18957message CarWatchdogProcessStats {
18958    // Records the stats of the processes owned by an application.
18959    repeated CarWatchdogProcessStat process_stat = 1;
18960}
18961
18962/**
18963 * Logs a process's stats.
18964 *
18965 * Keep in sync with proto file at
18966 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18967 *
18968 * Logged from:
18969 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18970 */
18971message CarWatchdogProcessStat {
18972    // Command name of the process.
18973    optional string process_name = 1;
18974
18975    // Process uptime.
18976    optional uint64 uptime_millis = 2;
18977
18978    // Number of major page faults caused by the process and its children.
18979    optional uint64 major_page_faults = 3;
18980
18981    // Peak virtual memory size in kb.
18982    optional uint64 vm_peak_kb = 4;
18983
18984    // Virtual memory size in kb.
18985    optional uint64 vm_size_kb = 5;
18986
18987    // Peak resident set size (high water mark) in kb.
18988    optional uint64 vm_hwm_kb = 6;
18989
18990    // Resident set size in kb.
18991    optional uint64 vm_rss_kb = 7;
18992}
18993
18994/**
18995 * Logs total I/O usage summary for all applications and services running in the system.
18996 *
18997 * Keep in sync with proto file at
18998 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18999 *
19000 * Pulled from:
19001 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
19002 */
19003message CarWatchdogSystemIoUsageSummary {
19004    // I/O usage summary for the system.
19005    optional CarWatchdogIoUsageSummary io_usage_summary = 1 [(log_mode) = MODE_BYTES];
19006
19007    // Start time of the event in milliseconds since epoch.
19008    // Note: This field must be a top-level field as it is used to slice the metrics.
19009    optional int64 start_time_millis = 2;
19010}
19011
19012/**
19013 * Logs I/O usage summary for an UID.
19014 *
19015 * Keep in sync with proto file at
19016 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
19017 *
19018 * Pulled from:
19019 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
19020 */
19021message CarWatchdogUidIoUsageSummary {
19022    // UID of the application/service whose usage summary are recorded.
19023    optional int32 uid = 1 [(is_uid) = true];
19024
19025    // I/O usage summary for the UID.
19026    optional CarWatchdogIoUsageSummary io_usage_summary = 2 [(log_mode) = MODE_BYTES];
19027
19028    // Start time of the event in milliseconds since epoch.
19029    // Note: This field must be a top-level field as it is used to slice the metrics.
19030    optional int64 start_time_millis = 3;
19031}
19032
19033/**
19034 * Logs I/O usage summary for a time period.
19035 *
19036 * Keep in sync with proto file at
19037 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
19038 *
19039 * Pulled from:
19040 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
19041 */
19042message CarWatchdogIoUsageSummary {
19043    // Summary event time period.
19044    optional CarWatchdogEventTimePeriod event_time_period = 1;
19045
19046    // Daily I/O usage summary for the period. Logs summary entries only for days with I/O usage.
19047    // The entries are ordered beginning from the event_time_period.start_time_millis.
19048    repeated CarWatchdogDailyIoUsageSummary daily_io_usage_summary = 2;
19049}
19050
19051/**
19052 * Logs a car watchdog event's time period.
19053 *
19054 * Keep in sync with proto file at
19055 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
19056 *
19057 * Pulled from:
19058 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
19059 */
19060message CarWatchdogEventTimePeriod {
19061    enum Period {
19062        UNKNOWN_PERIOD = 0;
19063        WEEKLY = 1;
19064        BIWEEKLY = 2;
19065        MONTHLY = 3;
19066    }
19067
19068    // Deprecated field - Start time of the event in milliseconds since epoch.
19069    optional uint64 start_time_millis = 1 [deprecated = true];
19070
19071    // Period for the event.
19072    optional Period period = 2;
19073}
19074
19075/**
19076 * Logs daily I/O usage summary.
19077 *
19078 * Keep in sync with proto file at
19079 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
19080 *
19081 * Pulled from:
19082 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
19083 */
19084message CarWatchdogDailyIoUsageSummary {
19085    // Total bytes written to disk during a day.
19086    optional CarWatchdogPerStateBytes written_bytes = 1;
19087
19088    // Total uptime for the system or service or application during a day.
19089    optional uint64 uptime_millis = 2;
19090
19091    // Total disk I/O overuses during a day.
19092    optional int32 overuse_count = 3;
19093}
19094
19095/*
19096 * pushes Media playback information.
19097 * Logged from
19098 *  frameworks/base/services/core/java/com/android/server/media/metrics/
19099 *      MediaMetricsManagerService.java
19100 */
19101message MediametricsPlaybackReported {
19102    optional int32 uid = 1 [(is_uid) = true];
19103
19104    // Randomly generated log session ID. A Base64 encoded hex string representing a
19105    // 128-bit integer.
19106    optional string log_session_id = 2;
19107    // The total length of the media in milliseconds. 0 for live contents.
19108    optional int64 media_duration_millis = 3;
19109    // Network, device, or mixed.
19110    optional android.stats.mediametrics.StreamSourceType stream_source = 4;
19111    // Stream type. DASH, HLS, etc
19112    optional android.stats.mediametrics.StreamType stream_type = 5;
19113    // Live, VOD, others
19114    optional android.stats.mediametrics.PlaybackType playback_type = 6;
19115    // DRM type
19116    optional android.stats.mediametrics.DrmType drm_type = 7;
19117    // Main, AD, others
19118    optional android.stats.mediametrics.ContentType content_type = 8;
19119    // Player name. E.g. ExoPlayer
19120    optional string player_name = 9;
19121    // Player version. E.g. 1.10.3e
19122    optional string player_version = 10;
19123    // Player related experiment IDs
19124    optional Experiments experiment_ids = 11 [(log_mode) = MODE_BYTES];
19125    // Number of frames played. Dropped frames are not included.  -1 means unknown.
19126    optional int32 video_frames_played = 12;
19127    // Number of frames dropped. -1 means unknown.
19128    optional int32 video_frames_dropped = 13;
19129    // Number of audio underruns. -1 means unknown.
19130    optional int32 audio_underrun_count = 14;
19131    // Total number of bytes read from the network
19132    optional int64 network_bytes_read = 15;
19133    // Total number of bytes read from on-device sources
19134    optional int64 local_bytes_read = 16;
19135    // Total transfer spent reading from the network in ms.
19136    // For parallel requests, the overlapping time intervals are counted only once.
19137    optional int64 network_transfer_duration_millis = 17;
19138    // A session ID generated from DRM to distinguish different DRM sessions.
19139    optional string drm_session_id = 18;
19140}
19141
19142message MediaNetworkInfoChanged {
19143    // Randomly generated log session ID. A Base64 encoded hex string representing a
19144    // 128-bit integer.
19145    optional string log_session_id = 1;
19146    //  New network type
19147    optional android.stats.mediametrics.NetworkType type = 2;
19148    // When the network info change occurred relative to playback creation
19149    // time in milliseconds.
19150    // It is in absolute time (e.g. always ticks even if the playback is paused).
19151    optional int64 time_since_playback_created_millis = 3;
19152}
19153
19154message MediaPlaybackStateChanged {
19155    // Randomly generated log session ID. A Base64 encoded hex string representing a
19156    // 128-bit integer.
19157    optional string log_session_id = 1;
19158    //  New playback state
19159    optional android.stats.mediametrics.PlaybackState playback_state = 2;
19160    // When the state change occurred relative to playback creation time in
19161    // milliseconds.
19162    // It is in absolute time (e.g. always ticks even if the playback is paused).
19163    optional int64 time_since_playback_created_millis = 3;
19164}
19165
19166message MediaPlaybackErrorReported {
19167    // Randomly generated log session ID. A Base64 encoded hex string representing a
19168    // 128-bit integer.
19169    optional string log_session_id = 1;
19170    //  A shortened call stack of the error
19171    optional string exception_stack = 2;
19172    //  Error code
19173    optional android.stats.mediametrics.PlaybackErrorCode error_code = 3;
19174    //  Sub-code of error type specified by the error code.
19175    optional int32 sub_error_code = 4;
19176    // When the error occurred relative to playback creation time in millisecond.
19177    // It is in absolute time (e.g. always ticks even if the playback is paused).
19178    optional int64 time_since_playback_created_millis = 5;
19179}
19180
19181message MediaPlaybackTrackChanged {
19182    // Randomly generated log session ID. A Base64 encoded hex string representing a
19183    // 128-bit integer.
19184    optional string log_session_id = 1;
19185    //  The track is on or off after the change
19186    optional android.stats.mediametrics.TrackState state = 2;
19187    //  The reason of the track change
19188    optional android.stats.mediametrics.TrackChangeReason reason = 3;
19189    //  The MIME type of the container. E.g. video/mp4
19190    optional string container_mime_type = 4;
19191    //  The sample MIME type of the track. E.g. video/avc
19192    optional string sample_mime_type = 5;
19193
19194    //  Codec name
19195    optional string codec_name = 6;
19196    //  Bits per second. 0 means unknown.
19197    optional int32 bitrate = 7;
19198
19199   // When the track change occurred, relative to playback creation time in
19200   // millisecond.
19201   // It is in absolute time (e.g. always ticks even if the playback is paused).
19202   optional int64 time_since_playback_created_millis = 8;
19203
19204    //  Track type. Audio, Video, Text
19205    optional android.stats.mediametrics.TrackType type = 9;
19206    //  2-letter ISO 639-1 language code.
19207    optional string language = 10;
19208    //  IETF BCP 47 optional language region subtag based on a two-letter country code
19209    optional string language_region = 11;
19210    //  Number of channels
19211    optional int32 channel_count = 12;
19212    //  Samples per second
19213    optional int32 sample_rate = 13;
19214    //  The width of the video in pixels.
19215    optional int32 width = 14;
19216    //  The height of the video in pixels.
19217    optional int32 height = 15;
19218    //  Video frame rate in frames per second.
19219    optional float video_frame_rate = 16;
19220}
19221
19222message Experiments {
19223    // Experiment IDs sent by the player.
19224    repeated int64 experiments = 1;
19225}
19226
19227/**
19228 * Logs when a Wifi network scan happens.
19229 *
19230 * Logged from:
19231 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
19232 */
19233message WifiScanReported {
19234    enum Type {
19235        TYPE_UNKNOWN = 0;
19236
19237        // Single scan.
19238        TYPE_SINGLE = 1;
19239
19240        // Background scan (deprecated, should not happen).
19241        TYPE_BACKGROUND = 2;
19242    }
19243
19244    enum Result {
19245        RESULT_UNKNOWN = 0;
19246
19247        // Failed to start scan.
19248        RESULT_FAILED_TO_START = 1;
19249
19250        // The HAL reported a scan failure after the scan was started.
19251        RESULT_FAILED_TO_SCAN = 2;
19252
19253        // Scan succeeded.
19254        RESULT_SUCCESS = 3;
19255    }
19256
19257    enum Source {
19258        SOURCE_UNKNOWN = 0;
19259
19260        // No work source set - not possible to determine the origin.
19261        SOURCE_NO_WORK_SOURCE = 1;
19262
19263        // The Wifi stack.
19264        SOURCE_WIFI_STACK = 2;
19265
19266        // GMS on behalf of some other app.
19267        SOURCE_GMS = 3;
19268
19269        // Settings app.
19270        SOURCE_SETTINGS_APP = 4;
19271
19272        // Other app directly.
19273        SOURCE_OTHER_APP = 5;
19274    }
19275
19276    enum Importance {
19277        IMPORTANCE_UNKNOWN = 0;
19278
19279        // Foreground app. Corresponds to the value of
19280        // ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND or less.
19281        IMPORTANCE_FOREGROUND = 1;
19282
19283        // Foreground service. Corresponds to the value of
19284        // ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE
19285        IMPORTANCE_FOREGROUND_SERVICE = 2;
19286
19287        // Everything else.
19288        IMPORTANCE_BACKGROUND = 3;
19289    }
19290
19291    // Scan type
19292    optional Type type = 1;
19293
19294    // Outcome: success/failure
19295    optional Result result = 2;
19296
19297    // What initiated a scan.
19298    optional Source source = 3;
19299
19300    // Process importance of the initiator.
19301    // This is only available for non-system calls.
19302    optional Importance importance = 4;
19303
19304    // Time taken for the scan.
19305    optional int32 scan_duration_millis = 5;
19306
19307    // Count of found networks.
19308    optional int32 count_networks_found = 6;
19309}
19310
19311/**
19312 * Logs when a Wifi PNO (Preferred Network Offload) scan happens.
19313 *
19314 * Logged from:
19315 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
19316 */
19317message WifiPnoScanReported {
19318    enum State {
19319        UNKNOWN = 0;
19320
19321        // Scan started.
19322        STARTED = 1;
19323
19324        // Scan failed to start (e.g. bad request, unsupported by hardware, etc).
19325        FAILED_TO_START = 2;
19326
19327        // Scan completed and a network was found.
19328        // Note - due to implementation constraints, nothing is reported when a scan completes but
19329        // doesn't find any networks.
19330        FINISHED_NETWORKS_FOUND = 3;
19331
19332        // Scan failed.
19333        FAILED = 4;
19334    }
19335
19336    optional State state = 1;
19337}
19338
19339/**
19340 * Logs when an airplane mode session happens.
19341 *
19342 * Logged from:
19343 *   packages/modules/Wifi/service/java/com/android/server/wifi/WifiMetrics.java
19344 *   packages/modules/Bluetooth/service/java/com/android/server/bluetooth/BluetoothAirplaneModeListener.java
19345 */
19346message AirplaneModeSessionReported {
19347    enum PackageName {
19348        WIFI = 0;
19349        BLUETOOTH = 1;
19350    }
19351    // Module recording the airplane mode session
19352    optional PackageName package_name = 1;
19353    // State of the module before entering airplane mode
19354    // False - module off
19355    // True - module on
19356    optional bool previous_state = 2;
19357    // State of the module at the beginning of airplane mode
19358    optional bool entering_state = 3;
19359    // State of the module at the end of airplane mode
19360    optional bool exiting_state = 4;
19361    // Whether the user has activated the feature by
19362    // toggling the module in airplane mode
19363    optional bool feature_active = 5;
19364    // Whether the user toggled the module during current airplane mode
19365    optional bool user_toggled = 6;
19366    // Whether the user toggled the module within one minute
19367    optional bool user_toggled_within_minute = 7;
19368    // Whether media profile was connected before entering airplane mode
19369    // Only applicable to the Bluetooth module
19370    optional bool media_profile_connected = 8;
19371}
19372
19373/**
19374 * Logs when a package installation session happens.
19375 *
19376 * Logged from:
19377 *   frameworks/base/services/core/java/com/android/server/pm/InstallPackageHelper.java
19378 */
19379message PackageInstallationSessionReported {
19380    // Used to correlate with Play logging metrics
19381    optional int32 session_id = 1;
19382    // Only logged for failed installations
19383    optional string package_name = 2;
19384
19385    // UID of the app that is successfully installed
19386    optional int32 uid = 3 [(is_uid) = true];
19387    // Users that will have this package installed
19388    repeated int32 user_ids = 4;
19389    // User types for the users listed above
19390    repeated int32 user_types = 5;
19391    // Users that originally had this package installed if it already exists
19392    repeated int32 original_user_ids = 6;
19393    // User types for original users
19394    repeated int32 original_user_types = 7;
19395    // PackageManager.INSTALL_FAILED_* error codes
19396    optional int32 public_return_code = 8;
19397    // Internal error codes that indicate detailed installation failures
19398    optional int32 internal_error_code = 9;
19399    // Total size of the new APKs in the current session
19400    optional int64 apks_size_bytes = 10;
19401    // Version code of the app
19402    optional int64 version_code = 11;
19403
19404    // List of install steps defined in
19405    // frameworks/base/services/core/java/com/android/server/pm/PackageMetrics.java
19406    repeated int32 install_steps = 12;
19407    // Duration of each step in the installation; order must match install_steps
19408    repeated int64 step_duration_millis = 13;
19409    // Total duration can be greater than zero even if install failed
19410    optional int64 total_duration_millis = 14;
19411    // Installation flags including DONT_KILL
19412    optional int32 install_flags = 15;
19413    // UID of the package that initiates the installation
19414    optional int32 installer_package_uid = 16 [(is_uid) = true];
19415    // UID of the package that previously installed the app
19416    optional int32 original_installer_package_uid = 17 [(is_uid) = true];
19417    // {@see android.content.pm.DataLoaderType}
19418    optional int32 data_loader_type = 18;
19419    // {@see android.content.pm.UserActionRequirement}
19420    optional int32 user_action_required_type = 19;
19421
19422    // Install types might overlap, therefore using booleans for each type
19423    // A regular new app install has every field as false.
19424    optional bool is_instant = 20;
19425    optional bool is_replace = 21;
19426    optional bool is_system = 22;
19427    optional bool is_inherit = 23;
19428    optional bool is_installing_existing_as_user = 24;
19429    optional bool is_move_install = 25;
19430    // Whether this is a staged installation
19431    optional bool is_staged = 26;
19432}
19433
19434message PackageUninstallationReported {
19435    // UID of the package being uninstalled
19436    optional int32 uid = 1 [(is_uid) = true];
19437    // Users on which the package (or system app update) is uninstalled from
19438    // If uninstall for all users, list all the user ids
19439    repeated int32 user_ids = 2;
19440    // Types of the users listed above. Order must match above.
19441    repeated int32 user_types = 3;
19442    // Users that originally had this package (or system app update) installed
19443    repeated int32 original_user_ids = 4;
19444    repeated int32 original_user_types = 5;
19445    // Flags of uninstallation, including KEEP_DATA
19446    optional int32 uninstall_flags = 6;
19447    // PackageManager.DELETE_SUCCEEDED or PackageManager.DELETE_FAILED_*
19448    optional int32 return_code = 7;
19449    // Special uninstall types might overlap, therefore booleans
19450    // An uninstall of a non-system app on all users should have all fields false
19451    optional bool is_system = 8;
19452    // When this is true, user_ids != original_user_ids
19453    optional bool is_uninstall_for_users = 9;
19454}
19455
19456/**
19457 * Logs when the entitlement configuration of an IMS service is queried/updated.
19458 *
19459 * Logged from: ImsServiceEntitlement app
19460 */
19461message ImsServiceEntitlementUpdated {
19462    // The purpose of entitlement query/update
19463    enum Purpose {
19464        UNKNOWN_PURPOSE = 0;
19465
19466        // Initial service activation in foreground
19467        ACTIVATION = 1;
19468
19469        // Updating service configuration in foreground
19470        UPDATE = 2;
19471
19472        // Background polling for querying service entitlement
19473        POLLING = 3;
19474    }
19475
19476    // The IMS services
19477    enum ServiceType {
19478        UNKNOWN_SERVICE = 0;
19479        VOWIFI = 1;
19480        VOLTE = 2;
19481        SMSOIP = 3;
19482    }
19483
19484    // The result of activation
19485    enum AppResult {
19486        UNKNOWN_RESULT = 0;
19487        ENABLED = 1;
19488        DISABLED = 2;
19489        INCOMPATIBLE = 3;
19490        PROVISIONING = 4;
19491        SUCCESSFUL = 5;
19492        FAILED = 6;
19493        CANCELED = 7;
19494        TIMEOUT = 8;
19495        UNEXPECTED_RESULT = 9;
19496    }
19497
19498    // The Android carrier ID for the carrier providing the IMS service.
19499    // This may not be the actual carrier of the device, e.g. a MVNO
19500    // may use the IMS service of its MNO.
19501    optional int64 carrier_id = 1;
19502
19503    // The Android carrier ID of the actual carrier.
19504    // E.g. a MVNO may use its MNO's IMS service. In this case,
19505    // actual_carrier_id is the MVNO and carrier_id is the MNO.
19506    optional int64 actual_carrier_id = 2;
19507
19508    // The purpose of this query/update.
19509    optional Purpose purpose = 3;
19510
19511    // Which IMS service's entitlement status were queried/updated.
19512    optional ServiceType service_type = 4;
19513
19514    // Result of this query/update.
19515    optional AppResult app_result = 5;
19516
19517    // How long (in milliseconds) this query/update took.
19518    optional int64 duration_millis = 6;
19519}
19520
19521/**
19522 * Logged when a SIM-specific settings restore was attempted.
19523 *
19524 * Logged from:
19525 *    packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyProvider.java
19526 */
19527message SimSpecificSettingsRestored {
19528    optional android.telephony.SimSpecfifcSettingsRestoreResult result = 1;
19529
19530    // Indicates which restore flow was followed.
19531    optional android.telephony.SimSpecificSettingsRestoreCase restored_from_suw = 2;
19532
19533    // Indicates which criteria was used to match the inserted SIM to backed up
19534    // SIM. Only relevant when result is SUCCESS
19535    optional android.telephony.SimSpecificSettingsRestoreMatchingCriteria matching_criteria = 3;
19536}
19537
19538/**
19539 * The latency of Binder calls broken down by calling API and method name.
19540 * This is different from BinderCalls as it collects a histogram of the
19541 * latencies (to get more detailed data) not just the count, sum, and maximum.
19542 *
19543 * Logged from:
19544 * frameworks/base/core/java/com/android/internal/os/BinderLatencyObserver.java
19545 */
19546message BinderLatencyReported {
19547    message Dims {
19548        enum ProcessSource {
19549            UNKNOWN_PROCESS_SOURCE = 0;
19550            SYSTEM_SERVER = 1;
19551            TELEPHONY = 2;
19552            BLUETOOTH = 3;
19553            WIFI = 4;
19554        }
19555        enum ServiceClassName {
19556            UNKNOWN_CLASS = 0;
19557        }
19558        enum ServiceMethodName {
19559            UNKNOWN_METHOD = 0;
19560        }
19561
19562        // Required.
19563        optional ProcessSource process_source = 1;
19564
19565        // The class name of the API making the call to Binder. Enum value
19566        // is preferred as uses much less data to store.
19567        // This field does not contain PII.
19568        oneof service_class {
19569            ServiceClassName service_class_name_as_enum = 2;
19570            string service_class_name = 3;
19571        }
19572
19573        // Method name of the API call. It can also be a transaction code if we
19574        // cannot resolve it to a name. See Binder#getTransactionName. Enum value
19575        // is preferred as uses much less data to store.
19576        // This field does not contain PII.
19577        oneof service_method {
19578            ServiceMethodName service_method_name_as_enum = 4;
19579            string service_method_name = 5;
19580        }
19581    }
19582
19583    message ApiStats {
19584        // required.
19585        optional Dims dims = 1;
19586
19587        // Indicates the first bucket that had any data. Allows omitting any empty
19588        // buckets at the start of the bucket list and thus save on data size.
19589        optional int32 first_bucket_index = 2;
19590        // Stores the count of samples for each bucket. The number of buckets and
19591        // their sizes are controlled server side with a flag.
19592        repeated int32 buckets = 3;
19593    }
19594
19595    message RepeatedApiStats {
19596        repeated ApiStats api_stats = 1;
19597    }
19598
19599    // The binder latency data broken down by the dimensions specified above.
19600    // The message wrapper is used for the repeated field as top level repeated
19601    // fields are not allowed.
19602    // MODE_BYTES is used as nested messages are not allowed otherwise.
19603    // Required.
19604    optional RepeatedApiStats repeated_api_stats = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
19605
19606    // The fraction of samples that are recorded in the histogram.
19607    // Required.
19608    optional float sampling_rate = 2;
19609
19610    // Indicates how many shards the APIs are divided in - e.g. for 3 every
19611    // 3rd API will be included in the data for this shard.
19612    // Required.
19613    optional int32 sharding_modulo = 3;
19614
19615    // Params for histogram buckets.
19616    // The number of buckets the histogram should have.
19617    optional int32 bucket_count = 4;
19618
19619    // The size (upper bound) of the first bucket (used to avoid creating an
19620    // excessive amount of small buckets). E.g. for first_bucket_size of 5, the
19621    // first bucket will be [0, 5) and the second will be [5, 5 * scaleFactor).
19622    optional int32 first_bucket_size = 5;
19623
19624    // The rate in which each consecutive bucket increases (before rounding).
19625    // Implemented in: com.android.internal.os.BinderLatencyBuckets.
19626    optional float scale_factor = 6;
19627}
19628
19629/**
19630 * Log audio device types that are used for input/output.
19631 * Next Tag: 2
19632 */
19633message AudioDevice {
19634    // See audio_devices_t in system/media/audio/include/system/audio-hal-enums.h
19635    repeated int32 type = 1;
19636}
19637
19638/**
19639 * Track information about AAudio Stream
19640 * Logged from
19641 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
19642 */
19643message MediametricsAAudioStreamReported {
19644    // The implementation of aaudio.
19645    optional android.media.audio.CallerPath path = 1;
19646
19647    // The direction of the stream.
19648    optional android.media.audio.Direction direction = 2;
19649
19650    // The amount read or written in one shot by the Mixer or DSP.
19651    optional int32 frames_per_burst = 3;
19652    // The number of frames that the buffer is used.
19653    optional int32 buffer_size = 4;
19654    // The allocated number of frames for the buffer.
19655    optional int32 buffer_capacity = 5;
19656    // The channel count of the aaudio stream.
19657    optional int32 channel_count = 6;
19658    // Total frames transferred (written or read)
19659    optional int64 total_frames_transferred = 7;
19660
19661    // The performance mode requested by the applications.
19662    optional android.media.audio.PerformanceMode perf_mode_requested = 8;
19663    // The actual performance mode used by aaudio.
19664    optional android.media.audio.PerformanceMode perf_mode_actual = 9;
19665
19666    // The mode requested for sharing the device
19667    optional android.media.audio.SharingMode sharing = 10;
19668
19669    // Approximate number of glitches.
19670    // Underrun on output stream. Overrun on input stream.
19671    optional int32 xrun_count = 11;
19672    // Devices that are used by the aaudio stream.
19673    optional AudioDevice types = 12 [(log_mode) = MODE_BYTES];
19674
19675    // Format request by the applications
19676    optional int32 format_app = 13;
19677    // Format processed by the framework
19678    optional int32 format_device = 14;
19679
19680    // Android S metric log session id, a Base64Url encoded string representing a 128-bit integer.
19681    optional string log_session_id = 15;
19682
19683    // The sample rate of the aaudio stream.
19684    optional int32 sample_rate = 16;
19685
19686    // The content type of the aaudio stream.
19687    optional android.media.audio.ContentType content_type = 17;
19688
19689    // The mode of sharing the device requested by the client.
19690    optional android.media.audio.SharingMode sharing_requested = 18;
19691
19692    // Android U
19693    // The format used by the audio hardware.
19694    optional int32 format_hardware = 19;
19695
19696    // Android U
19697    // The channel count used by the audio hardware.
19698    optional int32 channel_count_hardware = 20;
19699
19700    // Android U
19701    // The sample rate used by the audio hardware.
19702    optional int32 sample_rate_hardware = 21;
19703
19704    // Android U
19705    // The UID of the client.
19706    optional int32 uid = 22 [(is_uid) = true];
19707
19708    // Android U
19709    // The sample rate used by the client.
19710    optional int32 sample_rate_client = 23;
19711}
19712
19713/**
19714 * Logs media transcoding session ended events.
19715 *
19716 * Logged from:
19717 *   frameworks/av/media/libmediatranscoding/TranscoderWrapper.cpp
19718 */
19719message MediaTranscodingSessionEnded {
19720
19721    enum Reason {
19722        UNKNOWN = 0;       // Unused.
19723        FINISHED = 1;      // Transcoding session finished successfully.
19724        ERROR = 2;         // Transcoding session returned error while running.
19725        PAUSED = 3;        // Transcoding session was paused, potentially failed.
19726        CANCELLED = 4;     // Transcoding session was cancelled.
19727        START_FAILED = 5;  // Transcoding session failed to start.
19728        RESUME_FAILED = 6; // Transcoding session failed to resume.
19729        CREATE_FAILED = 7; // Transcoder instance failed to crate.
19730        CONFIG_SRC_FAILED = 8;    // Configure source failed.
19731        CONFIG_DST_FAILED = 9;    // Configure destination failed.
19732        CONFIG_TRACK_FAILED = 10; // Configure track failed.
19733        OPEN_SRC_FD_FAILED = 11;  // Open source fd failed.
19734        OPEN_DST_FD_FAILED = 12;  // Open destination fd failed.
19735        NO_TRACKS = 13;  // No tracks in source file.
19736    }
19737
19738    // Reason for logging the atom.
19739    optional Reason reason = 1;
19740
19741    // UID of client connecting to media transcoding service.
19742    optional int32 calling_uid = 2 [(is_uid) = true];
19743
19744    // Transcode session status flag (media_status_t).
19745    optional int32 transcode_status = 3;
19746
19747    // Transcode speed as framerate, if status is success.
19748    optional int32 transcode_fps = 4;
19749
19750    // Source video dimensions.
19751    optional int32 src_width = 5;
19752    optional int32 src_height = 6;
19753
19754    // Source video codec information.
19755    optional string src_codec_type = 7;
19756    optional int32 src_profile = 8;
19757    optional int32 src_level = 9;
19758
19759    // Source video framerate.
19760    optional int32 src_fps = 10;
19761
19762    // Source video duration.
19763    optional int32 src_duration_millis = 11;
19764
19765    // Whether source video is HDR.
19766    optional bool src_is_hdr = 12;
19767
19768    // Destination video dimensions.
19769    optional int32 dst_width = 13;
19770    optional int32 dst_height = 14;
19771
19772    // Destination video codec information.
19773    optional string dst_codec_type = 15;
19774
19775    // Whether destination video is HDR.
19776    optional bool dst_is_hdr = 16;
19777}
19778
19779/** Logs information about an unattended reboot that took place. This is logged
19780 *  after the next boot, when the device is first unlocked.
19781 *
19782 * Logged from:
19783 *   packages/modules/Scheduling/service/java/com/android/server/RebootReadinessLogger.java
19784 */
19785message UnattendedRebootOccurred {
19786
19787    // Time between the reboot readiness state checks starting, and the device
19788    // becoming reboot-ready.
19789    optional int64 time_until_reboot_ready_millis= 1;
19790
19791    // Time taken for the device to be unlocked (i.e. for the keyguard to be
19792    // gone) after an unattended reboot took place.
19793    optional int64 time_until_first_unlock_millis = 2;
19794
19795    // Number of times the reboot was blocked by the device being interactive.
19796    optional int32 times_blocked_by_interactivity = 3;
19797
19798    // Number of times the reboot was blocked by a callback registered by a
19799    // subsystem or a privileged app.
19800    optional int32 times_blocked_by_subsystems = 4;
19801
19802    // Number of times the reboot was blocked by background app activity.
19803    optional int32 times_blocked_by_app_activity = 5;
19804
19805    // Time until next user interaction with the device.
19806    optional int64 time_until_next_interaction_ms = 6;
19807}
19808
19809
19810/**
19811 * Logs information about an app uid or registered system component that has
19812 * been blocking the device from being reboot-ready for a long time.
19813 *
19814 * Logged from:
19815 *   packages/modules/Scheduling/service/java/com/android/server/RebootReadinessLogger.java
19816 */
19817message LongRebootBlockingReported {
19818
19819    enum RebootBlockReason {
19820        SYSTEM_COMPONENT = 1;
19821        APP_UID = 2;
19822    }
19823
19824    // The reason why the reboot has been blocked. This is either a system
19825    // component that has registered a callback, or an app UID running in the
19826    // background.
19827    optional RebootBlockReason reboot_block_reason = 1;
19828
19829    // Only one of the following two fields should be set, depending on the
19830    // RebootBlockReason.
19831
19832    // The name supplied by a system component when it registered a callback
19833    // to block the reboot.
19834    optional string component_name = 2;
19835
19836    // The uid of an app that is running in the background.
19837    optional int32 uid = 3 [(is_uid) = true];
19838}
19839
19840/**
19841 * Logs the magnification activated mode and its duration of the usage
19842 * when the magnification is disabled.
19843 *
19844 * Logged from:
19845 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
19846 */
19847message MagnificationUsageReported {
19848    // The definition of the magnification mode.
19849    // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
19850    optional android.stats.accessibility.MagnificationMode activated_mode = 1;
19851
19852    // The duration of this magnification mode activation in milliseconds
19853    optional int64 duration_millis = 2;
19854
19855    // The last magnification scale for the activation in percentage
19856    optional int64 scale_percentage = 3;
19857}
19858
19859/**
19860 * Logs the magnification activated mode when IME dialog shows on the screen.
19861 *
19862 * Logged from:
19863 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
19864 */
19865message MagnificationModeWithImeOnReported {
19866    // The definition of the magnification mode.
19867    // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
19868    optional android.stats.accessibility.MagnificationMode activated_mode = 1;
19869}
19870
19871/**
19872 * Logs the duration for the magnification session which is activated by the triple tap and
19873 * hold gesture.
19874 *
19875 * Logged from:
19876 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
19877 */
19878message MagnificationTripleTapAndHoldActivatedSessionReported {
19879    // The duration of the triple tap and hold activated session in milliseconds
19880    optional int64 duration_millis = 1;
19881}
19882
19883/**
19884 * Logs the duration for the following typing focus activated session.
19885 *
19886 * Logged from:
19887 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
19888 */
19889message MagnificationFollowTypingFocusActivatedSessionReported {
19890    // The duration of the following typing focus activated session in milliseconds
19891    optional int64 duration_millis = 1;
19892}
19893
19894/*
19895 * Logged when hardware based user-configurable device state changes.
19896 *
19897 * Logged from:
19898 *     frameworks/base/services/core/java/com/android/server/devicestate/DeviceStateManagerService.java
19899 */
19900message DeviceStateChanged {
19901    optional int32 new_device_state = 1
19902            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
19903    optional bool boot_state = 2;
19904}
19905
19906/*
19907 * Logged when device folded state changes.
19908 *
19909 * Logged from:
19910 *     frameworks/base/packages/SystemUI/src/com/android/systemui/unfold/FoldStateLogger.kt
19911 */
19912message FoldStateDurationReported {
19913    enum State {
19914      UNKNOWN = 0;
19915      OPEN = 1;
19916      CLOSED = 2;
19917      HALF_OPEN = 3;
19918    }
19919
19920    optional State start_state = 1;
19921    optional State end_state = 2;
19922    optional int64 duration_millis = 3;
19923}
19924
19925/**
19926 * This metric is collected at the end of playback
19927 * as a pulled atom.
19928 *
19929 *   DrmHal::cleanup() {
19930 *     // ...
19931 *     reportFrameworkMetrics(reportPluginMetrics());
19932 *     // ...
19933 *   }
19934 * This proto should be kept in-sync with
19935 * frameworks/av/drm/libmediadrm/protos/metrics.proto.
19936 */
19937message DrmFrameworkMetrics {
19938
19939    // Attributes are associated with a recorded value. E.g. A counter may
19940    // represent a count of an operation returning a specific error code. The
19941    // error code will be an attribute.
19942    message Attributes {
19943        // Reserved for compatibility with logging proto.
19944        reserved 2 to 13;
19945
19946        // A general purpose error code where 0 means OK.
19947        optional int32 error_code = 1;
19948
19949        // Defined at ::android::hardware::drm::V1_0::KeyStatusType;
19950        optional uint32 key_status_type = 14;
19951
19952        // Defined at ::android::hardware::drm::V1_0::EventType;
19953        optional uint32 event_type = 15;
19954    }
19955
19956    // The Counter message is used to store a count value with an associated
19957    // Attribute.
19958    message Counter {
19959        optional uint64 count = 1;
19960        // Represents the attributes associated with this counter instance.
19961        optional Attributes attributes = 2;
19962    }
19963
19964    // The DistributionMetric is meant to capture the moments of a normally
19965    // distributed (or approximately normal) value.
19966    message DistributionMetric {
19967        optional float min = 1;
19968        optional float max = 2;
19969        optional float mean = 3;
19970        optional double variance = 4;
19971        optional uint64 operation_count = 5;
19972
19973        // Represents the attributes associated with this distribution metric
19974        // instance.
19975        optional Attributes attributes = 6;
19976    }
19977
19978    message SessionLifetime {
19979        // Start time of the session in milliseconds since epoch.
19980        optional uint64 start_time_millis = 1;
19981        // End time of the session in milliseconds since epoch.
19982        optional uint64 end_time_millis = 2;
19983    }
19984
19985    // The count of open session operations. Each instance has a specific error
19986    // code associated with it.
19987    repeated Counter open_session_counter = 1;
19988
19989    // The count of close session operations. Each instance has a specific error
19990    // code associated with it.
19991    repeated Counter close_session_counter = 2;
19992
19993    // Count and execution time of getKeyRequest calls.
19994    repeated DistributionMetric get_key_request_time_us = 3;
19995
19996    // Count and execution time of provideKeyResponse calls.
19997    repeated DistributionMetric provide_key_response_time_us = 4;
19998
19999    // Count of getProvisionRequest calls.
20000    repeated Counter get_provisioning_request_counter = 5;
20001
20002    // Count of provideProvisionResponse calls.
20003    repeated Counter provide_provisioning_response_counter = 6;
20004
20005    // Count of key status events broken out by status type.
20006    repeated Counter key_status_change_counter = 7;
20007
20008    // Count of events broken out by event type
20009    repeated Counter event_callback_counter = 8;
20010
20011    // Count getPropertyByteArray calls to retrieve the device unique id.
20012    repeated Counter get_device_unique_id_counter = 9;
20013
20014    message SessionLifetimeEntry {
20015        optional string session_id = 1;
20016        optional SessionLifetime session_lifetime = 2;
20017    }
20018    // Session ids to lifetime (start and end time) map.
20019    // Session ids are strings of hex-encoded byte arrays.
20020    // This field is equivalent to the map<string, SessionLifetime>
20021    // field in frameworks/av/drm/libmediadrm/protos/metrics.proto.
20022    repeated SessionLifetimeEntry session_lifetimes = 10;
20023}
20024
20025/**
20026 * The metric is collected at the end of playback
20027 * as a pulled atom MediaDrmActivityInfo.
20028 *
20029 * The framework_metrics is defined in
20030 * frameworks/av/drm/libmediadrm/protos/metrics.proto.
20031 *
20032 * The format of vendor_metrics is  MediaDrm plugin dependent.
20033 *
20034 *   DrmHal::cleanup() {
20035 *     // ...
20036 *     reportFrameworkMetrics(reportPluginMetrics());
20037 *     // ...
20038 *   }
20039 *
20040 * This pulled atom is then collected in
20041 * frameworks/av/services/mediametrics/MediaMetricsService.cpp.
20042 */
20043message MediaDrmActivityInfo {
20044    optional string package_name = 1;
20045    optional int64 package_version_code = 2;
20046
20047    // vendor+description tell about which DRM plugin is in use on this device
20048    optional string vendor = 3;
20049    optional string description = 4;
20050
20051    optional DrmFrameworkMetrics framework_metrics = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
20052    optional bytes vendor_metrics = 6 [(android.os.statsd.log_mode) = MODE_BYTES];
20053}
20054
20055/*
20056 * A canonical form time zone suggestion for metrics use.
20057 */
20058message MetricsTimeZoneSuggestion {
20059    enum Type {
20060        UNKNOWN = 0;
20061        CERTAIN = 1;
20062        UNCERTAIN = 2;
20063    }
20064    optional Type type = 1;
20065
20066    // The ordinals for time zone(s) in the suggestion. Always empty for
20067    // UNCERTAIN, and can be empty for CERTAIN, for example when the device is in
20068    // a disputed area / on an ocean.
20069    //
20070    // The suggestion's time zone IDs (which relate to location) are obfuscated by
20071    // mapping them to an ordinal. When the ordinal is assigned consistently across
20072    // several objects (i.e. so the same time zone ID is always mapped to the same
20073    // ordinal), this allows comparisons between those objects. For example, we can
20074    // answer "did these two suggestions agree?", "does the suggestion match the
20075    // device's current time zone?", without leaking knowledge of location. Ordinals
20076    // are also significantly more compact than full IANA TZDB IDs, albeit unstable
20077    // and of limited use.
20078    repeated int32 time_zone_ordinals = 2;
20079
20080    // The actual time zone ID(s) in the suggestion. Similar to time_zone_ordinals
20081    // but contains the actual string IDs.
20082    //
20083    // This information is only captured / reported for some devices based on the
20084    // value of a server side flag, i.e. it could be enabled for internal testers.
20085    // Therefore the list can be empty even when time_zone_ordinals is populated.
20086    //
20087    // When enabled, see time_zone_ordinals for the expected number of values.
20088    repeated string time_zone_ids = 3;
20089}
20090
20091/*
20092 * Logs a snapshot of time zone detector state.
20093 *
20094 * Logged from:
20095 * frameworks/base/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
20096 */
20097message TimeZoneDetectorState {
20098
20099    // True if telephony-based time zone detection is supported on the device.
20100    optional bool telephony_supported = 1;
20101
20102    // True if geo-based time zone detection is supported on the device.
20103    optional bool geo_supported = 2;
20104
20105    // The current user's master location setting value.
20106    optional bool location_enabled = 3;
20107
20108    // The current user's auto time zone detection enabled setting value.
20109    optional bool auto_detection_setting = 4;
20110
20111    // The current user's geo detection enabled setting.
20112    optional bool geo_detection_setting = 5;
20113
20114    enum DetectionMode {
20115        UNKNOWN = 0;
20116        MANUAL = 1;
20117        TELEPHONY = 2;
20118        GEO = 3;
20119    }
20120
20121    // The functional / behavioral state for how time zones are currently determined on the device.
20122    // Avoids needing to duplicate the logic used.
20123    optional DetectionMode detection_mode = 6;
20124
20125    // The device's current time zone ordinal (see MetricsTimeZoneSuggestion).
20126    optional int32 device_time_zone_ordinal = 7;
20127
20128    // The latest suggestion received from the user, e.g. via SettingsUI (non-persistent).
20129    optional MetricsTimeZoneSuggestion latest_manual_suggestion = 8
20130            [(log_mode) = MODE_BYTES];
20131
20132    // The latest telephony-derived suggestion (non-persistent).
20133    optional MetricsTimeZoneSuggestion latest_telephony_suggestion = 9
20134            [(log_mode) = MODE_BYTES];
20135
20136    // The latest geo-derived suggestion (non-persistent).
20137    optional MetricsTimeZoneSuggestion latest_geo_suggestion = 10
20138            [(log_mode) = MODE_BYTES];
20139
20140    // True if fallback to telephony time zone detection is supported on the device.
20141    optional bool telephony_time_zone_fallback_supported = 11;
20142
20143    // The device's current time zone ID (see MetricsTimeZoneSuggestion).
20144    optional string device_time_zone_id = 12;
20145
20146    // True if enhanced metrics collection is enabled.
20147    optional bool enhanced_metrics_collection_enabled = 13;
20148
20149    // True if the device may run geolocation time zone detection in the
20150    // background. This is the raw server flag value, not the value after
20151    // considering other state like the user's "use location" setting that also
20152    // affects runtime behavior. See LocationTimeZoneProviderController for
20153    // details.
20154    optional bool geo_detection_run_in_background_enabled = 14;
20155}
20156
20157/*
20158 * Logs information about an individual location time zone provider's state.
20159 *
20160 * Logged from:
20161 * frameworks/base/services/core/java/com/android/server/timezonedetector/location/RealProviderMetricsLogger.java
20162 */
20163message LocationTimeZoneProviderStateChanged {
20164    // The index of the provider (primary = 0, secondary = 1)
20165    optional int32 provider_index = 1 [(state_field_option).primary_field = true];
20166
20167    enum State {
20168        // A placeholder for unknown values.
20169        UNKNOWN = 0;
20170
20171        // The provider is initializing.
20172        INITIALIZING = 1;
20173
20174        // The provider is certain of the time zone.
20175        CERTAIN = 2;
20176
20177        // The provider is uncertain of the time zone.
20178        UNCERTAIN = 3;
20179
20180        // The provider has been stopped.
20181        STOPPED = 4;
20182
20183        // The provider has failed.
20184        PERM_FAILED = 5;
20185
20186        // The provider has been destroyed.
20187        DESTROYED = 6;
20188    }
20189
20190    // The state of the provider.
20191    optional State state = 2 [
20192        (state_field_option).exclusive_state = true,
20193        (state_field_option).nested = false
20194    ];
20195}
20196
20197/*
20198 * Logs information about the location time zone provider controller's state.
20199 *
20200 * Logged from:
20201 * frameworks/base/services/core/java/com/android/server/timezonedetector/location/RealControllerMetricsLogger.java
20202 */
20203message LocationTimeZoneProviderControllerStateChanged {
20204
20205    enum State {
20206        // A placeholder for unknown values.
20207        UNKNOWN = 0;
20208
20209        // The providers are initializing.
20210        PROVIDERS_INITIALIZING = 1;
20211
20212        // The controller is / has been stopped.
20213        STOPPED = 2;
20214
20215        // The controller is started and is initializing.
20216        INITIALIZING = 3;
20217
20218        // The controller is started and is certain of the time zone.
20219        CERTAIN = 4;
20220
20221        // The controller is started and is uncertain of the time zone.
20222        UNCERTAIN = 5;
20223
20224        // The controller has been destroyed.
20225        DESTROYED = 6;
20226
20227        // The controller has failed.
20228        FAILED = 7;
20229    }
20230
20231    // The state of the provider.
20232    optional State state = 1;
20233}
20234
20235/*
20236 * Reports fdtrack state change.
20237 *
20238 * Logged from:
20239 *   frameworks/base/services/java/com/android/server/SystemServer.java
20240 */
20241message FdtrackEventOccurred {
20242    enum FdtrackEventType {
20243      DISABLED = 1;
20244      ENABLED = 2;
20245
20246      // Aborting because we're above the abort threshold.
20247      ABORTING = 3;
20248    }
20249
20250    optional FdtrackEventType event = 1;
20251    optional int32 fd_count = 2;
20252}
20253
20254/**
20255 * Pushed when delivering a batch of alarms.
20256 *
20257 * Logged from:
20258 * frameworks/base/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
20259 */
20260message AlarmBatchDelivered {
20261    // The total number of alarms delivered in the batch.
20262    optional int32 num_alarms = 1;
20263
20264    // The number of wakeup alarms delivered in the batch.
20265    optional int32 wakeups = 2;
20266
20267    // A list of uids receiving the alarm delivery.
20268    repeated int32 uids = 3 [(is_uid) = true];
20269
20270    // The number of alarms delivered to each of the {@link uids} above.
20271    repeated int32 num_alarms_per_uid = 4;
20272
20273    // The number of wakeup alarms delivered to each of the {@link uids} above.
20274    repeated int32 num_wakeups_per_uid = 5;
20275}
20276
20277/**
20278 * Pushed when an app schedules an alarm.
20279 *
20280 * Logged from:
20281 * frameworks/base/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
20282 */
20283message AlarmScheduled {
20284    optional int32 calling_uid = 1 [(is_uid) = true];
20285
20286    optional bool is_exact = 2;
20287    optional bool is_wakeup = 3;
20288    optional bool is_allow_while_idle = 4;
20289    optional bool is_alarm_clock = 5;
20290    optional bool is_repeating = 6;
20291
20292    enum ReasonCode {
20293        NOT_APPLICABLE = 0;
20294        PERMISSION = 1;
20295        ALLOW_LIST = 2;
20296        CHANGE_DISABLED = 3;
20297        POLICY_PERMISSION = 4;
20298        LISTENER = 5;
20299        PRIORITIZED = 6;
20300    }
20301    optional ReasonCode exact_alarm_allowed_reason = 7;
20302    optional bool is_rtc = 8;
20303    // The state of the callingUid, from frameworks/proto_logging/stats/enums/app_shared/app_enums.proto.
20304    optional android.app.ProcessStateEnum calling_process_state = 9;
20305}
20306
20307/**
20308 * Logs statistics about pending alarms.
20309 *
20310 * Pulled from:
20311 * frameworks/base/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
20312 */
20313message PendingAlarmInfo {
20314    optional int32 num_total = 1;
20315    optional int32 num_exact = 2;
20316    optional int32 num_wakeup = 3;
20317    optional int32 num_allow_while_idle = 4;
20318    optional int32 num_prioritized = 5;
20319    optional int32 num_foreground_service = 6;
20320    optional int32 num_activity = 7;
20321    optional int32 num_service = 8;
20322    optional int32 num_listener = 9;
20323    optional int32 num_indefinite_future = 10;
20324    optional int32 num_repeating = 11;
20325    optional int32 num_alarm_clock = 12;
20326    optional int32 num_rtc = 13;
20327}
20328
20329/*
20330 * Logged when a package's user-level hibernation state changes.
20331 * Logged from:
20332 *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
20333 */
20334 message UserLevelHibernationStateChanged {
20335    // Name of the package that had its hibernation state change.
20336    optional string package_name = 1;
20337
20338    // Android user id to which this event belongs. This can only be 0, 10, 11 and so on.
20339    optional int32 user_id = 2;
20340
20341    // New hibernation state. True if hibernating, false otherwise
20342    optional bool is_hibernating = 3;
20343}
20344
20345/*
20346 * Pull atom for the number of hibernated packages on the device for the given user.
20347 * Logged from:
20348 *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
20349 */
20350message UserLevelHibernatedApps {
20351    // Total number of apps hibernated for the user
20352    optional int32 hibernated_app_count = 1;
20353
20354    // Android user id of the queried user which can only be 0, 10, 11 and so on.
20355    optional int32 user_id = 2;
20356}
20357
20358/**
20359 * Pull atom for total number of globally hibernated packages on the device and the storage savings
20360 * from these apps being hibernated.
20361 * Logged from:
20362 *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
20363 */
20364message GlobalHibernatedApps {
20365    // Total number of apps in global hibernation
20366    optional int32 hibernated_app_count = 1;
20367
20368    // Cumulative storage savings from apps being hibernated
20369    optional int64 storage_saved_mb = 2;
20370}
20371
20372/*
20373 * Report the event of app process kills.
20374 * Logged from:
20375 *   frameworks/base/services/core/java/com/android/server/am/AppExitInfoTracker.java
20376 */
20377message AppProcessDied {
20378    // Uid of the package of the dying process
20379    optional int32 uid = 1 [(is_uid) = true];
20380
20381    // Name of the dying process, it'll be omitted if the process name and package name are the same
20382    optional string process_name = 2;
20383
20384    // The reason code of why the process dies
20385    optional android.app.AppExitReasonCode reason = 3;
20386
20387    // The supplemental reason code of why the process dies
20388    optional android.app.AppExitSubReasonCode sub_reason = 4;
20389
20390    // The importance of the process when it dies
20391    optional android.app.Importance importance = 5;
20392
20393    // The last known PSS (in kB) of the process before it dies, could be 0.
20394    optional int32 pss = 6;
20395
20396    // The last known RSS (in kB) of the process before it dies, could be 0.
20397    optional int32 rss = 7;
20398
20399    // Whether or not this process is hosting one or more foregound services.
20400    optional bool has_foreground_services = 8;
20401}
20402
20403// Each pull creates multiple atoms. One for each incremental package.
20404message InstalledIncrementalPackage {
20405    optional int32 uid = 1 [(is_uid) = true];
20406    optional bool is_loading = 2;
20407    optional int64 loading_completed_timestamp = 3;
20408}
20409
20410/**
20411 * Memory management statistics pulled atom based on /proc/vmstat.
20412 * Logged from StatsPullAtomService.
20413 */
20414message VmStat {
20415    optional int32 oom_kill_count = 1;
20416}
20417
20418/**
20419* Log that the user has interacted with an app on the permission usage
20420* fragment.
20421* Logged from permission/debug/PermissionUsageV2Frament.kt
20422*/
20423message PermissionUsageFragmentInteraction {
20424    // id which identifies single session of user interacting with permission hub
20425    optional int64 session_id = 1;
20426
20427    enum Action {
20428        UNDEFINED = 0;
20429        OPEN = 1;
20430        LOCATION_ACCESS_TIMELINE_VIEWED = 2;
20431        CAMERA_ACCESS_TIMELINE_VIEWED = 3;
20432        MICROPHONE_ACCESS_TIMELINE_VIEWED = 4;
20433        SHOW_SYSTEM_CLICKED = 5;
20434        SEE_OTHER_PERMISSIONS_CLICKED = 6;
20435        SHOW_7DAYS_CLICKED = 7;
20436    }
20437
20438    // The action the user took to interact with the fragment
20439    optional Action action = 2;
20440}
20441
20442/**
20443* Log that the user has clicked on .
20444* Logged from permission/debug/PermissionDetailsFragment.kt
20445*/
20446message PermissionDetailsInteraction {
20447    // id which identifies single session of user interacting with permission details fragment.
20448    optional int64 session_id = 1;
20449
20450    // The name of a permission group whose details are viewed.
20451    optional string permission_group_name = 2;
20452
20453    enum Action {
20454        UNDEFINED = 0;
20455        SHOW_SYSTEM_CLICKED = 1;
20456        INFO_ICON_CLICKED = 2;
20457        TIMELINE_ROW_CLICKED = 3;
20458        SHOW_7DAYS_CLICKED = 4;
20459        MANAGE_PERMISSIONS_CLICKED = 5;
20460    }
20461
20462    // Package name for which the info icon was clicked.
20463    optional string package_name = 3;
20464
20465    // The action the user took to interact with the fragment
20466    optional Action action = 4;
20467}
20468
20469/**
20470* Log that the user has toggled the sensor privacy.
20471*/
20472message PrivacySensorToggleInteraction {
20473
20474    enum Sensor {
20475        SENSOR_UNKNOWN = 0;
20476        MICROPHONE = 1;
20477        CAMERA = 2;
20478    }
20479
20480    // Sensor for which sensor privacy was toggled.
20481    optional Sensor sensor = 1;
20482
20483    enum Action {
20484        ACTION_UNKNOWN = 0;
20485        TOGGLE_ON = 1;
20486        TOGGLE_OFF = 2;
20487        TOGGLE_ON_EXCEPT_ALLOWLISTED_APPS = 3;
20488    }
20489
20490    // Action taken on sensor.
20491    optional Action action = 2;
20492
20493    enum Source {
20494        SOURCE_UNKNOWN = 0;
20495        DIALOG = 1;
20496        SETTINGS = 2;
20497        QS_TILE = 3;
20498    }
20499
20500    // Source for the toggling.
20501    optional Source source = 3;
20502
20503    // Amount of time a user spent in the previous sensor privacy state in minutes.
20504    optional int64 time_in_previous_state_in_mins = 4;
20505}
20506
20507message PrivacyToggleDialogInteraction {
20508
20509    enum Action {
20510        ACTION_UNKNOWN = 0;
20511        ENABLE = 1;
20512        CANCEL = 2;
20513    }
20514
20515    // Action taken on the toggle dialog.
20516    optional Action action = 1;
20517
20518    // Name of the package for which the dialog was shown.
20519    optional string package_name = 2;
20520}
20521
20522message VendorApexInfo {
20523  optional string package_name = 1;
20524  optional string version_code = 2;
20525  optional string version_name = 3;
20526  optional string source_dir = 4;
20527  optional string signing_certs_hash = 5;
20528  optional string file_hash = 6;
20529}
20530
20531/**
20532 * Logs the non-a11yTool service warning status and its duration of the usage.
20533 *
20534 * Logged from:
20535 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
20536 *   packages/apps/Settings
20537 */
20538message NonA11yToolServiceWarningReported {
20539    // Package name of the non-a11yTool service.
20540    optional string package_name = 1;
20541
20542    // Warning status of the non-a11yTool service.
20543    optional android.stats.accessibility.WarningStatus status = 2;
20544
20545    // Duration between status in milliseconds.
20546    optional int64 duration_millis = 3;
20547}
20548
20549message MediaCapabilities {
20550    message AudioEncodings {
20551        repeated android.stats.mediametrics.AudioEncoding audio_encodings = 1;
20552    }
20553
20554    message HdrFormats {
20555        repeated android.stats.mediametrics.HdrFormat hdr_formats = 1;
20556    }
20557
20558
20559    message DisplayMode {
20560        optional int32 height = 1;
20561        optional int32 width = 2;
20562        optional float refresh_rate = 3;
20563        optional int32 seamless_refresh_rates_group_id = 4;
20564    }
20565
20566    message DisplayModes {
20567        repeated DisplayMode display_modes = 1;
20568    }
20569
20570    // Surround sound capabilities
20571
20572    // List of surround sound encodings supported by this device
20573    optional AudioEncodings surround_encodings = 1 [(log_mode) = MODE_BYTES];
20574    // List of surround sound encodings supported by the sink device
20575    optional AudioEncodings sink_surround_encodings = 2 [(log_mode) = MODE_BYTES];
20576    // List of supported surround sound encodings disabled by user
20577    optional AudioEncodings user_disabled_surround_encodings = 3 [(log_mode) = MODE_BYTES];
20578    // List of unsupported surround sound encodings enabled by user
20579    optional AudioEncodings user_enabled_surround_encodings = 4 [(log_mode) = MODE_BYTES];
20580     // The surround sound output mode chosen by user
20581    optional android.stats.mediametrics.EncodedSurroundOutputMode surround_output_mode = 5;
20582
20583
20584    // Display capabilities
20585
20586    // List of HDR display formats supported by the sink device
20587    optional HdrFormats sink_hdr_formats = 6 [(log_mode) = MODE_BYTES];
20588    // List of modes supported by the sink device. Each mode has height, width, refresh rate and a list
20589    // of refresh-rates between which a seamless switch is possible.
20590    optional DisplayModes sink_display_modes = 7 [(log_mode) = MODE_BYTES];
20591    // The HDCP level with which the display is connected
20592    optional int32 hdcp_level = 8;
20593
20594    // Display settings
20595
20596    // The Match content refresh rate user preference
20597    optional android.stats.mediametrics.MatchContentFrameRatePreference
20598                match_content_refresh_rate_preference = 9;
20599    // List of HDR formats disabled by the user
20600    optional HdrFormats user_disabled_hdr_formats = 10 [(log_mode) = MODE_BYTES];
20601    // The resolution height selected by the user
20602    optional int32 user_preferred_resolution_height = 11;
20603    // The resolution width selected by the user
20604    optional int32 user_preferred_resolution_width = 12;
20605    // The refresh rate selected by the user
20606    optional float user_preferred_refresh_rate = 13;
20607    // Whether the user has disabled auto low latency mode
20608    optional bool has_user_disabled_allm = 14;
20609}
20610
20611/**
20612 * Logs when NNAPI model is compiled successfully
20613 * Logged from
20614 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
20615 */
20616message NeuralNetworksCompilationCompleted {
20617    // Linux process uid for the package.
20618    optional int32 uid = 1 [(is_uid) = true];
20619
20620    // id which identifies single session of client interacting with NNAPI runtime
20621    optional int32 session_id = 2;
20622
20623    // NNAPI mainline module version.
20624    optional int64 version_nnapi_module = 3;
20625
20626    // An identifier that can be used to match events for ML model architecture.
20627    // Hash is generated from model operations and operands definition, but not weights.
20628    // Hash algorithm: HMAC-SHA256
20629    // Size: 32 byte
20630    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];
20631
20632    // Device driver identifier used by this compilation.
20633    // NeuralNetworks models are compiled/prepared for one or more device drivers (e.g., DSP, GPU,
20634    // TPU, CPU). The device driver identifier is a concatenation of [device driver name, =, and
20635    // device driver version]. If multiple device drivers are used, all device driver identifiers
20636    // are sorted and concatenated with comma as a separator.
20637    optional string device_id = 5;
20638
20639    // Type of tensors used for inputs
20640    optional android.neuralnetworks.DataClass input_data_class = 6;
20641
20642    // Type of tensors used for outputs
20643    optional android.neuralnetworks.DataClass output_data_class = 7;
20644
20645    // Did the compilation had to fallback to cpu due to an error?
20646    optional bool fallback_to_cpu_from_error = 8;
20647
20648    // Did client name target devices explicitly?
20649    optional bool introspection_enabled = 9;
20650
20651    // Was cache enabled?
20652    optional bool cache_enabled = 10;
20653
20654    // Was control flow used in the model?
20655    optional bool has_control_flow = 11;
20656
20657    // Whether there exists a partition boundary in the compilation that has dynamic size
20658    optional bool has_dynamic_temporaries = 12;
20659
20660    // Time taken to compile a model
20661    optional int64 compilation_time_sum_millis = 13;
20662    optional int64 compilation_time_min_millis = 14;
20663    optional int64 compilation_time_max_millis = 15;
20664    optional int64 compilation_time_sum_squared_millis = 16;
20665    optional int32 compilation_time_count = 17;
20666
20667    // How many times this atom occurred locally before being pushed.
20668    optional int32 count = 18;
20669
20670    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
20671    optional int64 model_arch_hash_64 = 19;
20672}
20673
20674/**
20675 * Logs when NNAPI model fails compilation
20676 * Logged from
20677 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
20678 */
20679message NeuralNetworksCompilationFailed {
20680    // Linux process uid for the package.
20681    optional int32 uid = 1 [(is_uid) = true];
20682
20683    // id which identifies single session of client interacting with NNAPI runtime
20684    optional int32 session_id = 2;
20685
20686    // NNAPI mainline module version.
20687    optional int64 version_nnapi_module = 3;
20688
20689    // An identifier that can be used to match events for ML model architecture.
20690    // Hash is generated from model operations and operands definition, but not weights.
20691    // Hash algorithm: HMAC-SHA256
20692    // Size: 32 byte
20693    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];
20694
20695    // Device driver identifier used by this compilation.
20696    // NeuralNetworks models are compiled/prepared for one or more device drivers (e.g., DSP, GPU,
20697    // TPU, CPU). The device driver identifier is a concatenation of [device driver name, =, and
20698    // device driver version]. If multiple device drivers are used, all device driver identifiers
20699    // are sorted and concatenated with comma as a separator.
20700    optional string device_id = 5;
20701
20702    // Type of tensors used for inputs
20703    optional android.neuralnetworks.DataClass input_data_class = 6;
20704
20705    // Type of tensors used for outputs
20706    optional android.neuralnetworks.DataClass output_data_class = 7;
20707
20708    // Error code returned by compilation call
20709    optional android.neuralnetworks.ResultCode error_code = 8;
20710
20711    // Did client name target devices explicitly?
20712    optional bool introspection_enabled = 9;
20713
20714    // Was cache enabled?
20715    optional bool cache_enabled = 10;
20716
20717    // Was control flow used in the model?
20718    optional bool has_control_flow = 11;
20719
20720    // Whether there exists a partition boundary in the compilation that has dynamic size
20721    optional bool has_dynamic_temporaries = 12;
20722
20723    // How many times this atom occurred locally before being pushed.
20724    optional int32 count = 13;
20725
20726    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
20727    optional int64 model_arch_hash_64 = 14;
20728}
20729
20730/**
20731 * Logs when NNAPI model is executed successfully
20732 *
20733 * Logged from
20734 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
20735 */
20736message NeuralNetworksExecutionCompleted {
20737    // Linux process uid for the package.
20738    optional int32 uid = 1 [(is_uid) = true];
20739
20740    // id which identifies single session of client interacting with NNAPI runtime
20741    optional int32 session_id = 2;
20742
20743    // NNAPI mainline module version.
20744    optional int64 version_nnapi_module = 3;
20745
20746    // An identifier that can be used to match events for ML model architecture.
20747    // Hash is generated from model operations and operands definition, but not weights.
20748    // Hash algorithm: HMAC-SHA256
20749    // Size: 32 byte
20750    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];
20751
20752    // Device driver identifier used by this execution.
20753    // NeuralNetworks models are executed on one or more device drivers (e.g., DSP, GPU, TPU, CPU).
20754    // The device driver identifier is a concatenation of [device driver name, =, and device driver
20755    // version]. If multiple device drivers are used, all device driver identifiers are sorted and
20756    // concatenated with comma as a separator.
20757    optional string device_id = 5;
20758
20759    // Execution mode
20760    optional android.neuralnetworks.Mode mode = 6;
20761
20762    // Type of tensors used for inputs
20763    optional android.neuralnetworks.DataClass input_data_class = 7;
20764
20765    // Type of tensors used for outputs
20766    optional android.neuralnetworks.DataClass output_data_class = 8;
20767
20768    // Did client name target devices explicitly?
20769    optional bool introspection_enabled = 9;
20770
20771    // Was cache enabled?
20772    optional bool cache_enabled = 10;
20773
20774    // Was control flow used in the model?
20775    optional bool has_control_flow = 11;
20776
20777    // Whether there exists a partition boundary in the compilation that has dynamic size
20778    optional bool has_dynamic_temporaries = 12;
20779
20780    // Time taken to execute from runtime, including runtime/ipc overhead
20781    optional int64 duration_runtime_sum_micros = 13;
20782    optional int64 duration_runtime_min_micros = 14;
20783    optional int64 duration_runtime_max_micros = 15;
20784    optional int64 duration_runtime_sum_squared_micros = 16;
20785    optional int32 duration_runtime_count = 17;
20786
20787    // Time taken to execute in the driver, excluding runtime/ipc overhead
20788    optional int64 duration_driver_sum_micros = 18;
20789    optional int64 duration_driver_min_micros = 19;
20790    optional int64 duration_driver_max_micros = 20;
20791    optional int64 duration_driver_sum_squared_micros = 21;
20792    optional int32 duration_driver_count = 22;
20793
20794    // Time taken to execute on the hardware, excluding driver overhead
20795    optional int64 duration_hardware_sum_micros = 23;
20796    optional int64 duration_hardware_min_micros = 24;
20797    optional int64 duration_hardware_max_micros = 25;
20798    optional int64 duration_hardware_sum_squared_micros = 26;
20799    optional int32 duration_hardware_count = 27;
20800
20801    // How many times this atom occurred locally before being pushed.
20802    optional int32 count = 28;
20803
20804    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
20805    optional int64 model_arch_hash_64 = 29;
20806}
20807
20808/**
20809 * Logs when NNAPI model fails execution
20810 * Logged from
20811 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
20812 */
20813message NeuralNetworksExecutionFailed {
20814    // Linux process uid for the package.
20815    optional int32 uid = 1 [(is_uid) = true];
20816
20817    // id which identifies single session of client interacting with NNAPI runtime
20818    optional int32 session_id = 2;
20819
20820    // NNAPI mainline module version.
20821    optional int64 version_nnapi_module = 3;
20822
20823    // An identifier that can be used to match events for ML model architecture.
20824    // Hash is generated from model operations and operands definition, but not weights.
20825    // Hash algorithm: HMAC-SHA256
20826    // Size: 32 byte
20827    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];
20828
20829    // Device driver identifier used by this execution.
20830    // NeuralNetworks models are executed on one or more device drivers (e.g., DSP, GPU, TPU, CPU).
20831    // The device driver identifier is a concatenation of [device driver name, =, and device driver
20832    // version]. If multiple device drivers are used, all device driver identifiers are sorted and
20833    // concatenated with comma as a separator.
20834    optional string device_id = 5;
20835
20836    // Execution mode
20837    optional android.neuralnetworks.Mode mode = 6;
20838
20839    // Type of tensors used for inputs
20840    optional android.neuralnetworks.DataClass input_data_class = 7;
20841
20842    // Type of tensors used for outputs
20843    optional android.neuralnetworks.DataClass output_data_class = 8;
20844
20845    // Error code returned by execution call
20846    optional android.neuralnetworks.ResultCode error_code = 9;
20847
20848    // Did client name target devices explicitly?
20849    optional bool introspection_enabled = 10;
20850
20851    // Was cache enabled?
20852    optional bool cache_enabled = 11;
20853
20854    // Was control flow used in the model?
20855    optional bool has_control_flow = 12;
20856
20857    // Whether there exists a partition boundary in the compilation that has dynamic size
20858    optional bool has_dynamic_temporaries = 13;
20859
20860    // How many times this atom occurred locally before being pushed.
20861    optional int32 count = 14;
20862
20863    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
20864    optional int64 model_arch_hash_64 = 15;
20865}
20866
20867/**
20868 * Logs boot-time info for a Context Hub.
20869 */
20870message ContextHubBooted {
20871  // The amount of time it took the framework to connect to CHRE/Context Hub HAL
20872  // since the framework has booted.
20873  optional int64 boot_time_nanos = 1;
20874
20875  // The number of Context Hub instances found on this system.
20876  optional int32 num_context_hubs = 2;
20877}
20878
20879/**
20880 * Logs Context Hub restart events (e.g. crashes).
20881 */
20882message ContextHubRestarted {
20883  // The duration of time between the last time Context Hub restart and this event.
20884  // This should use the SystemClock.elapsedRealTime() API.
20885  optional int64 elapsed_time_millis_since_boot = 1;
20886
20887  // The ID of the Context Hub that has restarted (zero-indexed).
20888  optional int32 context_hub_id = 2;
20889}
20890
20891/**
20892 * Logs a snapshot of all the nanoapps loaded on this Context Hub.
20893 */
20894message ContextHubLoadedNanoappSnapshotReported {
20895  // The ID of the Context Hub the snapshot is for (zero-indexed).
20896  optional int32 context_hub_id = 1;
20897
20898  // The nanoapp this snapshot is for. The nanoapp ID is the 64-bit unique identifier
20899  // for the application, and the version is the semantic versioning (https://semver.org)
20900  // used to determine the software version.
20901  optional int64 nanoapp_id = 2;
20902  optional int32 nanoapp_version = 3;
20903}
20904
20905/**
20906 * Logs details of a dynamic CHRE nanoapp code download transaction.
20907 */
20908message ChreCodeDownloadTransacted {
20909  enum Type {
20910    TYPE_UNKNOWN = 0;
20911    TYPE_LOAD = 1;
20912    TYPE_UNLOAD = 2;
20913  }
20914  // The ID/version of the nanoapp this code download was for.
20915  optional int64 nanoapp_id = 1;
20916  optional int32 nanoapp_version = 2;
20917
20918  // The type of code download transaction.
20919  optional Type transaction_type = 3;
20920
20921  // The result of this transaction.
20922  optional android.contexthub.ContextHubTransactionResult transaction_result = 4;
20923}
20924
20925/**
20926 * Stats about each feature tag that was included in the registration.
20927 *
20928 * Logged from:
20929 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20930 */
20931message ImsRegistrationFeatureTagStats {
20932    // the carrier id associated with this SIP delegate
20933    // Used as a dimension
20934    optional int32 carrier_id = 1;
20935
20936    // The slot id associated with this SIP delegate
20937    // Used as a dimension
20938    optional int32 slot_id = 2;
20939
20940    // The name of the feature tag
20941    // used as a dimension
20942    optional android.telephony.ImsFeatureTag feature_tag_name = 3;
20943
20944    // The underlying radio technology type associated with the feature tag
20945    // used as a dimension
20946    // See the ImsRegistrationImplBase#REGISTRATION_TECH*
20947    optional int32 registration_tech = 4;
20948
20949    // The time this feature tag was registered, rounded to 5 minutes
20950    optional int32 registered_seconds = 5;
20951}
20952
20953/**
20954 * Stats about the messaging client interacting with telephony
20955 *
20956 * Logged from:
20957 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20958 */
20959message RcsClientProvisioningStats {
20960    enum EventType {
20961        EVENT_TYPE_UNSPECIFIED = 0;
20962        // The client sent its client params to the ACS service.
20963        CLIENT_PARAMS_SENT = 1;
20964        // The client has manually triggered reconfiguration
20965        TRIGGER_RCS_RECONFIGURATION = 2;
20966        // Default messaging application changed.
20967        DMA_CHANGED = 3;
20968    }
20969    // Carrier ID of the SIM used for IMS registration.
20970    // See https://source.android.com/devices/tech/config/carrierid.
20971    // Used as a dimension
20972    optional int32 carrier_id = 1;
20973
20974    // Index of the SIM used, 0 for single-SIM devices.
20975    // Used as a dimension
20976    optional int32 slot_id = 2;
20977
20978    // Used as a dimension
20979    optional EventType event = 3;
20980
20981    // The number of times this event has occurred.
20982    optional int32 count = 4;
20983}
20984
20985/**
20986 * Stats about the RCS provisioning via ACS
20987 *
20988 * Logged from:
20989 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20990 */
20991message RcsAcsProvisioningStats {
20992    enum ResponseType {
20993        RESPONSE_TYPE_UNSPECIFIED = 0;
20994        // a provisioning request resulted in an error.
20995        ERROR = 1;
20996        // a provisioning request succeeded and provided an xml
20997        PROVISIONING_XML = 2;
20998        // a provisioning request has resulted in a "pre-provisioning" xml, which
20999        // means RCS is not provisioned and requires the user to intervene.
21000        PRE_PROVISIONING_XML = 3;
21001    }
21002
21003    // Carrier ID of the SIM used for IMS registration.
21004    // See https://source.android.com/devices/tech/config/carrierid.
21005    // Used as a dimension
21006    optional int32 carrier_id = 1;
21007
21008    // Index of the SIM used, 0 for single-SIM devices.
21009    // Used as a dimension
21010    optional int32 slot_id = 2;
21011
21012    // The response code of provisioning if the provisioning resulted in
21013    // ResponseType.ERROR
21014    // Used as a dimension
21015    optional int32 response_code = 3;
21016
21017    // used as a dimension.
21018    optional ResponseType response_type = 4;
21019
21020    // Does the provisioning XML have single registration provisioned.
21021    // Populated if response_type is ResponseType.PROVISIONING_XML
21022    // used as a dimension
21023    optional bool is_single_registration_enabled = 5;
21024
21025    // The number of times this event has occurred.
21026    optional int32 count = 6;
21027
21028    // The amount of time in seconds that the device was in this state in total, rounded 5 minutes
21029    optional int32 state_timer_sec = 7;
21030}
21031
21032/**
21033 * Metrics surrounding the lifetime of a SIP delegate created by applications.
21034 *
21035 * Logged from:
21036 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
21037 */
21038message SipDelegateStats {
21039    // The random number identifier with this SIP delegate
21040    optional int32 dimension = 1;
21041
21042    // The carrier id associated with this SIP delegate
21043    optional int32 carrier_id = 2;
21044
21045    // The slot id associated with this SIP delegate
21046    optional int32 slot_id = 3;
21047
21048    // The total uptime of this delegate, rounded 5 minutes
21049    optional int32 uptime_seconds = 4;
21050
21051    // The reason why this SIP delegate was destroyed.
21052    // See the SipDelegateManager#SIP_DELEGATE_DESTROY_REASON*
21053    optional int32 destroy_reason = 5;
21054}
21055
21056/**
21057 * Tracks each feature tag associated with the SipDelegates that are currently active.
21058 *
21059 * Logged from:
21060 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
21061 */
21062message SipTransportFeatureTagStats {
21063    // the carrier id associated with this SIP delegate
21064    // Used as a dimension
21065    optional int32 carrier_id = 1;
21066
21067    // The slot id associated with this SIP delegate
21068    // Used as a dimension
21069    optional int32 slot_id = 2;
21070
21071    // The name of the feature tag
21072    // used as a dimension
21073    optional android.telephony.ImsFeatureTag feature_tag_name = 3;
21074
21075    // The reason why this feature tag was denied on the SIP Transport
21076    // used as a dimension
21077    // Use SIP transport denied reason.
21078    // See the SipDelegateManager#DENIED_REASON*
21079    optional int32 sip_transport_denied_reason = 4;
21080
21081    // The reason why this feature tag was associated with the SIP Transport but not
21082    // marked as deregistered.
21083    // used as a dimension
21084    // Use SIP transport deregistered reason.
21085    // See the DelegateRegistrationState#DEREGISTERING_REASON*
21086    optional int32 sip_transport_deregistered_reason = 5;
21087
21088    // the time this feature tag was in this state, rounded 5 minutes
21089    optional int32 associated_seconds = 6;
21090}
21091
21092/**
21093 * Tracks each SIP message and the response from either the app or network.
21094 *
21095 * Logged from:
21096 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
21097 */
21098message SipMessageResponse {
21099    enum Direction {
21100        UNKNOWN = 0;
21101        INCOMING = 1;
21102        OUTGOING = 2;
21103    }
21104    // the carrier id associated with this SIP delegate
21105    // Used as a dimension
21106    optional int32 carrier_id = 1;
21107
21108    // The slot id associated with this SIP delegate
21109    // Used as a dimension
21110    optional int32 slot_id = 2;
21111
21112    // The SIP message method type (INVITE, MESSAGE, etc...)
21113    // used as a dimension
21114    optional android.telephony.SipRequestMethodType sip_message_method = 3;
21115
21116    // The SIP message response code, used if this is a response to a request.
21117    // used as a dimension.
21118    optional int32 sip_message_response = 4;
21119
21120    // The SIP message direction
21121    // used as a dimension
21122    optional Direction sip_message_direction = 5;
21123
21124    // The response from the SIP stack to sending/receiving the message
21125    // used as a dimension
21126    // See the SipDelegateManager#MESSAGE_FAILURE_REASON*
21127    optional int32 message_error = 6;
21128
21129    // The number of messages that fit this criteria.
21130    optional int32 count = 7;
21131}
21132
21133/**
21134 * Tracks SIP sessions managed by the SIP transport.
21135 *
21136 * Logged from:
21137 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
21138 */
21139message SipTransportSession {
21140    enum Direction {
21141        UNKNOWN = 0;
21142        INCOMING = 1;
21143        OUTGOING = 2;
21144    }
21145    // the carrier id associated with this SIP delegate
21146    // Used as a dimension
21147    optional int32 carrier_id = 1;
21148
21149    // The slot id associated with this SIP delegate
21150    // Used as a dimension
21151    optional int32 slot_id = 2;
21152
21153    // The SIP message method that started the session (INVITE, SUBSCRIBE, etc...)
21154    // used as a dimension
21155    optional android.telephony.SipRequestMethodType session_method = 3;
21156
21157    // The SIP message direction
21158    // used as a dimension
21159    optional Direction sip_message_direction = 4;
21160
21161    // The response from the SIP stack or network.
21162    // used as a dimension.
21163    optional int32 sip_response = 5;
21164
21165    // The number of these sessions counted
21166    optional int32 session_count = 6;
21167
21168    // The number of sessions that were started properly and did not require
21169    // the SIP transport to forcefully close them.
21170    optional int32 ended_gracefully_count = 7;
21171}
21172
21173/**
21174 * Used to determine if there were dedicated bearers set up for a specific listener.
21175 * If not, this indicates that there may have been a network issue in the dedicated bearer setup.
21176 *
21177 * Logged from:
21178 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
21179 */
21180message ImsDedicatedBearerListenerEvent {
21181    // Carrier ID of the SIM used for IMS registration.
21182    // See https://source.android.com/devices/tech/config/carrierid.
21183    // Used as a dimension
21184    optional int32 carrier_id = 1;
21185
21186    // Index of the SIM used, 0 for single-SIM devices.
21187    // Used as a dimension
21188    optional int32 slot_id = 2;
21189
21190    // Radio access technology (RAT) used by the registration when it terminated.
21191    // The value is either 4G or 5G.
21192    // Used as a dimension
21193    optional android.telephony.NetworkTypeEnum rat_at_end = 3;
21194
21195    // QoS class identifier.
21196    // dimension
21197    optional int32 qci = 4;
21198
21199    // True if there was a dedicated bearer established for this listener.
21200    // dimension
21201    optional bool dedicated_bearer_established = 5;
21202
21203    // The count of listeners with this result.
21204    optional int32 event_count = 6;
21205}
21206
21207/**
21208 * Logs information related to ims dedicated bearer which fulfills required qos and provides guaranteed service.
21209 *
21210 * Logged from:
21211 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
21212 */
21213message ImsDedicatedBearerEvent {
21214    enum State {
21215        STATE_UNSPECIFIED = 0;
21216        STATE_ADDED = 1;
21217        STATE_MODIFIED = 2;
21218        STATE_DELETED = 3;
21219    }
21220    // Carrier ID of the SIM used for IMS registration.
21221    // See https://source.android.com/devices/tech/config/carrierid.
21222    // Used as a dimension
21223    optional int32 carrier_id = 1;
21224
21225    // Index of the SIM used, 0 for single-SIM devices.
21226    // Used as a dimension
21227    optional int32 slot_id = 2;
21228
21229    // Radio access technology (RAT) used by the registration when it terminated.
21230    // The value is either 4G or 5G.
21231    // Used as a dimension
21232    optional android.telephony.NetworkTypeEnum rat_at_end = 3;
21233
21234    // Qos class identifier.
21235    // Used as a dimension
21236    optional int32 qci = 4;
21237
21238    // Dedicated bearer state from the network.
21239    // Used as a dimension
21240    optional State bearer_state = 5;
21241
21242    // Whether location connection information is received.
21243    // Used as a dimension
21244    optional bool local_connection_info_received = 6;
21245
21246    // Whether remote connection information is received.
21247    // Used as a dimension
21248    optional bool remote_connection_info_received = 7;
21249
21250    // Whether or not the QoS indication had listeners.
21251    // Used as a dimension
21252    optional bool has_listeners = 8;
21253
21254    // The count that matches the above conditions.
21255    optional int32 count = 9;
21256}
21257
21258/**
21259 * Stats about each ServiceDescription that was included in the PIDF XML sent to the network during publish.
21260 *
21261 * Logged from:
21262 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
21263 */
21264message ImsRegistrationServiceDescStats {
21265    // Describe Service IDs will be included PUBLISH
21266    // See RcsContactPresenceTuple.java
21267    enum ServiceId {
21268        SERVICE_ID_UNSPECIFIED = 0;
21269        SERVICE_ID_CUSTOM = 1;
21270        SERVICE_ID_MMTEL = 2;
21271        SERVICE_ID_CHAT_V1 = 3;
21272        SERVICE_ID_CHAT_V2 = 4;
21273        SERVICE_ID_FT = 5;
21274        SERVICE_ID_FT_OVER_SMS = 6;
21275        SERVICE_ID_GEO_PUSH = 7;
21276        SERVICE_ID_GEO_PUSH_VIA_SMS = 8;
21277        SERVICE_ID_CALL_COMPOSER = 9;
21278        SERVICE_ID_POST_CALL = 10;
21279        SERVICE_ID_SHARED_MAP = 11;
21280        SERVICE_ID_SHARED_SKETCH = 12;
21281        SERVICE_ID_CHATBOT = 13;
21282        SERVICE_ID_CHATBOT_STANDALONE = 14;
21283        SERVICE_ID_CHATBOT_ROLE = 15;
21284    }
21285
21286    // the carrier id associated with this SIP delegate
21287    // Used as a dimension
21288    optional int32 carrier_id = 1;
21289
21290    // The slot id associated with this SIP delegate
21291    // Used as a dimension
21292    optional int32 slot_id = 2;
21293
21294    // The service id portion of the ServiceDescription
21295    // used as a dimension
21296    optional ServiceId service_id_name = 3;
21297
21298    // The version portion of the ServiceDescription
21299    // used as a dimension
21300    optional float service_id_version = 4;
21301
21302    // The underlying radio technology type associated with the feature tag
21303    // used as a dimension
21304    // See the ImsRegistrationImplBase#REGISTRATION_TECH*
21305    optional int32 registration_tech = 5;
21306
21307    // the time this feature tag was registered, rounded 5 minutes
21308    optional int32 published_seconds = 6;
21309}
21310
21311/**
21312 * Stats related to UCE queries to the network
21313 *
21314 * Logged from:
21315 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
21316 */
21317message UceEventStats {
21318    enum MessageType {
21319        MESSAGE_TYPE_UNSPECIFIED = 0;
21320        PUBLISH = 1;
21321        SUBSCRIBE = 2;
21322        INCOMING_OPTION = 3;
21323        OUTGOING_OPTION = 4;
21324    }
21325    enum CommandCode {
21326        SERVICE_UNKNOWN = 0;
21327        GENERIC_FAILURE = 1;
21328        INVALID_PARAM = 2;
21329        FETCH_ERROR = 3;
21330        REQUEST_TIMEOUT = 4;
21331        INSUFFICIENT_MEMORY = 5;
21332        LOST_NETWORK_CONNECTION = 6;
21333        NOT_SUPPORTED = 7;
21334        NOT_FOUND = 8;
21335        SERVICE_UNAVAILABLE = 9;
21336        NO_CHANGE = 10;
21337    }
21338    // Carrier ID of the SIM used for IMS registration.
21339    // See https://source.android.com/devices/tech/config/carrierid.
21340    // Used as a dimension
21341    optional int32 carrier_id = 1;
21342
21343    // Index of the SIM used, 0 for single-SIM devices.
21344    // Used as a dimension
21345    optional int32 slot_id = 2;
21346
21347    // Used to identify the message type.
21348    // Used as a dimension
21349    optional MessageType type = 3;
21350
21351    // Whether the UCE event is successfully finished. If false, the request to the
21352    // modem timed out and we sent a timeout error back to the requesting app.
21353    // Used as a dimension
21354    optional bool successful = 4;
21355
21356    // The command error code for the Uce event. Not populated if the modem
21357    // accepted the request and delivered a network_response.
21358    // Used as a dimension
21359    optional CommandCode command_code = 5;
21360
21361    // The network response code for the Uce event. Will not be populated if
21362    // command_code is present.
21363    // Used as a dimension
21364    optional int32 network_response = 6;
21365
21366    // The count that matches the above conditions;
21367    optional int32 count = 7;
21368}
21369
21370/**
21371 * Information related to a SIP NOTIFY event from modem.
21372 *
21373 * Logged from:
21374 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
21375 */
21376message PresenceNotifyEvent {
21377    // See RFC3265 Section 3.2.4 for more information about these subscription states.
21378    enum TerminatedReason {
21379        REASON_UNSPECIFIED = 0;
21380        // Not spec defined, the network returned a custom code that is not spec defined.
21381        REASON_CUSTOM = 1;
21382        REASON_DEACTIVATED = 2;
21383        REASON_PROBATION = 3;
21384        REASON_REJECTED = 4;
21385        REASON_TIMEOUT = 5;
21386        REASON_GIVEUP = 6;
21387        REASON_NORESOURCE = 7;
21388    }
21389
21390    // Carrier ID of the SIM used for IMS registration.
21391    // See https://source.android.com/devices/tech/config/carrierid.
21392    // Used as a dimension
21393    optional int32 carrier_id = 1;
21394
21395    // Index of the SIM used, 0 for single-SIM devices.
21396    // Used as a dimension
21397    optional int32 slot_id = 2;
21398
21399    // The terminated reason associated with the subscription state.
21400    // Used as a dimension
21401    optional TerminatedReason reason = 3;
21402
21403    // Whether or not the NOTIFY received contained at least one body with PIDF
21404    // content before moving to the terminated state.
21405    // Used as a dimension
21406    optional bool content_body_received = 4;
21407
21408    // The count of PIDF info received that contained RCS caps.
21409    optional int32 rcs_caps_count = 5;
21410
21411    // The count of PIDF info received that contained MMTEL caps.
21412    optional int32 mmtel_caps_count = 6;
21413
21414    // The count of PIDF info received that contained no mmtel or RCS caps.
21415    optional int32 no_caps_count = 7;
21416
21417    // The count that matches the above conditions;
21418    optional int32 count = 8;
21419}
21420
21421/**
21422 * Tracks GBA requests from applications
21423 *
21424 * Logged from:
21425 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
21426 */
21427message GbaEvent {
21428    enum FailedReason {
21429        UNKNOWN = 0;
21430        FEATURE_NOT_SUPPORTED = 1;
21431        FEATURE_NOT_READY = 2;
21432        NETWORK_FAILURE = 3;
21433        INCORRECT_NAF_ID = 4;
21434        SECURITY_PROTOCOL_NOT_SUPPORTED = 5;
21435    }
21436    // Carrier ID of the SIM used for IMS registration.
21437    // See https://source.android.com/devices/tech/config/carrierid.
21438    // Used as a dimension
21439    optional int32 carrier_id = 1;
21440
21441    // Index of the SIM used, 0 for single-SIM devices.
21442    // Used as a dimension
21443    optional int32 slot_id = 2;
21444
21445    // Whether the GBA event is successful.
21446    // Used as a dimension
21447    optional bool successful = 3;
21448
21449    // Gba authentication failed reason.
21450    // Used as a dimension
21451    optional FailedReason failed_reason = 4;
21452
21453    // The count that matches the above conditions.
21454    optional int32 count = 5;
21455}
21456
21457/*
21458 * Logs details of initiated UWB ranging session
21459 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
21460 */
21461message UwbSessionInitiated {
21462    // UWB profiles
21463    optional android.uwb.Profile profile = 1;
21464    // Scrambled timestamp sequence (STS) Type
21465    optional android.uwb.Sts sts = 2;
21466    // Was it an initiator as opposed to responder?
21467    optional bool is_initiator = 3;
21468    // Was it a controller as opposed to controlee?
21469    optional bool is_controller = 4;
21470    // Was the discovery done by the framework?
21471    optional bool is_discovered_by_framework = 5;
21472    // Was it out-of-band connection as opposed to in-band connection?
21473    // Note that this field is ignored if is_discovered_by_framework is false.
21474    optional bool is_out_of_band = 6;
21475    // UWB channel 5, 6, 9, etc.
21476    optional int32 channel = 7;
21477    // The status code of session initialization.
21478    optional android.uwb.Status status = 8;
21479    // Initialization latency in ms if is_discovered_by_framework is true.
21480    optional int32 latency_ms = 9;
21481    // Initialization latency in step size of 200 ms if is_discovered_by_framework is true.
21482    optional int32 latency_200ms = 10;
21483    // The uid of the app that initiates the connection.
21484    optional int32 uid = 11 [(is_uid) = true];
21485    // Ranging interval of the session in ms.
21486    optional int32 ranging_interval_ms = 12;
21487    // How many ongoing session when current session is initiated?
21488    optional int32 parallel_session_count = 13;
21489    // Composed value for UWB filter configurations.
21490    // This value combines the boolean value of multiple feature flags for
21491    // UWB filter configuration into one integer, where the bits of its binary value
21492    // are for the flags
21493    // Below are the flags from LSB to MSB, 1 for enabled and 0 for disabled
21494    // bit 0: filter_enabled
21495    // bit 1: enable_azimuth_mirroring
21496    // bit 2: enable_primer_aoa
21497    // bit 3: enable_primer_est_elevation
21498    // bit 4: enable_primer_fov
21499    // bit 5: predict_rear_azimuths
21500    // For example, when all flags are enabled this value is 63 (0b111111)
21501    // Refer to packages/modules/Uwb/service/ServiceUwbResources/res/values/config.xml
21502    // for more information about the flags
21503    optional int32 filter_config_value = 14;
21504}
21505
21506/*
21507 * Logs details of closed UWB ranging session
21508 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
21509 */
21510message UwbSessionClosed {
21511    // UWB profiles
21512    optional android.uwb.Profile profile = 1;
21513    // Scrambled timestamp sequence (STS) Type
21514    optional android.uwb.Sts sts = 2;
21515    // Was it an initiator as opposed to responder?
21516    optional bool is_initiator = 3;
21517    // Was it a controller as opposed to controlee?
21518    optional bool is_controller = 4;
21519    // Was the connection done by the app as opposed to by the framework?
21520    optional bool is_framework_initiated = 5;
21521    // Was it out-of-band connection as opposed to in-band connection?
21522    // Note that this field is ignored if is_framework_initiated is false.
21523    optional bool is_out_of_band = 6;
21524    // Session active duration in seconds
21525    optional int32 duration_sec = 7;
21526    // Session active duration bucket
21527    optional android.uwb.DurationBucket duration_bucket = 8;
21528    // Total ranging measurement count
21529    optional int32 ranging_count = 9;
21530    // Valid ranging measurement count
21531    optional int32 valid_ranging_count = 10;
21532    // Ranging measurement count bucket.
21533    optional android.uwb.CountBucket ranging_count_bucket = 11;
21534    // Valid ranging measurement count bucket.
21535    optional android.uwb.CountBucket valid_ranging_count_bucket = 12;
21536    // Ranging start count
21537    optional int32 start_count = 13;
21538    // Ranging start failure count
21539    optional int32 start_failure_count = 14;
21540    // Ranging start without valid ranging result count
21541    optional int32 start_no_valid_report_count = 15;
21542    // Total Rx data packet count
21543    optional int32 rx_packet_count = 16;
21544    // Total Tx data packet count
21545    optional int32 tx_packet_count = 17;
21546    // Count of Rx data packet with error
21547    optional int32 rx_error_count = 18;
21548    // Count of Tx data packet with error
21549    optional int32 tx_error_count = 19;
21550    // Count of Rx data packets sent to upper layer
21551    optional int32 rx_to_upper_layer_count = 20;
21552    // Ranging Measurement Type
21553    optional android.uwb.RangingType ranging_type = 21;
21554}
21555
21556/*
21557 * Logs details of start UWB ranging
21558 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
21559 */
21560message UwbStartRanging {
21561    // UWB profiles
21562    optional android.uwb.Profile profile = 1;
21563    // Scrambled timestamp sequence (STS) Type
21564    optional android.uwb.Sts sts = 2;
21565    // Was it an initiator as opposed to responder?
21566    optional bool is_initiator = 3;
21567    // Was it a controller as opposed to controlee?
21568    optional bool is_controller = 4;
21569    // Was the connection done by the app as opposed to by the framework?
21570    optional bool is_framework_initiated = 5;
21571    // Was it out-of-band connection as opposed to in-band connection?
21572    // Note that this field is ignored if is_framework_initiated is false.
21573    optional bool is_out_of_band = 6;
21574    // The status code of ranging start.
21575    optional android.uwb.RangingStatus status = 7;
21576}
21577
21578/*
21579 * Log that the ranging measurement is received
21580 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
21581 */
21582message UwbRangingMeasurementReceived {
21583    // UWB profiles
21584    optional android.uwb.Profile profile = 1;
21585    // None-Line-of-sight (LOS) indication
21586    optional android.uwb.Nlos nlos = 2;
21587    // Was the distance valid?
21588    optional bool is_distance_valid = 3;
21589    // The distance measurement in centimeters.
21590    optional int32 distance_cm = 4;
21591    // The distance measurement in step size of 50 cm
21592    optional int32 distance_50cm = 5;
21593    // RSSI of ranging report, in dBm
21594    optional int32 rssi = 6;
21595    // Was azimuth angle valid?
21596    optional bool is_azimuth_valid = 7;
21597    // The azimuth angle measurement in degrees.
21598    optional int32 azimuth_degree = 8;
21599    // The azimuth angle measurement in step size of 10 degree.
21600    optional int32 azimuth_10degree = 9;
21601    // The figure of merit of azimuth angle measurement.
21602    optional int32 azimuth_fom = 10;
21603    // Was elevation angle valid?
21604    optional bool is_elevation_valid = 11;
21605    // The elevation angle measurement in degrees.
21606    optional int32 elevation_degree = 12;
21607    // The elevation angle measurement in step size of 10 degree.
21608    optional int32 elevation_10degree = 13;
21609    // The figure of merit of elevation angle measurement.
21610    optional int32 elevation_fom = 14;
21611    // Ranging Measurement Type
21612    optional android.uwb.RangingType ranging_type = 15;
21613    // The filtered distance measurement in centimeters.
21614    optional int32 filtered_distance_cm = 16;
21615    // The filtered azimuth angle measurement in degrees.
21616    optional int32 filtered_azimuth_degree = 17;
21617    // The filtered figure of merit of azimuth angle measurement.
21618    optional int32 filtered_azimuth_fom = 18;
21619    // The filtered elevation angle measurement in degrees.
21620    optional int32 filtered_elevation_degree = 19;
21621    // The filtered figure of merit of elevation angle measurement.
21622    optional int32 filtered_elevation_fom = 20;
21623}
21624
21625/*
21626 * Log that the first ranging measurement is received
21627 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
21628 */
21629message UwbFirstRangingReceived {
21630    // UWB profiles
21631    optional android.uwb.Profile profile = 1;
21632    // The latency between the ranging start/resume and 1st ranging measurement, in ms.
21633    optional int32 latency_ms = 2;
21634    // The ranging latency in 200ms.
21635    optional int32 latency_200ms = 3;
21636}
21637
21638/*
21639 * Log that UWB device error is detected
21640 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
21641 */
21642message UwbDeviceErrorReported {
21643    enum Type {
21644        UNKNOWN = 0;
21645        // Initialization error
21646        INIT_ERROR = 1;
21647        // Device status error
21648        DEVICE_STATUS_ERROR = 2;
21649        // UCI generic error
21650        UCI_GENERIC_ERROR = 3;
21651    }
21652    // Error type
21653    optional Type type= 1;
21654}
21655
21656/**
21657 * Log that the clipboard has been cleared
21658 * Logged from frameworks/base/services/core/java/android/content/ClipboardAutoWipeService.java
21659 */
21660message ClipboardCleared {
21661    enum Source {
21662        SOURCE_UNKNOWN = 0;
21663        AUTO_CLEAR = 1;
21664    }
21665
21666    // Source of the wipe
21667    optional Source source = 1;
21668}
21669
21670/**
21671 * Pulls status for a SIM.
21672 *
21673 * Each pull creates multiple atoms, one for each SIM. The atom holds the status for a SIM that's
21674 * sensitive per carrier. The atom would be aggregated per carrier for analysis.
21675 *
21676 * Pulled from:
21677 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
21678 */
21679message PerSimStatus {
21680    enum WfcMode {
21681        UNKNOWN = 0;
21682        WIFI_ONLY = 1;
21683        CELLULAR_PREFERRED = 2;
21684        WIFI_PREFERRED = 3;
21685    }
21686    enum SimVoltageClass {
21687        VOLTAGE_CLASS_UNKNOWN = 0;
21688        VOLTAGE_CLASS_A = 1;
21689        VOLTAGE_CLASS_B = 2;
21690        VOLTAGE_CLASS_C = 3;
21691    }
21692
21693    // Index of the SIM, 0 for single-SIM devices.
21694    optional int32 sim_slot_index = 1;
21695
21696    // Carrier ID of the SIM.
21697    // See https://source.android.com/devices/tech/config/carrierid.
21698    optional int32 carrier_id = 2;
21699
21700    // Indicates whether phone number source UICC provides a phone number
21701    // and whether it agrees with other sources:
21702    //  - 0: no number provided
21703    //  - a positive integer (> 0): sources providing the same phone number
21704    //    shall use the same integer. The integer shall start from 1, and
21705    //    for each new unique source the next integer (2, 3, …) is used.
21706    // This way, the raw phone number cannot be derived from the value of
21707    // this field.
21708    // This also allows a quick check of conflicts: any field > 1 means conflict,
21709    // and the max means the count of unique phone numbers.
21710    optional int32 phone_number_source_uicc = 3;
21711
21712    // Indicates whether phone number source CARRIER provides a phone number
21713    // and whether it agrees with other sources.
21714    // See field phone_number_source_uicc.
21715    optional int32 phone_number_source_carrier = 4;
21716
21717    // Indicates whether phone number source IMS provides a phone number
21718    // and whether it agrees with other sources.
21719    // See field phone_number_source_uicc.
21720    optional int32 phone_number_source_ims = 5;
21721
21722    // Indicates whether VoLTE is enabled
21723    optional bool volte_enabled = 6;
21724
21725    // Indicates whether WFC is enabled
21726    optional bool wfc_enabled = 7;
21727
21728    // Indicates the user's WFC mode
21729    optional WfcMode wfc_mode = 8;
21730
21731    // Indicates the user's WFC mode when roaming
21732    optional WfcMode wfc_roaming_mode = 9;
21733
21734    // Indicates the user's setting for video calling.
21735    optional bool video_calling_enabled = 10;
21736
21737    // Indicates if data roaming is enabled
21738    optional bool data_roaming_enabled = 11;
21739
21740    // Indicates the list of networks allowed by the user. Bitmask is encoded as
21741    // TelephonyManager#NetworkTypeBitMask.
21742    optional int64 allowed_networks_by_user = 12;
21743
21744    // Indicates if 2G is disabled by the user using the "Allow 2G" toggle
21745    optional bool is_2g_disabled = 13;
21746
21747    // Indicates if PIN1 of the SIM card is enabled
21748    optional bool is_pin1_enabled = 14;
21749
21750    // Indicates the lowest voltage class supported by the SIM
21751    optional SimVoltageClass sim_voltage_class = 15;
21752
21753    // APN type bitmask of the APNs added or modified by user:
21754    // @ApnType in frameworks/base/telephony/java/android/telephony/Annotation.java.
21755    optional int32 user_modified_apn_type_bitmask = 16;
21756
21757    // Indicates the unmetered networks
21758    // Bitmask is encoded as TelephonyManager#NetworkTypeBitMask.
21759    optional int64 unmetered_networks = 17;
21760
21761    // Indicates whether VoNR is enabled
21762    optional bool vonr_enabled = 18;
21763
21764    // Indicates whether cross-SIM calling (WiFi calling over cellular data) is
21765    // enabled.
21766    optional bool cross_sim_calling_enabled = 19;
21767}
21768
21769/*
21770 * Logs Device Scan State events generated by Nearby Scan API.
21771 */
21772message NearbyDeviceScanStateChanged {
21773  // Uid of the client that triggers the Nearby scan.
21774  optional int32 uid = 1 [(is_uid) = true];
21775
21776  // Scan start timestamp as session id.
21777  optional int64 scan_session_id = 2;
21778
21779  // Scan state.
21780  optional android.nearby.NearbyScanState scan_state = 3;
21781
21782  // Scan type.
21783  optional android.nearby.NearbyScanType scan_type = 4;
21784
21785  // Medium that this device was discovered/lost.
21786  optional android.nearby.NearbyNetworkMedium network_medium = 5;
21787
21788  // Received Signal Strength Indication (RSSI) value of the device discovered/lost.
21789  optional int32 rssi = 6;
21790
21791  // Model of the device discovered/lost.
21792  optional string scanned_device_model = 7;
21793
21794  // Manufacturer of the device discovered/lost.
21795  optional string scanned_device_manufacturer = 8;
21796}
21797
21798/**
21799 * Logs when locales of an application are changed.
21800 * Logged from
21801 *   frameworks/base/services/core/java/com/android/server/locales/LocaleManagerService.java
21802 */
21803message ApplicationLocalesChanged {
21804    // The uid which invoked this update. The locales for an application
21805    // could be changed from the in-app picker OR from the settings UI.
21806    optional int32 calling_uid = 1 [(is_uid) = true];
21807
21808    // The uid for which the locale change is being done.
21809    optional int32 target_uid = 2 [(is_uid) = true];
21810
21811    // The new locales for the target package. A comma separated list of BCP 47
21812    // locale identifiers, compatible with LocaleList#forLanguageTags.
21813    optional string new_locales = 3;
21814
21815    // The previous locales for the target package. A comma separated list of
21816    // BCP 47 locale identifiers, compatible with LocaleList#forLanguageTags.
21817    optional string prev_locales = 4;
21818
21819    // Application locales changed status.
21820    enum Status {
21821        // A placeholder for unspecified values.
21822        STATUS_UNSPECIFIED = 0;
21823
21824        // New locales were committed.
21825        CONFIG_COMMITTED = 1;
21826
21827        // Likely because no change is required.
21828        CONFIG_UNCOMMITTED = 2;
21829
21830        // Failed because the target package is invalid.
21831        FAILURE_INVALID_TARGET_PACKAGE = 3;
21832
21833        // Failed because the calling package does not have the required permission.
21834        FAILURE_PERMISSION_ABSENT = 4;
21835    }
21836
21837    optional Status status = 5;
21838
21839    // The caller where changes application locales.
21840    enum Caller {
21841        // A placeholder for unknown value.
21842        CALLER_UNKNOWN = 0;
21843
21844        // The change was called from the delegate.
21845        CALLER_DELEGATE = 1;
21846
21847        // The change was called from Apps.
21848        CALLER_APPS = 2;
21849
21850        // The change was called from the system due to backup and restore.
21851        CALLER_BACKUP_RESTORE = 3;
21852
21853        // The change was called from the system when the app languages
21854        // feature or the set per-app locales was changed from opt-in to
21855        // opt-out.
21856        CALLER_APP_UPDATE_LOCALES_CHANGE = 4;
21857
21858        // The change was called from the system due to the dynamic locales
21859        // change.
21860        CALLER_DYNAMIC_LOCALES_CHANGE = 5;
21861    }
21862
21863    optional Caller caller = 6;
21864}
21865
21866/* Logs when the display HBM state changes.
21867 *
21868 * Logged from:
21869 *   frameworks/base/services/core/java/com/android/server/display/HighBrightnessModeController.java
21870 */
21871message DisplayHbmStateChanged {
21872    optional int32 display_id = 1;
21873
21874    // New HBM state
21875    optional android.server.display.HbmState state = 2;
21876
21877    // The reason the state changes.
21878    optional android.server.display.HbmStateTransitionReason reason = 3;
21879}
21880
21881/*
21882 * Logs when the display HBM brightness changes.
21883 * Logged from:
21884 *   frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessControllerjava
21885 */
21886message DisplayHbmBrightnessChanged {
21887    optional int32 display_id = 1;
21888
21889    // display brightness
21890    optional float brightness = 2;
21891}
21892
21893/**
21894 * Per-UID time spent running work on the GPU.
21895 *
21896 * Each pull creates multiple atoms, one per (GPU ID, UID) pair, for at most 10
21897 * randomly selected UIDs.
21898 *
21899 * Pulled from:
21900 *    frameworks/native/services/gpuservice/gpuwork/GpuWork.cpp
21901 */
21902message GpuWorkPerUid {
21903  // The UID (i.e. app id) that scheduled work on the GPU.
21904  optional int32 uid = 1 [(is_uid) = true];
21905
21906  // The GPU ID for which we have work information.
21907  optional int32 gpu_id = 2;
21908
21909  // The time duration (in seconds) over which this data was collected (most
21910  // likely 24 hours).
21911  optional int32 time_duration_seconds = 3;
21912
21913  // The total amount of time (in milliseconds) the GPU spent running work for
21914  // |uid|.
21915  optional int32 total_active_duration_millis = 4;
21916
21917  // The total amount of time (in milliseconds) the GPU was inactive while
21918  // running "continuous" work for |uid|. This is estimated by adding up the
21919  // duration of the small gaps between GPU work for |uid|.
21920  optional int32 total_inactive_duration_millis = 5;
21921}
21922
21923/**
21924 * Logs when entries are dropped in DropBox and the reason for the drop.
21925 *
21926 * Logged from: frameworks/base/services/
21927 */
21928message DropboxEntryDropped {
21929    // Explains at which stage of the DropBox workflow the entry was dropped.
21930    enum DropReason {
21931        UNKNOWN = 0;
21932        CLEARING_DATA = 3;
21933        AGED = 4;
21934        WRITE_FAILURE = 5;
21935        ENTRY_TOO_LARGE = 6;
21936
21937        reserved 1, 2;
21938    }
21939
21940    optional DropReason drop_reason = 1;
21941
21942    // Tag describing the type of dropbox entry.
21943    optional string tag = 2;
21944
21945    // The age (millis) of the dropped dropbox entry.
21946    optional int64 age_millis = 3;
21947}
21948
21949message PersistentUriPermissionsFlushed {
21950    // Current amount of persistent uri permissions overall
21951    optional int32 permissions_flushed_amount = 1;
21952}
21953
21954message PersistentUriPermissionsAmountPerPackage {
21955    // The uid persistent uri permissions amount reported for
21956    optional int32 uid = 1 [(is_uid) = true];
21957    // Current amount of persistent uri permissions for this package
21958    optional int32 amount = 2;
21959}
21960
21961/**
21962 * VBMeta Digest cryptographically encapsulates the composition of signed images or partitions of
21963 * a particular build.
21964 *
21965 * Logs when boot is complete.
21966 * Pushed from:
21967 *    frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
21968 */
21969message VBMetaDigestReported {
21970    // the hex encoded string of VBMeta Digest value
21971    optional string vbmeta_digest = 1;
21972}
21973
21974/**
21975 * APEXs can either be signed by Google or OEMs. This atom captures basic metadata of APEXs
21976 * pre-installed on a build or a device.
21977 *
21978 * Logs when boot is complete.
21979 * Pushed from:
21980 *    frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
21981 */
21982message ApexInfoGathered {
21983    // APEX package names are determined by OEMs
21984    optional string package_name = 1;
21985    // the version code of the APEX
21986    optional int64 version_code = 2;
21987
21988    // the hex encoded value of digest of the content of this APEX
21989    // we are deprecating the use of this going forward
21990    optional string content_digest = 3;
21991
21992    // the algorithm that the content digest is computed
21993    optional com.android.os.transparency.DigestAlgorithmType algo_type = 4;
21994
21995    // the SHA256 digest(s) of the APEX's signer certificate(s)
21996    repeated string signer_sha256_digest = 5;
21997}
21998
21999/**
22000 * MobileBundledApps (MBAs) include preloaded apps and apps that are installed in the background
22001 * without user knowledge/consent.
22002 *
22003 * However, note that we will only be recording *updated* preloaded apps + dynamic MBAs.
22004 *
22005 * Pushed from:
22006 *    frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
22007 *
22008 * Next ID: 12
22009 */
22010message MobileBundledAppInfoGathered {
22011    // MBA package names are determined by developers (which can include OEMs)
22012    optional string package_name = 1;
22013    // the package version code of the MBA
22014    optional int64 version_code = 2;
22015    // the split name (empty if it's the base)
22016    optional string split_name = 11;
22017
22018    // the hex encoded value of digest of the content of the MBA
22019    optional string content_digest = 3;
22020    // the algorithm that the content_digest is computed
22021    optional com.android.os.transparency.DigestAlgorithmType algo_type = 4;
22022    // the SHA256 digest(s) of the APEX's signer certificate(s)
22023    repeated string signer_sha256_digest = 5;
22024
22025    enum MBAStatus {
22026        ERROR = 0;
22027        PRELOADED = 1;
22028        UPDATED_PRELOAD = 2;
22029        NEW_MBA = 3;
22030        UPDATED_NEW_MBA = 4;
22031        DOWNGRADED_PRELOADED = 5;
22032        UNINSTALLED_MBA = 6;
22033    }
22034    // whether the MBA is preloaded, dynamically installed, or uninstalled/downgraded
22035    optional MBAStatus mba_status = 6;
22036    // the package that initiated the installation of this MBA
22037    optional string initiator = 7;
22038    // the SHA256 digest(s) of the initiator's signer certificate(s)
22039    repeated string initiator_signer_sha256_digest = 8;
22040    // the package that installs this MBA
22041    optional string installer = 9;
22042    // the package on behalf of which initiator requested the installation of this MBA
22043    optional string originator = 10;
22044}
22045
22046/**
22047 * PVM is protected virtual machine. This atom captures the notion of a container
22048 * that describes a virtual machine.
22049 *
22050 * Will be pushed from:
22051 *      frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
22052 */
22053message PvmInfoGathered {
22054    // PVM names are determined by OEMs
22055    optional string name = 1;
22056    // an int describing the version of the VM
22057    optional int64 version = 2;
22058    // the hex encoded SHA256 digest of the pvm descriptor file
22059    optional string sha256_digest = 3;
22060}
22061
22062/**
22063 * This will be pulled from
22064 *     frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
22065 */
22066message SignedPartitionInfo {
22067    // partition name (e.g. vendor, product) is determined by OEM
22068    optional string partition_name = 1;
22069    // the hex encoded SHA256 digest of the partition image file
22070    optional string sha256_digest = 2;
22071}
22072
22073/**
22074 * Logs when Wear Settings UI is interacted with
22075 */
22076message WearSettingsUIInteracted {
22077    /** The UI action category */
22078    optional android.app.wearsettings.Action action = 1;
22079
22080    /** The ID of the entry that the users actioned on. */
22081    optional android.app.wearsettings.ItemId item_id = 2;
22082}
22083
22084message TracingServiceReportEvent {
22085    enum Event {
22086      TRACING_SERVICE_REPORT_UNDEFINED = 0;
22087
22088      // Checkpoints inside TracingServiceProxy.
22089      TRACING_SERVICE_REPORT_BEGIN = 1;
22090      TRACING_SERVICE_REPORT_SVC_HANDOFF = 2;
22091
22092      // Guardrails inside TracingServiceProxy.
22093      TRACING_SERVICE_REPORT_BIND_PERM_INCORRECT = 3;
22094      TRACING_SERVICE_REPORT_SVC_PERM_MISSING = 4;
22095      TRACING_SERVICE_REPORT_SVC_COMM_ERROR = 5;
22096  }
22097
22098  // Which stage of the pipeline we are reporting from.
22099  optional Event event = 1;
22100
22101  // UUID of the trace.
22102  optional int64 trace_uuid_lsb = 2;
22103  optional int64 trace_uuid_msb = 3;
22104}
22105
22106/** Pulled from PinnerService. */
22107message PinnedFileSizesPerPackage {
22108    // If the file is pinned but not as part of a specific pinned app,
22109    // this will be set to 1000 - the value of system_server.
22110    optional int32 uid = 1 [(is_uid) = true];
22111
22112    // Consists of only the pinned file's filename, not its full path; for example
22113    // Given a pinned file at ‘/vendor/lib64/libCB.so’, then this field will be
22114    // Determined to have have the value ‘libCB.so’.
22115    optional string filename = 2;
22116
22117    // The size of the pinned file, in kilobytes.
22118    optional int32 size_kb = 3;
22119}
22120
22121/** Pulled from PendingIntentController. */
22122message PendingIntentsPerPackage {
22123    // The UID of the app that sent the PendingIntent.
22124    optional int32 uid = 1 [(is_uid) = true];
22125    // The total number of currently active PendingIntents belonging to this uid.
22126    optional int32 pending_intent_count = 2;
22127    // The total size of all currently active PendingIntents belonging to this uid, in kilobytes.
22128    optional int32 pending_intent_total_bundle_size_kb = 3;
22129}
22130
22131/*
22132 * Logs changes to game state set by game applications via GameService.
22133 */
22134message GameStateChanged {
22135    enum State {
22136        // Game mode is unknown.
22137        MODE_UNKNOWN = 0;
22138
22139        // The game is not in active play, e.g.e the user is using a game menu.
22140        MODE_NONE = 1;
22141
22142        // The game is in active, but interruptible, game play.
22143        MODE_GAMEPLAY_INTERRUPTIBLE = 2;
22144
22145        // The game is in active user play mode, which cannot be interrupted.
22146        MODE_GAMEPLAY_UNINTERRUPTIBLE = 3;
22147
22148        // The current content shown is not gameplay related (e.g. an ad).
22149        MODE_CONTENT = 4;
22150    }
22151
22152    // Provided to ensure package is available even with UID sharing.
22153    optional string package_name = 1;
22154
22155    // The UID (i.e. app id).
22156    optional int32 uid = 2 [(is_uid) = true];
22157
22158    // Whether the device enabled performance boost when the state was changed.
22159    optional bool boost_enabled = 3;
22160
22161    // This includes a top-level state for the game.
22162    optional State state = 4;
22163
22164    // Indicates if the game is loading assets/resources/compiling/etc.
22165    optional bool is_loading = 5;
22166
22167    // A developer-selected enum, for example to indicate level or scene.
22168    optional int32 label = 6;
22169
22170    // A developer-supplied enum, e.g. to indicate the current quality level.
22171    optional int32 quality = 7;
22172}
22173
22174/**
22175 * Log the duration of executing all receivers of LOCKED_BOOT_COMPLETED or BOOT_COMPLETED broadcast.
22176 * The dispatch latency is the dispatchTime - enqueueTime.
22177 * The completion latency is the completeTime - enqueueTime.
22178 * Logged from:
22179 *   frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
22180 */
22181message BootCompletedBroadcastCompletionLatencyReported {
22182    enum Event {
22183        UNKNOWN = 0;
22184        LOCKED_BOOT_COMPLETED = 1;
22185        BOOT_COMPLETED = 2;
22186    }
22187
22188    optional Event event = 1;
22189    // from enqueueTime to dispatchTime.
22190    optional int32 dispatch_latency_uptime_millis = 2;
22191    // from enqueueTime to completeTime.
22192    optional int32 complete_latency_uptime_millis = 3;
22193    // from enqueueRealTime to dispatchRealTime.
22194    optional int32 dispatch_latency_realtime_millis = 4;
22195    // from enqueueRealTime to completeRealTime.
22196    optional int32 complete_latency_realtime_millis = 5;
22197
22198    optional int32 user_id = 6;
22199    optional UserLifecycleJourneyReported.UserType user_type = 7;
22200}
22201
22202/**
22203 * Log that the permission reminder notification has been displayed or clicked.
22204 */
22205message PermissionReminderNotificationInteracted {
22206    // id which identifies single session of user interacting with permission
22207    // controller
22208    optional int64 session_id = 1;
22209
22210    enum Result {
22211        UNDEFINED = 0;
22212        // notification was presented to the user
22213        NOTIFICATION_PRESENTED = 1;
22214        // notification was clicked by the user
22215        NOTIFICATION_CLICKED = 2;
22216    }
22217
22218    // View / interaction recorded
22219    optional Result result = 2;
22220}
22221
22222/**
22223 * Log that the user has interacted with the permission decision screen.
22224 */
22225message RecentPermissionDecisionsInteracted {
22226    // id which identifies single session of user interacting with permission
22227    // controller
22228    optional int64 session_id = 1;
22229
22230    enum Action {
22231        ACTION_UNKNOWN = 0;
22232        SCREEN_VIEWED = 1;
22233        REVIEW_DECISION = 2;
22234        VIEW_ALL_CLICKED = 3;
22235    }
22236
22237    // Action taken on the recent permission decisions page.
22238    optional Action action = 2;
22239
22240    // Uid of the package for the permission decision being reviewed
22241    optional int32 uid = 3 [(is_uid) = true];
22242
22243    // Name of the permission for the permission decision being reviewed.
22244    optional string permission_group_name = 4;
22245}
22246
22247/**
22248 * Logs information about app background restrictions.
22249 *
22250 * Logged from:
22251 *      frameworks/base/services/core/java/com/android/server/am/AppRestrictionController.java
22252 */
22253message AppBackgroundRestrictionsInfo {
22254    // the uid of the app.
22255    optional int32 uid = 1 [(is_uid) = true];
22256
22257    enum RestrictionLevel {
22258        LEVEL_UNKNOWN = 0;
22259        LEVEL_UNRESTRICTED = 1;
22260        LEVEL_EXEMPTED = 2;
22261        LEVEL_ADAPTIVE_BUCKET = 3;
22262        LEVEL_RESTRICTED_BUCKET = 4;
22263        LEVEL_BACKGROUND_RESTRICTED = 5;
22264        LEVEL_HIBERNATION = 6;
22265    }
22266    // indicates the app background restriction level.
22267    optional RestrictionLevel restriction_level = 2;
22268
22269    enum Threshold {
22270        THRESHOLD_UNKNOWN = 0;
22271        THRESHOLD_RESTRICTED = 1; // app was background restricted by the system.
22272        THRESHOLD_USER = 2; // app was background restricted by user action.
22273    }
22274    // indicates which threshold caused the app to be put into bg restriction.
22275    optional Threshold threshold = 3;
22276
22277    enum StateTracker {
22278        UNKNOWN_TRACKER = 0;
22279        BATTERY_TRACKER = 1;
22280        BATTERY_EXEMPTION_TRACKER = 2;
22281        FGS_TRACKER = 3;
22282        MEDIA_SESSION_TRACKER = 4;
22283        PERMISSION_TRACKER = 5;
22284        BROADCAST_EVENTS_TRACKER = 6;
22285        BIND_SERVICE_EVENTS_TRACKER = 7;
22286    }
22287    // indicates the reason/tracker which caused the app to hit the threshold.
22288    optional StateTracker tracker = 4;
22289
22290    message FgsTrackerInfo {
22291        // indicates whether an fgs notification was visible for this app or not.
22292        optional bool fgs_notification_visible = 1;
22293        // total FGS duration for this app.
22294        optional int64 fgs_duration = 2;
22295    }
22296    optional FgsTrackerInfo fgs_tracker_info = 5 [(log_mode) = MODE_BYTES];
22297
22298    message BatteryTrackerInfo {
22299        // total battery usage within last 24h (1/10000th)
22300        optional int32 battery_24h = 1;
22301        // background battery usage (1/10000th)
22302        optional int32 battery_usage_background = 2;
22303        // FGS battery usage (1/10000th)
22304        optional int32 battery_usage_fgs = 3;
22305        // Foreground battery usage (1/10000th)
22306        optional int32 battery_usage_foreground = 4;
22307        // Cached battery usage (1/10000th)
22308        optional int32 battery_usage_cached = 5;
22309    }
22310    optional BatteryTrackerInfo battery_tracker_info = 6 [(log_mode) = MODE_BYTES];
22311
22312    message BroadcastEventsTrackerInfo {
22313        // the number of broadcasts sent by this app.
22314        optional int32 broadcasts_sent = 1;
22315    }
22316    optional BroadcastEventsTrackerInfo broadcast_events_tracker_info = 7 [(log_mode) = MODE_BYTES];
22317
22318    message BindServiceEventsTrackerInfo {
22319        // the number of bind service requests by this app.
22320        optional int32 bind_service_requests = 1;
22321    }
22322    optional BindServiceEventsTrackerInfo bind_service_events_tracker_info =
22323        8 [(log_mode) = MODE_BYTES];
22324
22325    // The reasons listed below are defined in PowerExemptionManager.java
22326    enum ExemptionReason {
22327        // range 0-9 is reserved for default reasons
22328        REASON_UNKNOWN = 0;
22329        REASON_DENIED = 1;
22330        REASON_OTHER = 2;
22331        // range 10-49 is reserved for BG-FGS-launch allowed proc states
22332        REASON_PROC_STATE_PERSISTENT = 10;
22333        REASON_PROC_STATE_PERSISTENT_UI = 11;
22334        REASON_PROC_STATE_TOP = 12;
22335        REASON_PROC_STATE_BTOP = 13;
22336        REASON_PROC_STATE_FGS = 14;
22337        REASON_PROC_STATE_BFGS = 15;
22338        // range 50-99 is reserved for BG-FGS-launch allowed reasons
22339        REASON_UID_VISIBLE = 50;
22340        REASON_SYSTEM_UID = 51;
22341        REASON_ACTIVITY_STARTER = 52;
22342        REASON_START_ACTIVITY_FLAG = 53;
22343        REASON_FGS_BINDING = 54;
22344        REASON_DEVICE_OWNER = 55;
22345        REASON_PROFILE_OWNER = 56;
22346        REASON_COMPANION_DEVICE_MANAGER = 57;
22347        REASON_BACKGROUND_ACTIVITY_PERMISSION = 58;
22348        REASON_BACKGROUND_FGS_PERMISSION = 59;
22349        REASON_INSTR_BACKGROUND_ACTIVITY_PERMISSION = 60;
22350        REASON_INSTR_BACKGROUND_FGS_PERMISSION = 61;
22351        REASON_SYSTEM_ALERT_WINDOW_PERMISSION = 62;
22352        REASON_DEVICE_DEMO_MODE = 63;
22353        REASON_ALLOWLISTED_PACKAGE = 65;
22354        REASON_APPOP = 66;
22355        REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD = 67;
22356        REASON_OP_ACTIVATE_VPN = 68;
22357        REASON_OP_ACTIVATE_PLATFORM_VPN = 69;
22358        REASON_TEMP_ALLOWED_WHILE_IN_USE = 70;
22359        REASON_CURRENT_INPUT_METHOD = 71;
22360        // range 100-199 is reserved for public reasons
22361        REASON_GEOFENCING = 100;
22362        REASON_PUSH_MESSAGING = 101;
22363        REASON_PUSH_MESSAGING_OVER_QUOTA = 102;
22364        REASON_ACTIVITY_RECOGNITION = 103;
22365        REASON_ACCOUNT_TRANSFER = 104;
22366        // range 200-299 is reserved for broadcast actions
22367        REASON_BOOT_COMPLETED = 200;
22368        REASON_PRE_BOOT_COMPLETED = 201;
22369        REASON_LOCKED_BOOT_COMPLETED = 202;
22370        REASON_BLUETOOTH_BROADCAST = 203;
22371        REASON_TIMEZONE_CHANGED = 204;
22372        REASON_TIME_CHANGED = 205;
22373        REASON_LOCALE_CHANGED = 206;
22374        REASON_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED = 207;
22375        REASON_REFRESH_SAFETY_SOURCES = 208;
22376        // range 300-399 is reserved for other internal reasons
22377        REASON_SYSTEM_ALLOW_LISTED = 300;
22378        REASON_ALARM_MANAGER_ALARM_CLOCK = 301;
22379        REASON_ALARM_MANAGER_WHILE_IDLE = 302;
22380        REASON_SERVICE_LAUNCH = 303;
22381        REASON_KEY_CHAIN = 304;
22382        REASON_PACKAGE_VERIFIER = 305;
22383        REASON_SYNC_MANAGER = 306;
22384        REASON_DOMAIN_VERIFICATION_V1 = 307;
22385        REASON_DOMAIN_VERIFICATION_V2 = 308;
22386        REASON_VPN = 309;
22387        REASON_NOTIFICATION_SERVICE = 310;
22388        REASON_PACKAGE_REPLACED = 311;
22389        REASON_LOCATION_PROVIDER = 312;
22390        REASON_MEDIA_BUTTON = 313;
22391        REASON_EVENT_SMS = 314;
22392        REASON_EVENT_MMS = 315;
22393        REASON_SHELL = 316;
22394        REASON_MEDIA_SESSION_CALLBACK = 317;
22395        REASON_ROLE_DIALER = 318;
22396        REASON_ROLE_EMERGENCY = 319;
22397        REASON_SYSTEM_MODULE = 320;
22398        REASON_CARRIER_PRIVILEGED_APP = 321;
22399        REASON_DPO_PROTECTED_APP = 322;
22400        REASON_DISALLOW_APPS_CONTROL = 323;
22401        REASON_ACTIVE_DEVICE_ADMIN = 324;
22402        REASON_MEDIA_NOTIFICATION_TRANSFER = 325;
22403        REASON_PACKAGE_INSTALLER = 326;
22404        REASON_SYSTEM_EXEMPT_APP_OP = 327;
22405        REASON_PACKAGE_UNARCHIVE = 328;
22406        REASON_TILE_ONCLICK = 329;
22407        // app requested to be exempt
22408        REASON_OPT_OUT_REQUESTED = 1000;
22409    }
22410    // indicates if the app is exempt from background restrictions and the reason if applicable.
22411    optional ExemptionReason exemption_reason = 9;
22412
22413    enum OptimizationLevel {
22414        UNKNOWN = 0;
22415        OPTIMIZED = 1;
22416        BACKGROUND_RESTRICTED = 2;
22417        NOT_OPTIMIZED = 3;
22418    }
22419    // the user choice for the optimization level of the app.
22420    optional OptimizationLevel opt_level = 10;
22421
22422    enum TargetSdk {
22423        SDK_UNKNOWN = 0;
22424        SDK_PRE_S = 1;
22425        SDK_S = 2;
22426        SDK_T = 3;
22427    }
22428    // indicates the target sdk level for this app.
22429    optional TargetSdk target_sdk = 11;
22430
22431    // indicates if the current device is a low ram device.
22432    optional bool low_mem_device = 12;
22433
22434    // indicates previous background restriction level.
22435    optional RestrictionLevel previous_restriction_level = 13;
22436}
22437
22438/**
22439 * Logs failure reason when MmsSmsProvider#getThreadId fails to return a threadId
22440 */
22441message MmsSmsProviderGetThreadIdFailed {
22442    enum FailureCode {
22443        FAILURE_UNKNOWN = 0;
22444        // Did not return a threadId due to recipients being passed in
22445        FAILURE_NO_RECIPIENTS = 1;
22446        FAILURE_FIND_OR_CREATE_THREAD_ID_SQL = 2;
22447        // Found more than one threadId for the given of recipients
22448        FAILURE_MULTIPLE_THREAD_IDS_FOUND = 3;
22449    }
22450
22451    optional FailureCode failure_code = 1;
22452}
22453
22454/**
22455 * Logs failure reason when MmsSmsDatabaseHelperOnUpgradeFailed fails on an upgrade step
22456 */
22457message MmsSmsDatabaseHelperOnUpgradeFailed {
22458    enum FailureCode {
22459        FAILURE_UNKNOWN = 0;
22460        FAILURE_IO_EXCEPTION = 1;
22461        FAILURE_SECURITY_EXCEPTION = 2;
22462        FAILURE_SQL_EXCEPTION = 3;
22463    }
22464
22465    // Database version being upgraded from
22466    optional int32 old_version = 1;
22467    // Database version being upgraded to
22468    optional int32 current_version = 2;
22469    // Version number of the database upgrade step that failed
22470    optional int32 upgrade_failed_to_version = 3;
22471    optional FailureCode failure_code = 4;
22472}
22473
22474/** Log for autofill events. This captures events till the view goes out of
22475 * focus. For each auttofilled view going out of focus, and coming back, a
22476 * separate event would be generated.
22477 *
22478 * Logged from:
22479 * frameworks/base/services/autofill/java/com/android/server/autofill/
22480 *
22481 * Next ID: 52
22482 */
22483message AutofillPresentationEventReported {
22484  enum PresentationEventResult {
22485    NONE_SHOWN_UNKNOWN_REASON =
22486        0;  // Includes reasons where losses can be partial: eg: IME not showing
22487            // certain datasets, while others are filtered out because user
22488            // started typing. So, it can either refer to a set of mixed of
22489            // known or unknown reasons.
22490    ANY_SHOWN =
22491        1;  // This is counter to the event name, but we need it in order to get
22492            // overall success rate.
22493    // Below ones corresponds to no presentation getting shown
22494    NONE_SHOWN_VIEW_FOCUS_CHANGED =
22495        2;  // User action leads to focus getting shifted to another field
22496    NONE_SHOWN_VIEW_CHANGED =
22497        3;  // This would also include if view becomes invisible.
22498    NONE_SHOWN_ACTIVITY_FINISHED = 4;  // Eg: User pressed back
22499    NONE_SHOWN_REQUEST_TIMEOUT =
22500        5;  // Autofill provider didn't respond in the given time.
22501    NONE_SHOWN_SESSION_COMMITTED_PREMATURELY =
22502        6;  // Session was prematurely committed. This can happen due to various
22503            // reasons, eg: app developers calling commit() earlier than when
22504            // they should.
22505    NONE_SHOWN_FILL_REQUEST_FAILED =
22506        7; // Autofill provider request failed. Different from timeout.
22507    NONE_SHOWN_NO_FOCUS =
22508        8; // Autofill provider request was triggered pre-focus. User never
22509           // focussed on autofillable fields. This can happen for FillDialog
22510           // where we trigger fill request at layout time.
22511    NONE_SHOWN_VIEW_FOCUSED_BEFORE_FILL_DIALOG_RESPONSE =
22512        9; // Users focus a field before the fill dialogs response is returned.
22513    NONE_SHOWN_SUGGESTION_FILTER_OUT =
22514        10; // Suggestions were filtered out due to pre-existing text
22515  }
22516
22517  // Id number which increases for each subsequent request.
22518  optional int32 request_id = 1;
22519
22520  // SessionId to aggregate requests within a session, and see overall
22521  // performance.
22522  optional int32 session_id = 2;
22523
22524  // Result of autofill event.
22525  optional PresentationEventResult presentation_event_result = 3;
22526
22527  // Count of datasets that should've been available for display. If the request
22528  // times out, this won't be populated.
22529  optional int32 available_count = 4;
22530
22531  // Count of datasets that are shown to the user.
22532  optional int32 count_shown = 5;
22533
22534  // Count of datasets that are eligible to be shown to the user, but aren't
22535  // shown because user started typing already, and the results were filtered.
22536  // If the user starts typing, dataset isn't shown at the moment, but then the
22537  // user deletes text, and the dataset becomes visible, it would count as
22538  // shown, and not as filtered out.
22539  optional int32 count_filtered_user_typing = 6;
22540
22541  // Count of datasets that aren't shown because IME didn't use datasets at all.
22542  optional int32 count_not_shown_unused_by_ime = 7;
22543
22544  // Count of datasets that are eligible to be shown to the user, but aren't
22545  // shown because display didn't show them (probably user didn't scroll to see
22546  // the view). The dataset was requested by display, but not shown.
22547  optional int32 count_not_shown_never_visible = 8;
22548
22549  // How the dataset is supposed to be shown to the user
22550  optional AutofillDisplayPresentationType display_presentation_type = 9;
22551
22552  // Autofill Service Provider's uid
22553  optional int32 autofill_service_uid = 10 [(is_uid) = true];
22554
22555  // Inline suggestion host's uid. Populated only when
22556  // AutofillDisplayPresentationType = INLINE
22557  optional int32 inline_suggestion_host_uid = 11 [(is_uid) = true];
22558
22559  // Whether a new request was triggered or alternatively served from cached
22560  // response.
22561  optional bool is_request_triggered = 12;
22562
22563  // Timestamps are in milliseconds, relative to when the Session was created
22564  // For example, if timestamp has a value = 100, the event was triggered
22565  // 100ms after the session was created.
22566  // Since these are relative to Session creation, you can subtract events to
22567  // get the latency duration between events.
22568  // t1 = 100
22569  // t2 = 300
22570  // duration = t2 - t1 = 200ms
22571  // ------------------------------------------------------------------------
22572  // Timestamp of when FillRequest is sent to Autofill provider
22573  // This is also the latency of when a field is focused to Framework sending a FillRequest
22574  optional int32 fill_request_sent_timestamp_ms = 13;
22575
22576  // Timestamp of when Autofill provider returns a FillResponse
22577  // The latency of the Autofill provider IPC can be calculated
22578  // by fillResponseReceivedTimestampMs - fillRequestSentTimestampMs
22579  optional int32 fill_response_received_timestamp_ms = 14;
22580
22581  // Timestamp of when FillResponse is sent to the IME/Dropdown handler/Fill Dialog UI
22582  // The latency of processing provider FillResponse to when suggestions are sent to be rendered
22583  // can be calculated by suggestionSentTimestampMs - fillResponseReceivedTimestampMs
22584  optional int32 suggestion_sent_timestamp_ms = 15;
22585
22586  // Timestamp of when the suggestion is first shown
22587  // The latency of showing suggestions can be calculated by
22588  // suggestionPresentedTimestampMs - suggestionSentTimestampMs
22589  optional int32 suggestion_presented_timestamp_ms = 16;
22590
22591  // The index of the dataset that a user selected. -1 if not selected.
22592  optional int32 selected_dataset_id = 17;
22593
22594  // True if the user dismissed the fill UI.
22595  optional bool dialog_dismissed = 18;
22596
22597  // True if the user clicked the negative CTA button.
22598  optional bool negative_cta_button_clicked = 19;
22599
22600  // True if the user clicked the positive CTA button.
22601  optional bool positive_cta_button_clicked = 20;
22602
22603  optional autofill.AuthenticationType authentication_type = 21;
22604
22605  optional autofill.AuthenticationResult authentication_result = 22;
22606
22607  // From response received to authentication UI displayed to the user.
22608  optional int64 latency_authentication_ui_display_millis = 23;
22609
22610  // From the user finishing authentication to the dataset is displayed to the user.
22611  optional int64 latency_dataset_display_millis = 24;
22612
22613  // Count of datasets that are available due to PCC Detection. These can include datasets
22614  // available via provider response, and would be eligible because of pcc too.
22615  // If PCC detection is preferred over Autofill provider, and Autofill provider had same detection
22616  // as PCC did, the following invariants would hold.
22617  // available_pcc_count = available_count
22618  // available_pcc_only_count = 0
22619  optional int32 available_pcc_count = 25;
22620
22621  // Count of datasets that are available only due to PCC Detection.
22622  optional int32 available_pcc_only_count = 26;
22623
22624  // The selection process of this dataset.
22625  optional autofill.DatasetPickedReason selected_dataset_picked_reason = 27;
22626
22627  // Which detection was preferred
22628  optional autofill.DetectionPreference detection_preference = 28;
22629
22630  // field_classification request id that was used for this event.
22631  optional int32 field_classification_request_id = 29;
22632
22633  // App package Uid
22634  optional int32 app_package_uid = 30 [(is_uid) = true];
22635
22636  // True if the request is directed to the credential autofill service.
22637  optional bool is_credential_request = 31;
22638
22639  // True if the response is from webview requesting credential autofill service.
22640  optional bool webview_requested_credential = 32;
22641
22642  // Count of views that are filtered because they are not in current session
22643  // before autofill framework calls AutofillManager.autofill().
22644  optional int64 views_fillable_excluded_by_session_count = 46;
22645
22646  // Count of views that can be filled as per the provider service.
22647  // views_fillable_total_count = views_filled_failure_count +
22648  //     views_filled_success_count + views_with_no_callback
22649  // views_with_no_callback aren't logged explicitly, as it can be computed.
22650  // There may be no callback due to views overriding default behavior, and
22651  // not adhering to javadoc guidelines. They may correspond to autofill
22652  // failing or being successful. There is no way for autofill framework to
22653  // know such status.
22654  optional int64 views_fillable_total_count = 33;
22655
22656  // Count of views that failed to receive autofill values. These are minimum counts.
22657  // It's possible that additional views themselves didn't fill correctly.
22658  optional int64 views_filled_failure_count = 34;
22659
22660  // ViewID of the AutofillID that triggered the presentation
22661  optional int32 focused_autofill_id = 35;
22662
22663  // Count of views that successfully received autofill values. These are guaranteed counts.
22664  // They are confirmed by getting views autofill value, and comparing against what was attempted
22665  // to be set.
22666  optional int64 views_filled_success_count = 36;
22667
22668  // Count of views that successfully received autofill values, but don't belong to this event.
22669  // This value is for confirmation that nothing is wrong. It's expected value is 0.
22670  // If non-zero, there's likely some bug in our logging (or in autofill).
22671  optional int64 views_filled_but_unexpected_count = 37;
22672
22673  // Timestamp (relative to session start) of when user tapped a selection
22674  optional int32 presentation_selected_timestamp_ms = 38;
22675
22676  // Timestamp (relative to session start) of filling into a field
22677  optional int32 field_autofilled_timestamp_ms = 39;
22678
22679  // Timestamp (relative to session start) of when the field is first modified
22680  // This is used to check if a field was modified before an Autofill suggestion
22681  // was presented
22682  optional int32 field_first_modified_timestamp_ms = 40;
22683
22684  // Timestamp (relative to session start) of when the field is last modified
22685  // This is value is updated when the view value was changed manually
22686  // (by app/user - not autofill)
22687  // This will be the same as field_first_modified_timestamp_ms
22688  // if field was only modified once
22689  optional int32 field_last_modified_timestamp_ms = 41;
22690
22691  // Supplement to suggestion_presented_timestamp_ms. This is the timestamp
22692  // of the last suggestion that was presented to the user. It is used to
22693  // distinguish multiple presentations in the same field.
22694  optional int32 suggestion_presented_last_timestamp_ms = 42;
22695
22696  // The virtual component (if any) of the autofill id
22697  optional int32 focused_virtual_autofill_id = 43;
22698
22699  // Length of text already in the field when the event is initialized
22700  optional int32 field_first_length = 44;
22701
22702  // Length of text already in the field when the event is logged
22703  optional int32 field_last_length = 45;
22704
22705  // Count of views that failed prior to refill attempt
22706  optional int32 view_failed_prior_to_refill_count = 47;
22707
22708  // Count of views that were able to be filled during refill
22709  // Note that this doesn't include views that were filled successfully prior
22710  // to refill.
22711  optional int32 view_filled_on_refill_count = 48;
22712
22713  // Count of views that failed in refill attempt
22714  optional int32 view_failed_on_refill_count = 49;
22715
22716  // Count of times response wasn't expired due to pending authentication.
22717  optional int32 fix_expire_response_auth_count = 50;
22718
22719  // Count of times notifyViewEntered wasn't done due to pending authentication
22720  optional int32 notify_view_entered_ignored_auth_count = 51;
22721}
22722
22723// Tells how Autofill dataset was/will-be displayed.
22724enum AutofillDisplayPresentationType {
22725  UNKNOWN_AUTOFILL_DISPLAY_PRESENTATION_TYPE = 0;
22726  MENU = 1;    // aka drop-down
22727  INLINE = 2;  // shown via IME
22728  DIALOG = 3;  // aka Bottom-sheet dialog
22729}
22730
22731/**
22732 * Log the CompanionDeviceManager associations are created by various device
22733 * profiles
22734 *
22735 * Logged from:
22736 * frameworks/base/services/companion/java/com/android/server/companion/
22737 * CompanionDeviceManagerService.java
22738 */
22739message CdmAssociationAction {
22740    enum Action {
22741        UNKNOWN = 0;
22742        CREATED = 1;
22743        REMOVED = 2;
22744    }
22745
22746    enum DeviceProfile{
22747        DEVICE_PROFILE_NULL = 0;
22748        DEVICE_PROFILE_WATCH = 1;
22749        DEVICE_PROFILE_APP_STREAMING = 2;
22750        DEVICE_PROFILE_AUTO_PROJECTION = 3;
22751        DEVICE_PROFILE_COMPUTER = 4;
22752        DEVICE_PROFILE_GLASSES = 5;
22753        DEVICE_PROFILE_NEARBY_DEVICE_STREAMING = 6;
22754    }
22755
22756    // Action taken on the CDM association been created by companion apps.
22757    optional Action action = 1;
22758
22759    // Name of the CDM Association Request profiles.
22760    optional DeviceProfile device_profile = 2;
22761}
22762
22763/**
22764 * Logs when text and reading options changed.
22765 *
22766 * Logged from:
22767 *   packages/apps/Settings/src/com/android/settings/accessibility
22768 */
22769message AccessibilityTextReadingOptionsChanged {
22770    // The item name of the accessibility feature "Text and Reading Options".
22771    optional android.stats.accessibility.TextReadingOption name = 1;
22772
22773    // The status value of the item of the accessibility feature "Text and Reading Options".
22774    optional int32 value = 2;
22775
22776    // The entry point from which page.
22777    optional android.stats.accessibility.TextReadingEntry entry_point = 3;
22778}
22779
22780/*
22781 * Pushed atom logged by ONS service.
22782 */
22783message OnsOpportunisticEsimProvisioningComplete {
22784    enum ResultCode {
22785      // Unknown
22786      RESULT_UNKNOWN = 0;
22787
22788      // Operation was successful.
22789      RESULT_SUCCESS = 1;
22790
22791      // Device capabilities not met such as eSIM and MultiSIM not supported.
22792      RESULT_DEVICE_NOT_CAPABLE = 2;
22793
22794      // Internet connection is not available while trying to download opportunistic eSIM.
22795      RESULT_INTERNET_NOT_AVAILABLE = 3;
22796
22797      // Error occurred while switching device from Single to MultiSIM mode.
22798      RESULT_SWITCH_TO_MULTISIM_FAILED = 4;
22799
22800      // Connection error occurred while downloading opportunistic eSIM from SMDP server.
22801      RESULT_CONNECTION_ERROR = 5;
22802
22803      // Download failed because there is no sufficient storage available in eUICC memory.
22804      RESULT_MEMORY_FULL = 6;
22805
22806      // Installation of downloaded eSIM failed.
22807      RESULT_INSTALL_ESIM_PROFILE_FAILED = 7;
22808
22809      // Unresolvable errors such as Invalid SMDP address or activation code.
22810      RESULT_UNRESOLVABLE_ERROR = 8;
22811
22812      // Auto provisioning disabled
22813      RESULT_AUTO_PROVISIONING_DISABLED = 9;
22814
22815      // eSIM provisioning failed
22816      RESULT_ESIM_PROVISIONING_FAILED = 10;
22817    }
22818
22819    // CBRS carrier id. Filled only while reporting failure cases.
22820    optional int32 carrier_id = 1;
22821
22822    // carrier id of the opportunistic eSIM downloaded from the SMDP server.
22823    //Filled only while reporting failure cases.
22824    optional int32 opportunistic_esim_carrier_id = 2;
22825
22826    // Flag to indicate that the data connection was used for downloading.
22827    optional bool is_mobile_data_used = 3;
22828
22829    // Error code occurred during the above operation.
22830    optional ResultCode error_code = 4;
22831
22832    // Retry count of the above operation.
22833    optional int32 retry_count = 5;
22834
22835    // Detailed error code.
22836    optional int32 detailed_error_code = 6;
22837}
22838
22839/**
22840 * Logs when a telephony anomaly is reported.
22841 *
22842 * Logged from:
22843 *   frameworks/base/telephony/java/android/telephony/AnomalyReporter.java
22844 */
22845message TelephonyAnomalyDetected {
22846    // Carrier ID of the SIM card.
22847    // See https://source.android.com/devices/tech/config/carrierid.
22848    optional int32 carrier_id = 1;
22849    // UUID of the anomaly, as generated by android.telephony.AnomalyReporter
22850    optional int64 event_id_lsb = 2;
22851    optional int64 event_id_msb = 3;
22852}
22853
22854// Logs when the remote key provisioner application is invoked, either
22855// due to a periodically scheduled job, due to an attestation key being
22856// consumed from the pool, or when the system has detected that it's
22857// completely out of attestation keys.
22858//
22859// Logged from:
22860//   packages/modules/RemoteKeyProvisioning
22861message RemoteKeyProvisioningAttempt {
22862    // The reason for the provisioning attempt.
22863    enum Cause {
22864        CAUSE_UNKNOWN = 0;
22865        SCHEDULED = 1;          // A scheduled job issued the request
22866        KEY_CONSUMED = 2;       // A provisioned key was consumed from the pool
22867        OUT_OF_KEYS = 3;        // The system is out of keys
22868    }
22869    optional Cause cause = 1;
22870
22871    // The name of the remotely provisioned component for whom keys are being
22872    // generated and certified. The string value is determined by the vendor,
22873    // and is fixed for the lifetime of the device. The number of unique string
22874    // values on a given device is determined by how many remotely provisioned
22875    // component HALs are on a given device. Typically, this is 2-3 HALs.
22876    optional string remotely_provisioned_component = 2;
22877
22878    // The uptime of the device, organized into time ranges of interest.
22879    enum UpTime {
22880        UPTIME_UNKNOWN = 0;
22881        LESS_THAN_5_MINUTES = 1;
22882        BETWEEN_5_AND_60_MINUTES = 2;
22883        MORE_THAN_60_MINUTES = 3;
22884    }
22885    optional UpTime uptime = 3;
22886
22887    // The state of remote provisioning enablement
22888    enum Enablement {
22889        ENABLEMENT_UNKNOWN = 0;
22890        ENABLED_WITH_FALLBACK = 1;
22891        ENABLED_RKP_ONLY = 2;
22892        DISABLED = 3;
22893    }
22894    optional Enablement enablement = 4;
22895
22896    // If the key pool is completely exhausted, this is set to true. Typically,
22897    // we do not expect to see a pool with no spare keys available.
22898    optional bool is_key_pool_empty = 5;
22899
22900    // Indicates success or failure of the provisioning attempt.
22901    optional com.android.remoteprovisioner.RemoteKeyProvisioningStatus status = 6;
22902
22903    // A digest of the root key that certified the provisioned certificates
22904    optional string root_cert_fingerprint = 7;
22905
22906    // The depth of the cert chains issued to the device
22907    optional int32 cert_chain_length = 8;
22908}
22909
22910// Logs that correlate remote key provisioning status with the active
22911// network for the given provisioning attempt.
22912//
22913// Logged from:
22914//   packages/modules/RemoteKeyProvisioning
22915message RemoteKeyProvisioningNetworkInfo {
22916    // The network transport, according ConnectivityManager::getActiveNetwork().
22917    optional android.stats.connectivity.TransportType transport_type = 1;
22918
22919    // Indicates success or failure of the provisioning attempt.
22920    optional com.android.remoteprovisioner.RemoteKeyProvisioningStatus status = 2;
22921
22922    // If an HTTP error was received, this contains the code. Else, contains 200.
22923    optional int32 http_status_error = 3;
22924}
22925
22926// Logs indicating timing data to understand how long the remote provisioner is
22927// taking to perform various sub-tasks. This is intended to be used with KLL metrics.
22928//
22929// Logged from:
22930//   packages/modules/RemoteKeyProvisioning
22931message RemoteKeyProvisioningTiming {
22932    // Time spent waiting on the RKP service to reply.
22933    optional int32 server_wait_millis = 1;
22934
22935    // Time spent waiting on internal binder calls to the provisioning service.
22936    optional int32 binder_wait_millis = 2;
22937
22938    // Time spent waiting on the serialization lock.
22939    optional int32 lock_wait_millis = 3;
22940
22941    // Total time spent processing the attempt.
22942    optional int32 total_processing_time = 4;
22943
22944    // The network transport, according ConnectivityManager::getActiveNetwork().
22945    optional android.stats.connectivity.TransportType transport_type = 5;
22946
22947    // The name of the remotely provisioned component for whom keys are being
22948    // generated and certified. The string value is determined by the vendor,
22949    // and is fixed for the lifetime of the device. The number of unique string
22950    // values on a given device is determined by how many remotely provisioned
22951    // component HALs are on a given device. Typically, this is 2-3 HALs.
22952    optional string remotely_provisioned_component = 6;
22953
22954    // Cause of the attempt which resulted in these timings.
22955    optional RemoteKeyProvisioningAttempt.Cause cause = 7;
22956
22957    // Indicates success or failure of the provisioning attempt.
22958    optional com.android.remoteprovisioner.RemoteKeyProvisioningStatus status = 8;
22959}
22960
22961// Deprecated in U.
22962//
22963// Counters that track how many errors we're seeing on the device for the
22964// given boot.
22965//
22966// Logged from:
22967//   packages/modules/RemoteKeyProvisioning
22968message RemoteKeyProvisioningErrorCounts {
22969    // The total number of RKP attempts there have been this boot.
22970    optional int32 total_count = 1;
22971
22972    // How many errors this device has encountered this boot.
22973    optional int32 error_count = 2;
22974
22975    // How many bytes of data have been sent that resulted in errors. These
22976    // bytes count against an error budget, so it's important to track.
22977    optional int32 error_bytes = 3;
22978}
22979
22980/**
22981 * Logs information about sync exemptions when they occur.
22982 *
22983 * Logged from:
22984 *      frameworks/base/services/core/java/com/android/server/content/ContentService.java
22985 */
22986message SyncExemptionOccurred {
22987    optional int32 uid = 1 [(is_uid) = true]; // the uid of the app.
22988
22989    enum ProcState {
22990        UNKNOWN = 0;
22991        PERSISTENT = 1;
22992        PERSISTENT_UI = 2;
22993        TOP = 3;
22994        BOUND_TOP = 4;
22995        FOREGROUND_SERVICE = 5;
22996        BOUND_FOREGROUND_SERVICE = 6;
22997        IMPORTANT_FOREGROUND = 7;
22998        IMPORTANT_BACKGROUND = 8;
22999        TRANSIENT_BACKGROUND = 9;
23000        BACKUP = 10;
23001        SERVICE = 11;
23002        RECEIVER = 12;
23003        TOP_SLEEPING = 13;
23004        HEAVY_WEIGHT = 14;
23005        HOME = 15;
23006        LAST_ACTIVITY = 16;
23007        CACHED_ACTIVITY = 17;
23008        CACHED_ACTIVITY_CLIENT = 18;
23009        CACHED_RECENT = 19;
23010        CACHED_EMPTY = 20;
23011    }
23012    optional ProcState proc_state = 2; // the proc state of the app when the exemption occurred.
23013
23014    optional bool is_uid_active = 3; // was the uid active when the exemption occurred.
23015
23016    optional AppBackgroundRestrictionsInfo.RestrictionLevel restriction_level = 4;
23017}
23018
23019// Logs the overall Safety State of the device (as cached by the Safety Center)
23020message SafetyState {
23021    // The overall severity level of the Safety Center.
23022    optional android.stats.safetycenter.SafetySeverityLevel overall_severity_level = 1;
23023
23024    // The number of open issues in the Safety Center.
23025    optional int64 open_issues_count = 2;
23026
23027    // The number of dismissed issues in the Safety Center.
23028    optional int64 dismissed_issues_count = 3;
23029}
23030
23031// Logs the state of an individual Safety Source when overall SafetyState is
23032// collected.
23033message SafetySourceStateCollected {
23034    optional int64 encoded_safety_source_id = 1;
23035
23036    optional android.stats.safetycenter.SafetySourceProfileType safety_source_profile_type = 2;
23037
23038    // The severity level of this source.
23039    optional android.stats.safetycenter.SafetySeverityLevel severity_level = 3;
23040
23041    // The number of open issues belonging to this Safety Source.
23042    optional int64 open_issues_count = 4;
23043
23044    // The number of dismissed issues belonging to this Safety Source.
23045    optional int64 dismissed_issues_count = 5;
23046
23047    optional int64 duplicate_filtered_out_issues_count = 6;
23048
23049    enum SourceState {
23050        SOURCE_STATE_UNKNOWN = 0;
23051        DATA_PROVIDED = 1;
23052        NO_DATA_PROVIDED = 2;
23053        REFRESH_TIMEOUT = 3;
23054        REFRESH_ERROR = 4;
23055        SOURCE_ERROR = 5;
23056        SOURCE_CLEARED = 6;
23057    }
23058    optional SourceState source_state = 7;
23059
23060    // Indicates the reason for which this event was collected.
23061    enum CollectionType {
23062        COLLECTION_TYPE_UNKNOWN = 0;
23063        AUTOMATIC = 1;
23064        SOURCE_UPDATED = 2;
23065    }
23066    optional CollectionType collection_type = 8;
23067
23068    enum UpdateType {
23069        UPDATE_TYPE_UNKNOWN = 0;
23070        SELF_INITIATED = 1;
23071        REFRESH_RESPONSE = 2;
23072    }
23073    optional UpdateType update_type = 9;
23074
23075    optional int64 refresh_reason = 10;
23076
23077    optional bool data_changed = 11;
23078
23079    optional int64 last_updated_elapsed_time_millis = 12;
23080}
23081
23082// Logs system-health and performance related events from the Safety Center
23083message SafetyCenterSystemEventReported {
23084    enum EventType {
23085        EVENT_TYPE_UNKNOWN = 0;
23086        SINGLE_SOURCE_GET_NEW_DATA = 1;
23087        SINGLE_SOURCE_RESCAN = 2;
23088        COMPLETE_GET_NEW_DATA = 3;
23089        COMPLETE_RESCAN = 4;
23090        INLINE_ACTION = 5;
23091    }
23092    optional EventType event_type = 1;
23093
23094    // Unset if this event isn't source-specific.
23095    optional int64 encoded_safety_source_id = 2;
23096
23097    // Unset if this event isn't source-specific.
23098    optional android.stats.safetycenter.SafetySourceProfileType safety_source_profile_type = 3;
23099
23100    // Unset if this event isn't specific to an issue.
23101    optional int64 encoded_issue_type_id = 4;
23102
23103    optional int64 duration_millis = 5;
23104
23105    enum Result {
23106        RESULT_UNKNOWN = 0;
23107        SUCCESS = 1;
23108        TIMEOUT = 2;
23109        ERROR = 3;
23110    }
23111    optional Result result = 6;
23112
23113    optional int64 refresh_reason = 7;
23114
23115    optional bool data_changed = 8;
23116}
23117
23118// Logs a user interaction with the Safety Center. Various fields may or may not be
23119// set depending on the Action reported.
23120message SafetyCenterInteractionReported {
23121    // ID which identifies single session of user interacting with Safety Center.
23122    optional int64 session_id = 1;
23123
23124    enum Action {
23125        ACTION_UNKNOWN = 0;
23126
23127        SAFETY_CENTER_VIEWED = 1;
23128        SAFETY_ISSUE_VIEWED = 2;
23129
23130        SCAN_INITIATED = 3;
23131
23132        ISSUE_PRIMARY_ACTION_CLICKED = 4;
23133        ISSUE_SECONDARY_ACTION_CLICKED = 5;
23134        ISSUE_DISMISS_CLICKED = 6;
23135
23136        MORE_ISSUES_CLICKED = 7;
23137        ENTRY_CLICKED = 8;
23138        ENTRY_ICON_ACTION_CLICKED = 9;
23139        STATIC_ENTRY_CLICKED = 10;
23140
23141        PRIVACY_CONTROL_TOGGLE_CLICKED = 11;
23142        SENSOR_PERMISSION_REVOKE_CLICKED = 12;
23143        SENSOR_PERMISSION_SEE_USAGES_CLICKED = 13;
23144        REVIEW_SETTINGS_CLICKED = 14;
23145
23146        NOTIFICATION_POSTED = 15;
23147        NOTIFICATION_DISMISSED = 16;
23148
23149        STATUS_VIEWED = 17;
23150        ENTRY_VIEWED = 18;
23151
23152        ISSUE_RESOLVED = 19;
23153    }
23154
23155    // Action taken in the Safety Center.
23156    optional Action action = 2;
23157
23158    enum ViewType {
23159        VIEW_TYPE_UNKNOWN = 0;
23160        FULL = 1;
23161        QUICK_SETTINGS = 2;
23162        SUBPAGE = 3;
23163
23164        // Prefix required to distinguish from NavigationSource.NOTIFICATION (since
23165        // proto enums use C++ scoping rules, enum value names must be unique within
23166        // the enum's enclosing type, not just the enum itself).
23167        VIEW_TYPE_NOTIFICATION = 4;
23168    }
23169
23170    // Which view of the Safety Center this interaction occurred in.
23171    optional ViewType view_type = 3;
23172
23173    enum NavigationSource {
23174        SOURCE_UNKNOWN = 0;
23175        NOTIFICATION = 1;
23176        QUICK_SETTINGS_TILE = 2;
23177        SETTINGS = 3;
23178        SENSOR_INDICATOR = 4;
23179
23180        // Set for navigations that start from within Safety Center. e.g. when a subpage
23181        // is opened from the main Safety Center page instead of from a notification.
23182        SAFETY_CENTER = 5;
23183    }
23184
23185    // Where the session was initiated from.
23186    optional NavigationSource navigation_source = 4;
23187
23188    // Severity level of the particular issue or entry, or the overall Safety
23189    // Center this interaction is associated with.
23190    optional android.stats.safetycenter.SafetySeverityLevel severity_level = 5;
23191
23192    // The hashed ID of the Safety Source that this interaction was with performed with,
23193    // or nothing if this event isn't source-specific.
23194    optional int64 encoded_safety_source_id = 6;
23195
23196    // The kind of profile that this safety source originated from (sources from
23197    // personal and work profiles may have the same source ID)
23198    optional android.stats.safetycenter.SafetySourceProfileType safety_source_profile_type = 7;
23199
23200    // A hash of the loggable issue type ID that this interaction was performed with.
23201    optional int64 encoded_issue_type_id = 8;
23202
23203    enum Sensor {
23204        SENSOR_UNKNOWN = 0;
23205        MICROPHONE = 1;
23206        CAMERA = 2;
23207        LOCATION = 3;
23208    }
23209
23210    // Which sensor was associated with this interaction (if any).
23211    optional Sensor sensor = 9;
23212
23213    optional int64 encoded_safety_sources_group_id = 10;
23214
23215    enum IssueState {
23216        ISSUE_STATE_UNKNOWN = 0;
23217        ACTIVE = 1;
23218        DISMISSED = 2;
23219    }
23220    optional IssueState issue_state = 11;
23221}
23222
23223/**
23224 * Logs information about SettingsProvider setting changes when they occur.
23225 *
23226 * Logged from:
23227 *      frameworks/base/packages/src/com/android/providers/settings/SettingsProvider.java
23228 */
23229message SettingsProviderSettingChanged {
23230    optional int32 user_id = 1; // user for whom the setting has changed
23231    optional string name = 2; // name of the setting
23232    optional int32 type = 3; // the setting type, e.g., global, system or secure
23233    optional int32 change_type = 4; // the change type, e.g., insert, delete or update
23234}
23235
23236/**
23237 * Pulls information for a single incoming MMS.
23238 *
23239 * Each pull creates multiple atoms, one for each MMS.
23240 * The sequence is randomized when pulled.
23241 *
23242 * Pulled from:
23243 *   packages/services/Mms/src/com/android/mms/service/metrics/MmsMetricsCollector.java
23244 */
23245message IncomingMms {
23246    // Radio access technology (RAT) used for downloading the MMS.
23247    // It can be IWLAN in case of IMS.
23248    // RAT is logged at the end of the download.
23249    optional android.telephony.NetworkTypeEnum rat = 1;
23250
23251    // Indicate a specific result handling the MMS.
23252    optional android.mms.MmsResultEnum result = 2;
23253
23254    // Roaming type when MMS was received.
23255    optional android.telephony.RoamingTypeEnum roaming = 3;
23256
23257    // Index of the SIM used, 0 for single-SIM devices.
23258    optional int32 sim_slot_index = 4;
23259
23260    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
23261    optional bool is_multi_sim = 5;
23262
23263    // Whether the MMS was received with an eSIM profile.
23264    optional bool is_esim = 6;
23265
23266    // Carrier ID of the SIM card used for the MMS.
23267    // See https://source.android.com/devices/tech/config/carrierid.
23268    optional int32 carrier_id = 7;
23269
23270    // Average time in milliseconds to download MMS from the network.
23271    optional int64 avg_interval_millis = 8;
23272
23273    // Total number of MMS having same configuration.
23274    optional int64 mms_count = 9;
23275
23276    // Retry count: 0 for the first attempt and then increasing for each attempt.
23277    optional int32 retry_id = 10;
23278
23279    // Whether MmsService or carrier app downloaded the MMS from the network.
23280    optional bool handled_by_carrier_app = 11;
23281
23282    // Whether the MMS was received with an enterprise profile.
23283    optional bool is_managed_profile = 12;
23284
23285    // Whether the MMS was received over non-terrestrial networks.
23286    optional bool is_ntn = 13;
23287}
23288
23289/**
23290 * Pulls information for a single outgoing MMS.
23291 *
23292 * Each pull creates multiple atoms, one for each MMS.
23293 * The sequence is randomized when pulled.
23294 *
23295 * Pulled from:
23296 *   packages/services/Mms/src/com/android/mms/service/metrics/MmsMetricsCollector.java
23297 */
23298message OutgoingMms {
23299    // Radio access technology (RAT) used for uploading the MMS.
23300    // It can be IWLAN in case of IMS.
23301    // RAT is logged at the end of the upload.
23302    optional android.telephony.NetworkTypeEnum rat = 1;
23303
23304    // Indicate a specific result handling the MMS.
23305    optional android.mms.MmsResultEnum result = 2;
23306
23307    // Roaming type when MMS was received.
23308    optional android.telephony.RoamingTypeEnum roaming = 3;
23309
23310    // Index of the SIM used, 0 for single-SIM devices.
23311    optional int32 sim_slot_index = 4;
23312
23313    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
23314    optional bool is_multi_sim = 5;
23315
23316    // Whether the MMS was sent with an eSIM profile.
23317    optional bool is_esim = 6;
23318
23319    // Carrier ID of the SIM card used for the MMS.
23320    // See https://source.android.com/devices/tech/config/carrierid.
23321    optional int32 carrier_id = 7;
23322
23323    // Average time in milliseconds to download MMS from the network.
23324    optional int64 avg_interval_millis = 8;
23325
23326    // Total number of MMS having same configuration.
23327    optional int64 mms_count = 9;
23328
23329    // Whether the default MMS application sent the MMS (regardless of which application).
23330    optional bool is_from_default_app = 10;
23331
23332    // Retry count: 0 for the first attempt and then increasing for each attempt.
23333    optional int32 retry_id = 11;
23334
23335    // Whether MmsService or carrier app uploaded the MMS to the network.
23336    optional bool handled_by_carrier_app = 12;
23337
23338    // Whether the MMS was sent with an enterprise profile.
23339    optional bool is_managed_profile = 13;
23340
23341    // Whether the MMS was sent over non-terrestrial networks.
23342    optional bool is_ntn = 14;
23343}
23344
23345message PrivacySignalNotificationInteraction {
23346
23347    enum Action {
23348        UNKNOWN = 0;
23349        NOTIFICATION_SHOWN = 1;
23350        NOTIFICATION_CLICKED = 2;
23351        DISMISSED = 3;
23352    }
23353
23354    // Privacy source that triggered the notification
23355    optional android.stats.privacysignals.PrivacySource privacy_source = 1;
23356
23357    // Optional Uid of the package for which the notification was sent.
23358    optional int32 uid = 2 [(is_uid) = true];
23359
23360    // Action taken on the notification.
23361    optional Action action = 3;
23362
23363    // Session Id to link the notification with the issue card.
23364    optional int64 session_id = 4; // to map the notification and issue card interaction
23365}
23366
23367message PrivacySignalIssueCardInteraction {
23368
23369    enum Action {
23370        ACTION_UNKNOWN = 0;
23371        CARD_SHOWN = 1;
23372        CARD_CLICKED = 2;
23373        CARD_DISMISSED = 3;
23374        CLICKED_CTA1 = 4;
23375        CLICKED_CTA2 = 5;
23376    }
23377
23378    // Privacy source  that pushed the issue card.
23379    optional android.stats.privacysignals.PrivacySource privacy_source = 1;
23380
23381    // Optional Uid of the package for which the issue card was sent.
23382    optional int32 uid = 2 [(is_uid) = true];
23383
23384    // Action taken on the issue card.
23385    optional Action action = 3;
23386
23387    // Session Id to link the notification with the issue card.
23388    optional int64 session_id = 4;
23389}
23390
23391message PrivacySignalsJobFailure {
23392
23393    // Which privacy source for which the daily job failed.
23394    optional android.stats.privacysignals.PrivacySource privacy_source = 1;
23395
23396    enum JobFailureReason {
23397        REASON_UNKNOWN = 0;
23398        TIMEOUT = 1;
23399        COROUTINE_CANCELLED = 2;
23400    }
23401    optional JobFailureReason reason =2;
23402}
23403
23404/**
23405 * Contains information about different method and code contention durations in
23406 * the ANR code path
23407 */
23408message ANRLatencyReported {
23409    /* Important durations */
23410    // Total duration of the ANR (in ms)
23411    optional int64 total_duration = 1;
23412    // The duration between when the ANR is triggered and when the stacks are dumped
23413    // (in ms)
23414    optional int64 triggering_to_stack_dump_duration = 2;
23415
23416    /* Disjoint durations, each duration representing the time spent in the
23417    method before calling the next one on the ANR chain */
23418    // The duration between when the ANR is triggered and when appNotResponding starts.
23419    optional int64 triggering_to_app_not_responding_duration = 3;
23420    // The time taken by appNotResponding before the record is placed on the
23421    // queue.
23422    optional int64 app_not_responding_duration = 4;
23423    // The time spent by the ANR record on the ANR queue.
23424    optional int64 anr_record_placed_on_queue_duration = 5;
23425    // The time from the start of the ANR processing by the ANR thread until the
23426    // stacks are dumped.
23427    optional int64 anr_processing_duration = 6;
23428    // The time taken to dump the stacks.
23429    optional int64 dump_stack_traces_duration = 7;
23430
23431    /* Helper methods */
23432    // The time spent waiting on updateCpuStatsNow to return.
23433    optional int64 update_cpu_stats_now_total_duration = 8;
23434    // The time spent waiting on currentPsiStateReturned to return.
23435    optional int64 current_psi_state_total_duration = 9;
23436    // The time spent waiting on ProcessCpuTracker methods to return
23437    optional int64 process_cpu_tracker_methods_total_duration = 10;
23438    // The time spent waiting on CriticalEventLog#logLinesForTraceFile to return.
23439    optional int64 critical_event_log_duration = 11;
23440
23441    /* Lock contention */
23442    // The time spent waiting on the Global Lock.
23443    optional int64 global_lock_total_contention = 12;
23444    // The time spent waiting on the PID lock.
23445    optional int64 pid_lock_total_contention = 13;
23446    // The time spent waiting on the AMS lock.
23447    optional int64 ams_lock_total_contention = 14;
23448    // The time spent waiting on proc lock.
23449    optional int64 proc_lock_total_contention = 15;
23450    // The time spent waiting on the ANR record queue lock.
23451    optional int64 anr_record_lock_total_contention = 16;
23452
23453    /* Misc */
23454    // The size of the ANR queue before pushing the ANR.
23455    optional int32 anr_queue_size_when_pushed = 17;
23456    // The type of the ANR.
23457    optional android.anr.AnrType anr_type = 18;
23458    // The number of dumped processes.
23459    optional int32 dumped_processes_count = 19;
23460    // Next ID: 20
23461}
23462
23463// Logs Display Brightness change events.
23464message DisplayBrightnessChanged {
23465
23466    enum Reason {
23467        REASON_UNKNOWN = 0;
23468        REASON_MANUAL = 1;
23469    }
23470
23471    // Display brightness before the brightness event, in nits.
23472    optional float initial_nits = 1;
23473
23474    // Display brightness after the brightness event, in nits.
23475    optional float end_nits = 2;
23476
23477    // Estimated ambient light, in lux.
23478    optional float lux = 3;
23479
23480    // Physical display id, with format $ADAPTER_PREFIX:$ID, in this case
23481    // "local:$PHYSICAL_ID".
23482    optional string physical_display_id = 4 [(state_field_option).primary_field = true];
23483
23484    // Whether the short term model was active at the time of the event.
23485    optional bool short_term_model_active = 5;
23486
23487    // The factor to adjust the screen brightness in low power mode in the range
23488    // 0 (screen off) to 1 (no change).
23489    // If not applied, this is set to -1.
23490    optional float power_brightness_factor = 6;
23491
23492    // The level of Reduce Bright Colors (RBC) intensity, the range is [0, 100].
23493    // If RBC is not enabled, this is set to -1;
23494    optional int32 reduce_bright_colors_strength = 7;
23495
23496    // Max nits value when High Brightness Mode (HBM) is enabled.
23497    // If HBM is not enabled, this is set to -1;
23498    optional float hbm_current_max = 8;
23499
23500    // Thermal throttling cap.
23501    // If thermal throttling not enabled, this is -1.
23502    optional float thermal_throttling_cap = 9;
23503
23504    // Whether adaptive brightness is enabled.
23505    optional bool adaptive_brightness_enabled = 10;
23506
23507    // Historical: replaced by entire_reason after 2023-04-10
23508    optional Reason reason = 11 [deprecated = true];
23509
23510    // Reason that triggered the brightness event to occur.
23511    optional android.display.DisplayBrightnessChangeReasonEnum entire_reason = 12;
23512
23513    // New brightness bucket index, from frameworks/proto_logging/stats/enums/display/display_enums.proto.
23514    optional android.display.DisplayBrightnessRangeEnum bucket_index = 13
23515            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
23516
23517    // Brightness is at maximum allowable value regarding the current context.
23518    optional bool brightness_at_max = 14;
23519
23520    // Whether HBM mode is enabled due to sunlight
23521    optional bool hbm_mode_sunlight = 15;
23522
23523    // Whether HBM mode is enabled due to HDR
23524    optional bool hbm_mode_hdr = 16;
23525
23526    // Whether modified by low power mode.
23527    optional bool modified_by_low_power_mode = 17;
23528
23529    // Value defined in frameworks/base/core/java/android/hardware/display/BrightnessInfo.java
23530    // BRIGHTNESS_MAX_REASON_NONE = 0
23531    // BRIGHTNESS_MAX_REASON_THERMAL = 1
23532    // BRIGHTNESS_MAX_REASON_* defined in the future
23533    optional int32 throttling_reason = 18;
23534
23535    // Whether modified by dimming.
23536    optional bool modified_by_dimming = 19;
23537
23538    // Whether Reduce Bright Colors (RBC) is enabled.
23539    optional bool rbc_enabled = 20;
23540
23541    // Whether ambient lux is invalid.
23542    optional bool ambient_lux_invalid = 21;
23543
23544    // Whether doze scale applied for auto brightness.
23545    optional bool doze_scale_applied = 22;
23546
23547    // Whether the value is set by the user.
23548    optional bool set_by_user = 23;
23549
23550    // Whether idle mode is active.
23551    optional bool idle_mode_active= 24;
23552
23553    // Whether low power mode is enabled.
23554    optional bool low_power_mode_enabled= 25;
23555}
23556
23557// Logs daily ambient brightness stats.
23558message AmbientBrightnessStatsReported {
23559
23560    // How much time was spent in each of the buckets, in seconds.
23561    repeated float bucket_size_seconds = 1;
23562
23563    // Ambient brightness values for creating bucket boundaries from.
23564    repeated float bucket_boundary_lux = 2;
23565}
23566
23567// Logs information about bpf maps in BpfNetMaps.
23568//
23569// Logged from:
23570//   packages/modules/Connectivity/service/src/com/android/server/BpfNetMaps.java
23571message NetworkBpfMapInfo {
23572    // The size of cookie tag bpf map.
23573    optional int32 cookie_tag_map_size = 1;
23574
23575    // The size of uid owner bpf map.
23576    optional int32 uid_owner_map_size = 2;
23577
23578    // The size of uid permission bpf map.
23579    optional int32 uid_permission_map_size = 3;
23580}
23581
23582/**
23583 * Pulls information for a single outgoing short code sms.
23584 *
23585 * Each pull generates multiple atoms, one for each category and xml_version combination.
23586 *
23587 * Pulled from:
23588 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
23589 */
23590message OutgoingShortCodeSms {
23591    /* Short code sms category. */
23592    optional android.telephony.ShortCodeSmsEnum category = 1;
23593
23594    /* sms_short_codes.xml file version used by the device. */
23595    optional int32 xml_version = 2;
23596
23597    /* Number of short code sms with the same configuration. */
23598    optional int32 short_code_sms_count = 3;
23599}
23600
23601/**
23602 * Logs information when a hearing aid is bonded
23603 *
23604 * Logged from:
23605 *   frameworks/base/packages/SettingsLib/src/com/android/settingslib/bluetooth/
23606 *   LocalBluetoothProfileManager.java
23607 */
23608message HearingAidInfoReported {
23609    // The device mode of the bonded hearing aid
23610    // Mode definition for hearing aids. See {@link HearingAidInfo}
23611    enum DeviceMode {
23612        MODE_UNKNOWN = -1;
23613        MONAURAL = 0;
23614        BINAURAL = 1;
23615        BANDED = 2;
23616    }
23617    optional DeviceMode device_mode = 1;
23618
23619    // The device side of the bonded hearing aid
23620    // Side definition for hearing aids. See {@link HearingAidInfo}.
23621    enum DeviceSide {
23622        SIDE_UNKNOWN = -1;
23623        LEFT = 0;
23624        RIGHT = 1;
23625        LEFT_AND_RIGHT = 2;
23626    }
23627    optional DeviceSide device_side = 2;
23628
23629    // The entry page id where the bonding process starts
23630    enum BondEntry {
23631        PAGE_UNKNOWN = -1;
23632        CONNECTED_DEVICES = 0;
23633        ACCESSIBILITY_HEARING_AIDS = 1;
23634        ACCESSIBILITY_HEARING_AID_PAIR_ANOTHER = 2;
23635        BLUETOOTH = 3;
23636        ACCESSIBILITY_HEARING_AID_SETTINGS = 4;
23637    }
23638    optional BondEntry bond_entry = 3;
23639}
23640
23641/**
23642 * Logs when Ambient/OFFLOAD Mode is entered or exited.
23643 *
23644 * Logged from:
23645 *  1. vendor/google_clockwork/packages/Ambient/src/com/google/
23646 *     android/wearable/ambient/AmbientService.java
23647 *  2. vendor/google_clockwork/packages/Ambient/src/com/google/android/
23648 *     wearable/ambient/autoresume/AmbientLiteFlowController.java
23649 *  3. frameworks/opt/wear/src/com/google/android/clockwork/
23650 *     displayoffload/DisplayOffloadService.java
23651 */
23652message AmbientModeChanged {
23653    enum AmbientStateEnum {
23654        AMBIENT_ENTER = 1;
23655        AMBIENT_EXIT = 2;
23656        AMBIENT_LITE_ENTER = 3;
23657        AMBIENT_LITE_EXIT = 4;
23658        OFFLOAD_ENTER = 5;
23659        OFFLOAD_EXIT = 6;
23660    }
23661
23662    optional AmbientStateEnum state = 1;
23663}
23664
23665
23666/**
23667 * Contains statistics about time spent fetching resource information from an APK.
23668 * Logged from:
23669 *   frameworks/base/core/java/android/content/res/ResourceTimer.java
23670 */
23671message ResourceValueApiStatisticsReported {
23672
23673  // The api that is being reported.
23674  optional android.app.ResourceApiEnum api = 1;
23675
23676  // The total number of events recorded.
23677  optional int32 event_count = 2;
23678
23679  // The total time spent in thie API.  The units are ns.
23680  optional int64 cumulative_event_time_ns = 3;
23681
23682  // Four percentile values.  Units are in ns.  A value of zero means the percentile could not be
23683  // computed.
23684  optional int32 p50_ns = 4;
23685  optional int32 p90_ns = 5;
23686  optional int32 p95_ns = 6;
23687  optional int32 p99_ns = 7;
23688
23689  // The five largest values recorded.  Units are in ns.  A value of zero means the value is
23690  // missing (which means fewer than 5 events were recorded).  Values that exceed INT_MAX are
23691  // capped at INT_MAX.
23692  optional int32 l0_ns = 8;
23693  optional int32 l1_ns = 9;
23694  optional int32 l2_ns = 10;
23695  optional int32 l3_ns = 11;
23696  optional int32 l4_ns = 12;
23697}
23698
23699/**
23700 * Logs when Iwlan responds the setup data call request.
23701 *
23702 * Logged from:
23703 *   packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
23704 */
23705message IwlanSetupDataCallResultReported {
23706  enum IwlanError {
23707    NO_ERROR = 0;
23708    IKE_PROTOCOL_EXCEPTION = 1;
23709    IKE_INTERNAL_IO_EXCEPTION = 2;
23710    IKE_GENERIC_EXCEPTION = 3;
23711    EPDG_SELECTOR_SERVER_SELECTION_FAILED = 4;
23712    TUNNEL_TRANSFORM_FAILED = 5;
23713    SIM_NOT_READY_EXCEPTION = 6;
23714    NETWORK_FAILURE = 7;
23715    UNKNOWN_EXCEPTION = 8;
23716  }
23717
23718  // Setup data call apn type
23719  // See go/apntypedefinition
23720  optional int32 apn_type = 1;
23721  // Is the request for handover
23722  optional bool is_handover = 2;
23723  // ePDG server address
23724  optional string epdg_server_address = 3;
23725  // If the request type is handover, record the source network type
23726  // See
23727  // frameworks/base/telephony/java/android/telephony/TelephonyManager.java
23728  optional int32 source_rat = 4;
23729  // If the request type is handover, record the source network roaming status
23730  optional bool is_cellular_roaming = 5;
23731  // Is network connected
23732  optional bool is_network_connected = 6;
23733  // Default network transport type
23734  // See
23735  // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
23736  optional int32 transport_type = 7;
23737  // Setup result
23738  optional int32 setup_request_result = 8;
23739  // Iwlan error code if setup failed
23740  optional IwlanError iwlan_error = 9;
23741  // Data call fail cause
23742  // See
23743  // frameworks/base/telephony/java/android/telephony/DataFailCause.java
23744  optional int32 data_call_fail_cause = 10;
23745  // Setup request processing duration
23746  optional int32 processing_duration_millis = 11;
23747  // Time for doing ePDG server selection through DNS query of FQDNs
23748  optional int32 epdg_server_selection_duration_millis = 12;
23749  // Time for establishing IKE tunnel
23750  optional int32 ike_tunnel_establishment_duration_millis = 13;
23751  // Tunnel State
23752  // See
23753  // packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
23754  optional int32 tunnel_state = 14;
23755  // Handover failure mode
23756  // See
23757  // frameworks/base/telephony/java/android/telephony/data/DataCallResponse.java
23758  optional int32 handover_failure_mode = 15;
23759  // Retry duration
23760  optional int32 retry_duration_millis = 16;
23761  // Iwlan error wrapped exception classname
23762  optional string iwlan_error_wrapped_classname = 17;
23763  // Iwlan error wrapped exception 1st line of stack trace
23764  optional string iwlan_error_wrapped_stack_first_frame = 18;
23765  // Error count of the same error cause
23766  optional int32 error_count_of_same_cause = 19;
23767  // Underlying network validation status
23768  optional bool is_underlying_network_validated = 20;
23769}
23770
23771/**
23772 * Logs when Iwlan reports IWLAN PDN disconnected without deactivation request.
23773 *
23774 * Logged from:
23775 *   packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
23776 */
23777message IwlanPdnDisconnectedReasonReported {
23778  // Disconnection cause
23779  // See
23780  // frameworks/base/telephony/java/android/telephony/DataFailCause.java
23781  optional int32 cause = 1;
23782  // Is network connected
23783  optional bool is_network_connected = 2;
23784  // default network transport type
23785  // See
23786  // packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
23787  optional int32 transport_type = 3;
23788  // Wifi signal level
23789  optional int32 wifi_signal_level = 4;
23790}
23791
23792/**
23793 * Logs the number of network count on each list of transports
23794 *
23795 * Logs from:
23796 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23797 */
23798message NetworkCountPerTransports {
23799    // the number of network count on each list of transports
23800    repeated NetworkCountForTransports network_count_for_transports = 1;
23801}
23802
23803/**
23804 * Logs the number of network count and transport type
23805 *
23806 * Logs from:
23807 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23808 */
23809message NetworkCountForTransports {
23810    // Transport types of the network
23811    optional int32 transport_types = 1;
23812
23813    // Number of networks for one list of transport types
23814    optional int32 network_count = 2;
23815}
23816
23817/**
23818 * Logs a list of networks
23819 *
23820 * Logs from:
23821 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23822 */
23823message NetworkList {
23824    repeated NetworkDescription network_description = 1;
23825}
23826
23827/**
23828 * Logs connection duration in seconds and list of transports
23829 *
23830 * Logs from:
23831 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23832 */
23833message ConnectionDurationForTransports {
23834    // Transport types of the network
23835    optional int32 transport_types = 1;
23836
23837    // Time duration that the device stays connected to the network
23838    optional int32 duration_sec = 2;
23839}
23840
23841/**
23842 * Logs connection duration on each list of transports, in seconds
23843 *
23844 * Logs from:
23845 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23846 */
23847message ConnectionDurationPerTransports {
23848    repeated ConnectionDurationForTransports connection_duration_for_transports = 1;
23849}
23850
23851/**
23852 * Logs network request count & request type
23853 *
23854 * Logs from:
23855 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23856 */
23857message RequestCountForType {
23858    // The type of network request
23859    optional android.stats.connectivity.RequestType request_type = 1;
23860
23861    // Number of network requests
23862    optional int32 request_count = 2;
23863}
23864
23865/**
23866 * Logs network request count
23867 *
23868 * Logs from:
23869 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23870 */
23871message NetworkRequestCount {
23872    // Network request count for request type
23873    repeated RequestCountForType request_count_for_type = 1;
23874}
23875
23876/**
23877 * Logs information about a network
23878 *
23879 * Logs from:
23880 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23881 */
23882message NetworkDescription {
23883    // The transport types of the network. A network may include multiple transport types.
23884    // Each transfer type is represented by a different bit, defined in
23885    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
23886    optional int32 transport_types = 1;
23887
23888    // Indicates the network is metered, non-metered or temporarily-unmetered
23889    optional android.stats.connectivity.MeteredState metered_state = 2;
23890
23891    // Indicates the network is validated, non-validated, partial or portal
23892    optional android.stats.connectivity.ValidatedState validated_state = 3;
23893
23894    // Record the bitmask of all the policies applied to this score of network.
23895    // Each policy is represented by a different bit, defined in
23896    // packages/modules/Connectivity/service/src/com/android/server/connectivity/FullScore.java
23897    optional int64 score_policies = 4;
23898
23899    // The capabilities of the network. A network may include multiple network capabilities.
23900    // Each capability is represented by a different bit, defined in
23901    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
23902    optional int64 capabilities = 5;
23903
23904    // Bitfield representing the network's enterprise capability identifier, defined in
23905    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
23906    optional int32 enterprise_id = 6;
23907}
23908
23909/**
23910 * Pulls a list of NumberOfRematchesPerReason.
23911 *
23912 * Pulled from:
23913 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23914 */
23915message NumberOfRematchesPerReason {
23916    // Number of network rematches for each rematch reason
23917    repeated NumberOfRematchesForReason number_of_rematches_per_reason= 1;
23918}
23919
23920/**
23921 * Logs number of network rematches for rematch reason
23922 *
23923 * Logs from:
23924 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23925 */
23926message NumberOfRematchesForReason {
23927    // The reason of network rematch
23928    optional android.stats.connectivity.RematchReason rematch_reason = 1;
23929
23930    // Number of network rematches
23931    optional int32 rematch_count = 2;
23932};
23933
23934/**
23935 * Pulls information for connectivity stats.
23936 *
23937 * Pulled from:
23938 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23939 */
23940message ConnectivityStateSample {
23941    // Number of networks per list of transports
23942    optional NetworkCountPerTransports network_count_per_transports = 1
23943    [(android.os.statsd.log_mode) = MODE_BYTES];
23944
23945    // This is a list of networks with their transports and the duration
23946    optional ConnectionDurationPerTransports connection_duration_per_transports = 2
23947    [(android.os.statsd.log_mode) = MODE_BYTES];
23948
23949    // Number of requests per category
23950    optional NetworkRequestCount network_request_count  = 3
23951    [(android.os.statsd.log_mode) = MODE_BYTES];
23952
23953    // Full list of network details (slice by transport / meteredness / internet+validated)
23954    optional NetworkList networks = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
23955}
23956
23957
23958/**
23959 * Pulls information for network selection rematch info.
23960 *
23961 * Pulled from:
23962 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23963 */
23964message NetworkSelectionRematchReasonsInfo {
23965    // Number of rematch per rematch reason
23966    optional NumberOfRematchesPerReason number_of_rematches_per_reason = 1
23967    [(android.os.statsd.log_mode) = MODE_BYTES];
23968}
23969
23970/**
23971 * Logs rematch information for the default network
23972 *
23973 * Logs from:
23974 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23975 */
23976message DefaultNetworkRematchInfo {
23977    // The session id comes from each reboot, this is used to correlate the statistics of the
23978    // networkselect on the same boot
23979    optional int64 session_id = 1;
23980
23981    // The information of old device default network
23982    optional NetworkDescription old_network = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
23983
23984    // The information of new device default network
23985    optional NetworkDescription new_network = 3 [(android.os.statsd.log_mode) = MODE_BYTES];
23986
23987    // The reason of network rematch
23988    optional android.stats.connectivity.RematchReason rematch_reason = 4;
23989
23990    // The time duration the device kept the old network as the default in seconds
23991    optional int32 time_duration_on_old_network_sec = 5;
23992}
23993
23994/**
23995 * Logs network selection performance
23996 *
23997 * Logs from:
23998 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23999 */
24000message NetworkSelectionPerformance {
24001    // Number of network requests
24002    optional int32 number_of_network_requests = 1;
24003
24004    // List of networks right now
24005    // (slice by transport / meteredness / internet+validated)
24006    optional NetworkList networks = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
24007
24008    // The latency of selection computed in milli-second
24009    optional int32 selection_computed_latency_milli = 3;
24010
24011    // The latency of selection applied in milli-second
24012    optional int32 selection_applied_latency_milli = 4;
24013
24014    // The latency of selection issued in milli-second
24015    optional int32 selection_issued_latency_milli = 5;
24016}
24017
24018message NetworkSliceRequestCountSample {
24019    // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY),
24020    // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
24021    optional int64 slice_id = 1;
24022
24023    // Bitfield representing the network's enterprise capability identifier
24024    // (e.g. NET_ENTERPRISE_ID_1), defined in
24025    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
24026    optional int32 enterprise_id = 2;
24027
24028    // number of request for this slice
24029    optional int32 request_count = 3;
24030
24031    // number of apps with outstanding request(s) for this slice
24032    optional int32 distinct_app_count = 4;
24033}
24034
24035message NetworkSliceSessionEnded {
24036    // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY),
24037    // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
24038    optional int64 slice_id = 1;
24039
24040    // Bitfield representing the network's enterprise capability identifier
24041    // (e.g. NET_ENTERPRISE_ID_1), defined in
24042    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
24043    optional int32 enterprise_id = 2;
24044
24045    // Number of bytes received at the device on this slice id
24046    optional int64 rx_bytes = 3;
24047
24048    // Number of bytes transmitted by the device on this slice id
24049    optional int64 tx_bytes = 4;
24050
24051    // Number of apps that have used this slice
24052    optional int32 number_of_apps = 5;
24053
24054    // How long(in seconds) this slice has been connected
24055    optional int32 slice_connection_duration_sec = 6;
24056}
24057
24058message NetworkSliceDailyDataUsageReported {
24059    // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY),
24060    // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
24061    optional int64 slice_id = 1;
24062
24063    // Bitfield representing the network's enterprise capability identifier
24064    // (e.g. NET_ENTERPRISE_ID_1), defined in
24065    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
24066    optional int32 enterprise_id = 2;
24067
24068    // Number of bytes received at the device on this slice id
24069    optional int64 rx_bytes = 3;
24070
24071    // Number of bytes transmitted by the device on this slice id
24072    optional int64 tx_bytes = 4;
24073
24074    // Number of apps that have used this slice
24075    optional int32 number_of_apps = 5;
24076
24077    // How long(in seconds) this slice has been connected
24078    optional int32 slice_connection_duration_sec = 6;
24079}
24080
24081/**
24082 * Logs the Brightness Configuration pushed by the long term model. The Brightness Configuration is
24083 * expressed as a curve where each point is a pair of ambient light (lux) and the corresponding
24084 * screen brightness (nits).
24085 *
24086 * Logged from:
24087 *    frameworks/base/services/core/java/com/android/server/display/DisplayManagerService.java
24088 */
24089message BrightnessConfigurationUpdated {
24090    // Array of ambient light values (in lux) to define the configuration.
24091    repeated float lux = 1;
24092    // Array of screen brightness values (in nits) corresponding to the lux
24093    // values above.
24094    repeated float nits = 2;
24095    // Physical display id, with format $ADAPTER_PREFIX:$ID, in this case
24096    // "local:$PHYSICAL_ID".
24097    optional string physical_display_id = 3;
24098}
24099
24100/**
24101 * Logs data when wear media output switcher is launched.
24102 *
24103 * Logged from:
24104 * package: vendor/google_clockwork/packages/Media
24105 */
24106message WearMediaOutputSwitcherLaunched {
24107    // Name of the media app package from where Output Switcher got triggered.
24108    optional string triggering_package_name = 1;
24109
24110    // The operation type for invoking the OutputSwitcher
24111    optional com.google.android.wearable.media.routing.OpType op_type = 2;
24112
24113    // The result of OutputSwticher launch.
24114    optional com.google.android.wearable.media.routing.LaunchResult result = 3;
24115}
24116
24117/**
24118 * Logs data when wear media output switcher is finished.
24119 *
24120 * Logged from:
24121 * package: vendor/google_clockwork/packages/Media
24122 */
24123message WearMediaOutputSwitcherFinished {
24124    optional bool user_did_some_activity = 1;
24125    optional bool is_device_connected = 2;
24126}
24127
24128/**
24129 * Logs data when wear media output switcher operation is INITIATED
24130 * or COMPLETED.
24131 *
24132 * Logged from:
24133 * package: vendor/google_clockwork/packages/Media
24134 */
24135message WearMediaOutputSwitcherConnectionReported {
24136    // Type of the medium through which media is played
24137    optional com.google.android.wearable.media.routing.MediumType source = 1;
24138    optional com.google.android.wearable.media.routing.MediumType target  = 2;
24139
24140    // Reason for the connection reported
24141    optional com.google.android.wearable.media.routing.ConnectionReportReason reason = 3;
24142
24143    // Current status of switching the media.
24144    optional com.google.android.wearable.media.routing.ConnectionState state =4;
24145
24146    // Type of target device.
24147    optional com.google.android.wearable.media.routing.MediaDeviceType target_device_type = 5;
24148
24149    // The operation type for invoking the OutputSwitcher
24150    optional com.google.android.wearable.media.routing.OpType op_type = 6;
24151
24152    optional bool is_retry = 7;
24153
24154    // For differentiating if the bluetooth device is connected from already
24155    // paired device list or from the bluetooth settings flow.
24156    optional bool is_already_paired = 8;
24157}
24158
24159/**
24160 * Logs data when wear media output switcher starts scanning
24161 * for already paired devices.
24162 *
24163 * Logged from:
24164 * package: vendor/google_clockwork/packages/Media
24165 */
24166message WearMediaOutputSwitcherDeviceScanTriggered {
24167    // The current status of the scanned device.
24168    optional com.google.android.wearable.media.routing.ScanState scan_state = 1;
24169
24170    // Name of the media app package from where Output Switcher got triggered.
24171    optional string triggering_package_name = 2;
24172
24173    optional com.google.android.wearable.media.routing.OpType op_type = 3;
24174}
24175
24176/**
24177 * Logs the latency for scanning the first device.
24178 *
24179 * Logged from:
24180 * package: vendor/google_clockwork/packages/Media
24181 */
24182message WearMediaOutputSwitcherFirstDeviceScanLatency {
24183    // The latency of scanning the first device
24184    optional int32 latency_in_millis = 1;
24185}
24186
24187/**
24188 * Logs the latency for scanning all devices.
24189 *
24190 * Logged from:
24191 * package: vendor/google_clockwork/packages/Media
24192 */
24193message WearMediaOutputSwitcherAllDevicesScanLatency {
24194    // The latency of scanning all available devices in milli-second
24195    optional int32 latency_in_millis = 1;
24196
24197    // Type of target device.
24198    optional com.google.android.wearable.media.routing.MediaDeviceType target_device_type = 2;
24199}
24200
24201/**
24202 * Logs the latency in connecting to an already paired device.
24203 *
24204 * Logged from:
24205 * package: vendor/google_clockwork/packages/Media
24206 */
24207message WearMediaOutputSwitcherConnectDeviceLatency {
24208    // The latency of connecting to an already paired device in milli-second.
24209    optional int32 latency_in_millis = 1;
24210
24211    // Type of target medium.
24212    optional com.google.android.wearable.media.routing.MediumType target_device_medium_type = 2;
24213
24214    // Type of target device.
24215    optional com.google.android.wearable.media.routing.MediaDeviceType target_device_type = 3;
24216}
24217
24218/**
24219 * Logs package manager snapshot performance.
24220 *
24221 * Logs from:
24222 *   frameworks/base/services/core/java/com/android/server/pm/SnapshotStatistics.java
24223 */
24224message PackageManagerSnapshotReported {
24225    // The histogram of snapshot rebuild latency in a period. Each bucket
24226    // represents a range of rebuild latency such as less than 1 ms, and the
24227    // value of the bucket is the number of snapshots in this range.
24228    repeated int32 rebuild_latency_buckets= 1;
24229
24230    // The histogram of the snapshot usage in a period. Each bucket
24231    // represents a range of snapshot uses such as less than 1, and the
24232    // value is the number of snapshots in this range.
24233    repeated int32 reuse_count_buckets = 2;
24234
24235    // The maximum rebuild latency in a period.
24236    optional int64 max_rebuild_latency_us = 3;
24237
24238    // The maximum number of snapshot usage in a period.
24239    optional int32 max_reuse_count = 4;
24240
24241    // The average rebuild latency for each snapshot in a period.
24242    optional int64 rebuild_latency_us_avg = 5;
24243
24244    // The average snapshot usage for each snapshot in a period.
24245    optional int32 reuse_count_avg = 6;
24246
24247    // The number of packages on the device.
24248    optional int32 packages_count = 7;
24249}
24250
24251/**
24252 * Logs package manager apps filter cache built performance.
24253 *
24254 * Logs from:
24255 *   frameworks/base/services/core/java/com/android/server/pm/AppsFilterImpl.java
24256 */
24257message PackageManagerAppsFilterCacheBuildReported {
24258    // An event id to indicate the type of the cache building.
24259    enum Event {
24260        UNSPECIFIED = 0;
24261        BOOT = 1;
24262        USER_CREATED = 2;
24263        USER_DELETED = 3;
24264    }
24265    optional Event event_type = 1;
24266
24267    // The time to build the cache in microseconds.
24268    optional int64 build_cache_latency_us = 2;
24269
24270    // The number of users on the device.
24271    optional int32 user_count = 3;
24272
24273    // The number of packages on the device.
24274    optional int32 packages_count = 4;
24275
24276    // The size of the cache.
24277    optional int32 cache_size_bytes = 5;
24278}
24279
24280/**
24281 * Logs package manager apps filter cache updated performance.
24282 *
24283 * Logs from:
24284 *   frameworks/base/services/core/java/com/android/server/pm/AppsFilterImpl.java
24285 */
24286message PackageManagerAppsFilterCacheUpdateReported {
24287    // An event id to indicate the type of cache updating.
24288    enum Event {
24289        UNSPECIFIED = 0;
24290        PACKAGE_ADDED = 1;
24291        PACKAGE_DELETED = 2;
24292        PACKAGE_REPLACED = 3;
24293        COMPAT_CHANGED = 4;
24294    }
24295    optional Event event_type = 1;
24296
24297    // The package's uid.
24298    optional int32 uid = 2 [(is_uid) = true];
24299
24300    // The time to update the cache in microseconds.
24301    optional int64 update_cache_latency_us = 3;
24302
24303    // The number of users on the device.
24304    optional int32 user_count = 4;
24305
24306    // The number of packages on the device.
24307    optional int32 packages_count = 5;
24308
24309    // The size of the cache.
24310    optional int32 cache_size_bytes = 6;
24311}
24312
24313/**
24314* Logged during the watch face editing session in Wear Services
24315* This atom will log the duration with SessionStateEnum#END.
24316*
24317* Logged from :
24318* com/google/wear/services/watchfaces/editing/api/WatchFaceEditingApiImpl.java
24319*/
24320message WsWatchFaceEdited {
24321   // Depicts the state of the session eg: START/END/ABORT.
24322   optional android.app.wearservices.SessionStateEnum session_state = 1;
24323
24324   // Session duration for watch face editing.
24325   optional int32 session_duration_millis = 2;
24326
24327   // Enum to depict the source of the request. Values (PHONE, WATCH)
24328   optional android.app.wearservices.RequestSource request_source = 3;
24329
24330   // Component package for watch face.
24331   optional int32 component_package_uid = 4 [(is_uid) = true];
24332}
24333
24334/**
24335* Logged for watch face favorite feature in Wear Services.
24336*
24337* Logged from :
24338* com/google/wear/services/watchfaces/api/WatchFacesApiImpl.java
24339*/
24340message WsWatchFaceFavouriteActionReported {
24341   // Component package for watch face.
24342   optional int32 component_package_uid = 1 [(is_uid) = true];
24343
24344   // Depicts the action for wf favorites eg: Add/Remove.
24345   optional android.app.wearservices.ActionEnum favorite_action = 2;
24346
24347   // Enum to depict the source of the request. Values (PHONE, WATCH)
24348   optional android.app.wearservices.RequestSource request_source = 3;
24349}
24350
24351/**
24352* Logged for the watch face set feature in Wear Services.
24353*
24354* Logged from :
24355* com/google/wear/services/watchfaces/api/WatchFacesApiImpl.java
24356*/
24357message WsWatchFaceSetActionReported {
24358   // Component package for watch face.
24359   optional int32 component_package_uid = 1 [(is_uid) = true];
24360
24361  // Result for WF, whether it resulted in SAME/FAVORITE/FALLBACK
24362  optional android.app.wearservices.SetResultEnum wf_set_result = 2;
24363
24364  // Enum to depict the source of the request. Values (PHONE, WATCH)
24365   optional android.app.wearservices.RequestSource request_source = 3;
24366}
24367
24368/**
24369* Logged when tile list is modified (go/wear-dd-wearservices-telemetry)
24370*/
24371message WsTileListChanged {
24372    enum Event {
24373        EVENT_UNKNOWN = 0;
24374        TILE_ADDED = 1;
24375        TILE_REMOVED = 2;
24376        TILE_UPDATED = 3;  // go/wear-dd-tiles-oem-metadata
24377    }
24378    // Component package for the tile that is being changed.
24379    optional int32 component_package_uid = 1 [(is_uid) = true];
24380
24381    // Class name for the tile.
24382    optional string component_class_name = 2;
24383
24384    // The event in result of which tile list has changed.
24385    optional Event event = 3;
24386
24387    // Where a tile has been changed from. When changed on the companion equals
24388    // to the phone source, otherwise watch source if it's changed from the watch.
24389    optional android.app.wearservices.RequestSource request_source = 4;
24390
24391    // The package name of the app where the tile change has originated from.
24392    // Null for cases where the tile change originated from paired phone
24393    // where request_source would be RequestSource.PHONE.
24394    optional string origin_package_name = 5;
24395}
24396
24397/**
24398* A snapshot of all visible tiles in the order they appear on the watch.
24399* (go/wear-dd-wearservices-telemetry)
24400*/
24401message WsTileSnapshot {
24402    // Component package name for the tiles.
24403    repeated string component_package_name = 1;
24404
24405    // Class name for the tiles.
24406    repeated string component_class_name = 2;
24407
24408    // The size in bytes of the vendor-specific metadata associated with this
24409    // tile.  It will be zero (or not present) if no vendor-specific metadata is
24410    // associated with the tile or the associated metadata is empty.
24411    //
24412    // See go/wear-dd-tiles-oem-metadata for details.
24413    repeated int32 vendor_metadata_size_bytes = 3;
24414}
24415/*
24416* Logs calls to getType of a contentProvider, where the caller has potentially no access to
24417* the provider.
24418*
24419* Logs from :
24420* frameworks/base/services/core/java/com/android/server/am/ContentProviderHelper.java
24421* frameworks/base/core/java/android/content/ContentProvider.java
24422*/
24423message GetTypeAccessedWithoutPermission{
24424  // Indicator of the type of permission failure
24425  enum FailureType{
24426      UNSPECIFIED = 0;
24427      AM_FRAMEWORK_PERMISSION = 1;
24428      AM_CHECK_URI_PERMISSION = 2;
24429      AM_ERROR = 3;
24430      PROVIDER_FRAMEWORK_PERMISSION = 4;
24431      PROVIDER_CHECK_URI_PERMISSION = 5;
24432      PROVIDER_ERROR = 6;
24433  }
24434  optional FailureType location = 1;
24435  // Name of the caller package
24436  optional int32 calling_uid = 2 [(is_uid) = true];
24437  // Name of the provider (authority) which is being accessed
24438  optional string provider = 3;
24439  // Type of the uri returned
24440  optional string type = 4;
24441}
24442
24443/** Logged when a complication is changed on a watch face. Both
24444  data for complication that is being placed in the complication
24445  slot (we call is new here) and for complication that is being
24446  replaced (we call is old) is reported.
24447*/
24448message WsWatchFaceComplicationSetChanged {
24449  // Watch face package uid
24450  optional int32 watch_face_package_uid = 1 [(is_uid) = true];
24451
24452  // Complication component package uid for complication that is being replaced.
24453  // Equals to -1 if new complication is placed on previously empty slot.
24454  optional int32 old_complication_component_package_uid = 2 [(is_uid) = true];
24455
24456  // Complication component class name for complication that is being replaced.
24457  // Equals to empty string if new complication is placed on previously empty slot.
24458  optional string old_complication_component_class_name = 3;
24459
24460  // Complication component package uid for new complication.
24461  // Equals to -1 if complication is removed from complication slot.
24462  optional int32 new_complication_component_package_uid = 4 [(is_uid) = true];
24463
24464  // Complication component class name for new complication.
24465  // Equals to empty string if complication is removed from complication slot.
24466  optional string new_complication_component_class_name = 5;
24467
24468  // Where a complication has been changed from. When changed on the companion equals
24469  // to SOURCE_PHONE, otherwise if it's changed from the watch SOURCE_WATCH.
24470  optional android.app.wearservices.RequestSource request_source = 6;
24471
24472  // Old complication type.
24473  optional int32 old_complication_type = 7;
24474
24475  // New complication type.
24476  optional int32 new_complication_type = 8;
24477}
24478
24479/** Snapshot of all active complications on the current watch face.
24480*   (go/wear-dd-wearservices-telemetry)
24481*/
24482message WsActiveWatchFaceComplicationSetSnapshot {
24483  // Complication package name.
24484  repeated string complication_component_package_name = 1;
24485
24486  // Complication component class name.
24487  repeated string complication_component_class_name = 2;
24488
24489  // Complication type.
24490  repeated int32 complication_type = 4;
24491
24492  // Active watch face package uid.
24493  optional int32 watch_face_package_uid = 3 [(is_uid) = true];
24494
24495  /* Active watch face class name. This will be
24496  null for Declarative WF packages, as these packages have only one WF. */
24497  optional string watch_face_class_name = 5;
24498}
24499
24500message UnsafeIntentEventReported {
24501    enum EventType {
24502        UNKNOWN = 0;
24503        // When a component is matched with a null action.
24504        NULL_ACTION_MATCH = 1;
24505        // When a non-exported internal component is matched.
24506        INTERNAL_NON_EXPORTED_COMPONENT_MATCH = 2;
24507        // When an explicit intent does not match
24508        // an external component intent filter.
24509        EXPLICIT_INTENT_FILTER_UNMATCH = 3;
24510        // When a mutable pending intent for an implicit intent is retrieved
24511        NEW_MUTABLE_IMPLICIT_PENDING_INTENT_RETRIEVED = 4;
24512    }
24513    // Type of matching event.
24514    optional EventType event_type = 1;
24515    // The calling UID.
24516    optional int32 calling_uid = 2 [(is_uid) = true];
24517    // The component name of the intent.
24518    optional string component_name = 3;
24519    // The package name of the intent.
24520    optional string package_name = 4;
24521    // The action of the intent.
24522    optional string action = 5;
24523    // List of categories of the intent.
24524    repeated string categories = 6;
24525    // Data type of the intent.
24526    optional string data_type = 7;
24527    // Data scheme of the intent.
24528    optional string data_scheme = 8;
24529    // Is the unsafe intent event blocked by the system.
24530    optional bool is_blocked = 9;
24531}
24532
24533/**
24534 * Snapshot of all favorite watch faces from the watch.
24535 */
24536message WsFavouriteWatchFaceListSnapshot {
24537  repeated string watch_face_component_name = 1;
24538}
24539