• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/grammaticalinflection/grammatical_inflection.proto";
33import "frameworks/proto_logging/stats/atoms/hardware/biometrics/biometrics_atoms.proto";
34import "frameworks/proto_logging/stats/atoms/hotword/hotword_atoms.proto";
35import "frameworks/proto_logging/stats/atoms/input/input_atoms.proto";
36import "frameworks/proto_logging/stats/atoms/kernel/kernel_atoms.proto";
37import "frameworks/proto_logging/stats/atoms/locale/locale_atoms.proto";
38import "frameworks/proto_logging/stats/atoms/location/location_atoms.proto";
39import "frameworks/proto_logging/stats/atoms/media/media_drm_atoms.proto";
40import "frameworks/proto_logging/stats/atoms/wearsysui/wearsysui_atoms.proto";
41import "frameworks/proto_logging/stats/atoms/providers/mediaprovider/media_provider_atoms.proto";
42import "frameworks/proto_logging/stats/atoms/sysui/sysui_atoms.proto";
43import "frameworks/proto_logging/stats/atoms/usb/usb_atoms.proto";
44import "frameworks/proto_logging/stats/atoms/view/inputmethod/inputmethod_atoms.proto";
45import "frameworks/proto_logging/stats/atom_field_options.proto";
46import "frameworks/proto_logging/stats/enums/adservices/fledge/enums.proto";
47import "frameworks/proto_logging/stats/enums/anr/enums.proto";
48import "frameworks/proto_logging/stats/enums/adservices/measurement/enums.proto";
49import "frameworks/proto_logging/stats/enums/app/enums.proto";
50import "frameworks/proto_logging/stats/enums/app/job/enums.proto";
51import "frameworks/proto_logging/stats/enums/app/remoteprovisioner_enums.proto";
52import "frameworks/proto_logging/stats/enums/app/settings_enums.proto";
53import "frameworks/proto_logging/stats/enums/app/wearservices/wearservices_enums.proto";
54import "frameworks/proto_logging/stats/enums/app/tvsettings_enums.proto";
55import "frameworks/proto_logging/stats/enums/app/wearsettings_enums.proto";
56import "frameworks/proto_logging/stats/enums/autofill/enums.proto";
57import "frameworks/proto_logging/stats/enums/bluetooth/a2dp/enums.proto";
58import "frameworks/proto_logging/stats/enums/bluetooth/enums.proto";
59import "frameworks/proto_logging/stats/enums/bluetooth/hci/enums.proto";
60import "frameworks/proto_logging/stats/enums/bluetooth/hfp/enums.proto";
61import "frameworks/proto_logging/stats/enums/bluetooth/leaudio/enums.proto";
62import "frameworks/proto_logging/stats/enums/bluetooth/smp/enums.proto";
63import "frameworks/proto_logging/stats/enums/contexthub/enums.proto";
64import "frameworks/proto_logging/stats/enums/debug/enums.proto";
65import "frameworks/proto_logging/stats/enums/display/enums.proto";
66import "frameworks/proto_logging/stats/enums/hardware/biometrics/enums.proto";
67import "frameworks/proto_logging/stats/enums/jank/enums.proto";
68import "frameworks/proto_logging/stats/enums/media/audio/enums.proto";
69import "frameworks/proto_logging/stats/enums/media/midi/enums.proto";
70import "frameworks/proto_logging/stats/enums/media/outputswitcher/enums.proto";
71import "frameworks/proto_logging/stats/enums/media/enums.proto";
72import "frameworks/proto_logging/stats/enums/mms/enums.proto";
73import "frameworks/proto_logging/stats/enums/nearby/enums.proto";
74import "frameworks/proto_logging/stats/enums/net/enums.proto";
75import "frameworks/proto_logging/stats/enums/neuralnetworks/enums.proto";
76import "frameworks/proto_logging/stats/enums/nfc/enums.proto";
77import "frameworks/proto_logging/stats/enums/os/enums.proto";
78import "frameworks/proto_logging/stats/enums/server/connectivity/data_stall_event.proto";
79import "frameworks/proto_logging/stats/enums/server/display/enums.proto";
80import "frameworks/proto_logging/stats/enums/server/enums.proto";
81import "frameworks/proto_logging/stats/enums/server/job/enums.proto";
82import "frameworks/proto_logging/stats/enums/server/location/enums.proto";
83import "frameworks/proto_logging/stats/enums/service/enums.proto";
84import "frameworks/proto_logging/stats/enums/service/procstats_enum.proto";
85import "frameworks/proto_logging/stats/enums/stats/connectivity/connectivity_service.proto";
86import "frameworks/proto_logging/stats/enums/stats/connectivity/network_stack.proto";
87import "frameworks/proto_logging/stats/enums/stats/connectivity/tethering.proto";
88import "frameworks/proto_logging/stats/enums/stats/dnsresolver/dns_resolver.proto";
89import "frameworks/proto_logging/stats/enums/stats/devicepolicy/device_policy.proto";
90import "frameworks/proto_logging/stats/enums/stats/devicepolicy/device_policy_enums.proto";
91import "frameworks/proto_logging/stats/enums/stats/docsui/docsui_enums.proto";
92import "frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto";
93import "frameworks/proto_logging/stats/enums/stats/enums.proto";
94import "frameworks/proto_logging/stats/enums/stats/hdmi/enums.proto";
95import "frameworks/proto_logging/stats/enums/stats/intelligence/enums.proto";
96import "frameworks/proto_logging/stats/enums/stats/location/location_enums.proto";
97import "frameworks/proto_logging/stats/enums/stats/mediametrics/mediametrics.proto";
98import "frameworks/proto_logging/stats/enums/stats/mediaprovider/mediaprovider_enums.proto";
99import "frameworks/proto_logging/stats/enums/stats/mobiledatadownload/enums.proto";
100import "frameworks/proto_logging/stats/enums/stats/privacysignals/enums.proto";
101import "frameworks/proto_logging/stats/enums/stats/safetycenter/enums.proto";
102import "frameworks/proto_logging/stats/enums/stats/storage/storage_enums.proto";
103import "frameworks/proto_logging/stats/enums/stats/style/style_enums.proto";
104import "frameworks/proto_logging/stats/enums/stats/sysui/notification_enums.proto";
105import "frameworks/proto_logging/stats/enums/stats/tls/enums.proto";
106import "frameworks/proto_logging/stats/enums/stats/tv/tif_enums.proto";
107import "frameworks/proto_logging/stats/enums/stats/wm/enums.proto";
108import "frameworks/proto_logging/stats/enums/system/security/keystore2/enums.proto";
109import "frameworks/proto_logging/stats/enums/telecomm/enums.proto";
110import "frameworks/proto_logging/stats/enums/telephony/enums.proto";
111import "frameworks/proto_logging/stats/enums/uwb/enums.proto";
112import "frameworks/proto_logging/stats/enums/view/enums.proto";
113import "frameworks/proto_logging/stats/enums/wifi/enums.proto";
114import "frameworks/proto_logging/stats/enums/stats/textclassifier/textclassifier_enums.proto";
115import "frameworks/proto_logging/stats/enums/stats/otaupdate/updateengine_enums.proto";
116import "frameworks/proto_logging/stats/message/mediametrics_message.proto";
117import "frameworks/proto_logging/stats/atoms/devicelogs/device_logs_atoms.proto";
118import "frameworks/proto_logging/stats/atoms/wearservices/wearservices_atoms.proto";
119import "frameworks/proto_logging/stats/atoms/wear/media/wear_media_atoms.proto";
120
121/**
122 * The primary atom class. This message defines all of the available
123 * raw stats log events from the Android system, also known as "atoms."
124 *
125 * This field contains a single oneof with all of the available messages.
126 * The stats-log-api-gen tool runs as part of the Android build and
127 * generates the android.util.StatsLog class, which contains the constants
128 * and methods that Android uses to log.
129 *
130 * This Atom class is not actually built into the Android system.
131 * Instead, statsd on Android constructs these messages synthetically,
132 * in the format defined here and in stats_log.proto.
133 */
134message Atom {
135    // Pushed atoms start at 2.
136    oneof pushed {
137        // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
138        BleScanStateChanged ble_scan_state_changed = 2
139                [(module) = "bluetooth", (module) = "statsdtest"];
140        ProcessStateChanged process_state_changed = 3 [(module) = "framework", deprecated = true];
141        BleScanResultReceived ble_scan_result_received = 4
142            [(module) = "bluetooth", (module) = "statsdtest"];
143        SensorStateChanged sensor_state_changed =
144                5 [(module) = "framework", (module) = "statsdtest"];
145        gps.GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
146        SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
147        ScheduledJobStateChanged scheduled_job_state_changed =
148                8 [(module) = "framework", (module) = "statsdtest"];
149        ScreenBrightnessChanged screen_brightness_changed =
150                9 [(module) = "framework", (module) = "statsdtest"];
151        WakelockStateChanged wakelock_state_changed =
152                10 [(module) = "framework", (module) = "statsdtest"];
153        LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
154                11 [(module) = "framework"];
155        MobileRadioPowerStateChanged mobile_radio_power_state_changed =
156                12 [(module) = "framework", (truncate_timestamp) = true];
157        WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
158        ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
159                14 [(module) = "framework"];
160        MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
161        ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
162        CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
163        ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
164        sysui.LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
165        BatterySaverModeStateChanged battery_saver_mode_state_changed =
166                20 [(module) = "framework", (module) = "statsdtest"];
167        DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
168        DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
169        AudioStateChanged audio_state_changed =
170                23 [(module) = "framework", (truncate_timestamp) = true];
171        MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
172        CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
173        FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
174        UidProcessStateChanged uid_process_state_changed =
175                27 [(module) = "framework", (module) = "statsdtest"];
176        ProcessLifeCycleStateChanged process_life_cycle_state_changed =
177                28 [(module) = "framework", (module) = "statsdtest"];
178        ScreenStateChanged screen_state_changed =
179                29 [(module) = "framework", (module) = "statsdtest"];
180        BatteryLevelChanged battery_level_changed =
181                30 [(module) = "framework", (module) = "statsdtest"];
182        ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
183        PluggedStateChanged plugged_state_changed = 32
184                [(module) = "framework", (module) = "statsdtest"];
185        InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
186        input.TouchEventReported touch_event_reported = 34;
187        WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
188        KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
189        WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
190        WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
191        WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
192        PhoneSignalStrengthChanged phone_signal_strength_changed =
193                40 [(module) = "framework", (module) = "statsdtest", (truncate_timestamp) = true];
194        SettingChanged setting_changed = 41 [(module) = "framework"];
195        ActivityForegroundStateChanged activity_foreground_state_changed =
196                42 [(module) = "framework", (module) = "statsdtest"];
197        IsolatedUidChanged isolated_uid_changed =
198                43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
199        PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
200        WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
201        AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
202        AppBreadcrumbReported app_breadcrumb_reported = 47 [(module) = "statsd"];
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        LmkStateChanged lmk_state_changed = 54 [(module) = "framework"];
210        AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
211        ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
212        BootSequenceReported boot_sequence_reported = 57;
213        DaveyOccurred davey_occurred = 58 [(module) = "statsd", deprecated = true];
214        OverlayStateChanged overlay_state_changed =
215                59 [(module) = "framework", (module) = "statsdtest"];
216        ForegroundServiceStateChanged foreground_service_state_changed
217                = 60 [(module) = "framework"];
218        CallStateChanged call_state_changed =
219                61 [(module) = "telecom", (truncate_timestamp) = true];
220        sysui.KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
221        sysui.KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
222        sysui.KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered =
223                64 [(module) = "sysui"];
224        AppDied app_died = 65 [(module) = "framework"];
225        ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
226        BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "bluetooth"];
227        BluetoothConnectionStateChanged bluetooth_connection_state_changed =
228                68 [(module) = "bluetooth"];
229        GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
230        UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
231        SpeakerImpedanceReported speaker_impedance_reported = 71;
232        HardwareFailed hardware_failed = 72;
233        PhysicalDropDetected physical_drop_detected = 73;
234        ChargeCyclesReported charge_cycles_reported = 74;
235        MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
236        MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
237        UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
238        AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
239        ANROccurred anr_occurred = 79 [(module) = "framework"];
240        WTFOccurred wtf_occurred = 80 [(module) = "framework"];
241        LowMemReported low_mem_reported = 81 [(module) = "framework"];
242        GenericAtom generic_atom = 82;
243        VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
244        DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
245        ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
246        BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
247        BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
248        BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
249        UiEventReported ui_event_reported = 90 [
250            (module) = "framework",
251            (module) = "sysui",
252            (module) = "mediaprovider"
253        ];
254        BatteryHealthSnapshot battery_health_snapshot = 91;
255        SlowIo slow_io = 92;
256        BatteryCausedShutdown battery_caused_shutdown = 93;
257        PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
258        PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
259        UserRestrictionChanged user_restriction_changed = 96;
260        SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
261        ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
262        // TODO: service state change is very noisy shortly after boot, as well
263        // as at other transitions - coming out of doze, device plugged in, etc.
264        // Consider removing this if it becomes a problem
265        ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
266        ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
267        FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
268        BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
269        DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
270        DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
271        DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
272            105 [(module) = "docsui"];
273        DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
274        DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
275        DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
276            108 [(module) = "docsui"];
277        DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
278        DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
279        DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
280        DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
281        WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
282        WifiRunningStateChanged wifi_running_state_changed = 114
283                [(module) = "framework", deprecated = true];
284        AppCompacted app_compacted = 115 [(module) = "framework", deprecated = true];
285        NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
286        DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
287            117 [(module) = "docsui"];
288        DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
289        DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
290        DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
291        DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
292        RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
293        SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
294        GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
295        BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
296                125 [(module) = "bluetooth"];
297        BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
298                126 [(module) = "bluetooth"];
299        BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
300                127 [(module) = "bluetooth"];
301        AppDowngraded app_downgraded = 128 [(module) = "framework"];
302        AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
303        LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
304        GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
305        GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
306        UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
307        NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
308        NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
309        NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
310        NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
311        NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
312        NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
313        SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
314        SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
315        BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
316                142 [(module) = "framework"];
317        AttentionManagerServiceResultReported attention_manager_service_result_reported =
318                143 [(module) = "framework"];
319        AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
320        SpeechDspStatReported speech_dsp_stat_reported = 145;
321        UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
322        WatchdogRollbackOccurred watchdog_rollback_occurred =
323                147 [(module) = "framework", (module) = "statsd"];
324        BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
325                148 [(module) = "framework"];
326        BubbleUIChanged bubble_ui_changed = 149 [(module) = "framework"];
327        ScheduledJobConstraintChanged scheduled_job_constraint_changed =
328                150 [(module) = "framework"];
329        BluetoothActiveDeviceChanged bluetooth_active_device_changed =
330                151 [(module) = "bluetooth"];
331        BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
332                152 [(module) = "bluetooth"];
333        BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
334                153 [(module) = "bluetooth"];
335        BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
336                154 [(module) = "bluetooth"];
337        BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
338                155 [(module) = "bluetooth"];
339        BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
340                156 [(module) = "bluetooth"];
341        BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
342                157 [(module) = "bluetooth"];
343        BluetoothDeviceFailedContactCounterReported
344                bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
345        BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
346                159 [(module) = "bluetooth"];
347        BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
348                160 [(module) = "bluetooth"];
349        BluetoothQualityReportReported bluetooth_quality_report_reported =
350                161 [(module) = "bluetooth"];
351        BluetoothDeviceInfoReported bluetooth_device_info_reported =
352                162 [(module) = "bluetooth"];
353        BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
354                163 [(module) = "bluetooth"];
355        BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
356                164 [(module) = "bluetooth"];
357        BluetoothBondStateChanged bluetooth_bond_state_changed =
358                165 [(module) = "bluetooth"];
359        BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
360                166 [(module) = "bluetooth"];
361        BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
362                167 [(module) = "bluetooth"];
363        ScreenTimeoutExtensionReported screen_timeout_extension_reported =
364                168 [(module) = "framework"];
365        ProcessStartTime process_start_time = 169 [(module) = "framework"];
366        PermissionGrantRequestResultReported permission_grant_request_result_reported =
367                170 [(module) = "permissioncontroller"];
368        BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed =
369                171 [(module) = "bluetooth"];
370        DeviceIdentifierAccessDenied device_identifier_access_denied =
371                172 [(module) = "telephony_common"];
372        BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
373        sysui.AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
374        sysui.AssistGestureFeedbackReported assist_gesture_feedback_reported =
375                175 [(module) = "sysui"];
376        sysui.AssistGestureProgressReported assist_gesture_progress_reported =
377                176 [(module) = "sysui"];
378        input.TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
379        HiddenApiUsed hidden_api_used = 178 [(module) = "framework"];
380        StyleUIChanged style_ui_changed = 179 [(module) = "sysui", (module) = "wallpaper"];
381        PrivacyIndicatorsInteracted privacy_indicators_interacted =
382                180 [(module) = "permissioncontroller"];
383        AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
384                181 [(module) = "framework"];
385        NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
386        AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
387        BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
388        SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
389        TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
390        BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
391                187 [(module) = "bluetooth"];
392        IntelligenceEventReported intelligence_event_reported =
393                188 [(module) = "intelligence"];
394        ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
395                189 [(module) = "framework"];
396        RoleRequestResultReported role_request_result_reported =
397                190 [(module) = "permissioncontroller"];
398        MediametricsAudiopolicyReported mediametrics_audiopolicy_reported =
399                191 [(module) = "media_metrics"];
400        MediametricsAudiorecordReported mediametrics_audiorecord_reported =
401                192[(module) = "media_metrics"];
402        MediametricsAudiothreadReported mediametrics_audiothread_reported =
403                193 [(module) = "media_metrics"];
404        MediametricsAudiotrackReported mediametrics_audiotrack_reported =
405                194 [(module) = "media_metrics"];
406        MediametricsCodecReported mediametrics_codec_reported =
407                195 [(module) = "media_metrics"];
408        MediametricsDrmWidevineReported mediametrics_drm_widevine_reported =
409                196 [(module) = "media_metrics"];
410        MediametricsExtractorReported mediametrics_extractor_reported =
411                197 [(module) = "media_metrics"];
412        MediametricsMediadrmReported mediametrics_mediadrm_reported =
413                198 [(module) = "media_metrics"];
414        MediametricsNuPlayerReported mediametrics_nuplayer_reported =
415                199 [(module) = "media_metrics"];
416        MediametricsRecorderReported mediametrics_recorder_reported =
417                200 [(module) = "media_metrics"];
418        MediametricsDrmManagerReported mediametrics_drmmanager_reported =
419                201 [(module) = "media_metrics"];
420        CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
421        GarageModeInfo garage_mode_info = 204 [(module) = "car"];
422        TestAtomReported test_atom_reported = 205
423            [(module) = "cts", (module) = "statsdtest"];
424        ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
425                206 [(module) = "framework"];
426        ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
427        ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
428        ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
429        LocationManagerApiUsageReported location_manager_api_usage_reported =
430                210 [(module) = "framework"];
431        ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
432                211 [(module) = "permissioncontroller"];
433        RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
434                212 [(module) = "permissioncontroller"];
435        GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
436                213 [(module) = "permissioncontroller"];
437        LocationAccessCheckNotificationAction location_access_check_notification_action =
438                214 [(module) = "permissioncontroller"];
439        AppPermissionFragmentActionReported app_permission_fragment_action_reported =
440                215 [(module) = "permissioncontroller"];
441        AppPermissionFragmentViewed app_permission_fragment_viewed =
442                216 [(module) = "permissioncontroller"];
443        AppPermissionsFragmentViewed app_permissions_fragment_viewed =
444                217 [(module) = "permissioncontroller"];
445        PermissionAppsFragmentViewed permission_apps_fragment_viewed =
446                218  [(module) = "permissioncontroller"];
447        TextSelectionEvent text_selection_event = 219  [(module) = "textclassifier"];
448        TextLinkifyEvent text_linkify_event = 220  [(module) = "textclassifier"];
449        ConversationActionsEvent conversation_actions_event = 221  [(module) = "textclassifier"];
450        LanguageDetectionEvent language_detection_event = 222  [(module) = "textclassifier"];
451        ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
452        sysui.BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
453        UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported =
454                225 [(module) = "update_engine"];
455        UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported =
456                226 [(module) = "update_engine"];
457        CameraActionEvent camera_action_event = 227 [(module) = "framework"];
458        AppCompatibilityChangeReported app_compatibility_change_reported =
459                228 [(module) = "framework"];
460        PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
461        VmsClientConnectionStateChanged vms_client_connection_state_changed =
462                230 [(module) = "car"];
463        MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
464        MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
465        MediaProviderPermissionRequested media_provider_permission_requested =
466            235 [(module) = "mediaprovider"];
467        MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
468        MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
469            237 [(module) = "mediaprovider"];
470        RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
471        BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
472        BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
473                240 [(module) = "framework"];
474        BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
475        BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
476        UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
477        NotificationReported notification_reported = 244 [(module) = "framework"];
478        sysui.NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
479        NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
480        IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
481        IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
482        CellBroadcastMessageReported cb_message_reported =
483            249 [(module) = "cellbroadcast"];
484        CellBroadcastMessageError cb_message_error =
485            250 [(module) = "cellbroadcast"];
486        WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
487        WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
488        WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
489        AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
490        SnapshotMergeReported snapshot_merge_reported =
491            255 [(module) = "update_engine"];
492        ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
493            256  [(module) = "framework"];
494        // DisplayJankReported was deprecated in Android 12+
495        DisplayJankReported display_jank_reported = 257 [deprecated = true];
496        AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
497        SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
498        RankingSelected ranking_selected = 260 [
499            (module) = "framework",
500            (module) = "sysui",
501            (module) = "mediaprovider"
502        ];
503        TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
504        sysui.LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
505        PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
506        UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
507        UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
508        AccessibilityShortcutReported accessibility_shortcut_reported =
509            266 [(module) = "framework"];
510        AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
511        DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
512        AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
513        AutoRevokeNotificationClicked auto_revoke_notification_clicked =
514            270 [(module) = "permissioncontroller"];
515        AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
516            271 [(module) = "permissioncontroller"];
517        AutoRevokedAppInteraction auto_revoked_app_interaction =
518            272 [(module) = "permissioncontroller", (module) = "settings"];
519        AppPermissionGroupsFragmentAutoRevokeAction
520            app_permission_groups_fragment_auto_revoke_action =
521            273 [(module) = "permissioncontroller"];
522        EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
523        AudioPowerUsageDataReported audio_power_usage_data_reported =
524            275 [(module) = "media_metrics"];
525        TvTunerStateChanged tv_tuner_state_changed = 276 [(module) = "framework"];
526        sysui.MediaOutputOpSwitchReported mediaoutput_op_switch_reported =
527            277 [(module) = "sysui"];
528        CellBroadcastMessageFiltered cb_message_filtered =
529            278 [(module) = "cellbroadcast"];
530        TvTunerDvrStatus tv_tuner_dvr_status = 279 [(module) = "framework"];
531        TvCasSessionOpenStatus tv_cas_session_open_status =
532            280 [(module) = "framework"];
533        AssistantInvocationReported assistant_invocation_reported = 281 [(module) = "framework"];
534        DisplayWakeReported display_wake_reported = 282 [(module) = "framework"];
535        CarUserHalModifyUserRequestReported car_user_hal_modify_user_request_reported =
536            283 [(module) = "car"];
537        CarUserHalModifyUserResponseReported car_user_hal_modify_user_response_reported =
538            284 [(module) = "car"];
539        CarUserHalPostSwitchResponseReported car_user_hal_post_switch_response_reported =
540            285 [(module) = "car"];
541        CarUserHalInitialUserInfoRequestReported car_user_hal_initial_user_info_request_reported =
542            286 [(module) = "car"];
543        CarUserHalInitialUserInfoResponseReported car_user_hal_initial_user_info_response_reported =
544            287 [(module) = "car"];
545        CarUserHalUserAssociationRequestReported car_user_hal_user_association_request_reported =
546            288 [(module) = "car"];
547        CarUserHalSetUserAssociationResponseReported car_user_hal_set_user_association_response_reported =
548            289 [(module) = "car"];
549        NetworkIpProvisioningReported network_ip_provisioning_reported =
550            290 [(module) = "network_stack"];
551        NetworkDhcpRenewReported network_dhcp_renew_reported = 291 [(module) = "network_stack"];
552        NetworkValidationReported network_validation_reported = 292 [(module) = "network_stack"];
553        NetworkStackQuirkReported network_stack_quirk_reported = 293 [(module) = "network_stack"];
554        MediametricsAudioRecordDeviceUsageReported mediametrics_audiorecorddeviceusage_reported =
555            294 [(module) = "media_metrics"];
556        MediametricsAudioThreadDeviceUsageReported mediametrics_audiothreaddeviceusage_reported =
557            295 [(module) = "media_metrics"];
558        MediametricsAudioTrackDeviceUsageReported mediametrics_audiotrackdeviceusage_reported =
559            296 [(module) = "media_metrics"];
560        MediametricsAudioDeviceConnectionReported mediametrics_audiodeviceconnection_reported =
561            297 [(module) = "media_metrics"];
562        BlobCommitted blob_committed = 298 [(module) = "framework"];
563        BlobLeased blob_leased = 299 [(module) = "framework"];
564        BlobOpened blob_opened = 300 [(module) = "framework"];
565        ContactsProviderStatusReported contacts_provider_status_reported = 301;
566        KeystoreKeyEventReported keystore_key_event_reported = 302;
567        NetworkTetheringReported  network_tethering_reported =
568            303 [(module) = "network_tethering"];
569        sysui.ImeTouchReported ime_touch_reported = 304 [(module) = "sysui"];
570        UIInteractionFrameInfoReported ui_interaction_frame_info_reported =
571            305 [(module) = "framework"];
572        UIActionLatencyReported ui_action_latency_reported = 306 [(module) = "framework"];
573        WifiDisconnectReported wifi_disconnect_reported = 307 [(module) = "wifi"];
574        WifiConnectionStateChanged wifi_connection_state_changed = 308 [(module) = "wifi"];
575        HdmiCecActiveSourceChanged hdmi_cec_active_source_changed = 309 [(module) = "framework"];
576        HdmiCecMessageReported hdmi_cec_message_reported = 310 [(module) = "framework"];
577        AirplaneMode airplane_mode = 311 [(module) = "telephony"];
578        ModemRestart modem_restart = 312 [(module) = "telephony"];
579        CarrierIdMismatchReported carrier_id_mismatch_reported = 313 [(module) = "telephony"];
580        CarrierIdTableUpdated carrier_id_table_updated = 314 [(module) = "telephony"];
581        DataStallRecoveryReported data_stall_recovery_reported = 315 [(module) = "telephony"];
582        MediametricsMediaParserReported mediametrics_mediaparser_reported =
583                316 [(module) = "media_metrics"];
584        TlsHandshakeReported tls_handshake_reported = 317 [(module) = "conscrypt"];
585        TextClassifierApiUsageReported text_classifier_api_usage_reported = 318  [(module) = "textclassifier"];
586        CarWatchdogKillStatsReported car_watchdog_kill_stats_reported = 319 [(module) = "car"];
587        MediametricsPlaybackReported mediametrics_playback_reported = 320 [(module) = "media_metrics"];
588        MediaNetworkInfoChanged media_network_info_changed = 321 [(module) = "media_metrics"];
589        MediaPlaybackStateChanged media_playback_state_changed = 322 [(module) = "media_metrics"];
590        MediaPlaybackErrorReported media_playback_error_reported = 323 [(module) = "media_metrics"];
591        MediaPlaybackTrackChanged media_playback_track_changed = 324 [(module) = "media_metrics"];
592        WifiScanReported wifi_scan_reported = 325 [(module) = "wifi"];
593        WifiPnoScanReported wifi_pno_scan_reported = 326  [(module) = "wifi"];
594        TifTuneStateChanged tif_tune_changed = 327 [(module) = "framework"];
595        AutoRotateReported auto_rotate_reported = 328 [(module) = "framework"];
596        PerfettoTrigger perfetto_trigger = 329 [(module) = "perfetto"];
597        TranscodingData transcoding_data = 330 [(module) = "mediaprovider"];
598        ImsServiceEntitlementUpdated ims_service_entitlement_updated = 331 [(module) = "imsentitlement"];
599        DeviceRotated device_rotated = 333 [(module) = "framework"];
600        SimSpecificSettingsRestored sim_specific_settings_restored = 334
601            [(module) = "telephony"];
602        TextClassifierDownloadReported text_classifier_download_reported = 335 [(module) = "textclassifier"];
603        PinStorageEvent pin_storage_event = 336 [(module) = "telephony"];
604        FaceDownReported face_down_reported = 337 [(module) = "framework"];
605        BluetoothHALCrashReasonReported bluetooth_hal_crash_reason_reported =
606            338 [(module) = "bluetooth"];
607        RebootEscrowPreparationReported reboot_escrow_preparation_reported =
608            339 [(module) = "framework"];
609        RebootEscrowLskfCaptureReported reboot_escrow_lskf_capture_reported =
610            340 [(module) = "framework"];
611        RebootEscrowRebootReported reboot_escrow_reboot_reported = 341 [(module) = "framework"];
612        BinderLatencyReported binder_latency_reported = 342 [(module) = "framework"];
613        MediametricsAAudioStreamReported mediametrics_aaudiostream_reported =
614            343 [(module) = "media_metrics"];
615        MediaTranscodingSessionEnded media_transcoding_session_ended = 344
616            [(module) = "media"];
617        MagnificationUsageReported magnification_usage_reported =
618            345 [(module) = "framework"];
619        MagnificationModeWithImeOnReported magnification_mode_with_ime_on_reported =
620            346 [(module) = "framework"];
621        AppSearchCallStatsReported app_search_call_stats_reported = 347 [(module) = "appsearch"];
622        AppSearchPutDocumentStatsReported app_search_put_document_stats_reported = 348 [(module) = "appsearch"];
623        sysui.DeviceControlChanged device_control_changed = 349 [(module) = "sysui"];
624        DeviceStateChanged device_state_changed = 350 [(module) = "framework"];
625        input.InputDeviceRegistered inputdevice_registered = 351 [(module) = "framework"];
626        sysui.SmartSpaceCardReported smartspace_card_reported = 352 [(module) = "sysui"];
627        AuthPromptAuthenticateInvoked auth_prompt_authenticate_invoked = 353 [(module) = "framework"];
628        AuthManagerCanAuthenticateInvoked auth_manager_can_authenticate_invoked = 354 [(module) = "framework"];
629        AuthEnrollActionInvoked auth_enroll_action_invoked = 355 [(module) = "framework"];
630        AuthDeprecatedAPIUsed auth_deprecated_api_used = 356 [(module) = "framework"];
631        UnattendedRebootOccurred unattended_reboot_occurred = 357 [(module) = "scheduling"];
632        LongRebootBlockingReported long_reboot_blocking_reported = 358 [(module) = "scheduling"];
633        LocationTimeZoneProviderStateChanged location_time_zone_provider_state_changed =
634            359 [(module) = "framework"];
635        // 360-363 are reserved.
636        FdtrackEventOccurred fdtrack_event_occurred = 364 [(module) = "framework"];
637        TimeoutAutoExtendedReported timeout_auto_extended_reported = 365
638            [(module) = "framework"];
639        AlarmBatchDelivered alarm_batch_delivered = 367 [(module) = "framework"];
640        AlarmScheduled alarm_scheduled = 368 [(module) = "framework"];
641        CarWatchdogIoOveruseStatsReported car_watchdog_io_overuse_stats_reported = 369 [(module) = "car"];
642        UserLevelHibernationStateChanged user_level_hibernation_state_changed = 370 [(module) = "framework"];
643        AppSearchInitializeStatsReported app_search_initialize_stats_reported = 371 [(module) = "appsearch"];
644        AppSearchQueryStatsReported app_search_query_stats_reported = 372 [(module) = "appsearch"];
645        AppProcessDied app_process_died = 373 [(module) = "framework"];
646        NetworkIpReachabilityMonitorReported network_ip_reachability_monitor_reported =
647            374 [(module) = "network_stack"];
648        input.SlowInputEventReported slow_input_event_reported = 375 [(module) = "input"];
649        ANROccurredProcessingStarted anr_occurred_processing_started = 376 [(module) = "framework"];
650        AppSearchRemoveStatsReported app_search_remove_stats_reported = 377 [(module) = "appsearch"];
651        MediaCodecReported media_codec_reported =
652            378 [(module) = "framework", (module) = "media_metrics"];
653        PermissionUsageFragmentInteraction permission_usage_fragment_interaction = 379 [(module) = "permissioncontroller"];
654        PermissionDetailsInteraction permission_details_interaction = 380 [(module) = "permissioncontroller"];
655        PrivacySensorToggleInteraction privacy_sensor_toggle_interaction = 381 [(module) = "framework"];
656        PrivacyToggleDialogInteraction privacy_toggle_dialog_interaction = 382 [(module) = "framework"];
657        AppSearchOptimizeStatsReported app_search_optimize_stats_reported = 383 [(module) = "appsearch"];
658        NonA11yToolServiceWarningReported non_a11y_tool_service_warning_report = 384 [(module) = "framework"];
659        AppSearchSetSchemaStatsReported app_search_set_schema_stats_reported = 385 [(module) = "appsearch"];
660        AppCompatStateChanged app_compat_state_changed = 386 [(module) = "framework"];
661        SizeCompatRestartButtonEventReported size_compat_restart_button_event_reported = 387 [(module) = "framework"];
662        SplitscreenUIChanged splitscreen_ui_changed = 388 [(module) = "framework"];
663        NetworkDnsHandshakeReported network_dns_handshake_reported = 389 [(module) = "resolv"];
664        BluetoothCodePathCounter bluetooth_code_path_counter =
665            390 [(module) = "bluetooth"];
666        BluetoothLeBatchScanReportDelay bluetooth_le_batch_scan_report_delay =
667            392 [(module) = "bluetooth"];
668        sysui.AccessibilityFloatingMenuUIChanged accessibility_floating_menu_ui_changed =
669            393 [(module) = "sysui"];
670        NeuralNetworksCompilationCompleted neuralnetworks_compilation_completed = 394
671            [(module) = "neuralnetworks"];
672        NeuralNetworksExecutionCompleted neuralnetworks_execution_completed = 395
673            [(module) = "neuralnetworks"];
674        NeuralNetworksCompilationFailed neuralnetworks_compilation_failed = 396
675            [(module) = "neuralnetworks"];
676        NeuralNetworksExecutionFailed neuralnetworks_execution_failed = 397
677            [(module) = "neuralnetworks"];
678        ContextHubBooted context_hub_booted = 398 [(module) = "contexthub"];
679        ContextHubRestarted context_hub_restarted = 399 [(module) = "contexthub"];
680        ContextHubLoadedNanoappSnapshotReported context_hub_loaded_nanoapp_snapshot_reported = 400
681            [(module) = "contexthub"];
682        ChreCodeDownloadTransacted chre_code_download_transacted = 401 [(module) = "contexthub"];
683        UwbSessionInitiated uwb_session_inited = 402 [(module) = "uwb"];
684        UwbSessionClosed uwb_session_closed = 403 [(module) = "uwb"];
685        UwbFirstRangingReceived uwb_first_ranging_received = 404 [(module) = "uwb"];
686        UwbRangingMeasurementReceived uwb_ranging_measurement_received = 405 [(module) = "uwb"];
687        TextClassifierDownloadWorkScheduled text_classifier_download_work_scheduled = 406 [(module) = "textclassifier"];
688        TextClassifierDownloadWorkCompleted text_classifier_download_work_completed = 407 [(module) = "textclassifier"];
689        ClipboardCleared clipboard_cleared = 408 [(module) = "framework"];
690        VmCreationRequested vm_creation_requested = 409 [(module) = "virtualizationservice"];
691        NearbyDeviceScanStateChanged nearby_device_scan_state_changed = 410 [(module) = "nearby"];
692        CameraCompatControlEventReported camera_compat_control_event_reported = 411 [(module) = "framework"];
693        ApplicationLocalesChanged application_locales_changed = 412 [(module) = "framework"];
694        MediametricsAudioTrackStatusReported mediametrics_audiotrackstatus_reported =
695            413 [(module) = "media_metrics"];
696        FoldStateDurationReported fold_state_duration_reported = 414 [(module) = "framework"];
697        LocationTimeZoneProviderControllerStateChanged location_time_zone_provider_controller_state_changed =
698            415 [(module) = "framework"];
699        DisplayHbmStateChanged display_hbm_state_changed = 416 [(module) = "framework"];
700        DisplayHbmBrightnessChanged display_hbm_brightness_changed = 417 [(module) = "framework"];
701        PersistentUriPermissionsFlushed persistent_uri_permissions_flushed =
702            418 [(module) = "framework"];
703        EarlyBootCompOsArtifactsCheckReported early_boot_comp_os_artifacts_check_reported = 419 [(module) = "art"];
704        VBMetaDigestReported vbmeta_digest_reported = 420 [(module) = "framework"];
705        ApexInfoGathered apex_info_gathered = 421 [(module) = "framework"];
706        PvmInfoGathered pvm_info_gathered = 422 [(module) = "framework"];
707        WearSettingsUIInteracted wear_settings_ui_interacted = 423 [(module) = "wear_settings"];
708        TracingServiceReportEvent tracing_service_report_event = 424 [(module) = "framework"];
709        MediametricsAudioRecordStatusReported mediametrics_audiorecordstatus_reported =
710            425 [(module) = "media_metrics"];
711        sysui.LauncherLatency launcher_latency = 426 [(module) = "sysui"];
712        DropboxEntryDropped dropbox_entry_dropped = 427 [(module) = "framework"];
713        WifiP2pConnectionReported wifi_p2p_connection_reported = 428 [(module) = "wifi"];
714        GameStateChanged game_state_changed = 429 [(module) = "framework"];
715        hotword.HotwordDetectorCreateRequested hotword_detector_create_requested = 430
716            [(module) = "framework"];
717        hotword.HotwordDetectionServiceInitResultReported hotword_detection_service_init_result_reported = 431
718            [(module) = "framework"];
719        hotword.HotwordDetectionServiceRestarted hotword_detection_service_restarted = 432
720            [(module) = "framework"];
721        hotword.HotwordDetectorKeyphraseTriggered hotword_detector_keyphrase_triggered = 433
722            [(module) = "framework"];
723        hotword.HotwordDetectorEvents hotword_detector_events = 434
724            [(module) = "framework"];
725        AdServicesApiCalled ad_services_api_called =
726            435 [(module) = "adservices", (truncate_timestamp) = true];
727        AdServicesMeasurementReportsUploaded ad_services_mesurement_reports_uploaded =
728            436 [(module) = "adservices", (truncate_timestamp) = true];
729        BootCompletedBroadcastCompletionLatencyReported boot_completed_broadcast_completion_latency_reported =
730                437 [(module) = "framework"];
731        ContactsIndexerUpdateStatsReported contacts_indexer_update_stats_reported = 440
732            [(module) = "appsearch"];
733        AppBackgroundRestrictionsInfo app_background_restrictions_info =
734            441 [(module) = "framework"];
735        MmsSmsProviderGetThreadIdFailed mms_sms_provider_get_thread_id_failed = 442 [(module) = "telephony"];
736        MmsSmsDatabaseHelperOnUpgradeFailed mms_sms_database_helper_on_upgrade_failed = 443 [(module) = "telephony"];
737        PermissionReminderNotificationInteracted permission_reminder_notification_interacted =
738            444 [(module) = "permissioncontroller"];
739        RecentPermissionDecisionsInteracted recent_permission_decisions_interacted =
740            445 [(module) = "permissioncontroller"];
741        GnssPsdsDownloadReported gnss_psds_download_reported = 446 [(module) = "framework"];
742        LeAudioConnectionSessionReported le_audio_connection_session_reported = 447 [(module) = "bluetooth"];
743        LeAudioBroadcastSessionReported le_audio_broadcast_session_reported = 448 [(module) = "bluetooth"];
744        DreamUiEventReported dream_ui_event_reported = 449 [(module) = "framework"];
745        sysui.TaskManagerEventReported task_manager_event_reported = 450 [(module) = "sysui"];
746        CdmAssociationAction cdm_association_action = 451 [(module) = "framework"];
747        MagnificationTripleTapAndHoldActivatedSessionReported magnification_triple_tap_and_hold_activated_session_reported =
748            452 [(module) = "framework"];
749        MagnificationFollowTypingFocusActivatedSessionReported magnification_follow_typing_focus_activated_session_reported =
750            453 [(module) = "framework"];
751        AccessibilityTextReadingOptionsChanged accessibility_text_reading_options_changed = 454 [(module) = "settings"];
752        WifiSetupFailureCrashReported wifi_setup_failure_crash_reported = 455 [(module) = "wifi"];
753        UwbDeviceErrorReported uwb_device_error_reported = 456 [(module) = "uwb"];
754        IsolatedCompilationScheduled isolated_compilation_scheduled = 457 [(module) = "art"];
755        IsolatedCompilationEnded isolated_compilation_ended = 458 [(module) = "art"];
756        OnsOpportunisticEsimProvisioningComplete ons_opportunistic_esim_provisioning_complete = 459 [(module) = "ons"];
757        SystemServerPreWatchdogOccurred system_server_pre_watchdog_occurred = 460 [(module) = "framework"];
758        TelephonyAnomalyDetected telephony_anomaly_detected = 461 [(module) = "telephony"];
759        LetterboxPositionChanged letterbox_position_changed = 462 [(module) = "framework"];
760        RemoteKeyProvisioningAttempt remote_key_provisioning_attempt = 463 [(module) = "rkpd"];
761        RemoteKeyProvisioningNetworkInfo remote_key_provisioning_network_info = 464 [(module) = "rkpd"];
762        RemoteKeyProvisioningTiming remote_key_provisioning_timing = 465 [(module) = "rkpd"];
763        sysui.MediaOutputOpInteractionReported mediaoutput_op_interaction_report =
764            466 [(module) = "sysui"];
765        SyncExemptionOccurred sync_exemption_occurred = 468 [(module) = "framework"];
766        AutofillPresentationEventReported autofill_presentation_event_reported = 469 [(module) = "framework"];
767        DockStateChanged dock_state_changed = 470 [(module) = "framework"];
768        SafetySourceStateCollected safety_source_state_collected = 471 [(module) = "permissioncontroller"];
769        SafetyCenterSystemEventReported safety_center_system_event_reported = 472 [(module) = "permissioncontroller"];
770        SafetyCenterInteractionReported safety_center_interaction_reported = 473 [(module) = "permissioncontroller"];
771        SettingsProviderSettingChanged settings_provider_setting_changed = 474 [(module) = "framework"];
772        BroadcastDeliveryEventReported broadcast_delivery_event_reported =
773                475 [(module) = "framework"];
774        ServiceRequestEventReported service_request_event_reported = 476 [(module) = "framework"];
775        ProviderAcquisitionEventReported provider_acquisition_event_reported =
776                477 [(module) = "framework"];
777        BluetoothDeviceNameReported bluetooth_device_name_reported = 478 [(module) = "bluetooth"];
778        CellBroadcastConfigUpdated cb_config_updated = 479 [(module) = "cellbroadcast"];
779        CellBroadcastModuleErrorReported cb_module_error_reported = 480 [(module) = "cellbroadcast"];
780        CellBroadcastServiceFeatureChanged cb_service_feature_changed = 481 [(module) = "cellbroadcast"];
781        CellBroadcastReceiverFeatureChanged cb_receiver_feature_changed = 482 [(module) = "cellbroadcast"];
782        JSScriptEngineLatencyReported jsscriptengine_latency_reported = 483 [(module) = "adservices"];
783        PrivacySignalNotificationInteraction privacy_signal_notification_interaction = 484 [(module) = "permissioncontroller"];
784        PrivacySignalIssueCardInteraction privacy_signal_issue_card_interaction = 485 [(module) = "permissioncontroller"];
785        PrivacySignalsJobFailure privacy_signals_job_failure = 486 [(module) = "permissioncontroller"];
786        VibrationReported vibration_reported = 487 [(module) = "framework"];
787        SandboxApiCalled sandbox_api_called = 488 [(module) = "sdksandbox"];
788        UwbStartRanging uwb_ranging_start = 489 [(module) = "uwb"];
789        MobileDataDownloadFileGroupDownloadStatusReported mobile_data_download_file_group_status_reported = 490 [(module) = "adservices"];
790        AppCompactedV2 app_compacted_v2 = 491 [(module) = "framework"];
791        // reserved 492
792        AdServicesSettingsUsageReported ad_services_settings_usage_reported = 493 [(module) = "adservices", (truncate_timestamp) = true];
793        DisplayBrightnessChanged display_brightness_changed = 494 [(module) = "framework"];
794        ActivityActionBlocked activity_action_blocked = 495 [(module) = "framework"];
795        BackgroundFetchProcessReported background_fetch_process_reported =
796                496 [(module) = "adservices"];
797        UpdateCustomAudienceProcessReported update_custom_audience_process_reported =
798                497 [(module) = "adservices"];
799        RunAdBiddingProcessReported run_ad_bidding_process_reported = 498 [(module) = "adservices"];
800        RunAdScoringProcessReported run_ad_scoring_process_reported = 499 [(module) = "adservices"];
801        RunAdSelectionProcessReported run_ad_selection_process_reported =
802                500 [(module) = "adservices"];
803        RunAdBiddingPerCAProcessReported run_ad_bidding_per_ca_process_reported =
804                501 [(module) = "adservices"];
805        MobileDataDownloadDownloadResultReported mobile_data_download_download_result_reported = 502 [(module) = "adservices"];
806        MobileDataDownloadFileGroupStorageStatsReported mobile_data_download_file_group_storage_stats_reported = 503 [(module) = "adservices"];
807        NetworkDnsServerSupportReported network_dns_server_support_reported = 504 [(module) = "resolv"];
808        VmBooted vm_booted = 505 [(module) = "virtualizationservice"];
809        VmExited vm_exited = 506 [(module) = "virtualizationservice"];
810        AmbientBrightnessStatsReported ambient_brightness_stats_reported = 507 [(module) = "framework"];
811        MediametricsSpatializerCapabilitiesReported mediametrics_spatializercapabilities_reported =
812                508 [(module) = "media_metrics"];
813        MediametricsSpatializerDeviceEnabledReported mediametrics_spatializerdeviceenabled_reported =
814                509 [(module) = "media_metrics"];
815        MediametricsHeadTrackerDeviceEnabledReported mediametrics_headtrackerdeviceenabled_reported =
816                510 [(module) = "media_metrics"];
817        MediametricsHeadTrackerDeviceSupportedReported mediametrics_headtrackerdevicesupported_reported =
818                511 [(module) = "media_metrics"];
819        AdServicesMeasurementRegistrations ad_services_measurement_registrations =
820            512 [(module) = "adservices", (truncate_timestamp) = true];
821        HearingAidInfoReported hearing_aid_info_reported = 513 [(module) = "framework"];
822        DeviceWideJobConstraintChanged device_wide_job_constraint_changed =
823            514 [(module) = "framework"];
824        AmbientModeChanged ambient_mode_changed = 515 [(module) = "framework"];
825        ANRLatencyReported anr_latency_reported = 516 [(module) = "framework"];
826        ResourceValueApiStatisticsReported resource_api_info = 517 [(module) = "framework"];
827        SystemDefaultNetworkChanged system_default_network_changed =
828            518 [(module) = "network_stack"];
829        IwlanSetupDataCallResultReported iwlan_setup_data_call_result_reported = 519 [(module) = "iwlan"];
830        IwlanPdnDisconnectedReasonReported iwlan_pdn_disconnected_reason_reported = 520 [(module) = "iwlan"];
831        AirplaneModeSessionReported airplane_mode_session_reported = 521 [(module) = "wifi", (module) = "bluetooth"];
832        VmCpuStatusReported vm_cpu_status_reported = 522 [(module) = "virtualizationservice", deprecated = true];
833        VmMemStatusReported vm_mem_status_reported = 523 [(module) = "virtualizationservice", deprecated = true];
834        PackageInstallationSessionReported package_installation_session_reported = 524 [(module) = "framework"];
835        DefaultNetworkRematchInfo default_network_rematch_info = 525 [(module) = "connectivity"];
836        NetworkSelectionPerformance network_selection_performance = 526 [(module) = "connectivity"];
837        NetworkNsdReported network_nsd_reported = 527 [(module) = "connectivity"];
838        BluetoothDisconnectionReasonReported bluetooth_disconnection_reason_reported = 529 [(module) = "bluetooth"];
839        BluetoothLocalVersionsReported bluetooth_local_versions_reported = 530 [(module) = "bluetooth"];
840        BluetoothRemoteSupportedFeaturesReported bluetooth_remote_supported_features_reported = 531 [(module) = "bluetooth"];
841        BluetoothLocalSupportedFeaturesReported bluetooth_local_supported_features_reported = 532 [(module) = "bluetooth"];
842        BluetoothGattAppInfo bluetooth_gatt_app_info = 533 [(module) = "bluetooth"];
843        BrightnessConfigurationUpdated brightness_configuration_updated = 534 [(module) = "framework"];
844        AdServicesGetTopicsReported ad_services_get_topics_reported =
845            535 [(module) = "adservices", (truncate_timestamp) = true];
846        AdServicesEpochComputationGetTopTopicsReported
847            ad_services_epoch_computation_get_top_topics_reported =
848                536 [(module) = "adservices", (truncate_timestamp) = true];
849        AdServicesEpochComputationClassifierReported
850            ad_services_epoch_computation_classifier_reported =
851                537 [(module) = "adservices", (truncate_timestamp) = true];
852        WearMediaOutputSwitcherLaunched wear_media_output_switcher_launched =
853            538 [(module) = "MediaOutputSwitcher"];
854        WearMediaOutputSwitcherFinished wear_media_output_switcher_finished =
855            539 [(module) = "MediaOutputSwitcher"];
856        WearMediaOutputSwitcherConnectionReported
857            wear_media_output_switcher_connection_reported =
858                540 [(module) = "MediaOutputSwitcher"];
859        WearMediaOutputSwitcherDeviceScanTriggered
860            wear_media_output_switcher_device_scan_triggered =
861                541 [(module) = "MediaOutputSwitcher"];
862        WearMediaOutputSwitcherFirstDeviceScanLatency
863            wear_media_output_switcher_first_device_scan_latency =
864                542 [(module) = "MediaOutputSwitcher"];
865        WearMediaOutputSwitcherConnectDeviceLatency
866            wear_media_output_switcher_connect_device_latency =
867                543 [(module) = "MediaOutputSwitcher"];
868        PackageManagerSnapshotReported
869            package_manager_snapshot_reported = 544 [(module) = "framework"];
870        PackageManagerAppsFilterCacheBuildReported
871            package_manager_apps_filter_cache_build_reported = 545 [(module) = "framework"];
872        PackageManagerAppsFilterCacheUpdateReported
873            package_manager_apps_filter_cache_update_reported = 546 [(module) = "framework"];
874        sysui.LauncherImpressionEvent launcher_impression_event = 547 [(module) = "sysui"];
875        WearMediaOutputSwitcherAllDevicesScanLatency
876            wear_media_output_switcher_all_devices_scan_latency =
877                549 [(module) = "MediaOutputSwitcher"];
878        WsWatchFaceEdited ws_watch_face_edited = 551 [(module) = "wearservices"];
879        WsWatchFaceFavouriteActionReported ws_watch_face_favorite_action_reported = 552 [(module) = "wearservices"];
880        WsWatchFaceSetActionReported ws_watch_face_set_action_reported = 553 [(module) = "wearservices"];
881        PackageUninstallationReported package_uninstallation_reported = 554 [(module) = "framework"];
882        agif.GameModeChanged game_mode_changed = 555 [(module) = "framework"];
883        agif.GameModeConfigurationChanged game_mode_configuration_changed = 556 [(module) = "framework"];
884        BedtimeModeStateChanged bedtime_mode_state_changed = 557 [(module) = "framework"];
885        NetworkSliceSessionEnded network_slice_session_ended = 558 [(module) = "connectivity"];
886        NetworkSliceDailyDataUsageReported network_slice_daily_data_usage_reported = 559 [(module) = "connectivity"];
887        NfcTagTypeOccurred nfc_tag_type_occurred = 560 [(module) = "nfc"];
888        NfcAIDConflictOccurred nfc_aid_conflict_occurred = 561 [(module) = "nfc"];
889        NfcReaderConflictOccurred nfc_reader_conflict_occurred = 562 [(module) = "nfc"];
890        WsTileListChanged ws_tile_list_changed = 563 [(module) = "wearservices"];
891        GetTypeAccessedWithoutPermission get_type_accessed_without_permission = 564[(module) = "framework"];
892        MobileBundledAppInfoGathered mobile_bundled_app_info_gathered = 566 [(module) = "framework"];
893        WsWatchFaceComplicationSetChanged ws_watch_face_complication_set_changed = 567 [(module) = "wearservices"];
894        media.MediaDrmCreated media_drm_created = 568 [(module) = "media_metrics"];
895        media.MediaDrmErrored media_drm_errored = 569 [(module) = "media_metrics"];
896        media.MediaDrmSessionOpened media_drm_session_opened = 570
897            [(module) = "media_metrics"];
898        media.MediaDrmSessionClosed media_drm_session_closed = 571
899            [(module) = "media_metrics"];
900        UserSelectedResolution user_selected_resolution = 572 [(module) = "settings"];
901        UnsafeIntentEventReported unsafe_intent_event_reported = 573 [(module) = "framework"];
902        adpf.PerformanceHintSessionReported performance_hint_session_reported = 574 [(module) = "framework"];
903        MediametricsMidiDeviceCloseReported mediametrics_midi_device_close_reported =
904            576 [(module) = "media_metrics"];
905        hardware.biometrics.BiometricTouchReported biometric_touch_reported = 577 [(module) = "sysui"];
906        hotword.HotwordAudioEgressEventReported hotword_audio_egress_event_reported = 578
907            [(module) = "framework"];
908        AppSearchSchemaMigrationStatsReported
909          app_search_schema_migration_stats_reported = 579 [(module) = "appsearch"];
910        location.LocationEnabledStateChanged location_enabled_state_changed = 580 [(module) = "framework"];
911        view.inputmethod.ImeRequestFinished ime_request_finished = 581 [(module) = "framework"];
912        usb.UsbComplianceWarningsReported usb_compliance_warnings_reported = 582 [(module) = "framework"];
913        locale.AppSupportedLocalesChanged app_supported_locales_changed = 583 [(module) = "framework"];
914        grammaticalinflection.ApplicationGrammaticalInflectionChanged grammatical_inflection_changed = 584 [(module) = "framework"];
915        providers.mediaprovider.MediaProviderVolumeRecoveryReported
916            media_provider_volume_recovery_reported = 586 [(module) = "mediaprovider"];
917        hardware.biometrics.BiometricPropertiesCollected
918            biometric_properties_collected = 587 [(module) = "framework"];
919        kernel.KernelWakeupAttributed kernel_wakeup_attributed = 588 [(module) = "framework"];
920        display.ScreenStateChangedV2 screen_state_changed_v2 = 589 [(module) = "framework"];
921        wearservices.WsBackupActionReported ws_backup_action_reported = 590
922            [(module) = "wearservices"];
923        wearservices.WsRestoreActionReported ws_restore_action_reported = 591
924            [(module) = "wearservices"];
925        devicelogs.DeviceLogAccessEventReported device_log_access_event_reported = 592 [(module) = "sysui"];
926        wear.media.MediaSessionUpdated media_session_updated = 594 [(module) = "wearmedia"];
927        wearsysui.WearOobeStateChanged wear_oobe_state_changed = 595 [(module) = "framework"];
928        wearservices.WsNotificationUpdated ws_notification_updated = 596
929            [(module) = "wearservices"];
930        // reserved 597
931        corenetworking.connectivity.NetworkValidationFailureStatsDailyReported
932            network_validation_failure_stats_daily_reported = 601 [(module) = "connectivity"];
933        wearservices.WsComplicationTapped ws_complication_tapped = 602 [(module) = "wearservices"];
934        wearservices.WsWearTimeSession ws_wear_time_session = 610 [(module) = "wearservices"];
935    }
936
937    // Pushed atom extensions.
938    // The atom definitions are under atoms/<feature>/<feature>_extension_atoms.proto
939    extensions 332; // ArtDatumReported art_datum_reported
940    extensions 366; // OdrefreshReported odrefresh_reported
941    extensions 467; // BackgroundDexoptJobEnded background_dexopt_job_ended
942    extensions 528; // ExpressEventReported express_event_reported
943    extensions 548; // OdsignReported odsign_reported
944    extensions 550; // ArtDeviceDatumReported art_device_datum_reported
945    extensions 565; // ArtDatumDeltaReported art_datum_delta_reported
946    extensions 585; // CredentialManagerApiCalled credential_manager_api_called
947    extensions 593; // ExpressHistogramSampleReported express_histogram_sample_reported
948    extensions 598; // AdServicesBackCompatGetTopicsReported ad_services_back_compat_get_topics_reported
949    extensions 599; // AdServicesBackCompatEpochComputationClassifierReported ad_services_back_compat_epoch_computation_classifier_reported
950    extensions 600; // MediaCodecReclaimRequestCompleted media_codec_reclaim_request_completed
951    extensions 603; // AutofillUiEventReported autofill_ui_event_reported
952    extensions 604; // AutofillFillRequestReported autofill_fill_request_reported
953    extensions 605; // AutofillFillResponseReported autofill_fill_response_reported
954    extensions 606; // AutofillSaveEventReported autofill_save_event_reported
955    extensions 607; // AutofillSessionCommitted autofill_session_committed
956    extensions 608; // MediaActionReported media_action_reported
957    extensions 609; // MediaControlsLaunched media_controls_launched
958    extensions 611; // LockscreenShortcutSelected lockscreen_shortcut_selected
959    extensions 612; // LockscreenShortcutTriggered lockscreen_shortcut_triggered
960    extensions 613; // BluetoothHashedDeviceNameReported bluetooth_hashed_device_name_reported
961    extensions 614; // BluetoothL2capCocClientConnection bluetooth_l2cap_coc_client_connection
962    extensions 615; // BluetoothL2capCocServerConnection bluetooth_l2cap_coc_server_connection
963    extensions 616; // HealthConnectApiCalled health_connect_api_called
964    extensions 617; // HealthConnectUsageStats health_usage_stats
965    extensions 618; // HealthConnectStorageStats health_connect_storage_stats
966    extensions 619; // WearAdaptiveSuspendStatsReported wear_adaptive_suspend_stats_reported
967    extensions 620; // WearPowerAnomalyServiceOperationalStatsReported wear_power_anomaly_service_operational_stats_reported
968    extensions 621; // WearPowerAnomalyServiceEventStatsReported wear_power_anomaly_service_event_stats_reported
969    extensions 622; // SettingsSpaReported settings_spa_reported
970    extensions 623; // HealthConnectUiImpression health_connect_ui_impression
971    extensions 624; // HealthConnectUiInteraction health_connect_ui_interaction
972    extensions 625; // HealthConnectAppOpenedReported health_connect_app_opened_reported
973    extensions 626; // WsIncomingCallActionReported ws_incoming_call_action_reported
974    extensions 627; // WsCallDisconnectionReported ws_call_disconnection_reported
975    extensions 628; // WsCallDurationReported ws_call_duration_reported
976    extensions 629; // WsCallUserExperienceLatencyReported ws_call_user_experience_latency_reported
977    extensions 630; // WsCallInteractionReported ws_call_interaction_reported
978    extensions 631; // FullScreenIntentLaunched full_screen_intent_launched
979    extensions 632; // BalAllowed bal_allowed
980    extensions 633; // EmergencyStateChanged emergency_state_changed
981    extensions 634; // QualifiedRatListChanged qualified_rat_list_changed
982    extensions 635; // QnsImsCallDropStats qns_ims_call_drop_stats
983    extensions 636; // QnsFallbackRestrictionChanged qns_fallback_restriction_changed
984    extensions 637; // EmergencyNumberDialed emergency_number_dialed
985    extensions 638; // WifiAwareNdpReported wifi_aware_ndp_reported
986    extensions 639; // WifiAwareAttachReported wifi_aware_attach_reported
987    extensions 640; // AdServicesMeasurementDebugKeys ad_services_measurement_debug_keys
988    extensions 641; // MediaCodecStarted media_codec_started
989    extensions 642; // MediaCodecStopped media_codec_stopped
990    extensions 643; // HealthConnectApiInvoked health_connect_api_invoked
991    extensions 644; // ExpressUidEventReported express_uid_event_reported
992    extensions 645; // PermissionRationaleDialogViewed permission_rationale_dialog_viewed
993    extensions 646; // PermissionRationaleDialogActionReported permission_rationale_dialog_action_reported
994    extensions 647; // AppDataSharingUpdatesNotificationInteraction app_data_sharing_updates_notification_interaction
995    extensions 648; // AppDataSharingUpdatesFragmentViewed app_data_sharing_updates_fragment_viewed
996    extensions 649; // AppDataSharingUpdatesFragmentActionReported app_data_sharing_updates_fragment_action_reported
997    extensions 650; // DailykeepaliveInfoReported daily_keepalive_info_reported
998    extensions 651; // CredentialManagerInitialPhaseReported credential_manager_init_phase_reported
999    extensions 652; // CredentialManagerCandidatePhaseReported credential_manager_candidate_phase_reported
1000    extensions 653; // CredentialManagerFinalPhaseReported credential_manager_final_phase_reported
1001    extensions 654; // ExerciseRouteApiCalled exercise_route_api_called
1002    extensions 655; // PluginInitialized plugin_initialized
1003    extensions 656; // BluetoothLeSessionConnected bluetooth_le_session_connected
1004    extensions 657; // DNDStateChanged dnd_state_changed
1005    extensions 658; // ExpressUidHistogramSampleReported express_uid_histogram_sample_reported
1006    extensions 659; // AuotifllFieldClassificationEventReported autofill_field_classification_event_reported
1007    extensions 660; // TestExtensionAtomReported test_extension_atom_reported
1008    extensions 661; // WifiSelfRecoveryTriggered wifi_self_recovery_triggered
1009    extensions 662; // AdServicesErrorReported ad_services_error_reported
1010    extensions 663; // AdServicesBackgroundJobsExecutionReported ad_services_background_jobs_execution_reported
1011    extensions 664; // RkpdPoolStats rkpd_pool_stats
1012    extensions 665; // RkpdClientOperation rkpd_client_operation
1013    extensions 666;  // RestrictedBluetoothDeviceNameReported restricted_bluetooth_device_name_reported
1014    extensions 667; // CredentialManagerTotalCandidateReported credential_manager_total_reported
1015    extensions 668; // CredentialManagerFinalNoUidReported credential_manager_finalnouid_reported
1016    extensions 669; // CredentialManagerGetProviderReported credential_manager_get_reported
1017    extensions 670; // CredentialManagerBrowsedAuthenticationClicked credential_manager_auth_click_reported
1018    extensions 671; // CredentialManagerApiV2Called credential_manager_apiv2_called
1019    extensions 672; // TestRestrictedAtomReported test_restricted_atom_reported
1020    extensions 673; // AdServicesMeasurementDelayedSourceRegistration ad_services_measurement_delayed_source_registration
1021    extensions 674; // AdServicesMeasurementAttribution ad_services_measurement_attribution
1022    extensions 675; // AdServicesMeasurementJobs ad_services_measurement_jobs
1023    extensions 676; // AdServicesMeasurementWipeout ad_services_measurement_wipeout
1024    extensions 679; // TvLowPowerStandbyPolicy tv_low_power_standby_policy
1025    extensions 680; // SoftApStarted softap_started
1026    extensions 681; // SoftApStopped softap_stopped
1027    extensions 682; // KeyboardConfigured keyboard_configured
1028    extensions 683; // KeyboardSystemsEventReported keyboard_systems_event_reported
1029    extensions 684; // MediaCodecRendered media_codec_rendered
1030    extensions 685; // InTaskActivityStarted in_task_activity_started
1031    extensions 686; // InputDeviceUsageReported inputdevice_usage_reported
1032    extensions 687; // WifiLockReleased wifi_lock_released
1033    extensions 688; // WifiLockDeactivated wifi_lock_deactivated
1034    extensions 689; // WifiConfigSaved wifi_config_saved
1035    extensions 690; // WifiAwareResourceUsingChanged wifi_aware_resource_using_changed
1036    extensions 691; // WifiAwareHalApiCalled wifi_aware_hal_api_called
1037    extensions 692; // WifiLocalOnlyRequestReceived wifi_local_only_request_received
1038    extensions 693; // WifiLocalOnlyRequestScanTriggered wifi_local_only_request_scan_triggered
1039    extensions 694; // WifiThreadTaskExecuted wifi_thread_task_executed
1040    extensions 696; // BluetoothProfileConnectionAttempted bluetooth_profile_connection_attempted
1041    extensions 700; // WifiStateChanged wifi_state_changed
1042    extensions 702; // AdServicesConsentMigrated ad_services_consent_migrated
1043    extensions 705; // DreamSettingChanged dream_setting_changed
1044    extensions 706; // AiWallpapersButtonPressed ai_wallpapers_button_pressed
1045    extensions 707; // AiWallpapersTemplateSelected ai_wallpapers_template_selected
1046    extensions 708; // AiWallpapersTermSelected ai_wallpapers_term_selected
1047    extensions 709; // AiWallpapersWallpaperSet ai_wallpapers_wallpaper_set
1048    extensions 710; // AiWallpapersSessionSummary ai_wallpapers_session_summary
1049    extensions 716; // LauncherImpressionEventV2 launcher_impression_event_v2
1050    extensions 718; // StylusPredictionMetricsReported stylus_prediction_metrics_reported
1051    extensions 729; // MediaProjectionStateChanged media_projection_state_changed
1052    extensions 730; // MediaProjectionTargetChanged media_projection_target_changed
1053    extensions 9999; // Atom9999 atom_9999
1054    // StatsdStats tracks platform atoms with ids up to 900.
1055    // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
1056
1057    // Pulled events will start at field 10000.
1058    // Next: 10192
1059    oneof pulled {
1060        WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
1061        WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
1062        MobileBytesTransfer mobile_bytes_transfer =
1063                10002 [(module) = "framework", (truncate_timestamp) = true];
1064        MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
1065                10003 [(module) = "framework", (truncate_timestamp) = true];
1066        BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
1067        KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
1068        SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "framework", (module) = "statsdtest"];
1069        CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
1070        CpuTimePerUidFreq cpu_time_per_uid_freq =
1071                10010 [(module) = "framework", (module) = "statsd"];
1072        WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
1073        ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
1074        BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
1075        ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
1076        SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
1077        SystemUptime system_uptime = 10015 [(module) = "framework"];
1078        CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
1079        CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
1080        DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
1081        RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
1082        FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
1083        Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
1084        BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
1085        BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
1086        LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
1087        DiskStats disk_stats = 10025 [(module) = "framework"];
1088        DirectoryUsage directory_usage = 10026 [(module) = "framework"];
1089        AppSize app_size = 10027 [(module) = "framework"];
1090        CategorySize category_size = 10028 [(module) = "framework"];
1091        ProcStats proc_stats = 10029 [(module) = "framework"];
1092        BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
1093        NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
1094        DiskIo disk_io = 10032 [(module) = "framework"];
1095        PowerProfile power_profile = 10033 [(module) = "framework"];
1096        ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
1097        ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
1098        CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
1099        OnDevicePowerMeasurement on_device_power_measurement = 10038 [(module) = "framework"];
1100        DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
1101        ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
1102        BatteryLevel battery_level = 10043 [(module) = "framework"];
1103        BuildInformation build_information = 10044 [(module) = "framework"];
1104        BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
1105        DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
1106        DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
1107        NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
1108        RoleHolder role_holder = 10049 [(module) = "framework"];
1109        DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
1110        TrainInfo train_info = 10051 [(module) = "statsd"];
1111        TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
1112        ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
1113        GpuStatsGlobalInfo gpu_stats_global_info = 10054;
1114        GpuStatsAppInfo gpu_stats_app_info = 10055;
1115        SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
1116        AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
1117        FaceSettings face_settings = 10058 [(module) = "framework"];
1118        CoolingDevice cooling_device = 10059 [(module) = "framework"];
1119        AppOps app_ops = 10060 [(module) = "framework"];
1120        ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
1121        SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
1122        SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
1123        ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
1124        VmsClientStats vms_client_stats = 10065 [(module) = "car"];
1125        NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
1126        DangerousPermissionStateSampled dangerous_permission_state_sampled =
1127                10067 [(module) = "framework"];
1128        GraphicsStats graphics_stats = 10068 [(module) = "hwui"];
1129        RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
1130        IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
1131        PackageNotificationPreferences package_notification_preferences =
1132                10071 [(module) = "framework"];
1133        PackageNotificationChannelPreferences package_notification_channel_preferences =
1134                10072 [(module) = "framework"];
1135        PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
1136                10073 [(module) = "framework"];
1137        GnssStats gnss_stats = 10074 [(module) = "framework"];
1138        AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
1139        VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
1140        VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
1141        SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
1142        SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
1143        SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
1144        BlobInfo blob_info = 10081 [(module) = "framework"];
1145        DataUsageBytesTransfer data_usage_bytes_transfer =
1146                10082 [(module) = "framework", (truncate_timestamp) = true];
1147        BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
1148                10083 [(module) = "framework", (truncate_timestamp) = true];
1149        dnd.DNDModeProto dnd_mode_rule = 10084 [(module) = "framework"];
1150        GeneralExternalStorageAccessStats general_external_storage_access_stats =
1151            10085 [(module) = "mediaprovider"];
1152        IncomingSms incoming_sms = 10086 [(module) = "telephony"];
1153        OutgoingSms outgoing_sms = 10087 [(module) = "telephony"];
1154        CarrierIdTableVersion carrier_id_table_version = 10088 [(module) = "telephony"];
1155        DataCallSession data_call_session = 10089 [(module) = "telephony"];
1156        CellularServiceState cellular_service_state = 10090 [(module) = "telephony"];
1157        CellularDataServiceSwitch cellular_data_service_switch = 10091 [(module) = "telephony"];
1158        SystemMemory system_memory = 10092 [(module) = "framework"];
1159        ImsRegistrationTermination ims_registration_termination = 10093 [(module) = "telephony"];
1160        ImsRegistrationStats ims_registration_stats = 10094 [(module) = "telephony"];
1161        CpuTimePerClusterFreq cpu_time_per_cluster_freq = 10095 [(module) = "framework"];
1162        CpuCyclesPerUidCluster cpu_cycles_per_uid_cluster = 10096 [(module) = "framework"];
1163        DeviceRotatedData device_rotated_data = 10097 [(module) = "framework"];
1164        CpuCyclesPerThreadGroupCluster cpu_cycles_per_thread_group_cluster = 10098 [(module) = "framework"];
1165        MediaDrmActivityInfo media_drm_activity_info = 10099 [(module) = "media_metrics"];
1166        OemManagedBytesTransfer oem_managed_bytes_transfer = 10100 [(module) = "framework"];
1167        GnssPowerStats gnss_power_stats = 10101 [(module) = "framework"];
1168        TimeZoneDetectorState time_zone_detector_state = 10102 [(module) = "framework"];
1169        Keystore2StorageStats keystore2_storage_stats = 10103 [(module) = "framework"];
1170        RkpPoolStats rkp_pool_stats = 10104 [deprecated = true];
1171        ProcessDmabufMemory process_dmabuf_memory = 10105 [(module) = "framework"];
1172        PendingAlarmInfo pending_alarm_info = 10106 [(module) = "framework"];
1173        UserLevelHibernatedApps user_level_hibernated_apps = 10107 [(module) = "framework"];
1174        sysui.LauncherLayoutSnapshot launcher_layout_snapshot = 10108
1175            [(module) = "sysui"];
1176        GlobalHibernatedApps global_hibernated_apps = 10109 [(module) = "framework"];
1177        input.InputEventLatencySketch input_event_latency_sketch = 10110 [(module) = "input"];
1178        BatteryUsageStatsBeforeReset battery_usage_stats_before_reset =
1179            10111 [(module) = "framework"];
1180        BatteryUsageStatsSinceReset battery_usage_stats_since_reset =
1181            10112 [(module) = "framework"];
1182        BatteryUsageStatsSinceResetUsingPowerProfileModel
1183            battery_usage_stats_since_reset_using_power_profile_model =
1184            10113 [(module) = "framework"];
1185        InstalledIncrementalPackage installed_incremental_package = 10114 [(module) = "framework"];
1186        TelephonyNetworkRequests telephony_network_requests =
1187            10115 [(module) = "telephony", deprecated = true];
1188        AppSearchStorageInfo app_search_storage_info = 10116 [(module) = "appsearch"];
1189        VmStat vmstat = 10117 [(module) = "framework"];
1190        Keystore2KeyCreationWithGeneralInfo keystore2_key_creation_with_general_info =
1191                10118 [(module) = "framework"];
1192        Keystore2KeyCreationWithAuthInfo keystore2_key_creation_with_auth_info =
1193                10119 [(module) = "framework"];
1194        Keystore2KeyCreationWithPurposeAndModesInfo
1195                keystore2_key_creation_with_purpose_and_modes_info = 10120 [(module) = "framework"];
1196        Keystore2AtomWithOverflow keystore2_atom_with_overflow = 10121 [(module) = "framework"];
1197        Keystore2KeyOperationWithPurposeAndModesInfo
1198                keystore2_key_operation_with_purpose_and_modes_info =
1199                        10122 [(module) = "framework"];
1200        Keystore2KeyOperationWithGeneralInfo keystore2_key_operation_with_general_info =
1201                10123 [(module) = "framework"];
1202        RkpErrorStats rkp_error_stats = 10124 [(module) = "framework"];
1203        Keystore2CrashStats keystore2_crash_stats = 10125 [(module) = "framework"];
1204        VendorApexInfo vendor_apex_info = 10126 [(module) = "framework"];
1205        AccessibilityShortcutStats accessibility_shortcut_stats = 10127 [(module) = "framework"];
1206        AccessibilityFloatingMenuStats accessibility_floating_menu_stats =
1207            10128 [(module) = "framework"];
1208        DataUsageBytesTransferV2 data_usage_bytes_transfer_v2 = 10129 [(module) = "framework",
1209                (truncate_timestamp) = true];
1210        MediaCapabilities media_capabilities = 10130 [(module) = "framework"];
1211        CarWatchdogSystemIoUsageSummary car_watchdog_system_io_usage_summary =
1212            10131 [(module) = "car"];
1213        CarWatchdogUidIoUsageSummary car_watchdog_uid_io_usage_summary = 10132 [(module) = "car"];
1214        ImsRegistrationFeatureTagStats ims_registration_feature_tag_stats =
1215                10133 [(module) = "telephony"];
1216        RcsClientProvisioningStats rcs_client_provisioning_stats =
1217                10134 [(module) = "telephony"];
1218        RcsAcsProvisioningStats rcs_acs_provisioning_stats =
1219                10135 [(module) = "telephony"];
1220        SipDelegateStats sip_delegate_stats = 10136 [(module) = "telephony"];
1221        SipTransportFeatureTagStats sip_transport_feature_tag_stats =
1222                10137 [(module) = "telephony"];
1223        SipMessageResponse sip_message_response = 10138 [(module) = "telephony"];
1224        SipTransportSession sip_transport_session = 10139 [(module) = "telephony"];
1225        ImsDedicatedBearerListenerEvent ims_dedicated_bearer_listener_event =
1226                10140 [(module) = "telephony"];
1227        ImsDedicatedBearerEvent ims_dedicated_bearer_event = 10141 [(module) = "telephony"];
1228        ImsRegistrationServiceDescStats ims_registration_service_desc_stats =
1229                10142 [(module) = "telephony"];
1230        UceEventStats uce_event_stats = 10143 [(module) = "telephony"];
1231        PresenceNotifyEvent presence_notify_event = 10144 [(module) = "telephony"];
1232        GbaEvent gba_event = 10145 [(module) = "telephony"];
1233        PerSimStatus per_sim_status = 10146 [(module) = "telephony"];
1234        GpuWorkPerUid gpu_work_per_uid = 10147;
1235        PersistentUriPermissionsAmountPerPackage persistent_uri_permissions_amount_per_package =
1236            10148 [(module) = "framework"];
1237        SignedPartitionInfo signed_partition_info = 10149 [(module) = "framework"];
1238        PinnedFileSizesPerPackage pinned_file_sizes_per_package = 10150
1239            [(module) = "framework"];
1240        PendingIntentsPerPackage pending_intents_per_package = 10151
1241            [(module) = "framework"];
1242        UserInfo user_info = 10152 [(module) = "framework"];
1243        TelephonyNetworkRequestsV2 telephony_network_requests_v2 = 10153 [(module) = "telephony"];
1244        DeviceTelephonyProperties device_telephony_properties = 10154 [(module) = "telephony"];
1245        RemoteKeyProvisioningErrorCounts remote_key_provisioning_error_counts = 10155 [deprecated = true];
1246        SafetyState safety_state = 10156 [(module) = "permissioncontroller"];
1247        IncomingMms incoming_mms = 10157 [(module) = "mms"];
1248        OutgoingMms outgoing_mms = 10158 [(module) = "mms"];
1249        SandboxSdkStorage sandbox_sdk_storage = 10159 [(module) = "sdksandbox"];
1250        MultiUserInfo multi_user_info = 10160 [(module) = "framework"];
1251        NetworkBpfMapInfo network_bpf_map_info = 10161 [(module) = "connectivity"];
1252        OutgoingShortCodeSms outgoing_short_code_sms = 10162 [(module) = "telephony"];
1253        ConnectivityStateSample connectivity_state_sample = 10163 [(module) = "connectivity"];
1254        NetworkSelectionRematchReasonsInfo network_selection_rematch_reasons_info = 10164 [(module) = "connectivity"];
1255        agif.GameModeInfo game_mode_info = 10165 [(module) = "framework"];
1256        agif.GameModeConfiguration game_mode_configuration = 10166 [(module) = "framework"];
1257        agif.GameModeListener game_mode_listener = 10167 [(module) = "framework"];
1258        NetworkSliceRequestCountSample network_slice_request_count = 10168 [(module) = "connectivity"];
1259        WsTileSnapshot ws_tile_snapshot = 10169 [(module) = "wearservices"];
1260        WsActiveWatchFaceComplicationSetSnapshot ws_active_watch_face_complication_set_snapshot = 10170 [(module) = "wearservices"];
1261        ProcessState process_state = 10171 [(module) = "framework"];
1262        ProcessAssociation process_association = 10172 [(module) = "framework"];
1263        adpf.ADPFSystemComponentInfo adpf_system_component_info = 10173 [(module) = "framework"];
1264        sysui.NotificationMemoryUse notification_memory_use = 10174 [(module) = "sysui"];
1265        display.HdrCapabilities hdr_capabilities = 10175 [(module) = "framework"];
1266        WsFavouriteWatchFaceListSnapshot ws_favourite_watch_face_list_snapshot = 10176 [(module) = "wearservices"];
1267    }
1268
1269    // Pulled atom extensions.
1270    // The atom definitions are under atoms/<feature>/<feature>_extension_atoms.proto
1271    extensions 10177; // QnsRatPreferenceMismatchInfo qns_rat_preference_mismatch_info
1272    extensions 10178; // QnsHandoverTimeMillis qns_handover_time_millis
1273    extensions 10179; // QnsHandoverPingpong qns_handover_pingpong
1274    extensions 10180; // EmergencyNumbersInfo emergency_numbers_info
1275    extensions 10181; // MteState mte_state
1276    extensions 10182; // SatelliteController satellite_controller
1277    extensions 10183; // SatelliteSession satellite_session
1278    extensions 10184; // SatelliteIncomingDatagram satellite_incoming_datagram
1279    extensions 10185; // SatelliteOutgoingDatagram satellite_outgoing_datagram
1280    extensions 10186; // SatelliteProvision satellite_provision
1281    extensions 10187; // SatelliteSosMessageRecommender satellite_sos_message_recommender
1282    extensions 10188; // UwbActivityInfo uwb_activity_info
1283    extensions 10189; // CachedAppsHighWaterMark cached_apps_high_watermark
1284    extensions 10190; // WifiAwareCapabilities wifi_aware_capabilities
1285    extensions 10191; // TouchpadUsage touchpad_usage
1286    extensions 10192; // DreamSettingSnapshot dream_setting_snapshot
1287    extensions 10193; // WifiModuleInfo wifi_module_info
1288    extensions 99999; // Atom99999 atom_99999
1289
1290    // DO NOT USE field numbers above 100,000 in AOSP.
1291    // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
1292    // Field numbers 200,000 and above are reserved for future use; do not use them at all.
1293    reserved 83, 360 to 363, 492, 597, 10008, 10036, 10040, 10041, 21004, 21005;
1294}
1295
1296/*
1297 * *****************************************************************************
1298 * Below are all of the individual atoms that are logged by Android via statsd.
1299 *
1300 * RULES:
1301 *   - The field ids for each atom must start at 1, and count upwards by 1.
1302 *     Skipping field ids is not allowed.
1303 *   - These form an API, so renaming, renumbering or removing fields is
1304 *     not allowed between android releases.  (This is not currently enforced,
1305 *     but there will be a tool to enforce this restriction).
1306 *   - The types must be built-in protocol buffer types, namely, no sub-messages
1307 *     are allowed (yet).  The bytes type is also not allowed.
1308 *   - The CamelCase name of the message type should match the
1309 *     underscore_separated name as defined in Atom.
1310 *   - If an atom represents work that can be attributed to an app, there can
1311 *     be exactly one AttributionChain field. It must be field number 1.
1312 *   - A field that is a uid should be a string field, tagged with the [xxx]
1313 *     annotation. The generated code on android will be represented by UIDs,
1314 *     and those UIDs will be translated in xxx to those strings.
1315 *
1316 * CONVENTIONS:
1317 *   - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
1318 *   - If there is a UID, it goes first. Think in an object-oriented fashion.
1319 * *****************************************************************************
1320 */
1321
1322/**
1323 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
1324 * Logs when the Thermal service HAL notifies the throttling start/stop events.
1325 *
1326 * Logged from:
1327 *   frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
1328 */
1329message ThermalThrottlingStateChanged {
1330    // The type of temperature being reported (CPU, GPU, SKIN, etc)
1331    optional android.os.TemperatureTypeEnum sensor_type = 1;
1332
1333    // Throttling state, this field is DEPRECATED
1334    enum State {
1335        UNKNOWN = 0;
1336        START = 1; // START indicated that throttling was triggered.
1337        STOP = 2; // STOP indicates that throttling was cleared.
1338    }
1339    optional State state = 2;
1340
1341    optional float temperature = 3;
1342}
1343
1344/**
1345 * Track transcoding service usage
1346 * Logged from:
1347 *   packages/providers/MediaProvider/src/com/android/providers/media/TranscodeHelper.java
1348 * Next Tag: 14
1349 */
1350message TranscodingData {
1351    // Reason that leads to the type of access.
1352    enum AccessReason {
1353        UNKNOWN = 0;
1354        SYSTEM_DEFAULT = 1; // Default option
1355        SYSTEM_CONFIG = 2;  // Server-side/on-device config
1356        APP_MANIFEST = 3;  // media_capabilites.xml
1357        APP_COMPAT = 4;   // App compat framework
1358        APP_EXTRA = 5;   // ApplicationMediaCapabilities API in open()
1359    }
1360
1361    // Causes that leads to the failure of transcode.
1362    enum FailureCause {
1363        CAUSE_UNKNOWN = 0;
1364        TRANSCODING_SERVICE_ERROR = 1;     // Error from transcoding service.
1365        TRANSCODING_CLIENT_TIMEOUT = 2;    // Timeout from MediaProvider.
1366        TRANSCODING_SESSION_CANCELED = 3; // MediaProvider cancels the transcode.
1367    }
1368
1369    enum AccessType {
1370        HEVC_WRITE = 1;
1371        READ_DIRECT = 2;
1372        READ_CACHE = 3;
1373        READ_TRANSCODE = 4;
1374        WRITE_CACHE = 5; // App trying to write to transcodeid avc file in cache, this is rare.
1375        AVC_WRITE = 6;
1376    }
1377
1378    enum Result {
1379        SUCCESS = 0;
1380        FAIL = 1;
1381        UNDEFINED = 2;
1382    }
1383
1384    optional string requestor_package = 1;
1385    optional AccessType access_type = 2;
1386    optional int64 file_size_bytes = 3;
1387    optional Result transcode_result = 4;
1388    optional int64 transcode_duration_millis = 5; // The duration of transcoding.
1389    optional int64 file_duration_millis = 6; // The duration of the video file.
1390    optional int64 file_framerate_fps = 7; // The framerate of the video file.
1391    optional AccessReason access_reason = 8;
1392    optional int64 width = 9;
1393    optional int64 height = 10;
1394    optional bool hit_anr = 11;
1395    optional FailureCause failure_cause = 12;   // This field is valid only when fails.
1396    optional int64 transcoding_service_error_code = 13; // Error code from transcoding service.
1397}
1398
1399/**
1400 * Logs when the screen state changes.
1401 *
1402 * Logged from:
1403 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1404 */
1405message ScreenStateChanged {
1406    // New screen state, from frameworks/proto_logging/stats/enums/view/enums.proto.
1407    optional android.view.DisplayStateEnum state = 1
1408            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
1409}
1410
1411/**
1412 * Part of the go/activity-security project. Logs information about activity
1413 * starts which would be blocked as part of the project.
1414 *
1415 * Logged from:
1416 *  - frameworks/base/services/core/java/com/android/server/wm/ActivityStarter.java
1417 *  - frameworks/base/services/core/java/com/android/server/wm/ActivityClientController.java
1418 */
1419message ActivityActionBlocked {
1420    enum Action {
1421        ACTION_UNSPECIFIED = 0;
1422        ACTIVITY_START_SAME_TASK = 1;
1423        ACTIVITY_START_DIFFERENT_TASK = 2;
1424        ACTIVITY_START_NEW_TASK = 3;
1425        FINISH_TASK = 4;
1426    }
1427    optional int32 caller_uid = 1 [(is_uid) = true];
1428    optional string caller_activity_class_name = 2;
1429    optional int32 target_task_top_activity_uid = 3 [(is_uid) = true];
1430    optional string target_task_top_activity_class_name = 4;
1431    optional bool target_task_is_different = 5;
1432    optional int32 target_activity_uid = 6 [(is_uid) = true];
1433    optional string target_activity_class_name = 7;
1434    optional string target_intent_action = 8;
1435    optional int32 target_intent_flags = 9;
1436
1437    optional Action action = 10;
1438    optional int32 version = 11;
1439    optional bool multi_window = 12;
1440    optional int32 bal_code = 13;
1441    optional string task_debug_info = 14;
1442}
1443
1444/**
1445 * Logs that the process state of the uid, as determined by ActivityManager
1446 * (i.e. the highest process state of that uid's processes) has changed.
1447 *
1448 * Logged from:
1449 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1450 */
1451message UidProcessStateChanged {
1452    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
1453
1454    // The state, from frameworks/proto_logging/stats/enums/app/enums.proto.
1455    optional android.app.ProcessStateEnum state = 2
1456            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
1457}
1458
1459/**
1460 * Logs process state change of a process, as per the activity manager.
1461 *
1462 * Logged from:
1463 *   frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
1464 */
1465message ProcessStateChanged {
1466    optional int32 uid = 1;
1467    optional string process_name = 2;
1468    optional string package_name = 3;
1469    // TODO: remove this when validation is done
1470    optional int64 version = 5;
1471    // The state, from frameworks/proto_logging/stats/enums/app/enums.proto.
1472    optional android.app.ProcessStateEnum state = 4;
1473}
1474
1475/**
1476 * Logs how long a process was in each of the states.
1477 */
1478message ProcessState {
1479  optional int32 uid = 1 [(is_uid) = true];
1480  optional string process_name = 2;
1481
1482  // Measurement period. Can be used as denominator.
1483  // The gauge duration is not representative because we want uptime and also
1484  // the measurement usually ends at a time earlier than pull time.
1485  optional int32 measurement_start_uptime_seconds = 3;
1486  optional int32 measurement_end_uptime_seconds = 4;
1487  optional int32 measurement_duration_uptime_seconds = 5;
1488
1489  // Individual state breakdowns, summing up to total process runtime.
1490  // Flattening (instead of a dimensions - value pair) for two reasons:
1491  // 1. Makes metric filtering possible (can pull the entire process data based
1492  //    on a specific value.
1493  // 2. More efficient to encode (proto id serves as dimension).
1494  optional int32 top_seconds = 6;
1495  optional int32 fgs_seconds = 7;
1496  optional int32 bound_top_seconds = 8;
1497  optional int32 bound_fgs_seconds = 9;
1498  optional int32 important_foreground_seconds = 10;
1499  optional int32 cached_seconds = 11;
1500  optional int32 frozen_seconds = 12;
1501  optional int32 other_seconds = 13;
1502}
1503
1504/**
1505 * Logs association between processes.
1506 */
1507message ProcessAssociation {
1508  optional int32 client_uid = 1 [(is_uid) = true];
1509
1510  // If we only care about the package name name we do not need to upload this
1511  // (even though we should add it to the atom for filtering / sharding)
1512  optional string client_process = 2;
1513
1514  optional int32 service_uid = 3 [(is_uid) = true];
1515
1516  optional string service_name = 4;
1517
1518  optional string service_process = 10;
1519
1520  // Measurement period. Can be used as denominator.
1521  // The gauge duration is not representative because we want uptime and also
1522  // the measurement usually ends at a time earlier than pull time.
1523  optional int32 measurement_start_uptime_seconds = 5;
1524  optional int32 measurement_end_uptime_seconds = 6;
1525  optional int32 measurement_duration_uptime_seconds = 7;
1526
1527  optional int32 duration_seconds = 8;
1528
1529  // Number of times this association was established.
1530  optional int32 count = 9;
1531}
1532
1533/**
1534 * Logs when ActivityManagerService sleep state is changed.
1535 *
1536 * Logged from:
1537 *   frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
1538 */
1539message ActivityManagerSleepStateChanged {
1540    // TODO: import frameworks proto
1541    enum State {
1542        UNKNOWN = 0;
1543        ASLEEP = 1;
1544        AWAKE = 2;
1545    }
1546    optional State state = 1
1547            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
1548}
1549
1550/**
1551 * Logs when system memory state changes.
1552 *
1553 * Logged from:
1554 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1555 */
1556message MemoryFactorStateChanged {
1557    // TODO: import frameworks proto
1558    enum State {
1559        MEMORY_UNKNOWN = 0;
1560        NORMAL = 1;     // normal.
1561        MODERATE = 2;   // moderate memory pressure.
1562        LOW = 3;        // low memory.
1563        CRITICAL = 4;   // critical memory.
1564
1565    }
1566    optional State factor = 1 [(state_field_option).exclusive_state = true];
1567}
1568
1569/**
1570 * Logs when app is using too much cpu, according to ActivityManagerService.
1571 *
1572 * Logged from:
1573 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1574 */
1575message ExcessiveCpuUsageReported {
1576    optional int32 uid = 1;
1577    optional string process_name = 2;
1578    optional string package_name = 3;
1579    // package version. TODO: remove this when validation is done
1580    optional int64 version = 4;
1581}
1582
1583/**
1584 * Logs when a cached process is killed, along with its pss.
1585 *
1586 * Logged from:
1587 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1588 */
1589message CachedKillReported {
1590    optional int32 uid = 1;
1591    optional string process_name = 2;
1592    optional string package_name = 3;
1593    // TODO: remove this when validation is done
1594    optional int64 version = 5;
1595    optional int64 pss = 4;
1596}
1597
1598/**
1599 * Logs the change in wifi health.
1600 *
1601 * Logged from:
1602 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
1603 */
1604message WifiHealthStatReported {
1605    enum Band {
1606        UNKNOWN = 0;
1607        // All of 2.4GHz band
1608        BAND_2G = 1;
1609        // Frequencies in the range of [5150, 5250) GHz
1610        BAND_5G_LOW = 2;
1611        // Frequencies in the range of [5250, 5725) GHz
1612        BAND_5G_MIDDLE = 3;
1613        // Frequencies in the range of [5725, 5850) GHz
1614        BAND_5G_HIGH = 4;
1615        // Frequencies in the range of [5925, 6425) GHz
1616        BAND_6G_LOW = 5;
1617        // Frequencies in the range of [6425, 6875) GHz
1618        BAND_6G_MIDDLE = 6;
1619        // Frequencies in the range of [6875, 7125) GHz
1620        BAND_6G_HIGH = 7;
1621    }
1622    // duration this stat is obtained over in milliseconds
1623    optional int32 duration_millis = 1;
1624    // whether wifi is classified as sufficient for the user's data traffic, determined
1625    // by whether the calculated throughput exceeds the average demand within |duration_millis|
1626    optional bool is_sufficient = 2;
1627    // whether cellular data is available
1628    optional bool is_cell_data_available = 3;
1629    // the Band bucket the connected network is on
1630    optional Band band = 4;
1631    // the Signal strength in the range of [-126, 0)
1632    optional int32 rssi = 5;
1633    // estimated tx throughput in kbps
1634    optional int32 tx_kbps = 6 [default = -1];
1635    // estimated rx throughput in kbps
1636    optional int32 rx_kbps = 7 [default = -1];
1637}
1638
1639/**
1640 * Logged when wifi detects a significant change in connection failure rate.
1641 *
1642 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
1643 *
1644 */
1645message WifiFailureStatReported {
1646    enum AbnormalityType {
1647        UNKNOWN = 0;
1648        SIGNIFICANT_INCREASE = 1;
1649        SIGNIFICANT_DECREASE = 2;
1650        SIMPLY_HIGH = 3;
1651    }
1652    enum FailureType {
1653        FAILURE_UNKNOWN = 0;
1654        FAILURE_CONNECTION = 1;
1655        FAILURE_ASSOCIATION_REJECTION = 2;
1656        FAILURE_ASSOCIATION_TIMEOUT = 3;
1657        FAILURE_AUTHENTICATION = 4;
1658        FAILURE_NON_LOCAL_DISCONNECTION = 5;
1659        FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
1660    }
1661    // Reason for uploading this stat
1662    optional AbnormalityType abnormality_type = 1;
1663    // The particular type of failure
1664    optional FailureType failure_type = 2;
1665    // How many times we have encountered this combination of AbnormalityType and FailureType
1666    optional int32 failure_count = 3;
1667}
1668
1669/**
1670 * Logs whether a Wifi connection attempt was successful and reasons for failure if it wasn't.
1671 *
1672 * Logged from:
1673 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
1674 */
1675message WifiConnectionResultReported {
1676    enum FailureCode {
1677        FAILURE_UNKNOWN = 0;
1678        FAILURE_ASSOCIATION_TIMEOUT = 1;
1679        FAILURE_ASSOCIATION_REJECTION = 2;
1680        FAILURE_AUTHENTICATION_GENERAL = 3;
1681        FAILURE_AUTHENTICATION_EAP = 4;
1682        FAILURE_DHCP = 5;
1683        FAILURE_NETWORK_DISCONNECTION = 6;
1684        FAILURE_ROAM_TIMEOUT = 7;
1685        FAILURE_WRONG_PASSWORD = 8;
1686        FAILURE_CONNECT_NETWORK_FAILED = 9;
1687        FAILURE_NEW_CONNECTION_ATTEMPT = 10;
1688        FAILURE_REDUNDANT_CONNECTION_ATTEMPT = 11;
1689        FAILURE_NETWORK_NOT_FOUND = 12;
1690        FAILURE_NO_RESPONSE = 13;
1691        FAILURE_OTHERS = 14;
1692    }
1693
1694    enum Trigger {
1695        UNKNOWN = 0;
1696        // Connection attempt was initiated manually.
1697        MANUAL = 1;
1698        // Automatic reconnection to the same network as connected previously.
1699        RECONNECT_SAME_NETWORK = 2;
1700        // Automatic reconnection to a saved network, but not the previous one.
1701        AUTOCONNECT_CONFIGURED_NETWORK = 3;
1702        // Automatic first connection attempt after device boot.
1703        AUTOCONNECT_BOOT = 4;
1704    }
1705
1706    // True represents a successful connection.
1707    optional bool connection_result = 1;
1708    // Reason for the connection failure.
1709    optional FailureCode failure_code = 2;
1710    // Scan RSSI before the connection attempt.
1711    optional int32 rssi = 3;
1712    // Time taken by this connection attempt.
1713    optional int32 connection_attempt_duration_millis = 4;
1714    // Band bucket the connected network is on.
1715    optional android.net.wifi.WifiBandBucket band = 5;
1716    // Authentication type.
1717    optional android.net.wifi.WifiAuthType auth_type = 6;
1718    // What triggered this connection attempt.
1719    optional Trigger trigger = 7;
1720    // Whether this network was used (successfully connected to) previously.
1721    optional bool network_used = 8;
1722    // Time taken from the last successful connection (or device boot if that's the first one).
1723    optional int32 time_since_last_connection_seconds = 9;
1724    // Whether the connection is carrier wifi.
1725    optional bool is_carrier_wifi = 10;
1726    // Whether the OOB pseeudonym is enabled for the current connection.
1727    optional bool is_oob_pseudonym_enabled = 11;
1728    // The client mode role for the connection, can use to determine the connection type.
1729    optional android.net.wifi.ClientModeRole role = 12;
1730}
1731
1732/**
1733 * Logs when a Wifi connection drops.
1734 *
1735 * Logged from:
1736 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
1737 */
1738message WifiDisconnectReported {
1739    enum FailureCode {
1740        UNKNOWN = 0;
1741
1742        // Wifi supplicant failure reason codes (IEEE Std 802.11-2016, 9.4.1.7, Table 9-45).
1743        // See ISupplicantStaIfaceCallback.java:ReasonCode
1744        UNSPECIFIED = 1;
1745        PREV_AUTH_NOT_VALID = 2;
1746        DEAUTH_LEAVING = 3;
1747        DISASSOC_DUE_TO_INACTIVITY = 4;
1748        DISASSOC_AP_BUSY = 5;
1749        CLASS2_FRAME_FROM_NONAUTH_STA = 6;
1750        CLASS3_FRAME_FROM_NONASSOC_STA = 7;
1751        DISASSOC_STA_HAS_LEFT = 8;
1752        STA_REQ_ASSOC_WITHOUT_AUTH = 9;
1753        PWR_CAPABILITY_NOT_VALID = 10;
1754        SUPPORTED_CHANNEL_NOT_VALID = 11;
1755        BSS_TRANSITION_DISASSOC = 12;
1756        INVALID_IE = 13;
1757        MICHAEL_MIC_FAILURE = 14;
1758        FOURWAY_HANDSHAKE_TIMEOUT = 15;
1759        GROUP_KEY_UPDATE_TIMEOUT = 16;
1760        IE_IN_4WAY_DIFFERS = 17;
1761        GROUP_CIPHER_NOT_VALID = 18;
1762        PAIRWISE_CIPHER_NOT_VALID = 19;
1763        AKMP_NOT_VALID = 20;
1764        UNSUPPORTED_RSN_IE_VERSION = 21;
1765        INVALID_RSN_IE_CAPAB = 22;
1766        IEEE_802_1X_AUTH_FAILED = 23;
1767        CIPHER_SUITE_REJECTED = 24;
1768        TDLS_TEARDOWN_UNREACHABLE = 25;
1769        TDLS_TEARDOWN_UNSPECIFIED = 26;
1770        SSP_REQUESTED_DISASSOC = 27;
1771        NO_SSP_ROAMING_AGREEMENT = 28;
1772        BAD_CIPHER_OR_AKM = 29;
1773        NOT_AUTHORIZED_THIS_LOCATION = 30;
1774        SERVICE_CHANGE_PRECLUDES_TS = 31;
1775        UNSPECIFIED_QOS_REASON = 32;
1776        NOT_ENOUGH_BANDWIDTH = 33;
1777        DISASSOC_LOW_ACK = 34;
1778        EXCEEDED_TXOP = 35;
1779        STA_LEAVING = 36;
1780        END_TS_BA_DLS = 37;
1781        UNKNOWN_TS_BA = 38;
1782        TIMEOUT = 39;
1783        PEERKEY_MISMATCH = 45;
1784        AUTHORIZED_ACCESS_LIMIT_REACHED = 46;
1785        EXTERNAL_SERVICE_REQUIREMENTS = 47;
1786        INVALID_FT_ACTION_FRAME_COUNT = 48;
1787        INVALID_PMKID = 49;
1788        INVALID_MDE = 50;
1789        INVALID_FTE = 51;
1790        MESH_PEERING_CANCELLED = 52;
1791        MESH_MAX_PEERS = 53;
1792        MESH_CONFIG_POLICY_VIOLATION = 54;
1793        MESH_CLOSE_RCVD = 55;
1794        MESH_MAX_RETRIES = 56;
1795        MESH_CONFIRM_TIMEOUT = 57;
1796        MESH_INVALID_GTK = 58;
1797        MESH_INCONSISTENT_PARAMS = 59;
1798        MESH_INVALID_SECURITY_CAP = 60;
1799        MESH_PATH_ERROR_NO_PROXY_INFO = 61;
1800        MESH_PATH_ERROR_NO_FORWARDING_INFO = 62;
1801        MESH_PATH_ERROR_DEST_UNREACHABLE = 63;
1802        MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64;
1803        MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65;
1804        MESH_CHANNEL_SWITCH_UNSPECIFIED = 66;
1805
1806        // ClientModeImpl error codes
1807        // Defined in /frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
1808        IFACE_DESTROYED = 10000;
1809        WIFI_DISABLED = 10001;
1810        SUPPLICANT_DISCONNECTED = 10002;
1811        CONNECTING_WATCHDOG_TIMER = 10003;
1812        ROAM_WATCHDOG_TIMER = 10004;
1813    }
1814
1815    // How long the session lasted from successful connection to disconnect.
1816    optional int32 connected_duration_seconds = 1;
1817
1818    // Reason for the disconnect.
1819    optional FailureCode failure_code = 2;
1820
1821    // Band bucket the connected network was on.
1822    optional android.net.wifi.WifiBandBucket band = 3;
1823
1824    // Authentication type.
1825    optional android.net.wifi.WifiAuthType auth_type = 4;
1826
1827    // Last seen RSSI before the disconnect.
1828    optional int32 last_rssi = 5;
1829
1830    // Last seen link speed before the disconnect.
1831    optional int32 last_link_speed = 6;
1832}
1833
1834/**
1835 * Logs when Wifi connection is established or dropped.
1836 *
1837 * Logged from:
1838 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
1839 */
1840message WifiConnectionStateChanged {
1841    optional bool is_connected = 1 [
1842            (state_field_option).exclusive_state = true];
1843
1844    // Band bucket the connected network was on.
1845    // Filled for both connected and disconnected cases.
1846    optional android.net.wifi.WifiBandBucket band = 2;
1847
1848    // Authentication type.
1849    // Filled for both connected and disconnected cases.
1850    optional android.net.wifi.WifiAuthType auth_type = 3;
1851}
1852
1853/**
1854 * Logged when wifi peer to peer connection happens
1855 */
1856message WifiP2pConnectionReported {
1857    enum Type {
1858        UNSPECIFIED = 0;
1859        // fresh new connection.
1860        FRESH = 1;
1861        // reinvoke a group.
1862        REINVOKE = 2;
1863        // create a group with the current device as the group owner locally.
1864        LOCAL = 3;
1865        // create a group or join a group with config.
1866        FAST = 4;
1867    }
1868    enum FailureCode {
1869        // Failure is unknown.
1870        UNKNOWN = 0;
1871        // No failure.
1872        NONE = 1;
1873        // Timeout for current connecting request.
1874        TIMEOUT = 2;
1875        // The connecting request is canceled by the user.
1876        CANCEL = 3;
1877        // Provision discovery failure, e.g. no pin code, timeout, rejected by the peer.
1878        PROV_DISC_FAIL = 4;
1879        // Invitation failure, e.g. rejected by the peer.
1880        INVITATION_FAIL = 5;
1881        // Incoming request is rejected by the user.
1882        USER_REJECT = 6;
1883        // New connection request is issued before ending previous connecting request.
1884        NEW_CONNECTION_ATTEMPT = 7;
1885        // Group has been removed
1886        GROUP_REMOVED = 8;
1887        // Creating group failed
1888        CREATE_GROUP_FAILED = 9;
1889    }
1890    enum GroupRole {
1891        GROUP_UNKNOWN = 0;
1892        GROUP_OWNER = 1;
1893        GROUP_CLIENT = 2;
1894    }
1895    enum Band {
1896        // Unknown band/frequency
1897        BAND_UNKNOWN = 0;
1898        // any band
1899        BAND_AUTO = 1;
1900        // With 2G band
1901        BAND_2G = 2;
1902        // With 5G band
1903        BAND_5G = 3;
1904        // With 6G band
1905        BAND_6G = 4;
1906        // With a specific frequency
1907        BAND_FREQUENCY = 5;
1908    }
1909    // Type of the connection.
1910    optional Type type = 1;
1911    // Duration to connect in millis.
1912    optional int32 latency_ms= 2;
1913    // Duration to connect in step size of 200 millis.
1914    optional int32 latency_200ms= 3;
1915    // Failure code
1916    optional FailureCode failure_code = 4;
1917    // Group role. This could be unknown with connect() call when the WifiConfig doesn't have the
1918    // credential.
1919    optional GroupRole group_role = 5;
1920    // Group band preference
1921    optional Band band = 6;
1922    // Group frequency in MHz if positive. Otherwise, no frequency preference.
1923    optional int32 frequency_mhz = 7;
1924    // STA mode channel frequency. 0 means unknown.
1925    optional int32 sta_frequency_mhz = 8;
1926    // The uid of the app that initiates the connection.
1927    optional int32 uid = 9 [(is_uid) = true];
1928    // if the country code is in the world mode
1929    optional bool is_country_code_world_mode = 10;
1930    // fallback to negotiation if device receives invitation response status code "information is
1931    // currently unavailable"
1932    optional bool fallback_to_negotiation_on_invite_status_info_unavailable = 11;
1933    // The try count of connection
1934    optional int32 try_count = 12;
1935}
1936
1937/**
1938 * Logged when wifi setup failure or crash reported
1939 */
1940message WifiSetupFailureCrashReported {
1941    enum Type {
1942        UNKNOWN = 0;
1943        // Wifi HAL crash
1944        HAL_CRASH = 1;
1945        // Wificond crash
1946        WIFICOND_CRASH = 2;
1947        // Supplicant crash
1948        SUPPLICANT_CRASH = 3;
1949        // hostapd crash
1950        HOSTAPD_CRASH = 4;
1951        // HAL error on WifiNative.setupInterfaceForClientMode
1952        CLIENT_FAILURE_HAL = 5;
1953        // Wificond error on WifiNative.setupInterfaceForClientMode
1954        CLIENT_FAILURE_WIFICOND = 6;
1955        // Supplicant error on WifiNative.setupInterfaceForClientMode
1956        CLIENT_FAILURE_SUPPLICANT = 7;
1957        // HAL error on WifiNative.setupInterfaceForSoftApMode
1958        SOFT_AP_FAILURE_HAL = 8;
1959        // Wificond error on WifiNative.setupInterfaceForSoftApMode
1960        SOFT_AP_FAILURE_WIFICOND = 9;
1961        // Hostapd error on WifiNative.setupInterfaceForSoftApMode
1962        SOFT_AP_FAILURE_HOSTAPD = 10;
1963        // HAL error on WifiP2pNative.setupInterface
1964        P2P_FAILURE_HAL = 11;
1965        // Supplicant error on WifiP2pNative.setupInterface
1966        P2P_FAILURE_SUPPLICANT = 12;
1967    }
1968    // Type of failure
1969    optional Type type= 1;
1970}
1971
1972
1973/*
1974 * Logs metrics on bedtime mode state changed
1975 *
1976 * Logged From:
1977 *  frameworks/opt/wear/src/com/google/android/clockwork/healthservices/BedtimeModeController.java
1978*/
1979message BedtimeModeStateChanged {
1980    enum BedTimeModeState {
1981        BEDTIME_OFF = 0;
1982        BEDTIME_ON = 1;
1983    }
1984    // Log the bedtime mode state
1985    optional BedTimeModeState bedtime_mode_state = 1;
1986    enum State {
1987        OFF = 0;
1988        ON = 1;
1989    }
1990    // Current Wifi state when bedtime mode is toggled
1991    optional State current_wifi_state = 2;
1992
1993    // Current LTE state when bedtime mode is toggled
1994    optional State current_cellular_state = 3;
1995
1996    // Current BT state when bedtime mode is toggled
1997    optional State current_bluetooth_state = 4;
1998
1999    // Current Battery level. Should be in [0, 100].
2000    optional int32 battery_level = 5;
2001}
2002
2003/**
2004 * Logs when memory stats of a process is reported.
2005 *
2006 * Logged from:
2007 *   frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
2008 */
2009message ProcessMemoryStatReported {
2010    optional int32 uid = 1;
2011    optional string process_name = 2;
2012    optional string package_name = 3;
2013    //TODO: remove this when validation is done
2014    optional int64 version = 9;
2015    optional int64 pss = 4;
2016    optional int64 uss = 5;
2017    optional int64 rss = 6;
2018    enum Type {
2019        ADD_PSS_INTERNAL_SINGLE = 0;
2020        ADD_PSS_INTERNAL_ALL_MEM = 1;
2021        ADD_PSS_INTERNAL_ALL_POLL = 2;
2022        ADD_PSS_EXTERNAL = 3;
2023        ADD_PSS_EXTERNAL_SLOW = 4;
2024    }
2025    optional Type type = 7;
2026    optional int64 duration_millis = 8;
2027
2028    // The types of the components this process is hosting at the moment this
2029    // snapshot is taken.
2030    // See the available types in HostingComponentType in AppProtoEnums.
2031    optional int32 current_hosting_component_types = 10;
2032
2033    // The historical types of the components this process is or was hosting
2034    // since it's born.
2035    // See the available types in HostingComponentType in AppProtoEnums.
2036    optional int32 historical_hosting_component_types = 11;
2037}
2038
2039/**
2040 * Logs that a process started, finished, crashed, or ANRed.
2041 *
2042 * Logged from:
2043 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2044 */
2045message ProcessLifeCycleStateChanged {
2046    optional int32 uid = 1 [(is_uid) = true];
2047
2048    // The process name (usually same as the app name).
2049    optional string process_name = 2;
2050
2051    // What lifecycle state the process changed to.
2052    // This enum is specific to atoms.proto.
2053    enum State {
2054        FINISHED = 0;
2055        STARTED = 1;
2056        CRASHED = 2;
2057    }
2058    optional State state = 3;
2059}
2060
2061/**
2062 * Logs when the ble scan state changes.
2063 *
2064 * Logged from:
2065 *   packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
2066 */
2067message BleScanStateChanged {
2068    repeated AttributionNode attribution_node = 1
2069            [(state_field_option).primary_field_first_uid = true];
2070
2071    enum State {
2072        OFF = 0;
2073        ON = 1;
2074        // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
2075        RESET = 2;
2076    }
2077    optional State state = 2 [
2078        (state_field_option).exclusive_state = true,
2079        (state_field_option).default_state_value = 0 /* State.OFF */,
2080        (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
2081        (state_field_option).nested = true
2082    ];
2083
2084    // Does the scan have a filter.
2085    optional bool is_filtered = 3 [(state_field_option).primary_field = true];
2086    // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
2087    optional bool is_first_match = 4 [(state_field_option).primary_field = true];
2088    // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
2089    optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
2090}
2091
2092/**
2093 * Logs reporting of a ble scan finding results.
2094 *
2095 * Logged from:
2096 *   packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
2097 */
2098// TODO: Consider also tracking per-scanner-id.
2099message BleScanResultReceived {
2100    repeated AttributionNode attribution_node = 1;
2101
2102    // Number of ble scan results returned.
2103    optional int32 num_results = 2;
2104}
2105
2106/**
2107 * Logs when a sensor state changes.
2108 *
2109 * Logged from:
2110 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2111 */
2112message SensorStateChanged {
2113    repeated AttributionNode attribution_node = 1;
2114
2115    // The id (int) of the sensor.
2116    optional int32 sensor_id = 2;
2117
2118    enum State {
2119        OFF = 0;
2120        ON = 1;
2121    }
2122    optional State state = 3;
2123}
2124
2125/**
2126 * Logs when GPS signal quality.
2127 *
2128 * Logged from:
2129 *   /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
2130 */
2131message GpsSignalQualityChanged {
2132    optional android.server.location.GpsSignalQualityEnum level = 1;
2133}
2134
2135
2136/**
2137 * Logs when a sync manager sync state changes.
2138 *
2139 * Logged from:
2140 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2141 */
2142message SyncStateChanged {
2143    repeated AttributionNode attribution_node = 1;
2144
2145    // Name of the sync (as named in the app). Can be chosen at run-time.
2146    optional string sync_name = 2;
2147
2148    enum State {
2149        OFF = 0;
2150        ON = 1;
2151    }
2152    optional State state = 3;
2153}
2154
2155/*
2156 * Deferred job stats.
2157 *
2158 * Logged from:
2159 *   frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
2160*/
2161message DeferredJobStatsReported {
2162    repeated AttributionNode attribution_node = 1;
2163
2164    // Number of jobs deferred.
2165    optional int32 num_jobs_deferred = 2;
2166
2167    // Time since the last job runs.
2168    optional int64 time_since_last_job_millis = 3;
2169}
2170
2171/**
2172 * Logs when a job scheduler job state changes.
2173 *
2174 * Logged from:
2175 *   frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
2176 *   frameworks/base/services/core/java/com/android/server/job/JobServiceContext.java
2177 *
2178 * Next tag: 41
2179 */
2180message ScheduledJobStateChanged {
2181    repeated AttributionNode attribution_node = 1;
2182
2183    // Name of the job (as named in the app)
2184    optional string job_name = 2;
2185
2186    enum State {
2187        // A job started executing (passed through the STARTED state) and has finished.
2188        FINISHED = 0;
2189        // A scheduled job has just started executing.
2190        STARTED = 1;
2191        // An app just scheduled this job to be executed at some point in the future.
2192        SCHEDULED = 2;
2193        // The job was SCHEDULED but cancelled before it started executing (so it never went
2194        // through the STARTED state).
2195        CANCELLED = 3;
2196    }
2197    optional State state = 3;
2198
2199    // The internal reason a job has stopped.
2200    // This is only applicable when the state is FINISHED.
2201    // The default value is INTERNAL_STOP_REASON_UNKNOWN.
2202    optional android.app.job.InternalStopReasonEnum internal_stop_reason = 4;
2203
2204    // The publicly returned reason onStopJob() was called.
2205    // This is only applicable when the state is FINISHED, but may be undefined if
2206    // JobService.onStopJob() was never called for the job.
2207    // The default value is STOP_REASON_UNDEFINED.
2208    optional android.app.job.StopReasonEnum public_stop_reason = 17;
2209
2210    // The standby bucket of the app that scheduled the job. These match the framework constants
2211    // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
2212    // already assigned 0.
2213    enum Bucket {
2214        UNKNOWN = -1;
2215        ACTIVE = 0;
2216        WORKING_SET = 1;
2217        FREQUENT = 2;
2218        RARE = 3;
2219        NEVER = 4;
2220        RESTRICTED = 5;
2221        EXEMPTED = 6;
2222    }
2223    optional Bucket standby_bucket = 5 [default = UNKNOWN];
2224
2225    // On T- builds, this is the job id (as assigned by the app).
2226    // On U+ builds, this is generated by the system, factoring in the job's namespace.
2227    optional int64 job_id = 6;
2228
2229    // One flag for each of the API constraints defined by JobScheduler. Does not include implicit
2230    // constraints as they are always assumed to be set.
2231    optional bool has_charging_constraint = 7;
2232    optional bool has_battery_not_low_constraint = 8;
2233    optional bool has_storage_not_low_constraint = 9;
2234    optional bool has_timing_delay_constraint = 10;
2235    optional bool has_deadline_constraint = 11;
2236    optional bool has_idle_constraint = 12;
2237    optional bool has_connectivity_constraint = 13;
2238    optional bool has_content_trigger_constraint = 14;
2239    optional bool is_prefetch = 18;
2240    optional bool is_periodic = 34;
2241
2242    // True if the app has requested this run as an expedited job.
2243    optional bool is_requested_expedited_job = 15;
2244    // True if the job is running as an expedited job. Only valid for STARTED and FINISHED states.
2245    optional bool is_running_as_expedited_job = 16;
2246
2247    // True if the app has requested this run as a user initiated job.
2248    optional bool is_requested_as_user_initiated_job = 32;
2249    // True if the job is running as a user initiated job. Only valid for STARTED/FINISHED states.
2250    optional bool is_running_as_user_initiated_job = 33;
2251
2252    // The priority set by the app (via JobInfo.Builder.setPriority()).
2253    optional int32 requested_priority = 19;
2254    // The priority JobScheduler ran the job at. Only valid for STARTED and FINISHED states.
2255    optional int32 effective_priority = 20;
2256
2257    // Number of times JobScheduler has tried to run this particular job. This value is incremented
2258    // when a job is stopped and rescheduled for various reasons (lost network, constraints no
2259    // longer satisfied, etc). For periodic jobs, this value is reset after a successful run.
2260    optional int32 num_previous_attempts = 21;
2261
2262    // The deadline that the Job has requested.
2263    // This is only valid if has_deadline_constraint is true.
2264    optional int64 deadline_ms = 22;
2265
2266    // The delay that the Job has requested.
2267    // This is only valid if has_timing_delay_constraint is true.
2268    optional int64 delay_ms = 35;
2269
2270    // True if the Job hit its deadline
2271    optional bool is_deadline_constraint_satisfied = 23;
2272
2273    optional bool is_charging_constraint_satisfied = 24;
2274
2275    optional bool is_battery_not_low_constraint_satisfied = 25;
2276
2277    optional bool is_storage_not_low_constraint_satisfied = 26;
2278
2279    optional bool is_timing_delay_constraint_satisfied = 27;
2280
2281    optional bool is_idle_constraint_satisfied = 28;
2282
2283    optional bool is_connectivity_constraint_satisfied = 29;
2284
2285    optional bool is_content_trigger_constraint_satisfied = 30;
2286
2287    // The amount of time that elapsed between the job being scheduled (state = SCHEDULED)
2288    // and it being started (state = STARTED). Persisted jobs loaded at boot are considered
2289    // to be scheduled at boot, so all values are within the current boot cycle. Periodic
2290    // and other rescheduled jobs are considered to be newly scheduled and therefore this
2291    // value reflects the time since the most recent (re)schedule.
2292    // This is only valid for the STARTED and FINISHED states.
2293    optional int64 job_start_latency_ms = 31;
2294
2295    // The amount of data the app estimated it would download.
2296    // This is only valid if has_connectivity_constraint is true.
2297    // If the job has JobWorkItems attached, this value will include the estimates from the items.
2298    optional int64 estimated_download_bytes = 36;
2299
2300    // The amount of data the app estimated it would upload.
2301    // This is only valid if has_connectivity_constraint is true.
2302    // If the job has JobWorkItems attached, this value will include the estimates from the items.
2303    optional int64 estimated_upload_bytes = 37;
2304
2305    // The number of JobWorkItems the app has attached to this job but not completed
2306    // (by calling JobParameters.completeWork()).
2307    optional int32 num_uncompleted_work_items = 38;
2308
2309    // Proc state of the UID of the logged event
2310    optional android.app.ProcessStateEnum proc_state = 39 [default = PROCESS_STATE_UNKNOWN];
2311
2312    // Hash of the namespace set via JobScheduler.forNamespace(String).
2313    optional string namespace_hash = 40;
2314}
2315
2316/**
2317 * Logs when the audio state changes.
2318 *
2319 * Logged from:
2320 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2321 */
2322message AudioStateChanged {
2323    repeated AttributionNode attribution_node = 1;
2324
2325    enum State {
2326        OFF = 0;
2327        ON = 1;
2328        // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
2329        RESET = 2;
2330    }
2331    optional State state = 2;
2332}
2333
2334/**
2335 * Logs when the video codec state changes.
2336 *
2337 * Logged from:
2338 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2339 */
2340message MediaCodecStateChanged {
2341    repeated AttributionNode attribution_node = 1;
2342
2343    enum State {
2344        OFF = 0;
2345        ON = 1;
2346        // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
2347        RESET = 2;
2348    }
2349    optional State state = 2;
2350}
2351
2352/**
2353 * Logs when the flashlight state changes.
2354 *
2355 * Logged from:
2356 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2357 */
2358message FlashlightStateChanged {
2359    repeated AttributionNode attribution_node = 1;
2360
2361    enum State {
2362        OFF = 0;
2363        ON = 1;
2364        // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
2365        RESET = 2;
2366    }
2367    optional State state = 2;
2368}
2369
2370/**
2371 * Logs when the camera state changes.
2372 *
2373 * Logged from:
2374 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2375 */
2376message CameraStateChanged {
2377    repeated AttributionNode attribution_node = 1;
2378
2379    enum State {
2380        OFF = 0;
2381        ON = 1;
2382        // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
2383        RESET = 2;
2384    }
2385    optional State state = 2;
2386}
2387
2388/**
2389 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
2390 *
2391 * Logged from:
2392 *   TODO
2393 */
2394message WakelockStateChanged {
2395    repeated AttributionNode attribution_node = 1
2396            [(state_field_option).primary_field_first_uid = true];
2397
2398    // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
2399    // From frameworks/proto_logging/stats/enums/os/enums.proto.
2400    optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
2401
2402    // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
2403    optional string tag = 3 [(state_field_option).primary_field = true];
2404
2405    enum State {
2406        RELEASE = 0;
2407        ACQUIRE = 1;
2408        CHANGE_RELEASE = 2;
2409        CHANGE_ACQUIRE = 3;
2410    }
2411    optional State state = 4 [
2412        (state_field_option).exclusive_state = true,
2413        (state_field_option).default_state_value = 0,
2414        (state_field_option).nested = true
2415    ];
2416
2417    optional android.app.ProcessStateEnum process_state = 5 [default = PROCESS_STATE_UNKNOWN];
2418}
2419
2420/**
2421 * Logs when a partial wakelock is considered 'long' (over 1 min).
2422 *
2423 * Logged from:
2424 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2425 */
2426message LongPartialWakelockStateChanged {
2427    repeated AttributionNode attribution_node = 1;
2428
2429    // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
2430    optional string tag = 2;
2431
2432    // TODO: I have no idea what this is.
2433    optional string history_tag = 3;
2434
2435    enum State {
2436        OFF = 0;
2437        ON = 1;
2438    }
2439    optional State state = 4;
2440}
2441
2442/**
2443 * Logs when the device is interactive, according to the PowerManager Notifier.
2444 *
2445 * Logged from:
2446 *   frameworks/base/services/core/java/com/android/server/power/Notifier.java
2447 */
2448message InteractiveStateChanged {
2449    enum State {
2450        OFF = 0;
2451        ON = 1;
2452    }
2453    optional State state = 1;
2454}
2455
2456/**
2457 * Logs Battery Saver state change.
2458 *
2459 * Logged from:
2460 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2461 */
2462message BatterySaverModeStateChanged {
2463    enum State {
2464        OFF = 0;
2465        ON = 1;
2466    }
2467    optional State state = 1
2468            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2469}
2470
2471/**
2472 * Logs Doze mode state change.
2473 *
2474 * Logged from:
2475 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2476 */
2477message DeviceIdleModeStateChanged {
2478    optional android.server.DeviceIdleModeEnum state = 1
2479            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2480}
2481
2482
2483/**
2484 * Logs state change of Doze mode including maintenance windows.
2485 *
2486 * Logged from:
2487 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2488 */
2489message DeviceIdlingModeStateChanged {
2490    optional android.server.DeviceIdleModeEnum state = 1
2491            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2492}
2493
2494/**
2495 * Logs screen brightness level.
2496 *
2497 * Logged from:
2498 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2499 */
2500message ScreenBrightnessChanged {
2501    // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
2502    optional int32 level = 1;
2503}
2504
2505/**
2506 * Logs battery level (percent full, from 0 to 100).
2507 *
2508 * Logged from:
2509 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2510 */
2511message BatteryLevelChanged {
2512    // Battery level. Should be in [0, 100].
2513    optional int32 battery_level = 1;
2514}
2515
2516/**
2517 * Logs change in charging status of the device.
2518 *
2519 * Logged from:
2520 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2521 */
2522message ChargingStateChanged {
2523    // State of the battery, from frameworks/proto_logging/stats/enums/os/enums.proto.
2524    optional android.os.BatteryStatusEnum state = 1
2525            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2526}
2527
2528/**
2529 * Logs whether the device is plugged in, and what power source it is using.
2530 *
2531 * Logged from:
2532 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2533 */
2534message PluggedStateChanged {
2535    // Whether the device is plugged in, from frameworks/proto_logging/stats/enums/os/enums.proto.
2536    optional android.os.BatteryPluggedStateEnum state = 1
2537            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2538}
2539
2540/**
2541 * Logs whether the device is docked, and what type of dock it is using.
2542 *
2543 * Logged from:
2544 *   services/core/java/com/android/server/power/PowerManagerService.java
2545 */
2546message DockStateChanged {
2547    // The device dock state, from frameworks/proto_logging/stats/enums/server/enums.proto.
2548    optional android.server.DockStateEnum state = 1
2549    [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2550}
2551
2552/**
2553 * Logs when an app's wakeup alarm fires.
2554 *
2555 * Logged from:
2556 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2557 */
2558message WakeupAlarmOccurred {
2559    repeated AttributionNode attribution_node = 1;
2560
2561    // Name of the wakeup alarm.
2562    optional string tag = 2;
2563
2564    // Name of source package (for historical reasons, since BatteryStats tracked it).
2565    optional string package_name = 3;
2566
2567    // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
2568    optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
2569}
2570
2571/**
2572 * Logs when an an app causes the mobile radio to change state.
2573 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
2574 *
2575 * Logged from:
2576 *   frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
2577 */
2578message MobileRadioPowerStateChanged {
2579    repeated AttributionNode attribution_node = 1;
2580
2581    // Power state, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
2582    optional android.telephony.DataConnectionPowerStateEnum state = 2;
2583}
2584
2585/**
2586 * Logs when an an app causes the wifi radio to change state.
2587 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
2588 *
2589 * Logged from:
2590 *   frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
2591 */
2592message WifiRadioPowerStateChanged {
2593    repeated AttributionNode attribution_node = 1;
2594
2595    // Power state, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
2596    optional android.telephony.DataConnectionPowerStateEnum state = 2;
2597}
2598
2599/**
2600 * Logs kernel wakeup reasons and aborts.
2601 *
2602 * Logged from:
2603 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2604 */
2605message KernelWakeupReported {
2606    // Name of the kernel wakeup reason (or abort).
2607    optional string wakeup_reason_name = 1;
2608
2609    // Duration (in microseconds) for the wake-up interrupt to be serviced.
2610    optional int64 duration_micros = 2;
2611
2612    // The elapsed time when this wake-up was reported.
2613    optional int64 elapsed_millis = 3;
2614}
2615
2616/**
2617 * Logs when Wifi is toggled on/off.
2618 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
2619 *
2620 * Logged from:
2621 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2622 */
2623message WifiEnabledStateChanged {
2624    enum State {
2625        OFF = 0;
2626        ON = 1;
2627    }
2628    optional State state = 1;
2629}
2630
2631/**
2632 * This atom is deprecated starting in R.
2633 *
2634 * Logs when an app causes Wifi to run. In this context, 'to run' means to use Wifi Client Mode.
2635 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
2636 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
2637 *
2638 * Logged from:
2639 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2640 */
2641message WifiRunningStateChanged {
2642    repeated AttributionNode attribution_node = 1;
2643
2644    enum State {
2645        OFF = 0;
2646        ON = 1;
2647    }
2648    optional State state = 2;
2649}
2650
2651/**
2652 * Logs wifi locks held by an app.
2653 *
2654 * Logged from:
2655 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2656 */
2657message WifiLockStateChanged {
2658    repeated AttributionNode attribution_node = 1;
2659
2660    enum State {
2661        OFF = 0;
2662        ON = 1;
2663    }
2664    optional State state = 2;
2665
2666    // WifiLock type, from frameworks/proto_logging/stats/enums/wifi/enums.proto.
2667    optional android.net.wifi.WifiModeEnum mode = 3;
2668}
2669
2670/**
2671 * Logs wifi signal strength changes.
2672 *
2673 * Logged from:
2674 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
2675 */
2676message WifiSignalStrengthChanged {
2677    // Signal strength, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
2678    optional android.telephony.SignalStrengthEnum signal_strength = 1;
2679}
2680
2681/**
2682 * Logs wifi scans performed by an app.
2683 *
2684 * Logged from:
2685 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
2686 */
2687message WifiScanStateChanged {
2688    repeated AttributionNode attribution_node = 1;
2689
2690    enum State {
2691        OFF = 0;
2692        ON = 1;
2693    }
2694    optional State state = 2;
2695}
2696
2697/**
2698 * Logs wifi multicast locks held by an app
2699 *
2700 * Logged from:
2701 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
2702 */
2703message WifiMulticastLockStateChanged {
2704    repeated AttributionNode attribution_node = 1;
2705
2706    enum State {
2707        OFF = 0;
2708        ON = 1;
2709    }
2710    optional State state = 2;
2711
2712    optional string tag = 3;
2713}
2714
2715/**
2716 * Logs shutdown reason and duration on next boot.
2717 *
2718 * Logged from:
2719 *   frameworks/base/core/java/com/android/server/BootReceiver.java
2720 */
2721message ShutdownSequenceReported {
2722    // True if shutdown is for a reboot. Default: false if we do not know.
2723    optional bool reboot = 1;
2724
2725    // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
2726    optional string reason = 2;
2727
2728    // Beginning of shutdown time in ms using wall clock time since unix epoch.
2729    // Default: 0 if no start time received.
2730    optional int64 start_time_millis = 3;
2731
2732    // Duration of shutdown in ms. Default: 0 if no duration received.
2733    optional int64 duration_millis = 4;
2734}
2735
2736
2737/**
2738 * Logs boot reason and duration.
2739 *
2740 * Logged from:
2741 *   system/core/bootstat/bootstat.cpp
2742 */
2743message BootSequenceReported {
2744    // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
2745    // Default: "<EMPTY>" if not available.
2746    optional string bootloader_reason = 1;
2747
2748    // Reason for system boot. Eg. bootloader, reboot,userrequested
2749    // Default: "<EMPTY>" if not available.
2750    optional string system_reason = 2;
2751
2752    // End of boot time in ms from unix epoch using system wall clock.
2753    optional int64 end_time_millis = 3;
2754
2755    // Total boot duration in ms.
2756    optional int64 total_duration_millis = 4;
2757
2758    // Bootloader duration in ms.
2759    optional int64 bootloader_duration_millis = 5;
2760
2761    // Time since last boot in ms. Default: 0 if not available.
2762    optional int64 time_since_last_boot = 6;
2763}
2764
2765
2766/**
2767 * Logs call state and disconnect cause (if applicable).
2768 *
2769 * Logged from:
2770 *   packages/services/Telecomm/src/com/android/server/telecom/Call.java
2771 */
2772message CallStateChanged {
2773    // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
2774    // From frameworks/proto_logging/stats/enums/telecomm/enums.proto.
2775    optional android.telecom.CallStateEnum call_state = 1;
2776
2777    // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
2778    // This value is only applicable when the call_state is DISCONNECTED, and
2779    // should always be UNKNOWN if the call_state is not DISCONNECTED.
2780    // From frameworks/proto_logging/stats/enums/telecomm/enums.proto.
2781    optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
2782
2783    // True if the call is self-managed, which are apps that use the
2784    // telecom infrastructure to make their own calls.
2785    optional bool self_managed = 3;
2786
2787    // True if call is external. External calls are calls on connected Wear
2788    // devices but show up in Telecom so the user can pull them onto the device.
2789    optional bool external_call = 4;
2790
2791    // True if call is emergency call.
2792    optional bool emergency_call = 5;
2793
2794    // UID of the package that has initiated the call.
2795    optional int32 uid = 6 [(is_uid) = true];
2796
2797    // Elapsed time between CALL_STATE_ACTIVE to CALL_STATE_DISCONNECTED.
2798    // This value is only applicable when the call_state is DISCONNECTED,
2799    // 0 otherwise.
2800    optional int32 duration_seconds = 7;
2801
2802    // Number of all existing calls when this call is created.
2803    optional int32 existing_call_count = 8;
2804
2805    // Number of existing calls held by this call.
2806    // This value is set after a call is actually held, 0 otherwise.
2807    optional int32 held_call_count = 9;
2808
2809    // The reason the call hasn't been started by device condition.
2810    // This value is only applicable when the call_state is DISCONNECTED,
2811    // and should always be NONE if the call_state is not DISCONNECTED.
2812    // From frameworks/base/core/proto/android/telecomm/enums.proto.
2813    optional android.telecom.CallFailureCauseEnum start_fail_cause = 10;
2814}
2815
2816/*
2817 * Logs changes to the configuration of the device. The configuration is defined
2818 * in frameworks/base/core/java/android/content/res/Configuration.java
2819 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
2820 * Please go there to interpret the possible values each field can be.
2821 *
2822 * Logged from:
2823 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2824 */
2825message ResourceConfigurationChanged {
2826    // Bit mask of color capabilities of the screen.
2827    // Contains information about the color gamut and hdr mode of the screen.
2828    // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
2829    optional int32 color_mode = 1;
2830
2831    // The target screen density being rendered to.
2832    // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
2833    optional int32 density_dpi = 2;
2834
2835    // Current user preference for the scaling factor for fonts,
2836    // relative to the base density scaling.
2837    // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
2838    optional float font_scale = 3;
2839
2840    // Flag indicating whether the hard keyboard is hidden.
2841    // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
2842    optional int32 hard_keyboard_hidden = 4;
2843
2844    // The type of keyboard attached to the device.
2845    // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
2846    optional int32 keyboard = 5;
2847
2848    // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
2849    // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
2850    optional int32 keyboard_hidden = 6;
2851
2852    // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
2853    // 0 if undefined.
2854    // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
2855    optional int32 mcc = 7;
2856
2857    // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
2858    // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
2859    // MNC_ZERO symbol defined in Configuration.java.
2860    // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
2861    optional int32 mnc = 8;
2862
2863    // The kind of navigation available on the device.
2864    // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
2865    optional int32 navigation = 9;
2866
2867    // Flag indicating whether the navigation is available.
2868    // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
2869    optional int32 navigation_hidden = 10;
2870
2871    // Overall orientation of the screen.
2872    // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
2873    optional int32 orientation = 11;
2874
2875    // The current height of the available screen space, in dp units.
2876    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
2877    optional int32 screen_height_dp = 12;
2878
2879    // Bit mask of overall layout of the screen.
2880    // Contains information about screen size, whether the screen is wider/taller
2881    // than normal, whether the screen layout is right-tl-left or left-to-right,
2882    // and whether the screen has a rounded shape.
2883    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
2884    optional int32 screen_layout = 13;
2885
2886    // Current width of the available screen space, in dp units.
2887    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
2888    optional int32 screen_width_dp = 14;
2889
2890    // The smallest screen size an application will see in normal operation.
2891    // This is the smallest value of both screenWidthDp and screenHeightDp
2892    // in portrait and landscape.
2893    // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
2894    optional int32 smallest_screen_width_dp = 15;
2895
2896    // The type of touch screen attached to the device.
2897    // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
2898    optional int32 touchscreen = 16;
2899
2900    // Bit mask of the ui mode.
2901    // Contains information about the overall ui mode of the device.
2902    // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
2903    // Also contains information about whether the device is in night mode.
2904    // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
2905    optional int32 ui_mode = 17;
2906}
2907
2908
2909/**
2910 * Logs changes in the connection state of the mobile radio.
2911 *
2912 * Logged from:
2913 *    frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
2914 */
2915message MobileConnectionStateChanged {
2916    // States are from the state machine DataConnection.java.
2917    enum State {
2918        UNKNOWN = 0;
2919        // The connection is inactive, or disconnected.
2920        INACTIVE = 1;
2921        // The connection is being activated, or connecting.
2922        ACTIVATING = 2;
2923        // The connection is active, or connected.
2924        ACTIVE = 3;
2925        // The connection is disconnecting.
2926        DISCONNECTING = 4;
2927        // The connection is disconnecting after creating a connection.
2928        DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
2929    }
2930    optional State state  = 1;
2931    // For multi-sim phones, this distinguishes between the sim cards.
2932    optional int32 sim_slot_index = 2;
2933    // Used to identify the connection. Starts at 0 and increments by 1 for
2934    // every new network created. Resets whenever the device reboots.
2935    optional int32 data_connection_id = 3;
2936    // A bitmask for the capabilities of this connection.
2937    // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
2938    // Default value (if we have no information): 0
2939    optional int64 capabilities = 4;
2940    // If this connection has internet.
2941    // This just checks if the DEFAULT bit of capabilities is set.
2942    optional bool has_internet = 5;
2943}
2944
2945/**
2946 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
2947 *
2948 * Logged from:
2949 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
2950 */
2951message MobileRadioTechnologyChanged {
2952    optional android.telephony.NetworkTypeEnum state = 1;
2953    // For multi-sim phones, this distinguishes between the sim cards.
2954    optional int32 sim_slot_index = 2;
2955}
2956
2957/**
2958 * Logs the VID and PID of any connected USB devices.
2959 *
2960 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
2961 *
2962 * Logged by Vendor.
2963 */
2964message UsbDeviceAttached {
2965    optional int32 vid = 1;
2966    optional int32 pid = 2;
2967    optional bool has_audio = 3;
2968    optional bool has_hid = 4;
2969    optional bool has_storage = 5;
2970    enum State {
2971        STATE_DISCONNECTED = 0;
2972        STATE_CONNECTED = 1;
2973    }
2974    optional State state = 6;
2975    optional int64 last_connect_duration_millis = 7;
2976}
2977
2978
2979/**
2980 * Logs when Bluetooth is enabled and disabled.
2981 *
2982 * Logged from:
2983 *   services/core/java/com/android/server/BluetoothManagerService.java
2984 */
2985message BluetoothEnabledStateChanged {
2986    repeated AttributionNode attribution_node = 1;
2987    // Whether or not bluetooth is enabled on the device.
2988    enum State {
2989        UNKNOWN = 0;
2990        ENABLED = 1;
2991        DISABLED = 2;
2992    }
2993    optional State state = 2;
2994    // The reason for being enabled/disabled.
2995    // Eg. Airplane mode, crash, application request.
2996    optional android.bluetooth.EnableDisableReasonEnum reason = 3;
2997    // If the reason is an application request, this will be the package name.
2998    optional string pkg_name = 4;
2999}
3000
3001/**
3002 * Logs when profiles on a Bluetooth device connects and disconnects.
3003 *
3004 * Logged from:
3005 *    packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
3006 *
3007 * Next Tag: 6
3008 */
3009message BluetoothConnectionStateChanged {
3010    // The state of the connection.
3011    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
3012    optional android.bluetooth.ConnectionStateEnum state = 1;
3013    // An identifier that can be used to match connect and disconnect events.
3014    // Currently is last two bytes of a hash of a device level ID and
3015    // the mac address of the bluetooth device that is connected.
3016    // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
3017    optional int32 obfuscated_id = 2 [deprecated = true];
3018    // The profile that is connected. Eg. GATT, A2DP, HEADSET.
3019    // From android.bluetooth.BluetoothAdapter.java
3020    // Default: 0 when not used
3021    optional int32 bt_profile = 3;
3022    // An identifier that can be used to match events for this device.
3023    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3024    // Salt: Randomly generated 256 bit value
3025    // Hash algorithm: HMAC-SHA256
3026    // Size: 32 byte
3027    // Default: null or empty if the device identifier is not known
3028    optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
3029    // An identifier that can be used to match events for this device.
3030    // The incremental identifier is locally generated and guaranteed not derived
3031    // from any globally unique hardware id.
3032    // For paired devices, it stays consistent between Bluetooth toggling for the
3033    // same remote device.
3034    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3035    // session for the same remote device.
3036    // Default: 0 if the device's metric id is unknown.
3037    optional int32 metric_id = 5;
3038    // An index to group connection events by session. It's a counter generated by
3039    // each profile. e.g. Gatt server generate such id to identify Gatt apps
3040    optional int32 session_index = 6;
3041    // An identifier that indicates the connection failure reason
3042    optional int32 connection_reason = 7;
3043}
3044
3045/**
3046 * Logs when a Bluetooth device connects and disconnects over ACL
3047 *
3048 * Logged from:
3049 *    packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
3050 *
3051 * Next Tag: 4
3052 */
3053message BluetoothAclConnectionStateChanged {
3054    // An identifier that can be used to match events for this device.
3055    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3056    // Salt: Randomly generated 256 bit value
3057    // Hash algorithm: HMAC-SHA256
3058    // Size: 32 byte
3059    // Default: null or empty if the device identifier is not known
3060    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3061    // The state of the connection.
3062    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
3063    optional android.bluetooth.ConnectionStateEnum state = 2;
3064    // An identifier that can be used to match events for this device.
3065    // The incremental identifier is locally generated and guaranteed not derived
3066    // from any globally unique hardware id.
3067    // For paired devices, it stays consistent between Bluetooth toggling for the
3068    // same remote device.
3069    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3070    // session for the same remote device.
3071    // Default: 0 if the device's metric id is unknown.
3072    optional int32 metric_id = 3;
3073    // Used transport of this event.
3074    optional android.bluetooth.TransportTypeEnum transport = 4;
3075}
3076
3077/**
3078 * Logs when a Bluetooth device connects and disconnects over SCO
3079 *
3080 * Logged from:
3081 *    packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
3082 *    packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
3083 *
3084 * Next Tag: 5
3085 */
3086message BluetoothScoConnectionStateChanged {
3087    // An identifier that can be used to match events for this device.
3088    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3089    // Salt: Randomly generated 256 bit value
3090    // Hash algorithm: HMAC-SHA256
3091    // Size: 32 byte
3092    // Default: null or empty if the device identifier is not known
3093    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3094    // The state of the connection.
3095    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
3096    optional android.bluetooth.ConnectionStateEnum state = 2;
3097    // Codec used for this SCO connection
3098    // Default: UNKNOWN
3099    optional android.bluetooth.hfp.ScoCodec codec = 3;
3100    // An identifier that can be used to match events for this device.
3101    // The incremental identifier is locally generated and guaranteed not derived
3102    // from any globally unique hardware id.
3103    // For paired devices, it stays consistent between Bluetooth toggling for the
3104    // same remote device.
3105    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3106    // session for the same remote device.
3107    // Default: 0 if the device's metric id is unknown.
3108    optional int32 metric_id = 4;
3109}
3110
3111/**
3112 * Logged when active device of a profile changes
3113 *
3114 * Logged from:
3115 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
3116 *     packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
3117 *     packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
3118 */
3119message BluetoothActiveDeviceChanged {
3120    // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
3121    // From android.bluetooth.BluetoothProfile
3122    optional int32 bt_profile = 1;
3123    // An identifier that can be used to match events for this new active device.
3124    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3125    // Salt: Randomly generated 256 bit value
3126    // Hash algorithm: HMAC-SHA256
3127    // Size: 32 byte
3128    // Default: null or empty if there is no active device for this profile
3129    optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
3130    // An identifier that can be used to match events for this device.
3131    // The incremental identifier is locally generated and guaranteed not derived
3132    // from any globally unique hardware id.
3133    // For paired devices, it stays consistent between Bluetooth toggling for the
3134    // same remote device.
3135    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3136    // session for the same remote device.
3137    // Default: 0 if the device's metric id is unknown.
3138    optional int32 metric_id = 3;
3139}
3140
3141// Logs when there is an event affecting Bluetooth device's link layer connection.
3142// - This event is triggered when there is a related HCI command or event
3143// - Users of this metrics can deduce Bluetooth device's connection state from these events
3144// - HCI commands are logged before the command is sent, after receiving command status, and after
3145//   receiving command complete
3146// - HCI events are logged when they arrive
3147//
3148// Low level log from system/bt
3149//
3150// Bluetooth classic commands:
3151// - CMD_CREATE_CONNECTION
3152// - CMD_DISCONNECT
3153// - CMD_CREATE_CONNECTION_CANCEL
3154// - CMD_ACCEPT_CONNECTION_REQUEST
3155// - CMD_REJECT_CONNECTION_REQUEST
3156// - CMD_SETUP_ESCO_CONNECTION
3157// - CMD_ACCEPT_ESCO_CONNECTION
3158// - CMD_REJECT_ESCO_CONNECTION
3159// - CMD_ENH_SETUP_ESCO_CONNECTION
3160// - CMD_ENH_ACCEPT_ESCO_CONNECTION
3161//
3162// Bluetooth low energy commands:
3163// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
3164// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
3165// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
3166// - CMD_BLE_CLEAR_WHITE_LIST
3167// - CMD_BLE_ADD_WHITE_LIST
3168// - CMD_BLE_REMOVE_WHITE_LIST
3169//
3170// Bluetooth classic events:
3171// - EVT_CONNECTION_COMP
3172// - EVT_CONNECTION_REQUEST
3173// - EVT_DISCONNECTION_COMP
3174// - EVT_ESCO_CONNECTION_COMP
3175// - EVT_ESCO_CONNECTION_CHANGED
3176//
3177// Bluetooth low energy meta events:
3178// - BLE_EVT_CONN_COMPLETE_EVT
3179// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
3180//
3181// Next tag: 10
3182message BluetoothLinkLayerConnectionEvent {
3183    // An identifier that can be used to match events for this device.
3184    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3185    // Salt: Randomly generated 256 bit value
3186    // Hash algorithm: HMAC-SHA256
3187    // Size: 32 byte
3188    // Default: null or empty if the device identifier is not known
3189    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3190    // Connection handle of this connection if available
3191    // Range: 0x0000 - 0x0EFF (12 bits)
3192    // Default: 0xFFFF if the handle is unknown
3193    optional int32 connection_handle = 2;
3194    // Direction of the link
3195    // Default: DIRECTION_UNKNOWN
3196    optional android.bluetooth.DirectionEnum direction = 3;
3197    // Type of this link
3198    // Default: LINK_TYPE_UNKNOWN
3199    optional android.bluetooth.LinkTypeEnum type = 4;
3200
3201    // Reason metadata for this link layer connection event, rules for interpretation:
3202    // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
3203    //    EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
3204    // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
3205    //    set and valid, ignore hci_ble_event
3206
3207    // HCI command associated with this event
3208    // Default: CMD_UNKNOWN
3209    optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
3210    // HCI event associated with this event
3211    // Default: EVT_UNKNOWN
3212    optional android.bluetooth.hci.EventEnum hci_event = 6;
3213    // HCI BLE meta event associated with this event
3214    // Default: BLE_EVT_UNKNOWN
3215    optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
3216    // HCI command status code if this is triggerred by hci_cmd
3217    // Default: STATUS_UNKNOWN
3218    optional android.bluetooth.hci.StatusEnum cmd_status = 8;
3219    // HCI reason code associated with this event
3220    // Default: STATUS_UNKNOWN
3221    optional android.bluetooth.hci.StatusEnum reason_code = 9;
3222    // An identifier that can be used to match events for this device.
3223    // The incremental identifier is locally generated and guaranteed not derived
3224    // from any globally unique hardware id.
3225    // For paired devices, it stays consistent between Bluetooth toggling for the
3226    // same remote device.
3227    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3228    // session for the same remote device.
3229    // Default: 0 if the device's metric id is unknown.
3230    optional int32 metric_id = 10;
3231}
3232
3233/**
3234 * Logs when a module is rolled back by Watchdog.
3235 *
3236 * Logged from: Rollback Manager
3237 */
3238message WatchdogRollbackOccurred {
3239    enum RollbackType {
3240        UNKNOWN = 0;
3241        ROLLBACK_INITIATE = 1;
3242        ROLLBACK_SUCCESS = 2;
3243        ROLLBACK_FAILURE = 3;
3244        ROLLBACK_BOOT_TRIGGERED = 4;
3245    }
3246    optional RollbackType rollback_type = 1;
3247
3248    optional string package_name = 2;
3249
3250    optional int32 package_version_code = 3;
3251
3252    enum RollbackReasonType {
3253        REASON_UNKNOWN = 0;
3254        REASON_NATIVE_CRASH = 1;
3255        REASON_EXPLICIT_HEALTH_CHECK = 2;
3256        REASON_APP_CRASH = 3;
3257        REASON_APP_NOT_RESPONDING = 4;
3258        REASON_NATIVE_CRASH_DURING_BOOT = 5;
3259    }
3260    optional RollbackReasonType rollback_reason = 4;
3261
3262    // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
3263    // is initiated. Empty if the package is unknown.
3264    optional string failing_package_name = 5;
3265
3266    optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
3267}
3268
3269/**
3270 * Logs when there is a change in Bluetooth A2DP playback state
3271 *
3272 * Logged from:
3273 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
3274 */
3275message BluetoothA2dpPlaybackStateChanged {
3276    // An identifier that can be used to match events for this device.
3277    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3278    // Salt: Randomly generated 256 bit value
3279    // Hash algorithm: HMAC-SHA256
3280    // Size: 32 byte
3281    // Default: null or empty if the device identifier is not known
3282    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3283    // Current playback state
3284    // Default: PLAYBACK_STATE_UNKNOWN
3285    optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
3286    // Current audio coding mode
3287    // Default: AUDIO_CODING_MODE_UNKNOWN
3288    optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
3289    // An identifier that can be used to match events for this device.
3290    // The incremental identifier is locally generated and guaranteed not derived
3291    // from any globally unique hardware id.
3292    // For paired devices, it stays consistent between Bluetooth toggling for the
3293    // same remote device.
3294    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3295    // session for the same remote device.
3296    // Default: 0 if the device's metric id is unknown.
3297    optional int32 metric_id = 4;
3298}
3299
3300/**
3301 * Logs when there is a change in A2DP codec config for a particular remote device
3302 *
3303 * Logged from:
3304 *     frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
3305 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
3306 */
3307message BluetoothA2dpCodecConfigChanged {
3308    // An identifier that can be used to match events for this device.
3309    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3310    // Salt: Randomly generated 256 bit value
3311    // Hash algorithm: HMAC-SHA256
3312    // Size: 32 byte
3313    // Default: null or empty if the device identifier is not known
3314    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3315    // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
3316    // Default SOURCE_CODEC_TYPE_INVALID
3317    optional int32 codec_type = 2;
3318    // Codec priroity, the higher the more preferred, -1 for disabled
3319    // Default: CODEC_PRIORITY_DEFAULT
3320    optional int32 codec_priority = 3;
3321    // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
3322    // Default: SAMPLE_RATE_NONE
3323    optional int32 sample_rate = 4;
3324    // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
3325    // Default: BITS_PER_SAMPLE_NONE
3326    optional int32 bits_per_sample = 5;
3327    // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
3328    // Default: CHANNEL_MODE_NONE
3329    optional int32 channel_mode = 6;
3330    // Codec specific values
3331    // Default 0
3332    optional int64 codec_specific_1 = 7;
3333    optional int64 codec_specific_2 = 8;
3334    optional int64 codec_specific_3 = 9;
3335    optional int64 codec_specific_4 = 10;
3336    // An identifier that can be used to match events for this device.
3337    // The incremental identifier is locally generated and guaranteed not derived
3338    // from any globally unique hardware id.
3339    // For paired devices, it stays consistent between Bluetooth toggling for the
3340    // same remote device.
3341    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3342    // session for the same remote device.
3343    // Default: 0 if the device's metric id is unknown.
3344    optional int32 metric_id = 11;
3345}
3346
3347/**
3348 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
3349 * Each codec's capability is logged separately due to statsd restriction
3350 *
3351 * Logged from:
3352 *     frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
3353 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
3354 */
3355message BluetoothA2dpCodecCapabilityChanged {
3356    // An identifier that can be used to match events for this device.
3357    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3358    // Salt: Randomly generated 256 bit value
3359    // Hash algorithm: HMAC-SHA256
3360    // Size: 32 byte
3361    // Default: null or empty if the device identifier is not known
3362    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3363    // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
3364    // Default SOURCE_CODEC_TYPE_INVALID
3365    optional int32 codec_type = 2;
3366    // Codec priroity, the higher the more preferred, -1 for disabled
3367    // Default: CODEC_PRIORITY_DEFAULT
3368    optional int32 codec_priority = 3;
3369    // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
3370    // in BluetoothCodecConfig
3371    // Default: empty and SAMPLE_RATE_NONE for individual item
3372    optional int32 sample_rate = 4;
3373    // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
3374    // in BluetoothCodecConfig
3375    // Default: empty and BITS_PER_SAMPLE_NONE for individual item
3376    optional int32 bits_per_sample = 5;
3377    // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
3378    // BluetoothCodecConfig
3379    // Default: empty and CHANNEL_MODE_NONE for individual item
3380    optional int32 channel_mode = 6;
3381    // Codec specific values
3382    // Default 0
3383    optional int64 codec_specific_1 = 7;
3384    optional int64 codec_specific_2 = 8;
3385    optional int64 codec_specific_3 = 9;
3386    optional int64 codec_specific_4 = 10;
3387    // An identifier that can be used to match events for this device.
3388    // The incremental identifier is locally generated and guaranteed not derived
3389    // from any globally unique hardware id.
3390    // For paired devices, it stays consistent between Bluetooth toggling for the
3391    // same remote device.
3392    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3393    // session for the same remote device.
3394    // Default: 0 if the device's metric id is unknown.
3395    optional int32 metric_id = 11;
3396}
3397
3398/**
3399 * Logs when A2DP failed to read from PCM source.
3400 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
3401 *
3402 * Logged from:
3403 *     system/bt
3404 */
3405message BluetoothA2dpAudioUnderrunReported {
3406    // An identifier that can be used to match events for this device.
3407    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3408    // Salt: Randomly generated 256 bit value
3409    // Hash algorithm: HMAC-SHA256
3410    // Size: 32 byte
3411    // Default: null or empty if the device identifier is not known
3412    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3413    // Encoding interval in nanoseconds
3414    // Default: 0
3415    optional int64 encoding_interval_nanos = 2;
3416    // Number of bytes of PCM data that could not be read from the source
3417    // Default: 0
3418    optional int32 num_missing_pcm_bytes = 3;
3419    // An identifier that can be used to match events for this device.
3420    // The incremental identifier is locally generated and guaranteed not derived
3421    // from any globally unique hardware id.
3422    // For paired devices, it stays consistent between Bluetooth toggling for the
3423    // same remote device.
3424    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3425    // session for the same remote device.
3426    // Default: 0 if the device's metric id is unknown.
3427    optional int32 metric_id = 4;
3428}
3429
3430/**
3431 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
3432 * buffer queue is full and we have to drop data
3433 *
3434 * Logged from:
3435 *     system/bt
3436 */
3437message BluetoothA2dpAudioOverrunReported {
3438    // An identifier that can be used to match events for this device.
3439    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3440    // Salt: Randomly generated 256 bit value
3441    // Hash algorithm: HMAC-SHA256
3442    // Size: 32 byte
3443    // Default: null or empty if the device identifier is not known
3444    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3445    // Encoding interval in nanoseconds
3446    // Default: 0
3447    optional int64 encoding_interval_nanos = 2;
3448    // Number of buffers dropped in this event
3449    // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
3450    // Default: 0
3451    optional int32 num_dropped_buffers = 3;
3452    // Number of encoded buffers dropped in this event
3453    // Default 0
3454    optional int32 num_dropped_encoded_frames = 4;
3455    // Number of encoded bytes dropped in this event
3456    // Default: 0
3457    optional int32 num_dropped_encoded_bytes = 5;
3458    // An identifier that can be used to match events for this device.
3459    // The incremental identifier is locally generated and guaranteed not derived
3460    // from any globally unique hardware id.
3461    // For paired devices, it stays consistent between Bluetooth toggling for the
3462    // same remote device.
3463    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3464    // session for the same remote device.
3465    // Default: 0 if the device's metric id is unknown.
3466    optional int32 metric_id = 6;
3467}
3468
3469/**
3470 * Logs when we receive reports regarding a device's RSSI value
3471 *
3472 * Logged from:
3473 *     system/bt
3474 */
3475message BluetoothDeviceRssiReported {
3476    // An identifier that can be used to match events for this device.
3477    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3478    // Salt: Randomly generated 256 bit value
3479    // Hash algorithm: HMAC-SHA256
3480    // Size: 32 byte
3481    // Default: null or empty if the device identifier is not known
3482    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3483    // Connection handle of this connection if available
3484    // Range: 0x0000 - 0x0EFF (12 bits)
3485    // Default: 0xFFFF if the handle is unknown
3486    optional int32 connection_handle = 2;
3487    // HCI command status code if this is triggerred by hci_cmd
3488    // Default: STATUS_UNKNOWN
3489    optional android.bluetooth.hci.StatusEnum hci_status = 3;
3490    // BR/EDR
3491    //   Range: -128 ≤ N ≤ 127 (signed integer)
3492    //   Units: dB
3493    // LE:
3494    //   Range: -127 to 20, 127 (signed integer)
3495    //   Units: dBm
3496    // Invalid when an out of range value is reported
3497    optional int32 rssi = 4;
3498    // An identifier that can be used to match events for this device.
3499    // The incremental identifier is locally generated and guaranteed not derived
3500    // from any globally unique hardware id.
3501    // For paired devices, it stays consistent between Bluetooth toggling for the
3502    // same remote device.
3503    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3504    // session for the same remote device.
3505    // Default: 0 if the device's metric id is unknown.
3506    optional int32 metric_id = 5;
3507}
3508
3509/**
3510 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
3511 *
3512 * Logged from:
3513 *     system/bt
3514 */
3515message BluetoothDeviceFailedContactCounterReported {
3516    // An identifier that can be used to match events for this device.
3517    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3518    // Salt: Randomly generated 256 bit value
3519    // Hash algorithm: HMAC-SHA256
3520    // Size: 32 byte
3521    // Default: null or empty if the device identifier is not known
3522    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3523    // Connection handle of this connection if available
3524    // Range: 0x0000 - 0x0EFF (12 bits)
3525    // Default: 0xFFFF if the handle is unknown
3526    optional int32 connection_handle = 2;
3527    // HCI command status code if this is triggerred by hci_cmd
3528    // Default: STATUS_UNKNOWN
3529    optional android.bluetooth.hci.StatusEnum cmd_status = 3;
3530    // Number of consecutive failed contacts for a connection corresponding to the Handle
3531    // Range: uint16_t, 0-0xFFFF
3532    // Default: 0xFFFFF
3533    optional int32 failed_contact_counter = 4;
3534    // An identifier that can be used to match events for this device.
3535    // The incremental identifier is locally generated and guaranteed not derived
3536    // from any globally unique hardware id.
3537    // For paired devices, it stays consistent between Bluetooth toggling for the
3538    // same remote device.
3539    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3540    // session for the same remote device.
3541    // Default: 0 if the device's metric id is unknown.
3542    optional int32 metric_id = 5;
3543}
3544
3545/**
3546 * Logs when we receive reports regarding the tranmit power level used for a specific connection
3547 *
3548 * Logged from:
3549 *     system/bt
3550 */
3551message BluetoothDeviceTxPowerLevelReported {
3552    // An identifier that can be used to match events for this device.
3553    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3554    // Salt: Randomly generated 256 bit value
3555    // Hash algorithm: HMAC-SHA256
3556    // Size: 32 byte
3557    // Default: null or empty if the device identifier is not known
3558    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3559    // Connection handle of this connection if available
3560    // Range: 0x0000 - 0x0EFF (12 bits)
3561    // Default: 0xFFFF if the handle is unknown
3562    optional int32 connection_handle = 2;
3563    // HCI command status code if this is triggered by hci_cmd
3564    // Default: STATUS_UNKNOWN
3565    optional android.bluetooth.hci.StatusEnum hci_status = 3;
3566    // Range: -30 ≤ N ≤ 20
3567    // Units: dBm
3568    // Invalid when an out of range value is reported
3569    optional int32 transmit_power_level = 4;
3570    // An identifier that can be used to match events for this device.
3571    // The incremental identifier is locally generated and guaranteed not derived
3572    // from any globally unique hardware id.
3573    // For paired devices, it stays consistent between Bluetooth toggling for the
3574    // same remote device.
3575    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3576    // session for the same remote device.
3577    // Default: 0 if the device's metric id is unknown.
3578    optional int32 metric_id = 5;
3579}
3580
3581/**
3582 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
3583 * receiving an HCI command from the host
3584 *
3585 * Logged from: system/bt
3586 */
3587message BluetoothHciTimeoutReported {
3588    // HCI command associated with this event
3589    // Default: CMD_UNKNOWN
3590    optional android.bluetooth.hci.CommandEnum hci_command = 1;
3591}
3592
3593/**
3594 * Logs when we receive Bluetooth Link Quality Report event from the controller
3595 * See Android Bluetooth HCI specification for more details
3596 *
3597 * Note: all count and bytes field are counted since last event
3598 *
3599 * Logged from: system/bt
3600 */
3601message BluetoothQualityReportReported {
3602    // Quality report ID
3603    // Original type: uint8_t
3604    // Default: BQR_ID_UNKNOWN
3605    optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
3606    // Packet type of the connection
3607    // Original type: uint8_t
3608    // Default: BQR_PACKET_TYPE_UNKNOWN
3609    optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
3610    // Connection handle of the connection
3611    // Original type: uint16_t
3612    optional int32 connection_handle = 3;
3613    // Performing Role for the connection
3614    // Original type: uint8_t
3615    optional int32 connection_role = 4;
3616    // Current Transmit Power Level for the connection. This value is the same as the controller's
3617    // response to the HCI_Read_Transmit_Power_Level HCI command
3618    // Original type: uint8_t
3619    optional int32 tx_power_level = 5;
3620    // Received Signal Strength Indication (RSSI) value for the connection. This value is an
3621    // absolute receiver signal strength value
3622    // Original type: int8_t
3623    optional int32 rssi = 6;
3624    // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
3625    // channels used by the link currently
3626    // Original type: uint8_t
3627    optional int32 snr = 7;
3628    // Indicates the number of unused channels in AFH_channel_map
3629    // Original type: uint8_t
3630    optional int32 unused_afh_channel_count = 8;
3631    // Indicates the number of the channels which are interfered and quality is bad but are still
3632    // selected for AFH
3633    // Original type: uint8_t
3634    optional int32 afh_select_unideal_channel_count = 9;
3635    // Current Link Supervision Timeout Setting
3636    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
3637    // Original type: uint16_t
3638    optional int32 lsto = 10;
3639    // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
3640    // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
3641    // 0x01 (Piconet Clock)
3642    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
3643    // Original type: uint32_t
3644    optional int64 connection_piconet_clock = 11;
3645    // The count of retransmission
3646    // Original type: uint32_t
3647    optional int64 retransmission_count = 12;
3648    // The count of no RX
3649    // Original type: uint32_t
3650    optional int64 no_rx_count = 13;
3651    // The count of NAK (Negative Acknowledge)
3652    // Original type: uint32_t
3653    optional int64 nak_count = 14;
3654    // Controller timestamp of last TX ACK
3655    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
3656    // Original type: uint32_t
3657    optional int64 last_tx_ack_timestamp = 15;
3658    // The count of Flow-off (STOP)
3659    // Original type: uint32_t
3660    optional int64 flow_off_count = 16;
3661    // Controller timestamp of last Flow-on (GO)
3662    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
3663    // Original type: uint32_t
3664    optional int64 last_flow_on_timestamp = 17;
3665    // Buffer overflow count (how many bytes of TX data are dropped) since the last event
3666    // Original type: uint32_t
3667    optional int64 buffer_overflow_bytes = 18;
3668    // Buffer underflow count (in byte) since last event
3669    // Original type: uint32_t
3670    optional int64 buffer_underflow_bytes = 19;
3671}
3672
3673/**
3674 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
3675 *
3676 * Notes:
3677 * - Each event can be partially filled as we might learn different pieces of device
3678 *   information at different time
3679 * - Multiple device info events can be combined to give more complete picture
3680 * - When multiple device info events tries to describe the same information, the
3681 *   later one wins
3682 *
3683 * Logged from:
3684 *     packages/apps/Bluetooth
3685 */
3686message BluetoothDeviceInfoReported {
3687    // An identifier that can be used to match events for this device.
3688    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3689    // Salt: Randomly generated 256 bit value
3690    // Hash algorithm: HMAC-SHA256
3691    // Size: 32 byte
3692    // Default: null or empty if the device identifier is not known
3693    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3694    // Where is this device info obtained from
3695    optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
3696    // Name of the data source
3697    // For EXTERNAL: package name of the data source
3698    // For INTERNAL: null for general case, component name otherwise
3699    optional string source_name = 3;
3700    // Name of the manufacturer of this device
3701    optional string manufacturer = 4;
3702    // Model of this device
3703    optional string model = 5;
3704    // Hardware version of this device
3705    optional string hardware_version = 6;
3706    // Software version of this device
3707    optional string software_version = 7;
3708    // An identifier that can be used to match events for this device.
3709    // The incremental identifier is locally generated and guaranteed not derived
3710    // from any globally unique hardware id.
3711    // For paired devices, it stays consistent between Bluetooth toggling for the
3712    // same remote device.
3713    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3714    // session for the same remote device.
3715    // Default: 0 if the device's metric id is unknown.
3716    optional int32 metric_id = 8;
3717    // A flag indicating if the MAC address of the remote device is public or
3718    // random.
3719    optional android.bluetooth.AddressTypeEnum address_type = 9;
3720    // The first byte of MAC address
3721    optional int32 byte1 = 10;
3722    // The second byte of MAC address
3723    optional int32 byte2 = 11;
3724    // The third byte of MAC address
3725    optional int32 byte3 = 12;
3726
3727}
3728
3729/**
3730 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
3731 * device, as documented by the Bluetooth Core HCI specification
3732 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
3733 * Vol 2, Part E, Page 1118
3734 *
3735 * Logged from:
3736 *     system/bt
3737 */
3738message BluetoothRemoteVersionInfoReported {
3739    // Connection handle of the connection
3740    // Original type: uint16_t
3741    optional int32 connection_handle = 1;
3742    // HCI command status code
3743    // Default: STATUS_UNKNOWN
3744    optional android.bluetooth.hci.StatusEnum hci_status = 2;
3745    // 1 byte Version of current LMP in the remote controller
3746    optional int32 lmp_version = 3;
3747    // 2 bytes LMP manufacturer code of the remote controller
3748    // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
3749    optional int32 lmp_manufacturer_code = 4;
3750    // 4 bytes subversion of the LMP in the remote controller
3751    optional int32 lmp_subversion = 5;
3752}
3753
3754/**
3755 * Logs when certain Bluetooth SDP attributes are discovered
3756 * Constant definitions are from:
3757 *     https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
3758 *
3759 * Current logged attributes:
3760 * - BluetoothProfileDescriptorList
3761 * - Supported Features Bitmask
3762 *
3763 * Logged from:
3764 *     system/bt
3765 */
3766message BluetoothSdpAttributeReported {
3767    // An identifier that can be used to match events for this device.
3768    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3769    // Salt: Randomly generated 256 bit value
3770    // Hash algorithm: HMAC-SHA256
3771    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3772    // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
3773    // Original type: uint16_t
3774    optional int32 protocol_uuid = 2;
3775    // Short form UUIDs used to identify Bluetooth SDP attribute types
3776    // Original type: uint16_t
3777    optional int32 attribute_id = 3;
3778    // Attribute value for the particular attribute
3779    optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
3780    // An identifier that can be used to match events for this device.
3781    // The incremental identifier is locally generated and guaranteed not derived
3782    // from any globally unique hardware id.
3783    // For paired devices, it stays consistent between Bluetooth toggling for the
3784    // same remote device.
3785    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3786    // session for the same remote device.
3787    // Default: 0 if the device's metric id is unknown.
3788    optional int32 metric_id = 5;
3789}
3790
3791/**
3792* Logs the user created Bluetooth device's name.
3793* It is pushed at Bluetooth pairing and connection.
3794*
3795* Logged from:
3796*     packages/modules/Bluetooth
3797*/
3798message BluetoothDeviceNameReported {
3799   // An identifier that can be used to match events for this device.
3800   // The incremental identifier is locally generated and guaranteed not derived
3801   // from any globally unique hardware id.
3802   // For paired devices, it stays consistent between Bluetooth toggling for the
3803   // same remote device.
3804   // For unpaired devices, it stays consistent within the same Bluetooth adapter
3805   // session for the same remote device.
3806   // Default: 0 if the device's metric id is unknown.
3807   optional int32 metric_id = 1;
3808
3809   // Name of the Bluetooth device. It is created by the user.
3810   optional string device_name = 2;
3811}
3812
3813/**
3814 * Logs when bond state of a Bluetooth device changes
3815 *
3816 * Logged from:
3817 *     frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
3818 *     packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
3819 */
3820message BluetoothBondStateChanged {
3821    // An identifier that can be used to match events for this device.
3822    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3823    // Salt: Randomly generated 256 bit value
3824    // Hash algorithm: HMAC-SHA256
3825    // Size: 32 byte
3826    // Default: null or empty if the device identifier is not known
3827    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3828    // Preferred transport type to remote dual mode device
3829    // Default: TRANSPORT_AUTO means no preference
3830    optional android.bluetooth.TransportTypeEnum transport = 2;
3831    // The type of this Bluetooth device (Classic, LE, or Dual mode)
3832    // Default: UNKNOWN
3833    optional android.bluetooth.DeviceTypeEnum type = 3;
3834    // Current bond state (NONE, BONDING, BONDED)
3835    // Default: BOND_STATE_UNKNOWN
3836    optional android.bluetooth.BondStateEnum bond_state = 4;
3837    // Bonding sub state
3838    // Default: BOND_SUB_STATE_UNKNOWN
3839    optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
3840    // Unbond Reason
3841    // Default: UNBOND_REASON_UNKNOWN
3842    optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
3843    // An identifier that can be used to match events for this device.
3844    // The incremental identifier is locally generated and guaranteed not derived
3845    // from any globally unique hardware id.
3846    // For paired devices, it stays consistent between Bluetooth toggling for the
3847    // same remote device.
3848    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3849    // session for the same remote device.
3850    // Default: 0 if the device's metric id is unknown.
3851    optional int32 metric_id = 7;
3852}
3853
3854/**
3855 * Logs there is an event related Bluetooth classic pairing
3856 *
3857 * Logged from:
3858 *     system/bt
3859 */
3860message BluetoothClassicPairingEventReported {
3861    // An identifier that can be used to match events for this device.
3862    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3863    // Salt: Randomly generated 256 bit value
3864    // Hash algorithm: HMAC-SHA256
3865    // Size: 32 byte
3866    // Default: null or empty if the device identifier is not known
3867    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3868    // Connection handle of this connection if available
3869    // Range: 0x0000 - 0x0EFF (12 bits)
3870    // Default: 0xFFFF if the handle is unknown
3871    optional int32 connection_handle = 2;
3872    // HCI command associated with this event
3873    // Default: CMD_UNKNOWN
3874    optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
3875    // HCI event associated with this event
3876    // Default: EVT_UNKNOWN
3877    optional android.bluetooth.hci.EventEnum hci_event = 4;
3878    // HCI command status code if this is triggerred by hci_cmd
3879    // Default: STATUS_UNKNOWN
3880    optional android.bluetooth.hci.StatusEnum cmd_status = 5;
3881    // HCI reason code associated with this event
3882    // Default: STATUS_UNKNOWN
3883    optional android.bluetooth.hci.StatusEnum reason_code = 6;
3884    // A status value related to this specific event
3885    // Default: 0
3886    optional int64 event_value = 7;
3887    // An identifier that can be used to match events for this device.
3888    // The incremental identifier is locally generated and guaranteed not derived
3889    // from any globally unique hardware id.
3890    // For paired devices, it stays consistent between Bluetooth toggling for the
3891    // same remote device.
3892    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3893    // session for the same remote device.
3894    // Default: 0 if the device's metric id is unknown.
3895    optional int32 metric_id = 8;
3896}
3897
3898/**
3899 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
3900 *
3901 * Logged from:
3902 *     system/bt
3903 */
3904message BluetoothSmpPairingEventReported {
3905    // An identifier that can be used to match events for this device.
3906    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3907    // Salt: Randomly generated 256 bit value
3908    // Hash algorithm: HMAC-SHA256
3909    // Size: 32 byte
3910    // Default: null or empty if the device identifier is not known
3911    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3912    // SMP command sent or received over L2CAP
3913    // Default: CMD_UNKNOWN
3914    optional android.bluetooth.smp.CommandEnum smp_command = 2;
3915    // Whether this command is sent or received
3916    // Default: DIRECTION_UNKNOWN
3917    optional android.bluetooth.DirectionEnum direction = 3;
3918    // SMP failure reason code
3919    // Default: PAIRING_FAIL_REASON_DEFAULT
3920    optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
3921    // An identifier that can be used to match events for this device.
3922    // The incremental identifier is locally generated and guaranteed not derived
3923    // from any globally unique hardware id.
3924    // For paired devices, it stays consistent between Bluetooth toggling for the
3925    // same remote device.
3926    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3927    // session for the same remote device.
3928    // Default: 0 if the device's metric id is unknown.
3929    optional int32 metric_id = 5;
3930}
3931
3932/**
3933 * Logs when a Bluetooth socket’s connection state changed
3934 *
3935 * Logged from:
3936 *   system/bt
3937 */
3938message BluetoothSocketConnectionStateChanged {
3939    // An identifier that can be used to match events for this device.
3940    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3941    // Salt: Randomly generated 256 bit value
3942    // Hash algorithm: HMAC-SHA256
3943    // Size: 32 byte
3944    // Default: null or empty if this is a server listener socket
3945    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3946    // Temporary port of this socket for the current connection or session only
3947    // Default 0 when unknown or don't care
3948    optional int32 port = 2;
3949    // Socket type as mentioned in
3950    // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
3951    // Default: SOCKET_TYPE_UNKNOWN
3952    optional android.bluetooth.SocketTypeEnum type = 3;
3953    // Socket connection state
3954    // Default: SOCKET_CONNECTION_STATE_UNKNOWN
3955    optional android.bluetooth.SocketConnectionstateEnum state = 4;
3956    // Number of bytes sent to remote device during this connection
3957    optional int64 tx_bytes = 5;
3958    // Number of bytes received from remote device during this connection
3959    optional int64 rx_bytes = 6;
3960    // Socket owner's UID
3961    optional int32 uid = 7 [(is_uid) = true];
3962    // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
3963    // |port| must be spawned by |server_port|
3964    // Default 0 when unknown or don't care
3965    optional int32 server_port = 8;
3966    // Whether this is a server listener socket
3967    optional android.bluetooth.SocketRoleEnum is_server = 9;
3968    // An identifier that can be used to match events for this device.
3969    // The incremental identifier is locally generated and guaranteed not derived
3970    // from any globally unique hardware id.
3971    // For paired devices, it stays consistent between Bluetooth toggling for the
3972    // same remote device.
3973    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3974    // session for the same remote device.
3975    // Default: 0 if the device's metric id is unknown.
3976    optional int32 metric_id = 10;
3977}
3978
3979/**
3980 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
3981 *
3982 * Logged from:
3983 *   packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
3984 *   packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
3985 *
3986 */
3987message BluetoothClassOfDeviceReported {
3988    // An identifier that can be used to match events for this device.
3989    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3990    // Salt: Randomly generated 256 bit value
3991    // Hash algorithm: HMAC-SHA256
3992    // Size: 32 byte
3993    // Default: null or empty if this is a server listener socket
3994    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3995    // Class of Device (CoD) value including both Major, Minor device class and service class
3996    // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
3997    // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
3998    // Default: 0
3999    optional int32 class_of_device = 2;
4000    // An identifier that can be used to match events for this device.
4001    // The incremental identifier is locally generated and guaranteed not derived
4002    // from any globally unique hardware id.
4003    // For paired devices, it stays consistent between Bluetooth toggling for the
4004    // same remote device.
4005    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4006    // session for the same remote device.
4007    // Default: 0 if the device's metric id is unknown.
4008    optional int32 metric_id = 3;
4009}
4010
4011/**
4012 * Logs when there is a crash in hardware abstraction layer (HAL)
4013 *
4014 * Logged from:
4015 *   system/bt
4016 *
4017 */
4018message BluetoothHALCrashReasonReported {
4019    // An identifier that can be used to match events for this device.
4020    // The incremental identifier is locally generated and guaranteed not derived
4021    // from any globally unique hardware id.
4022    // For paired devices, it stays consistent between Bluetooth toggling for the
4023    // same remote device.
4024    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4025    // session for the same remote device.
4026    // Default: 0 if the device's metric id is unknown.
4027    optional int32 metric_id = 1;
4028    // An identifier that can be used to match events for this device.
4029    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
4030    // Salt: Randomly generated 256 bit value
4031    // Hash algorithm: HMAC-SHA256
4032    // Size: 32 byte
4033    // Default: null or empty if the device identifier is not known
4034    optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
4035    // Bluetooth HAL crash reason error code.
4036    // Original type: uint8_t
4037    // Default: 0x00 (DEFAULT)
4038    optional int32 error_code = 3;
4039    // Bluetooth HAL crash reason vendor error code.
4040    // Original type: uint8_t
4041    // Default: 0x00 (DEFAULT)
4042    optional int32 vendor_error_code = 4;
4043}
4044
4045/**
4046 * Logs when an LE Audio connection session ended
4047 *
4048 * Logged from:
4049 *   packages/modules/Bluetooth
4050 *
4051 */
4052message LeAudioConnectionSessionReported {
4053    // Size of this CSIS group
4054    optional int32 group_size = 1;
4055    // An identifier that can be used to match events for this CSIS group.
4056    // The incremental identifier is locally generated and guaranteed not derived
4057    // from any globally unique hardware id.
4058    // For paired groups, it stays consistent between Bluetooth toggling for the
4059    // same remote group.
4060    // For unpaired groups, it stays consistent within the same Bluetooth adapter
4061    // session for the same remote group.
4062    // Default: 0 if the group's metric id is unknown.
4063    optional int32 group_metric_id = 2;
4064    // Total duration of this LeAudioConnectionSession
4065    optional int64 duration_nanos = 3;
4066
4067    // Connecting timestamp offset to the beginning of this session of each device session
4068    repeated int64 device_connecting_offset_nanos = 4;
4069    // Connected timestamp offset to the beginning of this session of each device session
4070    repeated int64 device_connected_offset_nanos = 5;
4071    // Duration of each device session
4072    repeated int64 device_connection_duration_nanos = 6;
4073    // Connection status of each device session
4074    repeated android.bluetooth.leaudio.ConnectionStatus device_connection_status = 7;
4075    // Disconnection status of each device session
4076    repeated android.bluetooth.leaudio.ConnectionStatus device_disconnection_status = 8;
4077    // An identifier that can be used to match events for this device.
4078    // The incremental identifier is locally generated and guaranteed not derived
4079    // from any globally unique hardware id.
4080    // For paired devices, it stays consistent between Bluetooth toggling for the
4081    // same remote device.
4082    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4083    // session for the same remote device.
4084    // Default: 0 if the device's metric id is unknown.
4085    repeated int32 device_metric_id = 9;
4086
4087    // Streaming beginning timestamp offset to the beginning of this session
4088    repeated int64 streaming_session_offset_nanos = 10;
4089    // Streaming ending timestamp offset to the beginning of this session
4090    repeated int64 streaming_session_duration_nanos = 11;
4091    // Streaming context type of each steaming session
4092    repeated android.bluetooth.leaudio.ContextType streaming_context_type = 12;
4093}
4094
4095/**
4096 * Logs when an LE Audio broadcast session ended
4097 *
4098 * Logged from:
4099 *   packages/modules/Bluetooth
4100 *
4101 */
4102message LeAudioBroadcastSessionReported {
4103    // Broadcast duration
4104    optional int64 duration_nanos = 1;
4105}
4106
4107/**
4108 * Logs when the counter is incremented
4109 *
4110 * Logged from:
4111 *   system/bt
4112 *   packages/apps/Bluetooth
4113 *
4114 */
4115message BluetoothCodePathCounter {
4116    // Keys of events with enum ranges to be defined
4117    optional android.bluetooth.CodePathCounterKeyEnum key = 1;
4118    // Number of frequency of events
4119    optional int64 number = 2;
4120}
4121
4122/**
4123 * Logs when an application attempts to start a Bluetooth Low Energy scan.
4124 * It only happens when the scan is initiated and does not repeatedly call
4125 * while the scan is running.
4126 *
4127 * Logged from:
4128 *   packages/apps/Bluetooth/src/com/android/bluetooth/gatt/GattService.java
4129 *
4130 */
4131message BluetoothLeBatchScanReportDelay {
4132    optional int32 application_uid = 1;
4133    optional int64 application_report_delay_millis = 2;
4134}
4135
4136message BluetoothLocalVersionsReported {
4137    // Chip Manufacturer name
4138    optional int32 lmp_manufacturer_name = 1;
4139    // LMP Version
4140    optional int32 lmp_version = 2;
4141    // LMP Subversion
4142    optional int32 lmp_subversion = 3;
4143    // HCI Version
4144    optional int32 hci_version = 4;
4145    // HCI Revision
4146    optional int32 hci_revision = 5;
4147}
4148
4149message BluetoothRemoteSupportedFeaturesReported {
4150    // An identifier that can be used to match events for this device.
4151    // The incremental identifier is locally generated and guaranteed not derived
4152    // from any globally unique hardware id.
4153    // For paired devices, it stays consistent between Bluetooth toggling for the
4154    // same remote device.
4155    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4156    // session for the same remote device.
4157    // Default: 0 if the device's metric id is unknown.
4158    optional int32 metric_id = 1;
4159    // Page of the feature bit masks
4160    optional int32 page = 2;
4161    // Bit mask of features
4162    optional int64 features_page2 = 3;
4163    // Connection handle of this connection if available
4164    // Range: 0x0000 - 0x0EFF (12 bits)
4165    // Default: 0xFFFF if the handle is unknown
4166    optional int32 connection_handle = 4;
4167}
4168
4169message BluetoothLocalSupportedFeaturesReported {
4170    // Page of the feature bit masks
4171    optional int32 page_num = 1;
4172    // Bit mask of features
4173    optional int64 features_page = 2;
4174}
4175
4176message BluetoothDisconnectionReasonReported {
4177    // Disconnection reason
4178    optional int32 reason = 1;
4179    // An identifier that can be used to match events for this device.
4180    // The incremental identifier is locally generated and guaranteed not derived
4181    // from any globally unique hardware id.
4182    // For paired devices, it stays consistent between Bluetooth toggling for the
4183    // same remote device.
4184    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4185    // session for the same remote device.
4186    // Default: 0 if the device's metric id is unknown.
4187    optional int32 metric_id = 2;
4188    // Connection handle of this connection if available
4189    // Range: 0x0000 - 0x0EFF (12 bits)
4190    // Default: 0xFFFF if the handle is unknown
4191    optional int32 connection_handle = 3;
4192}
4193
4194message BluetoothGattAppInfo {
4195    // An index to group connection events by session. It's a counter generated by
4196    // each profile. e.g. Gatt server generate such id to identify Gatt apps
4197    optional int32 session_index = 1;
4198    // An identifier that can be used to match events for this device.
4199    // The incremental identifier is locally generated and guaranteed not derived
4200    // from any globally unique hardware id.
4201    // For paired devices, it stays consistent between Bluetooth toggling for the
4202    // same remote device.
4203    // For unpaired devices, it stays consistent within the same Bluetooth adapter
4204    // session for the same remote device.
4205    // Default: 0 if the device's metric id is unknown.
4206    optional int32 metric_id = 2;
4207    // UID of the GATT app
4208    optional int32 uid = 3 [(is_uid) = true];
4209}
4210
4211/**
4212 * Logs when something is plugged into or removed from the USB-C connector.
4213 *
4214 * Logged from:
4215 *  UsbService
4216 */
4217message UsbConnectorStateChanged {
4218    enum State {
4219        STATE_DISCONNECTED = 0;
4220        STATE_CONNECTED = 1;
4221    }
4222    optional State state = 1
4223            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
4224    optional string id = 2 [(state_field_option).primary_field = true];
4225    // Last active session in ms.
4226    // 0 when the port is in connected state.
4227    optional int64 last_connect_duration_millis = 3;
4228}
4229
4230/**
4231 * Logs the reported speaker impedance.
4232 *
4233 * Logged from:
4234 *  Vendor audio implementation.
4235 */
4236message SpeakerImpedanceReported {
4237    optional int32 speaker_location = 1;
4238    optional int32 impedance = 2;
4239}
4240
4241/**
4242 * Logs the report of a failed hardware.
4243 *
4244 * Logged from:
4245 *  Vendor HALs.
4246 *
4247 */
4248message HardwareFailed {
4249    enum HardwareType {
4250        HARDWARE_FAILED_UNKNOWN = 0;
4251        HARDWARE_FAILED_MICROPHONE = 1;
4252        HARDWARE_FAILED_CODEC = 2;
4253        HARDWARE_FAILED_SPEAKER = 3;
4254        HARDWARE_FAILED_FINGERPRINT = 4;
4255    }
4256    optional HardwareType hardware_type = 1;
4257
4258   /**
4259    * hardware_location allows vendors to differentiate between multiple instances of
4260    * the same hardware_type.  The specific locations are vendor defined integers,
4261    * referring to board-specific numbering schemes.
4262    */
4263    optional int32 hardware_location = 2;
4264
4265    /**
4266     * failure_code is specific to the HardwareType of the failed hardware.
4267     * It should use one of the enum values defined below.
4268     */
4269    enum HardwareErrorCode {
4270        UNKNOWN = 0;
4271        COMPLETE = 1;
4272        SPEAKER_HIGH_Z = 2;
4273        SPEAKER_SHORT = 3;
4274        FINGERPRINT_SENSOR_BROKEN = 4;
4275        FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
4276        DEGRADE = 6;
4277    }
4278    optional int32 failure_code = 3;
4279}
4280
4281/**
4282 * Log an event when the device has been physically dropped.
4283 * Reported from the /vendor partition.
4284 */
4285message PhysicalDropDetected {
4286    // Confidence that the event was actually a drop, 0 -> 100
4287    optional int32 confidence_pctg = 1;
4288    // Peak acceleration of the drop, in 1/1000s of a g.
4289    optional int32 accel_peak_thousandths_g = 2;
4290    // Duration of freefall in ms
4291    optional int32 freefall_time_millis = 3;
4292}
4293
4294/**
4295 * Log bucketed battery charge cycles.
4296 *
4297 * Each bucket represents cycles of the battery past
4298 * a given charge point.  For example, if 10 cycle buckets are
4299 * initialized, bucket 1 is the lowest 1/10th of the battery,
4300 * and bucket 10 is 100%.
4301 *
4302 * Logged from:
4303 * /sys/class/power_supply/bms/cycle_count, via Vendor.
4304 */
4305message ChargeCyclesReported {
4306    optional int32 cycle_bucket_1 = 1;
4307    optional int32 cycle_bucket_2 = 2;
4308    optional int32 cycle_bucket_3 = 3;
4309    optional int32 cycle_bucket_4 = 4;
4310    optional int32 cycle_bucket_5 = 5;
4311    optional int32 cycle_bucket_6 = 6;
4312    optional int32 cycle_bucket_7 = 7;
4313    optional int32 cycle_bucket_8 = 8;
4314    optional int32 cycle_bucket_9 = 9;
4315    optional int32 cycle_bucket_10 = 10;
4316}
4317
4318/**
4319 * Log battery health snapshot.
4320 *
4321 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
4322 * are snapshotted periodically over 24hrs.
4323 */
4324message BatteryHealthSnapshot {
4325    enum BatterySnapshotType {
4326        UNKNOWN = 0;
4327        MIN_TEMP = 1;         // Snapshot at min batt temp over 24hrs.
4328        MAX_TEMP = 2;         // Snapshot at max batt temp over 24hrs.
4329        MIN_RESISTANCE = 3;   // Snapshot at min batt resistance over 24hrs.
4330        MAX_RESISTANCE = 4;   // Snapshot at max batt resistance over 24hrs.
4331        MIN_VOLTAGE = 5;      // Snapshot at min batt voltage over 24hrs.
4332        MAX_VOLTAGE = 6;      // Snapshot at max batt voltage over 24hrs.
4333        MIN_CURRENT = 7;      // Snapshot at min batt current over 24hrs.
4334        MAX_CURRENT = 8;      // Snapshot at max batt current over 24hrs.
4335        MIN_BATT_LEVEL = 9;   // Snapshot at min battery level (SoC) over 24hrs.
4336        MAX_BATT_LEVEL = 10;  // Snapshot at max battery level (SoC) over 24hrs.
4337        AVG_RESISTANCE = 11;  // Snapshot at average battery resistance over 24hrs.
4338    }
4339    optional BatterySnapshotType type = 1;
4340    // Temperature, in 1/10ths of degree C.
4341    optional int32 temperature_deci_celsius = 2;
4342    // Voltage Battery Voltage, in microVolts.
4343    optional int32 voltage_micro_volt = 3;
4344    // Current Battery current, in microAmps.
4345    optional int32 current_micro_amps = 4;
4346    // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
4347    optional int32 open_circuit_micro_volt = 5;
4348    // Resistance Battery Resistance, in microOhms.
4349    optional int32 resistance_micro_ohm = 6;
4350    // Level Battery Level, as % of full.
4351    optional int32 level_percent = 7;
4352}
4353
4354/**
4355 * Log slow I/O operations on the primary storage.
4356 */
4357message SlowIo {
4358    // Classifications of IO Operations.
4359    enum IoOperation {
4360        UNKNOWN = 0;
4361        READ = 1;
4362        WRITE = 2;
4363        UNMAP = 3;
4364        SYNC = 4;
4365    }
4366    optional IoOperation operation = 1;
4367
4368    // The number of slow IO operations of this type over 24 hours.
4369    optional int32 count = 2;
4370}
4371
4372/**
4373 * Log battery caused shutdown with the last recorded voltage.
4374 */
4375message BatteryCausedShutdown {
4376    // The last recorded battery voltage prior to shutdown.
4377    optional int32 last_recorded_micro_volt = 1;
4378}
4379
4380/**
4381 * Logs when ThermalService receives throttling events.
4382 *
4383 * Logged from:
4384 *   frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
4385 */
4386message ThermalThrottlingSeverityStateChanged {
4387    // The type of temperature being reported (CPU, GPU, SKIN, etc)
4388    optional android.os.TemperatureTypeEnum sensor_type = 1;
4389
4390    // The name of the temperature source. Eg. CPU0
4391    optional string sensor_name = 2;
4392
4393    // Temperature in tenths of a degree C.
4394    // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
4395    optional int32 temperature_deci_celsius = 3;
4396
4397    // Relative severity of the throttling, see enum definition.
4398    optional android.os.ThrottlingSeverityEnum severity = 4;
4399}
4400
4401/**
4402 * Logs the duration of a davey (jank of >=700ms) when it occurs
4403 *
4404 * Logged from:
4405 *   frameworks/base/libs/hwui/JankTracker.cpp
4406 */
4407message DaveyOccurred {
4408    // The UID that logged this atom.
4409    optional int32 uid = 1 [(is_uid) = true];
4410
4411    // Amount of time it took to render the frame. Should be >=700ms.
4412    optional int64 jank_duration_millis = 2;
4413}
4414
4415/**
4416 * Logs phone signal strength changes.
4417 *
4418 * Logged from:
4419 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
4420 */
4421message PhoneSignalStrengthChanged {
4422    // Signal strength, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
4423    optional android.telephony.SignalStrengthEnum signal_strength = 1;
4424}
4425
4426
4427/**
4428 * Logs when the phone state, sim state or signal strength changes
4429 *
4430 * Logged from:
4431 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
4432 */
4433message PhoneServiceStateChanged {
4434    optional android.telephony.ServiceStateEnum state = 1;
4435    optional android.telephony.SimStateEnum sim_state = 2;
4436    optional android.telephony.SignalStrengthEnum signal_strength = 3;
4437}
4438
4439/**
4440 * Logs when the phone becomes on or off.
4441 *
4442 * Logged from:
4443 *   frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
4444 */
4445message PhoneStateChanged {
4446    enum State {
4447        OFF = 0;
4448        ON = 1;
4449    }
4450    optional State state = 1;
4451}
4452
4453message ExclusionRectStateChanged {
4454    optional string component_name = 1;    // if not available, simply packageName
4455    optional int32 requested_height = 2;   // px
4456    optional int32 rejected_height = 3;    // px
4457
4458    enum WindowHorizontalLocation {
4459        DEFAULT_LOCATION = 0;
4460        LEFT = 1;
4461        RIGHT = 2;
4462    }
4463    optional WindowHorizontalLocation x_location = 4;
4464    optional bool landscape = 5;
4465    optional bool splitscreen = 6 [deprecated = true];
4466    optional int32 duration_millis = 7;
4467}
4468
4469/**
4470 * Logs when Wallpaper or ThemePicker UI has changed.
4471 *
4472 * Logged from:
4473 *   packages/apps/ThemePicker
4474 *   packages/apps/WallpaperPicker2
4475 */
4476message StyleUIChanged {
4477    optional android.stats.style.Action action = 1;
4478    optional int32 color_package_hash = 2;
4479    optional int32 font_package_hash  = 3;
4480    optional int32 shape_package_hash = 4;
4481    optional int32 clock_package_hash = 5;
4482    optional int32 launcher_grid = 6;
4483    optional int32 wallpaper_category_hash = 7;
4484    optional int32 wallpaper_id_hash = 8;
4485    optional int32 color_preference = 9;
4486    optional android.stats.style.LocationPreference location_preference = 10;
4487    optional android.stats.style.DatePreference date_preference = 11;
4488    optional android.stats.style.LaunchedPreference launched_preference = 12;
4489    optional android.stats.style.EffectPreference effect_preference = 13;
4490    optional int32 effect_id_hash = 14;
4491    optional int32 lock_wallpaper_category_hash = 15;
4492    optional int32 lock_wallpaper_id_hash = 16;
4493    optional int32 first_launch_date_since_setup = 17;
4494    optional int32 first_wallpaper_apply_date_since_setup = 18;
4495    optional int32 app_launch_count = 19;
4496    optional int32 color_variant = 20;
4497    optional int64 time_elapsed_millis = 21;
4498    optional int32 effect_status_code = 22;
4499}
4500
4501/**
4502 * Logs when Settings UI has changed.
4503 *
4504 * Logged from:
4505 *   packages/apps/Settings
4506 */
4507message SettingsUIChanged {
4508    /**
4509     * Where this SettingsUIChange event comes from. For example, if
4510     * it's a PAGE_VISIBLE event, where the page is opened from.
4511     */
4512    optional android.app.settings.PageId attribution = 1;
4513
4514    /**
4515     * What the UI action is.
4516     */
4517    optional android.app.settings.Action action = 2;
4518
4519    /**
4520     * Where the action is happening
4521     */
4522    optional android.app.settings.PageId page_id = 3;
4523
4524    /**
4525     * What preference changed in this event.
4526     */
4527    optional string changed_preference_key = 4;
4528
4529    /**
4530     * The new value of the changed preference.
4531     */
4532    optional int64 changed_preference_int_value = 5;
4533
4534    /**
4535     * Data about elapsed time since setup wizard finished.
4536     */
4537    optional int64 elapsed_time_millis = 6;
4538}
4539
4540/**
4541 * Logs that a setting was updated.
4542 * Logged from:
4543 *   frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
4544 * The tag and is_default allow resetting of settings to default values based on the specified
4545 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
4546 */
4547message SettingChanged {
4548    // The name of the setting.
4549    optional string setting = 1;
4550
4551    // The change being imposed on this setting. May represent a number, eg "3".
4552    optional string value = 2;
4553
4554    // The new value of this setting. For most settings, this is same as value. For some settings,
4555    // value is +X or -X where X represents an element in a set. For example, if the previous value
4556    // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
4557    // The +/- feature is currently only used for location_providers_allowed.
4558    optional string new_value = 3;
4559
4560    // The previous value of this setting.
4561    optional string prev_value = 4;
4562
4563    // The tag used with the is_default for resetting sets of settings. This is generally null.
4564    optional string tag = 5;
4565
4566    // True if this setting with tag should be resettable.
4567    optional bool is_default = 6;
4568
4569    // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
4570    optional int32 user = 7;
4571
4572    enum ChangeReason {
4573        UPDATED = 1; // Updated can be an insertion or an update.
4574        DELETED = 2;
4575    }
4576    optional ChangeReason reason = 8;
4577}
4578
4579/**
4580 * Logs activity going to foreground or background
4581 *
4582 * Logged from:
4583  *   frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
4584 */
4585message ActivityForegroundStateChanged {
4586    optional int32 uid = 1 [(is_uid) = true];
4587    optional string pkg_name = 2;
4588    optional string class_name = 3;
4589
4590    enum State {
4591        BACKGROUND = 0;
4592        FOREGROUND = 1;
4593    }
4594    optional State state = 4;
4595}
4596
4597/**
4598 * Logs when a volume entered low Storage state.
4599 * Logged from:
4600 *      frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
4601 */
4602message LowStorageStateChanged {
4603    // Volume that ran out of storage.
4604    optional string volume_description = 1;
4605
4606    enum State {
4607        UNKNOWN = 0;
4608        OFF = 1;
4609        ON = 2;
4610    }
4611    optional State state = 2;
4612}
4613
4614/**
4615 * Logs when an app is downgraded.
4616 * Logged from:
4617 *      frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
4618 */
4619message AppDowngraded {
4620    optional string package_name = 1;
4621    // Size of the package (all data) before being downgraded.
4622    optional int64 size_in_bytes_before = 2;
4623    // Size of the package (all data) after being downgraded.
4624    optional int64 size_in_bytes_after = 3;
4625
4626    optional bool aggressive = 4;
4627}
4628
4629/**
4630 * Logs when an app is optimized after being downgraded.
4631 * Logged from:
4632 *      frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
4633 */
4634message AppOptimizedAfterDowngraded {
4635    optional string package_name = 1;
4636}
4637
4638/**
4639 * Logs whenever an app is installed on external storage.
4640 * Logged from:
4641        frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4642 */
4643message AppInstallOnExternalStorageReported {
4644    // The type of external storage.
4645    optional android.stats.storage.ExternalStorageType storage_type = 1;
4646    // The name of the package that is installed on the sd card.
4647    optional string package_name = 2;
4648}
4649
4650/**
4651 * Logs when an app crashes.
4652 * Logged from:
4653 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4654 */
4655message AppCrashOccurred {
4656    optional int32 uid = 1 [(is_uid) = true];
4657
4658    optional string event_type = 2;
4659
4660    // The name of the process.
4661    // system_server if it is not by an app
4662    optional string process_name = 3;
4663
4664    // The pid if available. -1 means not available.
4665    optional int32 pid = 4;
4666
4667    optional string package_name = 5;
4668
4669    enum InstantApp {
4670        UNAVAILABLE = 0;
4671        FALSE = 1;
4672        TRUE = 2;
4673    }
4674    optional InstantApp is_instant_app = 6;
4675
4676    enum ForegroundState {
4677        UNKNOWN = 0;
4678        BACKGROUND = 1;
4679        FOREGROUND = 2;
4680    }
4681    optional ForegroundState foreground_state = 7;
4682
4683    optional android.server.ErrorSource error_source = 8;
4684
4685    optional bool is_incremental = 9;
4686
4687    optional float loading_progress = 10;
4688
4689    optional int64 millis_since_oldest_pending_read = 11;
4690
4691    // Status code to represent the health of the file system backing storage, as defined in
4692    // frameworks/base/core/java/android/os/incremental/IStorageHealthListener.aidl.
4693    // Value -1 if the app is not installed on Incremental
4694    optional int32 storage_health_code = 12;
4695
4696    // Status code to represent the status of data loader, as defined in
4697    // frameworks/base/core/java/android/content/pm/IDataLoaderStatusListener.aidl.
4698    // Value -1 if the app is not installed on Incremental
4699    optional int32 data_loader_status_code = 13;
4700
4701    // Whether read logs collection is enabled
4702    optional bool read_logs_enabled = 14;
4703
4704    // Duration since last attempt to bind data loader. 0 means did not attempt to bind.
4705    // -1 means the app is not installed on Incremental.
4706    optional int64 millis_since_last_data_loader_bind = 15;
4707
4708    // Delay for retrying to bind data loader. If not bound, it shows how soon it will be bound.
4709    optional int64 data_loader_bind_delay_millis = 16;
4710
4711    // Total count of delayed reads, as reported by Incremental File System.
4712    optional int32 total_delayed_reads = 17;
4713
4714    // Total count of failed reads (timeout or hash errors) as reported by Incremental File System.
4715    optional int32 total_failed_reads = 18;
4716
4717    // UID of the process that tried to read a page from the app but failed.
4718    // This shows whether the read was initiated by the system, the app itself, or some other apps.
4719    // -1 means there was no read error or the app is not installed on Incremental.
4720    optional int32 last_read_error_uid = 19;
4721
4722    // Duration since that last read failure.
4723    // -1 means there was no read error or the app is not installed on Incremental.
4724    optional int64 last_read_error_millis_since = 20;
4725
4726    // Error code of last read failure. ETIME (value=62) for timeout, EBADMSG (value=74) for hash
4727    // and other positive values for other errors. -1 means app is not installed on Incremental.
4728    optional int32 last_read_error_code = 21;
4729
4730    // Total duration of delayed reads in milliseconds
4731    optional int64 total_delayed_reads_duration_millis = 22;
4732}
4733
4734/**
4735 * Logs when a WTF (What a Terrible Failure) happened.
4736 * Logged from:
4737 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4738 */
4739message WTFOccurred {
4740    optional int32 uid = 1 [(is_uid) = true];
4741
4742    optional string tag = 2;
4743
4744    // The name of the process.
4745    // system_server if it is not by an app
4746    optional string process_name = 3;
4747
4748    // The pid if available. -1 means not available.
4749    optional int32 pid = 4;
4750
4751    optional android.server.ErrorSource error_source = 5;
4752}
4753
4754/**
4755 * Logs when system server reports low memory.
4756 * Logged from:
4757 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4758 */
4759message LowMemReported {
4760}
4761
4762/**
4763 * Logs when an app ANR (App Not Responding) occurs.
4764 * Logged from:
4765 *      frameworks/base/services/core/java/com/android/server/am/AppErrors.java
4766 */
4767message ANROccurred {
4768    optional int32 uid = 1 [(is_uid) = true];
4769
4770    optional string process_name = 2;
4771
4772    optional string short_component_name = 3;
4773
4774    optional string reason = 4;
4775
4776    enum InstantApp {
4777        UNAVAILABLE = 0;
4778        FALSE = 1;
4779        TRUE = 2;
4780    }
4781    optional InstantApp is_instant_app = 5;
4782
4783    enum ForegroundState {
4784        UNKNOWN = 0;
4785        BACKGROUND = 1;
4786        FOREGROUND = 2;
4787    }
4788    optional ForegroundState foreground_state = 6;
4789
4790    optional android.server.ErrorSource error_source = 7;
4791
4792    optional string package_name = 8;
4793
4794    optional bool is_incremental = 9;
4795
4796    optional float loading_progress = 10;
4797
4798    optional int64 millis_since_oldest_pending_read = 11;
4799
4800    // Status code to represent the health of the file system backing storage, as defined in
4801    // frameworks/base/core/java/android/os/incremental/IStorageHealthListener.aidl.
4802    // Value -1 if the app is not installed on Incremental
4803    optional int32 storage_health_code = 12;
4804
4805    // Status code to represent the status of data loader, as defined in
4806    // frameworks/base/core/java/android/content/pm/IDataLoaderStatusListener.aidl.
4807    // Value -1 if the app is not installed on Incremental
4808    optional int32 data_loader_status_code = 13;
4809
4810    // Whether read logs collection is enabled
4811    optional bool read_logs_enabled = 14;
4812
4813    // Duration since last attempt to bind data loader. 0 means did not attempt to bind.
4814    // -1 means the app is not installed on Incremental.
4815    optional int64 millis_since_last_data_loader_bind = 15;
4816
4817    // Delay for retrying to bind data loader. If not bound, it shows how soon it will be bound.
4818    optional int64 data_loader_bind_delay_millis = 16;
4819
4820    // Total count of delayed reads, as reported by Incremental File System.
4821    optional int32 total_delayed_reads = 17;
4822
4823    // Total count of failed reads (timeout or hash errors) as reported by Incremental File System.
4824    optional int32 total_failed_reads = 18;
4825
4826    // UID of the process that tried to read a page from the app but failed.
4827    // This shows whether the read was initiated by the system, the app itself, or some other apps.
4828    // -1 means there was no read error or the app is not installed on Incremental.
4829    optional int32 last_read_error_uid = 19;
4830
4831    // Duration since that last read failure.
4832    // -1 means there was no read error or the app is not installed on Incremental.
4833    optional int64 last_read_error_millis_since = 20;
4834
4835    // Error code of last read failure. ETIME (value=62) for timeout, EBADMSG (value=74) for hash
4836    // and other positive values for other errors. -1 means app is not installed on Incremental.
4837    optional int32 last_read_error_code = 21;
4838
4839    // Total duration of delayed reads in milliseconds
4840    optional int64 total_delayed_reads_duration_millis = 22;
4841}
4842
4843/**
4844 * Logs immediately after an app ANR (App Not Responding) occurs. In contrast, ANROccurred (the
4845 * atom above) logs some time (not necessarily immediately) after the ANR is detected.
4846 * Logged from:
4847 *      frameworks/base/services/core/java/com/android/server/am/AppErrors.java
4848 */
4849message ANROccurredProcessingStarted {
4850  optional string process_name = 1;
4851}
4852
4853/**
4854 * Logs when the vibrator state changes.
4855 * Logged from:
4856 *      frameworks/base/services/core/java/com/android/vibrator/VibratorManagerService.java
4857 */
4858message VibratorStateChanged {
4859    repeated AttributionNode attribution_node = 1;
4860
4861    enum State {
4862        OFF = 0;
4863        ON = 1;
4864    }
4865    optional State state = 2;
4866
4867    // Duration (in milliseconds) requested to keep the vibrator on.
4868    // Only applicable for State == ON.
4869    optional int64 duration_millis = 3;
4870}
4871
4872/**
4873 * Logs vibration request.
4874 * Logged from:
4875 *      frameworks/base/services/core/java/com/android/server/vibrator/VibratorManagerService.java
4876 */
4877// Next tag: 26
4878message VibrationReported {
4879  repeated AttributionNode attribution_node = 1;
4880
4881  enum VibrationType {
4882    UNKNOWN = 0;
4883    SINGLE = 1;
4884    REPEATED = 2;
4885    EXTERNAL = 3;
4886  }
4887
4888  // Vibration identifiers for aggregation.
4889  optional VibrationType vibration_type = 2;
4890  // One of VibrationAttributes.USAGE_* constant values.
4891  optional int32 vibration_usage = 3;
4892  optional int32 vibration_status = 4;
4893
4894  // Vibration completion causes.
4895  // Flag indicating if the vibration was canceled by the same process
4896  // or superseded/canceled by another vibration from the same process.
4897  optional bool ended_by_same_uid = 5;
4898  // Usage value of the vibration that superseded/canceled this one.
4899  optional int32 ended_by_usage = 6;
4900  // Usage value of the vibration that was superseded/canceled by this one.
4901  optional int32 interrupted_usage = 7;
4902
4903  // Vibration execution counters.
4904  optional int32 repeat_count = 8;
4905  // Total duration of this vibration at the service, including setup and cleanup.
4906  optional int64 vibration_duration_millis = 9;
4907  // Total duration the vibrator motor was active with non-zero amplitude.
4908  optional int64 vibrator_on_duration_millis = 10;
4909  // Delta between the incoming binder call to vibrate and the first step in the
4910  // vibration conductor (closest measure of starting HAL interactions).
4911  optional int64 start_latency_millis = 11;
4912  // Delta between the HAL reporting the last vibrate operation has completed and
4913  // vibrator service has finished the vibration and become idle.
4914  optional int64 end_latency_millis = 12;
4915
4916  // Vibrator hardware HAL API interaction counters.
4917  // The majority of vibrations will populate only a couple of the fields below.
4918  optional int32 hal_compose_count = 13;
4919  optional int32 hal_compose_pwle_count = 14;
4920  optional int32 hal_on_count = 15;
4921  optional int32 hal_off_count = 16;
4922  optional int32 hal_perform_count = 17;
4923  optional int32 hal_set_amplitude_count = 18;
4924  optional int32 hal_set_external_control_count = 19;
4925
4926  // Vibrator hardware HAL API constants used (deduped).
4927  // Values from CompositionPrimitive.aidl successfully triggered by this vibration at least once.
4928  repeated int32 hal_supported_composition_primitives_used = 20;
4929  // Values from Effect.aidl triggered by this vibration at least once.
4930  repeated int32 hal_supported_effects_used = 21;
4931  // Values from CompositionPrimitive.aidl triggered but not supported by the device.
4932  repeated int32 hal_unsupported_composition_primitives_used = 22;
4933  // Values from Effect.aidl triggered but not supported by the device.
4934  repeated int32 hal_unsupported_effects_used = 23;
4935  // Vibrator hardware HAL argument sizes (total).
4936  optional int32 hal_composition_size = 24;
4937  optional int32 hal_pwle_size = 25;
4938}
4939
4940/*
4941 * Allows other apps to push events into statsd.
4942 * Logged from:
4943 *      frameworks/base/core/java/android/util/StatsLog.java
4944 */
4945message AppBreadcrumbReported {
4946    // The uid of the application that sent this custom atom.
4947    optional int32 uid = 1 [(is_uid) = true];
4948
4949    // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
4950    optional int32 label = 2;
4951
4952    // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
4953    // predicates for the metrics).
4954    enum State {
4955        UNKNOWN = 0;
4956        UNSPECIFIED = 1;  // For events that are known to not represent START/STOP.
4957        STOP = 2;
4958        START = 3;
4959    }
4960    optional State state = 3;
4961}
4962
4963/**
4964 * Logs the wall-clock time when a significant wall-clock time shift occurs.
4965 * For example, this could be due to the user manually changing the time.
4966 *
4967 * Logged from:
4968 *   frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
4969 */
4970message WallClockTimeShifted {
4971    // New wall-clock time in milliseconds, according to System.currentTimeMillis().
4972    optional int64 wall_clock_timestamp_millis = 1;
4973}
4974
4975/**
4976 * Logs when statsd detects an anomaly.
4977 *
4978 * Logged from:
4979 *   frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
4980 */
4981message AnomalyDetected {
4982    // Uid that owns the config whose anomaly detection alert fired.
4983    optional int32 config_uid = 1 [(is_uid) = true];
4984
4985    // Id of the config whose anomaly detection alert fired.
4986    optional int64 config_id = 2;
4987
4988    // Id of the alert (i.e. name of the anomaly that was detected).
4989    optional int64 alert_id = 3;
4990}
4991
4992message AppStartOccurred {
4993    // The uid if available. -1 means not available.
4994    optional int32 uid = 1 [(is_uid) = true];
4995
4996    // The app package name.
4997    optional string pkg_name = 2;
4998
4999    enum TransitionType {
5000        UNKNOWN = 0;
5001        WARM = 1;
5002        HOT = 2;
5003        COLD = 3;
5004        RELAUNCH = 4;
5005    }
5006    // The transition type.
5007    optional TransitionType type = 3;
5008
5009    // The activity name.
5010    optional string activity_name = 4;
5011
5012    // The name of the calling app. Empty if not set.
5013    optional string calling_pkg_name = 5;
5014
5015    // Whether the app is an instant app.
5016    optional bool is_instant_app = 6;
5017
5018    // Device uptime when activity started. Deprecated: use activity_start_timestamp_millis instead.
5019    optional int64 activity_start_millis = 7 [deprecated = true];
5020
5021    optional android.app.AppTransitionReasonEnum reason = 8;
5022
5023    optional int32 transition_delay_millis = 9;
5024    // -1 if not set.
5025    optional int32 starting_window_delay_millis = 10;
5026    // -1 if not set.
5027    optional int32 bind_application_delay_millis = 11;
5028    optional int32 windows_drawn_delay_millis = 12;
5029
5030    // Empty if not set.
5031    optional string launch_token = 13;
5032
5033    // The reason why the package was optimized.
5034    optional int32 package_optimization_compilation_reason = 14;
5035
5036    // The compiler filter used when when the package was optimized.
5037    optional int32 package_optimization_compilation_filter = 15;
5038
5039    enum SourceType {
5040        UNAVAILABLE = 0;
5041        LAUNCHER = 1;
5042        NOTIFICATION = 2;
5043        LOCKSCREEN = 3;
5044        RECENTS_ANIMATION = 4;
5045    }
5046    // The type of the startup source.
5047    optional SourceType source_type = 16;
5048
5049    // The time from the startup source to the beginning of handling the startup event.
5050    // -1 means not available.
5051    optional int32 source_event_delay_millis = 17;
5052
5053    // Whether the app is hibernating when it started
5054    optional bool is_hibernating = 18;
5055
5056    // Whether the app is installed on Incremental File System.
5057    optional bool is_incremental = 19;
5058
5059    // Whether the app is still being streamed.
5060    optional bool is_loading = 20;
5061
5062    // The hash value of the activity name.
5063    optional int32 activity_name_hash = 21;
5064
5065    // The timestamp(SystemClock#elapsedRealtime()) when starting activity.
5066    optional int64 activity_start_timestamp_millis = 22;
5067
5068    /**
5069     * The process state of apps, keep in sync with
5070     * frameworks/base/core/java/android/app/ActivityManager.java
5071     */
5072    enum AppProcessState {
5073        PROCESS_STATE_UNKNOWN = -1;
5074        PROCESS_STATE_PERSISTENT = 0;
5075        PROCESS_STATE_PERSISTENT_UI = 1;
5076        PROCESS_STATE_TOP = 2;
5077        PROCESS_STATE_BOUND_TOP = 3;
5078        PROCESS_STATE_FOREGROUND_SERVICE = 4;
5079        PROCESS_STATE_BOUND_FOREGROUND_SERVICE = 5;
5080        PROCESS_STATE_IMPORTANT_FOREGROUND = 6;
5081        PROCESS_STATE_IMPORTANT_BACKGROUND = 7;
5082        PROCESS_STATE_TRANSIENT_BACKGROUND = 8;
5083        PROCESS_STATE_BACKUP = 9;
5084        PROCESS_STATE_SERVICE = 10;
5085        PROCESS_STATE_RECEIVER = 11;
5086        PROCESS_STATE_TOP_SLEEPING = 12;
5087        PROCESS_STATE_HEAVY_WEIGHT = 13;
5088        PROCESS_STATE_HOME = 14;
5089        PROCESS_STATE_LAST_ACTIVITY = 15;
5090        PROCESS_STATE_CACHED_ACTIVITY = 16;
5091        PROCESS_STATE_CACHED_ACTIVITY_CLIENT = 17;
5092        PROCESS_STATE_CACHED_RECENT = 18;
5093        PROCESS_STATE_CACHED_EMPTY = 19;
5094        PROCESS_STATE_NONEXISTENT = 20;
5095    }
5096
5097    // The process state of the launching activity prior to the launch.
5098    optional AppProcessState process_state = 23;
5099
5100    // The oom adj score of the launching activity prior to the launch.
5101    optional int32 process_oom_adj = 24;
5102
5103    // The stopped state (if any) the package was in before the launch
5104    optional PackageStoppedState package_stopped_state = 25;
5105}
5106
5107message AppStartCanceled {
5108    // The uid if available. -1 means not available.
5109    optional int32 uid = 1 [(is_uid) = true];
5110
5111    // The app package name.
5112    optional string pkg_name = 2;
5113
5114    enum TransitionType {
5115        UNKNOWN = 0;
5116        WARM = 1;
5117        HOT = 2;
5118        COLD = 3;
5119        RELAUNCH = 4;
5120    }
5121    // The transition type.
5122    optional TransitionType type = 3;
5123
5124    // The activity name.
5125    optional string activity_name = 4;
5126}
5127
5128message AppStartFullyDrawn {
5129    // The uid if available. -1 means not available.
5130    optional int32 uid = 1 [(is_uid) = true];
5131
5132    // The app package name.
5133    optional string pkg_name = 2;
5134
5135    enum TransitionType {
5136        UNKNOWN = 0;
5137        WITH_BUNDLE = 1;
5138        WITHOUT_BUNDLE = 2;
5139    }
5140    // The transition type.
5141    optional TransitionType type = 3;
5142
5143    // The activity name.
5144    optional string activity_name = 4;
5145
5146    optional bool transition_process_running = 5;
5147
5148    // App startup time (until call to Activity#reportFullyDrawn()).
5149    optional int64 app_startup_time_millis = 6;
5150
5151    // The reason why the package was optimized.
5152    optional int32 package_optimization_compilation_reason = 7;
5153
5154    // The compiler filter used when when the package was optimized.
5155    optional int32 package_optimization_compilation_filter = 8;
5156
5157    enum SourceType {
5158        UNAVAILABLE = 0;
5159        LAUNCHER = 1;
5160        NOTIFICATION = 2;
5161        LOCKSCREEN = 3;
5162    }
5163    // The type of the startup source.
5164    optional SourceType source_type = 9;
5165
5166    // The time from the startup source to the beginning of handling the startup event.
5167    // -1 means not available.
5168    optional int32 source_event_delay_millis = 10;
5169
5170    // Whether the app is installed on Incremental File System.
5171    optional bool is_incremental = 11;
5172
5173    // Whether the app is still being streamed.
5174    optional bool is_loading = 12;
5175
5176    // The hash value of the activity name.
5177    optional int32 activity_name_hash = 13;
5178
5179    // The timestamp(SystemClock#elapsedRealtime()) when starting activity.
5180    optional int64 activity_start_timestamp_millis = 14;
5181}
5182
5183/**
5184 * Logs when an app enters a different App Compat state.
5185 *
5186 * Logged from:
5187 *   frameworks/base/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
5188 */
5189message AppCompatStateChanged {
5190    // UID of the package whose state changed.
5191    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
5192
5193    enum State {
5194        UNKNOWN = 0;
5195        // The app is not visible or has been closed.
5196        NOT_VISIBLE = 1;
5197        // The app’s bounds aren’t letterboxed.
5198        NOT_LETTERBOXED = 2;
5199        // The app’s bounds are letterboxed because of size-compat-mode.
5200        LETTERBOXED_FOR_SIZE_COMPAT_MODE = 3;
5201        // The app’s bounds are letterboxed because of fixed orientation.
5202        LETTERBOXED_FOR_FIXED_ORIENTATION = 4;
5203        // The app’s bounds are letterboxed because of aspect ratio restrictions.
5204        LETTERBOXED_FOR_ASPECT_RATIO = 5;
5205    }
5206
5207    // Position of the letterbox
5208    enum Position {
5209        UNKNOWN_POSITION = 0;
5210        NOT_LETTERBOXED_POSITION = 1;
5211        CENTER = 2;
5212        LEFT = 3;
5213        RIGHT = 4;
5214        TOP = 5;
5215        BOTTOM = 6;
5216    }
5217
5218    // The state that was entered.
5219    optional State state = 2 [
5220      (state_field_option).exclusive_state = true,
5221      (state_field_option).nested = false];
5222
5223    optional Position letterbox_position = 3;
5224}
5225
5226/**
5227 * Logs when an app that is letterboxed changes position.
5228 *
5229 * Logged from:
5230 *   frameworks/base/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
5231 */
5232
5233message LetterboxPositionChanged {
5234    // UID of the package that is letterboxed.
5235    optional int32 uid = 1 [(is_uid) = true];
5236
5237    // The new position of the letterbox
5238    enum PositionChange {
5239        UNKNOWN = 0;
5240        CENTER_TO_LEFT = 1;
5241        LEFT_TO_CENTER = 2;
5242        CENTER_TO_RIGHT= 3;
5243        RIGHT_TO_CENTER = 4;
5244        CENTER_TO_TOP = 5;
5245        TOP_TO_CENTER = 6;
5246        CENTER_TO_BOTTOM = 7;
5247        BOTTOM_TO_CENTER = 8;
5248    }
5249
5250    optional PositionChange position_change = 2;
5251
5252}
5253
5254/**
5255 * Logs events reported for the Size Compat restart button of an app.
5256 *
5257 * Logged from:
5258 *   frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
5259 */
5260message SizeCompatRestartButtonEventReported {
5261    // UID of the package that has the button.
5262    optional int32 uid = 1 [(is_uid) = true];
5263
5264    enum Event {
5265        UNKNOWN = 0;
5266        APPEARED = 1;
5267        CLICKED = 2;
5268    }
5269
5270    // The event that was reported.
5271    optional Event event = 2;
5272}
5273
5274/**
5275 * Logs events reported for the Camera App Compat control, which is used to
5276 * correct stretched viewfinder in apps that don't handle all possible
5277 * configurations, and changes between them, correctly.
5278 *
5279 * Logged from:
5280 *   frameworks/base/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
5281 */
5282message CameraCompatControlEventReported {
5283  // UID of the package that has the control.
5284  optional int32 uid = 1 [(is_uid) = true];
5285
5286  enum Event {
5287    UNKNOWN = 0;
5288    // Button to apply the treatment appeared.
5289    APPEARED_APPLY_TREATMENT = 1;
5290    // Button to revert the treatment appeared.
5291    APPEARED_REVERT_TREATMENT = 2;
5292    // Users clicked on the button to apply the treatment.
5293    CLICKED_APPLY_TREATMENT = 3;
5294    // Users clicked on the button to revert the treatment.
5295    CLICKED_REVERT_TREATMENT = 4;
5296    // Users clicked on the button to dismiss the control.
5297    CLICKED_DISMISS = 5;
5298  }
5299
5300  // The event that was reported.
5301  optional Event event = 2;
5302}
5303
5304/**
5305 * Logs a picture-in-picture action
5306 * Logged from:
5307 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5308 *      frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
5309 *      frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
5310 */
5311message PictureInPictureStateChanged {
5312    // -1 if it is not available
5313    optional int32 uid = 1 [(is_uid) = true];
5314
5315    optional string short_name = 2;
5316
5317    enum State {
5318        ENTERED = 1;
5319        EXPANDED_TO_FULL_SCREEN = 2;
5320        MINIMIZED = 3;
5321        DISMISSED = 4;
5322    }
5323    optional State state = 3;
5324}
5325
5326/**
5327 * Logs overlay action
5328 * Logged from:
5329 *     services/core/java/com/android/server/wm/Session.java
5330 */
5331message OverlayStateChanged {
5332    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
5333
5334    optional string package_name = 2 [(state_field_option).primary_field = true];
5335
5336    optional bool using_alert_window = 3;
5337
5338    enum State {
5339        ENTERED = 1;
5340        EXITED = 2;
5341    }
5342    optional State state = 4
5343            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
5344}
5345
5346/**
5347 * Logs foreground service starts and stops.
5348 * Note that this is not when a service starts or stops, but when it is
5349 * considered foreground.
5350 * Logged from
5351 *     frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
5352 */
5353message ForegroundServiceStateChanged {
5354    optional int32 uid = 1 [(is_uid) = true];
5355    // package_name + "/" + class_name
5356    optional string short_name = 2;
5357
5358    enum State {
5359        UNKNOWN_STATE = 0;
5360        ENTER = 1;
5361        EXIT = 2;
5362        DENIED = 3;
5363        API_CALL = 4; // this event is to annotate API call.
5364        TIMED_OUT = 5; // SHORT_SERVICE timed out.
5365    }
5366    optional State state = 3;
5367
5368    // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
5369    // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
5370    optional bool allow_while_in_use_permission = 4;
5371    // the reason why FGS is allowed or denied to start. The reason code is defined as
5372    // PowerExemptionManager#ReasonCode.
5373    optional int32 fgs_start_reason_code = 5;
5374    // FGS service's targetSdkVersion.
5375    optional int32 target_sdk_version = 6;
5376    // uid of the app that start/bind this service.
5377    optional int32 calling_uid = 7;
5378    // targetSdkVersion of the app that start/bind this service.
5379    optional int32 caller_target_sdk_version = 8;
5380    // uid of the app that set the temp-allowlist, INVALID_UID (-1) if not in any
5381    // temp-allowlist.
5382    optional int32 temp_allow_list_calling_uid = 9;
5383    // FGS notification was deferred.
5384    optional bool fgs_notification_deferred = 10;
5385    // FGS notification was shown before the FGS finishes, or it wasn't deferred in the first place.
5386    optional bool fgs_notification_shown = 11;
5387    // The duration from state ENTER to state EXIT. Only meaningful when the state is EXIT.
5388    optional int32 fgs_duration_ms = 12;
5389    // Number of times startForeground() is called on this service.
5390    optional int32 fgs_start_count = 13;
5391    // SHA-1 hashed short_name combined with ANDROID_ID.
5392    optional int32 short_name_hash = 14;
5393    // Whether this FGS package had permission to notify the user.
5394    optional bool fgs_has_notification_permission = 15;
5395
5396    // Keep in sync with frameworks/base/core/java/android/content/pm/ServiceInfo.java
5397    enum ForegroundServiceType {
5398        FOREGROUND_SERVICE_TYPE_NONE = 0;
5399        FOREGROUND_SERVICE_TYPE_DATA_SYNC = 0x0001; // 1 << 0
5400        FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK = 0x0002; // 1 << 1
5401        FOREGROUND_SERVICE_TYPE_PHONE_CALL = 0x0004; //1 << 2
5402        FOREGROUND_SERVICE_TYPE_LOCATION = 0x0008; // 1 << 3
5403        FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE = 0x0010; // 1 << 4
5404        FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION = 0x0020; // 1 << 5
5405        FOREGROUND_SERVICE_TYPE_CAMERA = 0x0040; // 1 << 6
5406        FOREGROUND_SERVICE_TYPE_MICROPHONE = 0x0080; // 1 << 7
5407        FOREGROUND_SERVICE_TYPE_HEALTH = 0x0100; // 1 << 8
5408        FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING = 0x0200; // 1 << 9
5409        FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED = 0x0400; // 1 << 10
5410        FOREGROUND_SERVICE_TYPE_SHORT_SERVICE = 0x0800; // 1 << 11
5411        FOREGROUND_SERVICE_TYPE_SPECIAL_USE = 0x40000000; // 1 << 30
5412    }
5413
5414    // The foreground service types, must be one or a combination of the types
5415    // in the ForegroundServiceType above.
5416    optional int32 fgs_types = 16;
5417    // The result check code for the fgs type enforcement.
5418    optional android.app.FgsTypePolicyCheckEnum fgs_type_check_code = 17;
5419    // If true, this FGS service is a delegate (instead of real FGS).
5420    optional bool is_delegate = 18;
5421    // The actual client app's uid.
5422    optional int32 delegate_client_uid = 19 [(is_uid) = true];
5423    // The service module that start/stop the delegate, could be
5424    // MediaSessionService, VOIP, Camera, Audio, Location etc.
5425    // The enum is defined in interface
5426    // ForegroundServiceDelegationOptions.DelegationService
5427    optional int32 delegation_service = 20;
5428
5429    enum ApiJourneyState {
5430    	  UNKNOWN_JOURNEY_STATE = 0;
5431        ENTER_WITH_FGS = 1;
5432        EXIT_WITH_FGS = 2;
5433        EXIT_WITHOUT_FGS = 3;
5434        PAUSE = 4;
5435        RESUME = 5;
5436    }
5437
5438    optional ApiJourneyState api_state = 21;
5439
5440    enum ApiType {
5441    	  UNKNOWN_API_TYPE = 0;
5442        CAMERA = 1;
5443        BLUETOOTH = 2;
5444        LOCATION = 3;
5445        MEDIA_PLAYBACK = 4;
5446        AUDIO = 5;
5447        MICROPHONE = 6;
5448        PHONE_CALL = 7;
5449        USB = 8;
5450        CDM = 9;
5451    }
5452
5453    repeated ApiType api_type = 22;
5454
5455    repeated int64 api_timestamp = 23;
5456
5457    optional int64 api_before_fgs_start_duration_millis = 28;
5458
5459    optional int64 api_after_fgs_end_duration_millis = 29;
5460
5461    // Keep it in sync with ActivityManager.ProcessCapability.
5462    enum ProcessCapability {
5463        PROCESS_CAPABILITY_NONE = 0;
5464        PROCESS_CAPABILITY_FOREGROUND_LOCATION = 1;
5465        PROCESS_CAPABILITY_FOREGROUND_CAMERA = 2;
5466        PROCESS_CAPABILITY_FOREGROUND_MICROPHONE = 4;
5467        PROCESS_CAPABILITY_POWER_RESTRICTED_NETWORK = 8;
5468        PROCESS_CAPABILITY_BFSL = 16;
5469        PROCESS_CAPABILITY_USER_RESTRICTED_NETWORK = 32;
5470    }
5471
5472    optional android.app.ProcessStateEnum service_uid_state = 24 [default = PROCESS_STATE_UNKNOWN];
5473    optional ProcessCapability service_uid_capabilities = 25;
5474
5475    optional android.app.ProcessStateEnum calling_uid_state = 26 [default = PROCESS_STATE_UNKNOWN];
5476    optional ProcessCapability calling_uid_capabilities = 27;
5477
5478    optional int32 while_in_use_reason_code_no_binding = 30;
5479    optional int32 while_in_use_reason_code_in_bind_service = 31;
5480    optional int32 while_in_use_reason_code_by_bindings = 32;
5481    optional int32 fgs_start_reason_code_no_binding = 33;
5482    optional int32 fgs_start_reason_code_in_bind_service = 34;
5483    optional int32 fgs_start_reason_code_by_bindings = 35;
5484
5485    enum FgsStartApi {
5486        // Not available -- used in atoms that are unrelated to this selection.
5487        FGSSTARTAPI_NA = 0;
5488        // The FGS was not started. (likely it's bound.)
5489        FGSSTARTAPI_NONE = 1;
5490        // The FGS was started with Context.startService().
5491        FGSSTARTAPI_START_SERVICE = 2;
5492        // The FGS was started with Context.startForegroundService().
5493        FGSSTARTAPI_START_FOREGROUND_SERVICE = 3;
5494        // It's a delegate FGS.
5495        FGSSTARTAPI_DELEGATE = 4;
5496
5497    }
5498    optional FgsStartApi fgs_start_api = 36;
5499
5500    // Whether setFgsRestrictionLocked() was called in Service.startForeground().
5501    optional bool fgs_restriction_recalculated = 37;
5502}
5503
5504/**
5505 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
5506 * A foreground service session is any continuous period during which the uid holds at least one
5507 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
5508 * Accesses initiated while the uid is in the TOP state are ignored.
5509 * Sessions with no attempted accesses are not logged.
5510 * Logged from
5511 *     frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
5512 */
5513message ForegroundServiceAppOpSessionEnded {
5514    optional int32 uid = 1 [(is_uid) = true];
5515
5516    // The operation's name.
5517    // Only following four ops are logged
5518    // COARSE_LOCATION = 0
5519    // FINE_LOCATION = 1
5520    // CAMERA = 26
5521    // RECORD_AUDIO = 27
5522    optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
5523
5524    // The uid's permission mode for accessing the AppOp during this fgs session.
5525    enum Mode {
5526        MODE_UNKNOWN = 0;
5527        MODE_ALLOWED = 1; // Always allowed
5528        MODE_IGNORED = 2; // Denied
5529        MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
5530    }
5531    optional Mode app_op_mode = 3;
5532
5533    // Number of times this AppOp was requested and allowed.
5534    optional int32 count_ops_accepted = 4;
5535    // Number of times this AppOp was requested but denied.
5536    optional int32 count_ops_rejected = 5;
5537}
5538
5539/**
5540 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
5541 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
5542 * attributed back to the parent (host) uid. One example is Chrome.
5543 *
5544 * Logged from:
5545 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
5546 */
5547message IsolatedUidChanged {
5548    // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
5549    // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
5550    // This field is ignored when event == REMOVED.
5551    optional int32 parent_uid = 1;
5552
5553    optional int32 isolated_uid = 2;
5554
5555    // We expect an isolated uid to be removed before if it's used for another parent uid.
5556    enum Event {
5557        REMOVED = 0;
5558        CREATED = 1;
5559    }
5560    optional Event event = 3;
5561}
5562
5563/*
5564 * Logs the reception of an incoming network packet causing the main system to wake up for
5565 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
5566 * and processed by WakeupController.cpp.
5567 */
5568message PacketWakeupOccurred {
5569    // The uid owning the socket into which the packet was delivered, or -1 if the packet was
5570    // delivered nowhere.
5571    optional int32 uid = 1 [(is_uid) = true];
5572    // The interface name on which the packet was received.
5573    optional string iface = 2;
5574    // The ethertype value of the packet.
5575    optional int32 ethertype = 3;
5576    // String representation of the destination MAC address of the packet.
5577    optional string destination_hardware_address = 4;
5578    // String representation of the source address of the packet if this was an IP packet.
5579    optional string source_ip = 5;
5580    // String representation of the destination address of the packet if this was an IP packet.
5581    optional string destination_ip = 6;
5582    // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
5583    // field if this was an IPv6 packet. The range of possible values is the same for both IP
5584    // families.
5585    optional int32 ip_next_header = 7;
5586    // The source port if this was a TCP or UDP packet.
5587    optional int32 source_port = 8;
5588    // The destination port if this was a TCP or UDP packet.
5589    optional int32 destination_port = 9;
5590}
5591
5592/*
5593 * Logs the memory stats for an app on startup.
5594 * Logged from:
5595 *     frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5596 */
5597message AppStartMemoryStateCaptured {
5598    // The uid if available. -1 means not available.
5599    optional int32 uid = 1 [(is_uid) = true];
5600
5601    // The process name.
5602    optional string process_name = 2;
5603
5604    // The activity name.
5605    optional string activity_name = 3;
5606
5607    // # of page-faults
5608    optional int64 page_fault = 4;
5609
5610    // # of major page-faults
5611    optional int64 page_major_fault = 5;
5612
5613    // RSS
5614    optional int64 rss_in_bytes = 6;
5615
5616    // CACHE
5617    optional int64 cache_in_bytes = 7;
5618
5619    // SWAP
5620    optional int64 swap_in_bytes = 8;
5621}
5622
5623/*
5624 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
5625 * for LMK event.
5626 * Logged from:
5627 *      system/core/lmkd/lmkd.c
5628 */
5629message LmkStateChanged {
5630    enum State {
5631        UNKNOWN = 0;
5632        START = 1;
5633        STOP = 2;
5634    }
5635    optional State state = 1;
5636}
5637
5638/*
5639 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
5640 * Logged from:
5641 *      system/core/lmkd/lmkd.c
5642 */
5643message LmkKillOccurred {
5644    enum Reason {
5645        UNKNOWN = 0;
5646        PRESSURE_AFTER_KILL = 1;
5647        NOT_RESPONDING = 2;
5648        LOW_SWAP_AND_THRASHING = 3;
5649        LOW_MEM_AND_SWAP = 4;
5650        LOW_MEM_AND_THRASHING = 5;
5651        DIRECT_RECL_AND_THRASHING = 6;
5652        LOW_MEM_AND_SWAP_UTIL = 7;
5653        LOW_FILECACHE_AFTER_THRASHING = 8;
5654    }
5655
5656    // The uid if available. -1 means not available.
5657    optional int32 uid = 1 [(is_uid) = true];
5658
5659    // The process name.
5660    optional string process_name = 2;
5661
5662    // oom adj score.
5663    optional int32 oom_adj_score = 3;
5664
5665    // # of page-faults
5666    optional int64 page_fault = 4;
5667
5668    // # of major page-faults
5669    optional int64 page_major_fault = 5;
5670
5671    // RSS
5672    optional int64 rss_in_bytes = 6;
5673
5674    // CACHE
5675    optional int64 cache_in_bytes = 7;
5676
5677    // SWAP
5678    optional int64 swap_in_bytes = 8;
5679
5680    // The elapsed real time of start of the process.
5681    optional int64 process_start_time_nanos = 9;
5682
5683    // Min oom adj score considered by lmkd.
5684    optional int32 min_oom_score = 10;
5685
5686    // Free physical memory on device at LMK time.
5687    optional int32 free_mem_kb = 11;
5688
5689    // Free swap on device at LMK time.
5690    optional int32 free_swap_kb = 12;
5691
5692    // What triggered the LMK event.
5693    optional Reason reason = 13;
5694
5695    // Current thrashing levels (workingset_refaults/filecache in %).
5696    optional int32 thrashing = 14;
5697
5698    // Max thrashing levels (workingset_refaults/filecache in %).
5699    optional int32 max_thrashing = 15;
5700
5701    // How many active foreground services across the system
5702    optional int32 total_foreground_services = 16;
5703
5704    // How many processes hosting foreground services
5705    optional int32 procs_with_foreground_services = 17;
5706}
5707
5708/*
5709 * Logs when the ActivityManagerService detects that an app died.
5710 *
5711 * Logged from:
5712 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5713 */
5714message AppDied {
5715    // timestamp(elapsedRealtime) of record creation
5716    optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
5717}
5718
5719/**
5720 * An atom for generic metrics logging. Available from Android Q.
5721 */
5722message GenericAtom {
5723    // The uid of the application that sent this custom atom.
5724    optional int32 uid = 1 [(is_uid) = true];
5725
5726    // An event_id indicates the type of event.
5727    optional android.stats.EventType event_id = 2;
5728}
5729
5730/**
5731 * Atom for simple logging of user interaction and impression events, such as "the user touched
5732 * this button" or "this dialog was displayed".
5733 * Keep the UI event stream clean: don't use for system or background events.
5734 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
5735 *
5736 * Logged from:
5737 *   frameworks/base/services/core/java/com/android/server/
5738 *   frameworks/base/packages/SystemUI/src/com/android/systemui/
5739 */
5740message UiEventReported {
5741    // The event_id.
5742    optional int32 event_id = 1;
5743    // The event's source or target uid and package, if applicable.
5744    // For example, the package posting a notification, or the destination package of a share.
5745    optional int32 uid = 2 [(is_uid) = true];
5746    optional string package_name = 3;
5747    // An identifier used to disambiguate which logs refer to a particular instance of some
5748    // UI element. Useful when there might be multiple instances simultaneously active.
5749    optional int32 instance_id = 4;
5750}
5751
5752/**
5753 * Atom for logging Dream user interaction and impression events.
5754 *
5755 * Logged from:
5756 *   frameworks/base/services/core/java/com/android/server/
5757 */
5758message DreamUiEventReported {
5759    // The event's source or target uid, if applicable.
5760    optional int32 uid = 1 [(is_uid) = true];
5761    // The event_id (as for UiEventReported).
5762    optional int32 event_id = 2;
5763    // An identifier used to disambiguate which logs refer to a particular instance of some
5764    // UI element. Useful when there might be multiple instances simultaneously active.
5765    optional int32 instance_id = 3;
5766
5767    // The name of the dream component, which identifies the type of the dream.
5768    optional string dream_component_name = 4;
5769}
5770
5771/**
5772 * Reports a notification was created or updated.
5773 *
5774 * Logged from:
5775 *   frameworks/base/services/core/java/com/android/server/notification/
5776 */
5777message NotificationReported {
5778    // The event_id (as for UiEventReported).
5779    optional int32 event_id = 1;
5780    // The notifying app's uid and package.
5781    optional int32 uid = 2 [(is_uid) = true];
5782    optional string package_name = 3;
5783    // A small system-assigned identifier for the notification.
5784    // Locally probably-unique, but expect collisions across users and/or days.
5785    optional int32 instance_id = 4;
5786    optional int32 notification_id_hash = 5;  // Small hash of the app-assigned notif ID + tag
5787    optional int32 channel_id_hash = 6;  // Small hash of app-assigned channel ID
5788
5789    // Grouping information
5790    optional int32 group_id_hash = 7;  // Small hash of the group ID of the notification
5791    optional int32 group_instance_id = 8;  // Instance_id of the group-summary notification
5792    optional bool is_group_summary = 9;  // Tags the group-summary notification
5793
5794    // Attributes
5795    optional string category = 10;   // App-assigned notification category (API-defined strings)
5796    optional int32 style = 11;       // App-assigned notification style
5797    optional int32 num_people = 12;  // Number of Person records attached to the notification
5798
5799    // Ordering, importance and interruptiveness
5800
5801    optional int32 position = 13;    // Position in NotificationManager's list
5802
5803    optional android.stats.sysui.NotificationImportance importance = 14;
5804    optional int32 alerting = 15;    // Bitfield, 1=buzz 2=beep 4=blink
5805
5806    enum NotificationImportanceExplanation {
5807        IMPORTANCE_EXPLANATION_UNKNOWN = 0;
5808        IMPORTANCE_EXPLANATION_APP = 1;     // App-specified channel importance.
5809        IMPORTANCE_EXPLANATION_USER = 2;    // User-specified channel importance.
5810        IMPORTANCE_EXPLANATION_ASST = 3;    // Notification Assistant override.
5811        IMPORTANCE_EXPLANATION_SYSTEM = 4;  // System override.
5812        // Like _APP, but based on pre-channels priority signal.
5813        IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
5814    }
5815
5816    optional NotificationImportanceExplanation importance_source = 16;
5817    optional android.stats.sysui.NotificationImportance importance_initial = 17;
5818    optional NotificationImportanceExplanation importance_initial_source = 18;
5819    optional android.stats.sysui.NotificationImportance importance_asst = 19;
5820    optional int32 assistant_hash = 20;
5821    optional float assistant_ranking_score = 21;
5822
5823    // Fields for tracking ongoing and foreground service notifications
5824    optional bool is_ongoing = 22;
5825    optional bool is_foreground_service = 23;
5826    // Fields to know about the timeout for notifications.
5827    optional int64 timeout_millis = 24;
5828
5829    // Field for tracking whether the notification is non-dismissible
5830    optional bool is_non_dismissible = 25;
5831
5832    // Time elapsed between the notify() API call and the NLSes being told about the notification.
5833    // Will be 0 for NotificationReported protos that do not correspond to a notify() call.
5834    optional int64 post_duration_millis = 26;
5835
5836    // State of the full screen intent posted with this notification.
5837    enum FsiState {
5838        // This notification was not posted with a full screen intent.
5839        NO_FSI = 0;
5840        // This notification was posted with a full screen intent and the FSI permission is granted.
5841        FSI_ALLOWED = 1;
5842        // This notification was posted with a full screen intent but the FSI permission is denied.
5843        FSI_DENIED = 2;
5844    }
5845    optional FsiState fsi_state = 27;
5846
5847    // True if the device was locked or showing unlocked AOD.
5848    optional bool is_locked = 28;
5849
5850    // Age of the notification in minutes.
5851    optional int32 age_in_minutes = 29;
5852}
5853
5854/**
5855 * Reports a notification channel, or channel group, was created, updated, or deleted.
5856 *
5857 * Logged from:
5858 *   frameworks/base/services/core/java/com/android/server/notification/
5859 */
5860message NotificationChannelModified {
5861    // The event_id (as for UiEventReported).
5862    optional int32 event_id = 1;
5863    // The notifying app's uid and package.
5864    optional int32 uid = 2 [(is_uid) = true];
5865    optional string package_name = 3;
5866    // Hash of app-assigned notification channel ID or channel-group ID
5867    optional int32 channel_id_hash = 4;
5868    // Previous importance setting, if applicable
5869    optional android.stats.sysui.NotificationImportance old_importance = 5;
5870    // New importance setting
5871    optional android.stats.sysui.NotificationImportance importance = 6;
5872    // whether or not this channel represents a conversation
5873    optional bool is_conversation = 7;
5874    // Hash of app-assigned notification conversation id
5875    optional int32 conversation_id_hash = 8;
5876    // whether or not the user demoted this channel out of the conversation space
5877    optional bool is_conversation_demoted = 9;
5878    // whether this conversation is marked as being a priority
5879    optional bool is_conversation_priority = 10;
5880}
5881
5882/**
5883 * Logged when notification are dismissed. If multiple notifications are dismissed together,
5884 * this is only logged once per style per UID.
5885 * Logged from
5886 *    frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging
5887 */
5888message NotificationDismissed {
5889    // UID if the application (can be mapped to package and version)
5890    optional int32 uid = 1 [(is_uid) = true];
5891    // Integer enum value showing aggregated notification style.
5892    optional android.stats.sysui.NotificationStyle style = 2;
5893    // Reason for dismissal, based on REASON_ constants in
5894    // frameworks/base/core/java/android/service/notification/NotificationListenerService.java
5895    optional int32 reason = 3;
5896    // Number of notifications dismissed.
5897    optional int32 count = 4;
5898    // Memory use of Notification object being dismissed, in KB.
5899    optional int32 notificationObjectMemoryUse = 5;
5900    // Memory use of Notification views being dismissed, in KB.
5901    optional int32 notificationViewMemoryUse = 6;
5902    // Current memory use of SystemUI, RSS Anon in KB.
5903    optional int32 systemUiMemoryUse = 7;
5904}
5905
5906/**
5907 * Logs when a biometric acquire event occurs.
5908 *
5909 * Logged from:
5910 *   frameworks/base/services/core/java/com/android/server/biometrics
5911 */
5912message BiometricAcquired {
5913    // Biometric modality that was acquired.
5914    optional android.hardware.biometrics.ModalityEnum modality = 1;
5915    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
5916    optional int32 user = 2;
5917    // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
5918    optional bool is_crypto = 3;
5919    // Action that the device is performing. Acquired messages are only expected for enroll and
5920    // authenticate. Other actions may indicate an error.
5921    optional android.hardware.biometrics.ActionEnum action = 4;
5922    // The client that this acquisition was received for.
5923    optional android.hardware.biometrics.ClientEnum client = 5;
5924    // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
5925    optional int32 acquire_info = 6;
5926    // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
5927    optional int32 acquire_info_vendor = 7;
5928    // Dictates if this message should trigger additional debugging.
5929    optional bool debug = 8;
5930    // The ID of the biometric sensor associated with this action.
5931    optional int32 sensor_id = 9;
5932    // The ID of the session this event occurred in (if any)
5933    optional int32 session_id = 10;
5934    // The type of session (i.e. CUJ)
5935    optional android.hardware.biometrics.SessionTypeEnum session_type = 11;
5936    // If the AoD was on when this event occurred.
5937    optional bool is_aod = 12;
5938    // If the display is on when this event occurred.
5939    optional bool is_display_on = 13;
5940    // The dock state when this event occurred.
5941    optional android.server.DockStateEnum dock_state = 14;
5942    // The orientation of the device when this event occurred
5943    optional android.hardware.biometrics.OrientationEnum orientation = 15;
5944    // The fold state of the device when this event occurred
5945    optional android.hardware.biometrics.FoldStateEnum fold_state = 16;
5946    // The order this event was processed by the framework, if part of a session
5947    optional int32 session_order = 17;
5948    // An associated device wake up reason for this event, or UNKNOWN if the event was not triggered due to a wake up event.
5949    optional android.hardware.biometrics.WakeReasonEnum wake_reason = 18;
5950}
5951
5952/**
5953 * Logs when a biometric authentication event occurs.
5954 *
5955 * Logged from:
5956 *   frameworks/base/services/core/java/com/android/server/biometrics
5957 */
5958message BiometricAuthenticated {
5959    // Biometric modality that was used.
5960    optional android.hardware.biometrics.ModalityEnum modality = 1;
5961    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
5962    optional int32 user = 2;
5963    // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
5964    // storage.
5965    optional bool is_crypto = 3;
5966    // The client that this acquisition was received for.
5967    optional android.hardware.biometrics.ClientEnum client = 4;
5968    // If authentication requires user confirmation. See BiometricPrompt's
5969    // setRequireConfirmation(bool) method.
5970    optional bool require_confirmation = 5;
5971
5972    enum State {
5973        UNKNOWN = 0;
5974        REJECTED = 1;
5975        PENDING_CONFIRMATION = 2;
5976        CONFIRMED = 3;
5977    }
5978
5979    // State of the current auth attempt.
5980    optional State state = 6;
5981    // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
5982    // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
5983    // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
5984    // CONFIRMED.
5985    optional int64 latency_millis = 7;
5986    // Dictates if this message should trigger additional debugging.
5987    optional bool debug = 8;
5988    // The ID of the biometric sensor associated with this action.
5989    optional int32 sensor_id = 9;
5990    // The ambient light lux when authenticated.
5991    optional float ambient_light_lux = 10;
5992    // The ID of the session this event occurred in (if any)
5993    optional int32 session_id = 11;
5994    // The type of session (i.e. CUJ)
5995    optional android.hardware.biometrics.SessionTypeEnum session_type = 12;
5996    // If the AoD was on when this event occurred.
5997    optional bool is_aod = 13;
5998    // If the display is on when this event occurred.
5999    optional bool is_display_on = 14;
6000    // The dock state when this event occurred.
6001    optional android.server.DockStateEnum dock_state = 15;
6002    // The orientation of the device when this event occurred
6003    optional android.hardware.biometrics.OrientationEnum orientation = 16;
6004    // The fold state of the device when this event occurred
6005    optional android.hardware.biometrics.FoldStateEnum fold_state = 17;
6006    // The order this event was processed by the framework, if part of a session
6007    optional int32 session_order = 18;
6008    // An associated device wake up reason for this event, or UNKNOWN if the event was not triggered due to a wake up event.
6009    optional android.hardware.biometrics.WakeReasonEnum wake_reason = 19;
6010    // Additional modality-specific details that caused a biometric to be activated (often associated with a device wake_reason).
6011    repeated android.hardware.biometrics.WakeReasonDetailsEnum wake_reason_details = 20;
6012}
6013
6014/**
6015 * Logs when a biometric error occurs.
6016 *
6017 * Logged from:
6018 *   frameworks/base/services/core/java/com/android/server/biometrics
6019 */
6020message BiometricErrorOccurred {
6021    // Biometric modality that was used.
6022    optional android.hardware.biometrics.ModalityEnum modality = 1;
6023    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
6024    optional int32 user = 2;
6025    // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
6026    optional bool is_crypto = 3;
6027    // Action that the device is performing.
6028    optional android.hardware.biometrics.ActionEnum action = 4;
6029    // The client that this acquisition was received for.
6030    optional android.hardware.biometrics.ClientEnum client = 5;
6031    // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
6032    // are unique to modality.
6033    optional int32 error_info = 6;
6034    // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
6035    // by the vendor and not specified by the HIDL interface.
6036    optional int32 error_info_vendor = 7;
6037    // Dictates if this message should trigger additional debugging.
6038    optional bool debug = 8;
6039    // Time spent during the authentication attempt.
6040    optional int64 latency_millis = 9;
6041    // The ID of the biometric sensor associated with this action.
6042    optional int32 sensor_id = 10;
6043    // The ID of the session this event occurred in (if any)
6044    optional int32 session_id = 11;
6045    // The type of session (i.e. CUJ)
6046    optional android.hardware.biometrics.SessionTypeEnum session_type = 12;
6047    // If the AoD was on when this event occurred.
6048    optional bool is_aod = 13;
6049    // If the display is on when this event occurred.
6050    optional bool is_display_on = 14;
6051    // The dock state when this event occurred.
6052    optional android.server.DockStateEnum dock_state = 15;
6053    // The orientation of the device when this event occurred
6054    optional android.hardware.biometrics.OrientationEnum orientation = 16;
6055    // The fold state of the device when this event occurred
6056    optional android.hardware.biometrics.FoldStateEnum fold_state = 17;
6057    // The order this event was processed by the framework, if part of a session
6058    optional int32 session_order = 18;
6059    // An associated device wake up reason for this event, or UNKNOWN if the event was not triggered due to a wake up event.
6060    optional android.hardware.biometrics.WakeReasonEnum wake_reason = 19;
6061    // Additional modality-specific details that caused a biometric to be activated (often associated with a device wake_reason).
6062    repeated android.hardware.biometrics.WakeReasonDetailsEnum wake_reason_details = 20;
6063}
6064
6065/**
6066 * Logs when a system health issue is detected.
6067 * Logged from:
6068 *   frameworks/base/services/core/java/com/android/server/biometrics
6069 */
6070message BiometricSystemHealthIssueDetected {
6071    // Biometric modality.
6072    optional android.hardware.biometrics.ModalityEnum modality = 1;
6073    // Type of issue detected.
6074    optional android.hardware.biometrics.IssueEnum issue = 2;
6075    // Dictates if this message should trigger additional debugging.
6076    optional bool debug = 3;
6077    // The ID of the biometric sensor associated with this action.
6078    optional int32 sensor_id = 4;
6079}
6080
6081/**
6082 * Logs when a biometric enrollment occurs.
6083 *
6084 * Logged from:
6085 *   frameworks/base/services/core/java/com/android/server/biometrics
6086 */
6087message BiometricEnrolled {
6088    // Biometric modality that was used.
6089    optional android.hardware.biometrics.ModalityEnum modality = 1;
6090    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
6091    optional int32 user = 2;
6092    // The amount of time the enrollment took in milliseconds.
6093    optional int64 latency_millis = 3;
6094    // Whether or not the enrollment was successful.
6095    optional bool success = 4;
6096    // The ID of the biometric sensor associated with this action.
6097    optional int32 sensor_id = 5;
6098    // The ambient light lux when the user enrolled.
6099    optional float ambient_light_lux = 6;
6100}
6101
6102/*
6103 * Logs when one of the BiometricPrompt#authenticate() method variants is called.
6104 *
6105 * Logged from:
6106 *   frameworks/base/services/core/java/com/android/server/biometrics
6107 *
6108 */
6109 message AuthPromptAuthenticateInvoked {
6110    // Whether an explicit CryptoObject was passed to the biometric prompt.
6111    optional bool is_crypto = 1;
6112    // The value passed to setConfirmationRequired(boolean), or true if not set.
6113    optional bool is_confirmation_required = 2;
6114    // The value passed to setDeviceCredentialAllowed(boolean), or false if not set.
6115    optional bool is_credential_allowed = 3;
6116    // Whether a value was passed to setAllowedAuthenticators(int).
6117    optional bool is_allowed_authenticators_set = 4;
6118    // The value passed to setAllowedAuthenticators(int), if any.
6119    optional int32 allowed_authenticators = 5;
6120}
6121
6122/*
6123 * Logs when one of the BiometricPrompt#canAuthenticate() method variants is called.
6124 *
6125 * Logged from:
6126 *   frameworks/base/services/core/java/com/android/server/biometrics
6127 *
6128 */
6129message AuthManagerCanAuthenticateInvoked {
6130    // Whether a bit field of allowed authenticator types was provided as an argument.
6131    optional bool is_allowed_authenticators_set = 1;
6132    // The bit field of allowed authenticator types provided, if any.
6133    optional int32 allowed_authenticators = 2;
6134    // The authentication status code that was returned.
6135    optional int32 result_code = 3;
6136}
6137
6138/*
6139 * Logs when Biometric enrollment is requested via the ACTION_BIOMETRIC_ENROLL intent action.
6140 *
6141 * Logged from:
6142 *   frameworks/base/services/core/java/com/android/server/biometrics
6143 *
6144 */
6145message AuthEnrollActionInvoked {
6146    // Whether a Class 3 (strong) biometric was previously enrolled on this device.
6147    optional bool is_strong_biometric_enrolled = 1;
6148    // Whether a Class 2 (weak) biometric was previously enrolled on this device.
6149    optional bool is_weak_biometric_enrolled = 2;
6150    // Whether a PIN/pattern/password was previously enrolled on this device.
6151    optional bool is_device_credential_enrolled = 3;
6152    // Whether a bit field of allowed authenticator types was provided as an extra.
6153    optional bool is_allowed_authenticators_set = 4;
6154    // The bit field of allowed authenticator types provided, if any.
6155    optional int32 allowed_authenticators = 5;
6156}
6157
6158/*
6159 * Logs when an application uses a deprecated biometric or authentication API feature.
6160 *
6161 * Logged from:
6162 *   frameworks/base/services/core/java/com/android/server/biometrics
6163 */
6164 message AuthDeprecatedAPIUsed {
6165    enum APIEnum {
6166        API_UNKNOWN = 0;
6167        // android.hardware.fingerprint.FingerprintManager#authenticate(CryptoObject,
6168        // CancellationSignal, int, AuthenticationCallback, Handler)
6169        API_FINGERPRINT_MANAGER_AUTHENTICATE = 1;
6170        // android.hardware.fingerprint.FingerprintManager#hasEnrolledFingerprints()
6171        API_FINGERPRINT_MANAGER_HAS_ENROLLED_FINGERPRINTS = 2;
6172        // android.hardware.fingerprint.FingerprintManager#isHardwareDetected()
6173        API_FINGERPRINT_MANAGER_IS_HARDWARE_DETECTED = 3;
6174        // android.hardware.biometrics.BiometricManager#canAuthenticate()
6175        API_BIOMETRIC_MANAGER_CAN_AUTHENTICATE = 4;
6176    }
6177
6178     // The deprecated API feature that was used.
6179     optional APIEnum deprecated_api = 1;
6180     // The UID of the application that used the deprecated API.
6181     optional int32 app_uid = 2;
6182     // The target SDK version (API level) of the application that used the deprecated API.
6183     optional int32 target_sdk = 3;
6184 }
6185
6186/*
6187 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
6188 */
6189message FlagFlipUpdateOccurred {
6190    // If the event is from a flag config package, specify the package name.
6191    optional string flag_flip_package_name = 1;
6192
6193    // The order id of the package
6194    optional int64 order_id = 2;
6195}
6196
6197/**
6198 * Potential experiment ids that goes with a train install.
6199 * Should be kept in sync with experiment_ids.proto.
6200 */
6201message TrainExperimentIds {
6202    repeated int64 experiment_id = 1;
6203}
6204
6205/*
6206 * Logs when a binary push state changes.
6207 * Logged by the installer via public api.
6208 */
6209message BinaryPushStateChanged {
6210    // Name of the train.
6211    optional string train_name = 1;
6212    // Version code for a "train" of packages that need to be installed atomically
6213    optional int64 train_version_code = 2;
6214    // After installation of this package, device requires a restart.
6215    optional bool requires_staging = 3;
6216    // Rollback should be enabled for this install.
6217    optional bool rollback_enabled = 4;
6218    // Requires low latency monitoring if possible.
6219    optional bool requires_low_latency_monitor = 5;
6220
6221    enum State {
6222        UNKNOWN = 0;
6223        INSTALL_REQUESTED = 1;
6224        INSTALL_STARTED = 2;
6225        INSTALL_STAGED_NOT_READY = 3;
6226        INSTALL_STAGED_READY = 4;
6227        INSTALL_SUCCESS = 5;
6228        // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6229        // and INSTALL_FAILURE_COMMIT.
6230        INSTALL_FAILURE = 6  [deprecated = true];
6231        // This enum is for installs that are manually cancelled via the Manual Update UI.
6232        INSTALL_CANCELLED = 7;
6233        INSTALLER_ROLLBACK_REQUESTED = 8;
6234        INSTALLER_ROLLBACK_INITIATED = 9;
6235        INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6236        INSTALLER_ROLLBACK_STAGED = 11;
6237        INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6238        INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6239        INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6240        INSTALLER_ROLLBACK_SUCCESS = 15;
6241        INSTALLER_ROLLBACK_FAILURE = 16;
6242        INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6243        INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6244        INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6245        INSTALL_STAGED_CANCEL_REQUESTED = 20;
6246        INSTALL_STAGED_CANCEL_SUCCESS = 21;
6247        INSTALL_STAGED_CANCEL_FAILURE = 22;
6248        INSTALL_FAILURE_DOWNLOAD = 23;
6249        INSTALL_FAILURE_STATE_MISMATCH = 24;
6250        INSTALL_FAILURE_COMMIT = 25;
6251        REBOOT_TRIGGERED = 26;
6252        // Logged after INSTALL_REQUESTED for devices installing a train that
6253        // contains no module requiring reboot.
6254        REBOOT_NOT_REQUIRED = 27;
6255        // Logged after INSTALL_REQUESTED for devices that are installing a train
6256        // which requires reboot and eligible for soft restart.
6257        SOFT_RESTART_ELIGIBLE = 28;
6258        // Logged after INSTALL_REQUESTED for devices that are installing a train
6259        // which requires reboot and eligible for notification restart.
6260        NOTIFICATION_RESTART_ELIGIBLE = 29;
6261        // Logged after INSTALL_REQUESTED for devices that are installing a train
6262        // which requires reboot and not eligible for any reboot promotion strategy
6263        // (e.g. soft restart, notification restart).
6264        NO_REBOOT_PROMOTION_STRATEGY_ELIGIBLE = 30;
6265        REBOOT_TRIGGER_FAILURE = 31;
6266        // Logged after INSTALL_REQUESTED for devices installing a train which
6267        // requires reboot and eligible for unattended reboot.
6268        UNATTENDED_REBOOT_ELIGIBLE = 32;
6269        // Logged when Phonesky trys to prepare LSKF.
6270        LSKF_PREPARATION_INITITATED = 33;
6271        // Logged when LSKF preparation succeeded.
6272        LSKF_PREPARATION_SUCCESS = 34;
6273        // Logged when LSKF preparation failed.
6274        LSKF_PREPARATION_FAILURE = 35;
6275        // Logged when Phonesky cannot schedule reboot job on a unattended reboot
6276        // eligible device.
6277        UNATTENDED_REBOOT_NOT_TRIGGERED = 36;
6278        // Logged when SIM PIN recovery preparation succeeded.
6279        SIM_PIN_PREPARATION_SUCCESS = 37;
6280        // Logged when SIM PIN recovery preparation failed.
6281        SIM_PIN_PREPARATION_FAILURE = 38 [deprecated = true];
6282        // Logged when unattended reboot is aborted and falls back to organic
6283        // reboot.
6284        UNATTENDED_REBOOT_ABORT = 39;
6285        // Logged when Phonesky re-prepares LSKF.
6286        LSKF_PREPARATION_RETRY = 40;
6287        // Logged when the device doesn’t support checkpoint and cannot stage
6288        // multiple sessions.
6289        CHECKPOINT_NOT_SUPPORTED = 41;
6290        // Logged when Phonesky instructs Android platform to monitor reboot
6291        // readiness signal.
6292        PENDING_REBOOT_MARKED = 42;
6293        // Logged when Phonesky instructs Android platform to stop monitoring reboot
6294        // readiness signal.
6295        PENDING_REBOOT_CANCELLED = 43 [deprecated = true];
6296        // Logged when Phonesky receives reboot readiness broadcast and the device
6297        // is ready to reboot.
6298        SIGNAL_READY_TO_REBOOT_RECEIVED = 44;
6299        // Logged when Phonesky receives reboot readiness broadcast and the device
6300        // is not ready to reboot.
6301        SIGNAL_NOT_READY_TO_REBOOT_RECEIVED = 45;
6302        // Logged when Phonesky cancels an untracked train.
6303        UNTRACKED_TRAIN_CANCELLED = 46;
6304    }
6305    optional State state = 6;
6306    // Possible experiment ids for monitoring this push.
6307    optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
6308    // Index of the Android User. E.g. 0 for primary profile, 10, 11, 12
6309    // for guest and secondary profiles. Not PII.
6310    optional int32 user_id = 8;
6311    // Log additional info for a state when needed.
6312    // When state = REBOOT_TRIGGERED, this field logs the reboot type:
6313    //  USERSPACE_REBOOT = 1.
6314    //  FORCED_REBOOT = 2.
6315    //  NOTIFICATION_RESTART_REBOOT = 3.
6316    //  UNATTENDED_REBOOT_SECURED_AND_SIM_PIN = 4.
6317    //  UNATTENDED_REBOOT_SECURED_NO_SIM_PIN = 5.
6318    //  UNATTENDED_REBOOT_UNSECURED_AND_SIM_PIN = 6.
6319    //  UNATTENDED_REBOOT_UNSECURED_NO_SIM_PIN = 7.
6320    // When state = INSTALL_FAILURE, this field logs the Install errors related
6321    // statusCode
6322    // When state = UNATTENDED_REBOOT_ABORT, this field logs the cancellation
6323    // reason:
6324    //  LSKF_RETRY_EXCEED_MAXIMUM = 1.
6325    //  SIM_PIN_NOT_PREPARED = 2.
6326    // When state = UNATTENDED_REBOOT_ELIGIBLE, this field logs the cancellation
6327    // reason:
6328    //  UNATTENDED_REBOOT_SECURED_AND_SIM_PIN = 1.
6329    //  UNATTENDED_REBOOT_SECURED_NO_SIM_PIN = 2.
6330    //  UNATTENDED_REBOOT_UNSECURED_AND_SIM_PIN = 3.
6331    //  UNATTENDED_REBOOT_UNSECURED_NO_SIM_PIN = 4.
6332    // When state = UNATTENDED_REBOOT_NOT_TRIGGERED, this field logs the
6333    // cancellation reason:
6334    //  LSKF_NOT_PREPARED = 1.
6335    //  REBOOT_NOT_READY = 2.
6336    // When state = PENDING_REBOOT_CANCELLED, this field logs the cancellation
6337    // reason:
6338    //  LSKF_NOT_PREPARED = 1.
6339    //  NO_STAGED_TRAIN = 2.
6340    //  HAS_SIM_PIN_AND_SIM_PIN_STORAGE_DISABLED = 3.
6341    optional int32 reason = 9;
6342    // Whether or not this is a rollback event.
6343    optional bool is_rollback = 10;
6344}
6345
6346/* Test atom, is not logged anywhere */
6347message TestAtomReported {
6348    repeated AttributionNode attribution_node = 1;
6349    optional int32 int_field = 2;
6350    optional int64 long_field = 3;
6351    optional float float_field = 4;
6352    optional string string_field = 5;
6353    optional bool boolean_field = 6;
6354    enum State {
6355        UNKNOWN = 0;
6356        OFF = 1;
6357        ON = 2;
6358    }
6359    optional State state = 7;
6360    optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
6361    repeated int32 repeated_int_field = 9;
6362    repeated int64 repeated_long_field = 10;
6363    repeated float repeated_float_field = 11;
6364    repeated string repeated_string_field = 12;
6365    repeated bool repeated_boolean_field = 13;
6366    repeated State repeated_enum_field = 14;
6367}
6368
6369/** Represents USB port overheat event. */
6370message UsbPortOverheatEvent {
6371    /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
6372    optional int32 plug_temperature_deci_c = 1;
6373
6374    /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
6375    optional int32 max_temperature_deci_c = 2;
6376
6377    /* Time between USB plug event and overheat threshold trip, in seconds. */
6378    optional int32 time_to_overheat_secs = 3;
6379
6380    /* Time between overheat threshold trip and hysteresis, in seconds. */
6381    optional int32 time_to_hysteresis_secs = 4;
6382
6383    /* Time between hysteresis and active mitigation ending, in seconds. */
6384    optional int32 time_to_inactive_secs = 5;
6385};
6386
6387/**
6388 * Logs total effective full charge and discharge cycles on a battery.
6389 * Here are some examples of one effective cycle:
6390 *   1) the battery charges from 0% to 100% and drains back to 0%,
6391 *   2) charging from 50% to 100% and draining back to 50% twice.
6392 * Pulled from:
6393 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
6394 */
6395message BatteryCycleCount {
6396    /* Number of total charge and discharge cycles on the system battery. */
6397    optional int32 cycle_count = 1;
6398}
6399
6400/**
6401 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
6402 * others), its type (public or private) and the size in bytes.
6403 * Pulled from:
6404 *   StatsCompanionService
6405 */
6406
6407message ExternalStorageInfo {
6408
6409    enum VolumeType {
6410        UNKNOWN = 0;
6411        PUBLIC = 1;
6412        PRIVATE = 2;
6413        OTHER = 3;
6414    }
6415
6416    // The type of external storage.
6417    optional android.stats.storage.ExternalStorageType storage_type = 1;
6418    // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
6419    optional VolumeType volume_type = 2;
6420    // Total size of the sd card in bytes.
6421    optional int64 size_bytes = 3;
6422}
6423
6424/*
6425 * Logs when a connection becomes available and lost.
6426 * Logged in StatsCompanionService.java
6427 */
6428message ConnectivityStateChanged {
6429  // Id of the network.
6430  optional int32 net_id = 1;
6431
6432  enum State {
6433    UNKNOWN = 0;
6434    CONNECTED = 1;
6435    DISCONNECTED = 2;
6436  }
6437  // Connected state of a network.
6438  optional State state = 2;
6439}
6440
6441/**
6442 * Logs when a service starts and stops.
6443 * Logged from:
6444 *   services/core/java/com/android/server/am/ActiveServices.java
6445 */
6446message ServiceStateChanged {
6447
6448    optional int32 uid = 1 [(is_uid) = true];
6449
6450    optional string package_name = 2;
6451
6452    optional string service_name = 3;
6453
6454    enum State {
6455        START = 1;
6456        STOP = 2;
6457    }
6458
6459    optional State state = 4;
6460}
6461
6462/**
6463 * Logs when a service is launched.
6464 * Logged from:
6465 *   services/core/java/com/android/server/am/ActiveServices.java
6466 */
6467message ServiceLaunchReported {
6468
6469    optional int32 uid = 1 [(is_uid) = true];
6470
6471    optional string package_name = 2;
6472
6473    optional string service_name = 3;
6474}
6475
6476/**
6477 * The type of process start. It's the same as ProcessStartTime.StartType but we
6478 * can't re-type that for background compatibility.
6479 */
6480enum ProcessStartType {
6481    PROCESS_START_TYPE_UNKNOWN = 0;
6482    PROCESS_START_TYPE_WARM = 1;
6483    PROCESS_START_TYPE_HOT = 2;
6484    PROCESS_START_TYPE_COLD = 3;
6485}
6486
6487/**
6488 * The stopped state of a package.
6489 */
6490enum PackageStoppedState {
6491    PACKAGE_STATE_UNKNOWN = 0;
6492    PACKAGE_STATE_NORMAL = 1; // The package is not in any stopped state
6493    PACKAGE_STATE_STOPPED = 2; // ApplicationInfo.FLAG_STOPPED
6494}
6495
6496/**
6497 * Logs when a service request is made.
6498 * Logged from:
6499 *   services/core/java/com/android/server/am/ActiveServices.java
6500 */
6501message ServiceRequestEventReported {
6502    /** The package uid of the service host. */
6503    optional int32 uid = 1 [(is_uid) = true];
6504
6505    /** The package uid of the service launch request. */
6506    optional int32 requester_uid = 2 [(is_uid) = true];
6507
6508    /** The action name of the service request. */
6509    optional string action_name = 3;
6510
6511    /**
6512     * The types of the requests to the service.
6513     */
6514    enum RequestType {
6515        UNKNOWN = 0;
6516        START = 1;
6517        BIND = 2;
6518    }
6519
6520    /** The type of the current request to the service.*/
6521    optional RequestType request_type = 4;
6522
6523    /** Whether or not it's requested to start as a foreground service. */
6524    optional bool fg_required = 5;
6525
6526    /** The start type of the host process. */
6527    optional ProcessStartType proc_start_type = 6;
6528
6529    /** The process name who requests the service launch */
6530    optional string request_process_name = 7;
6531
6532    /** The service component name, here consists of the class name part only */
6533    optional string service_component_name = 8;
6534
6535    /** The state the package was in when the service was requested */
6536    optional PackageStoppedState package_stopped_state = 9;
6537
6538    /** The package name of the service host */
6539    optional string package_name = 10;
6540
6541    /** The package name of the service lunch request */
6542    optional string requester_package_name = 11;
6543
6544    /** The process state of the requester */
6545    optional android.app.ProcessStateEnum requester_process_state = 12;
6546
6547    /** The process state of the service host before this service request */
6548    optional android.app.ProcessStateEnum service_process_state = 13;
6549}
6550
6551/**
6552 * Logs indicating a broadcast is being delivered to a receiver.
6553 *
6554 * Logged from:
6555 *     frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6556 */
6557message BroadcastDeliveryEventReported {
6558    /** The package uid of the broadcast receiver. */
6559    optional int32 uid = 1 [(is_uid) = true];
6560
6561    /** The package uid of the broadcast sender. */
6562    optional int32 sender_uid = 2 [(is_uid) = true];
6563
6564    /** The action name of the broadcast. */
6565    optional string action_name = 3;
6566
6567    /**
6568     * The types of the broadcast receivers.
6569     */
6570    enum ReceiverType {
6571        UNKNOWN = 0;
6572        RUNTIME = 1;
6573        MANIFEST = 2;
6574    }
6575
6576    /** The type of the current broadcast receiver. */
6577    optional ReceiverType receiver_type = 4;
6578
6579    /** The start type of the host process. */
6580    optional ProcessStartType proc_start_type = 5;
6581
6582    /** The delay in ms from enqueue to dispatch of this intent to the set of receivers. */
6583    optional int64 dispatch_delay = 6;
6584
6585    /** The delay in ms from beginning of dispatch to this specific receiver. */
6586    optional int64 receive_delay = 7;
6587
6588    /** The delay in ms from dispatch to finish the handling of this intent. */
6589    optional int64 finish_delay = 8;
6590
6591    /** The stopped state (if any) the package was in before the broadcast was delivered */
6592    optional PackageStoppedState package_stopped_state = 9;
6593
6594    /** The package name of the broadcast receiver */
6595    optional string package_name = 10;
6596
6597    /** The package name of the broadcast sender */
6598    optional string sender_package_name = 11;
6599
6600    /** The type of the broadcast */
6601    optional int32 broadcast_type = 12;
6602
6603    /** Delivery group policy set for the broadcast */
6604    optional android.app.BroadcastDeliveryGroupPolicy delivery_group_policy = 13;
6605
6606    /** Flags set in the broadcast intent */
6607    optional int32 intent_flags = 14;
6608
6609    /** The intent filter priority of the broadcast receiver */
6610    optional int32 filter_priority = 15;
6611
6612    /** The procstate of the broadcast sender */
6613    optional android.app.ProcessStateEnum sender_proc_state = 16;
6614
6615    /** The procstate of the broadcast receiver before receiving this broadcast */
6616    optional android.app.ProcessStateEnum receiver_process_state = 17;
6617}
6618
6619/**
6620 * Logs indicating a client is requesting to acquire a provider,
6621 * this doesn't include the case where the provider has been installed in the
6622 * client's process space and it's just increasing a ref count.
6623 *
6624 * Logged from:
6625 *      frameworks/base/services/core/java/com/android/server/am/ContentProviderHelper.java
6626 */
6627message ProviderAcquisitionEventReported {
6628    /** The package uid of the content provider host. */
6629    optional int32 uid = 1 [(is_uid) = true];
6630
6631    /** The package uid of the content provider client who makes the request. */
6632    optional int32 client_uid = 2 [(is_uid) = true];
6633
6634    /** The start type of the host process. */
6635    optional ProcessStartType proc_start_type = 3;
6636
6637    /** The stopped state (if any) the package was in when acquiring the provider */
6638    optional PackageStoppedState package_stopped_state = 4;
6639
6640    /** The package name of the content provider host. */
6641    optional string package_name = 5;
6642
6643    /** The package name of the content provider client who makes the request. */
6644    optional string client_package_name = 6;
6645
6646    /** The process state of the client */
6647    optional android.app.ProcessStateEnum client_process_state = 7;
6648
6649    /** The process state of the content provider host before being acquired */
6650    optional android.app.ProcessStateEnum provider_process_state = 8;
6651}
6652
6653/**
6654 * Logs when a hidden API is used.
6655 *
6656 * Logged from:
6657 *     libcore/libart/src/main/java/dalvik/system/VMRuntime.java
6658 */
6659message HiddenApiUsed {
6660    // The uid of the app making the hidden access.
6661    optional int32 uid = 1 [(is_uid) = true];
6662
6663    // Signature of the method or field accessed.
6664    optional string signature = 2;
6665
6666    enum AccessMethod {
6667        NONE = 0;
6668        REFLECTION = 1;
6669        JNI = 2;
6670        LINKING = 3;
6671    }
6672
6673    // Type of access.
6674    optional AccessMethod access_method = 3;
6675
6676    // Whether the access was prevented or not.
6677    optional bool access_denied = 4;
6678}
6679
6680/**
6681 * Logs user interaction with the Privacy Indicators added in Q. In particular:
6682 * - When user sees privacy chip
6683 * - When user clicks privacy chip
6684 * - How does the user exit the Privacy Dialog
6685 * Logged from:
6686 *   packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
6687 */
6688message PrivacyIndicatorsInteracted {
6689
6690    enum Type {
6691        UNKNOWN = 0;
6692        CHIP_VIEWED = 1;
6693        CHIP_CLICKED = 2;
6694        reserved 3; // Used only in beta builds, never shipped
6695        DIALOG_DISMISS = 4;
6696        DIALOG_LINE_ITEM = 5;
6697    }
6698
6699    optional Type type = 1 [(state_field_option).exclusive_state = true];
6700}
6701
6702/**
6703 * Logs information about a package that is moved from the internal to external storage and vice
6704 * versa.
6705 * It logs the package name, the type of the external storage where the package is installed
6706 * (if moved to external storage, or UNKNOWN if moved to internal storage),
6707 * and the move type: if it's from internal to external or the other way around.
6708 *
6709 * Logged from:
6710        frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
6711 */
6712message AppMovedStorageReported {
6713    enum MoveType {
6714        UNKNOWN = 0;
6715        TO_EXTERNAL = 1;
6716        TO_INTERNAL = 2;
6717    }
6718    // The type of the external storage.
6719    optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6720    // The type of move.
6721    optional MoveType move_type = 2;
6722    // The name of the package that was moved.
6723    optional string package_name = 3;
6724}
6725
6726/**
6727 * Logs when system server watchdog occurs.
6728 * Logged from:
6729 *      frameworks/base/services/core/java/com/android/server/Watchdog.java
6730 */
6731message SystemServerWatchdogOccurred {
6732    optional string subject = 1;
6733}
6734
6735/**
6736 * Logs when system server pre-watchdog occurs.
6737 * Logged from:
6738 *      frameworks/base/services/core/java/com/android/server/Watchdog.java
6739 */
6740message SystemServerPreWatchdogOccurred {
6741}
6742
6743/**
6744 * Logs when new file added to tombstones.
6745 * Logged from:
6746 *      frameworks/base/core/java/com/android/server/BootReceiver.java
6747 */
6748message TombStoneOccurred {
6749}
6750
6751/*
6752 * Information about a role request
6753 *
6754 * Logged from:
6755 *   packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
6756 */
6757message RoleRequestResultReported {
6758    // UID of application requesting the role
6759    optional int32 requesting_uid = 1;
6760
6761    // Package name of application requesting the role
6762    optional string requesting_package_name = 2;
6763
6764    // The role to be granted
6765    optional string role_name = 3;
6766
6767    // The count of applications qualifying for the role
6768    optional int32 qualifying_count = 4;
6769
6770    // UID of application current granted the role
6771    optional int32 current_uid = 5;
6772
6773    // Package name of application current granted the role
6774    optional string current_package_name = 6;
6775
6776    // UID of another application that user chose to grant the role to, instead of the requesting
6777    // application
6778    optional int32 granted_another_uid = 7;
6779
6780    // Package name of another application that user chose to grant the role to, instead of the
6781    // requesting application
6782    optional string granted_another_package_name = 8;
6783
6784    enum Result {
6785        UNDEFINED = 0;
6786        // role request was ignored
6787        IGNORED = 1;
6788        // role request was ignored because it's already granted
6789        IGNORED_ALREADY_GRANTED = 2;
6790        // role request was ignored because the application isn't qualified
6791        IGNORED_NOT_QUALIFIED = 3;
6792        // role request was ignored because user said it should be always denied
6793        IGNORED_USER_ALWAYS_DENIED = 4;
6794        // role was granted by user action
6795        USER_GRANTED = 5;
6796        // role was denied by user action
6797        USER_DENIED = 6;
6798        // role was denied by user granting another application the role
6799        USER_DENIED_GRANTED_ANOTHER = 7;
6800        // role was denied and set to be always denied by the user
6801        USER_DENIED_WITH_ALWAYS = 8;
6802        // role request was ignored because the user is blocked from changing
6803        // roles via DISALLOW_CONFIG_DEFAULT_APPS user restriction
6804        IGNORED_USER_RESTRICTION = 9;
6805    }
6806    // The result of the role request
6807    optional Result result = 9;
6808}
6809
6810/**
6811 * Logs when a Vehicle Maps Service client's connection state has changed
6812 *
6813 * Logged from:
6814 *   packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
6815 */
6816message VmsClientConnectionStateChanged {
6817    // The UID of the VMS client app
6818    optional int32 uid = 1 [(is_uid) = true];
6819
6820    enum State {
6821        UNKNOWN = 0;
6822        // Attempting to connect to the client
6823        CONNECTING = 1;
6824        // Client connection established
6825        CONNECTED = 2;
6826        // Client connection closed unexpectedly
6827        DISCONNECTED = 3;
6828        // Client connection closed by VMS
6829        TERMINATED = 4;
6830        // Error establishing the client connection
6831        CONNECTION_ERROR = 5;
6832    }
6833
6834    optional State state  = 2;
6835}
6836
6837message MimeTypes {
6838    repeated string mime_types = 1;
6839}
6840
6841/**
6842 * Logs statistics regarding accesses to external storage.
6843 * All stats are normalized for one day period.
6844 *
6845 * Logged from:
6846 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
6847 */
6848message GeneralExternalStorageAccessStats {
6849    optional int32 uid = 1 [(is_uid) = true];
6850    // Total number of accesses like creation, open, delete and rename/update.
6851    // Includes file path and ContentResolver accesses
6852    optional uint32 total_accesses = 2;
6853    // Number of file path accesses, as opposed to file path and ContentResolver.
6854    optional uint32 file_path_accesses = 3;
6855    // Number of accesses on secondary volumes like SD cards.
6856    // Includes file path and ContentResolver accesses
6857    optional uint32 secondary_storage_accesses = 4;
6858    // Comma-separated list of mime types that were accessed.
6859    optional MimeTypes mime_types_accessed = 5 [(log_mode) = MODE_BYTES];
6860}
6861
6862/**
6863 * Logs when MediaProvider has successfully finished scanning a storage volume.
6864 *
6865 * Logged from:
6866 *   packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
6867 */
6868message MediaProviderScanOccurred {
6869    enum Reason {
6870        // Scan triggered due to unknown reason
6871        UNKNOWN = 0;
6872        // Scan triggered due to storage volume being mounted
6873        MOUNTED = 1;
6874        // Scan triggered due to explicit user action or app request
6875        DEMAND = 2;
6876        // Scan triggered due to idle maintenance
6877        IDLE = 3;
6878    }
6879
6880    // Volume type that this event pertains to
6881    optional android.stats.mediaprovider.VolumeType volume_type = 1;
6882    // Reason why this scan was triggered
6883    optional Reason reason = 2;
6884    // Total number of files scanned
6885    optional int64 item_count = 3;
6886    // Duration of scan, normalized per file
6887    optional float normalized_duration_millis = 4;
6888    // Number of database inserts, normalized per file
6889    optional float normalized_insert_count = 5;
6890    // Number of database updates, normalized per file
6891    optional float normalized_update_count = 6;
6892    // Number of database deletes, normalized per file
6893    optional float normalized_delete_count = 7;
6894}
6895
6896/**
6897 * Logs when an app has asked MediaProvider to delete media belonging to the user.
6898 *
6899 * Logged from:
6900 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
6901 */
6902message MediaContentDeleted {
6903    // Volume type that this event pertains to
6904    optional android.stats.mediaprovider.VolumeType volume_type = 1;
6905    // UID of app that requested deletion
6906    optional int32 uid = 2 [(is_uid) = true];
6907    // Number of items that were deleted
6908    optional int32 item_count = 3;
6909}
6910
6911/**
6912 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
6913 *
6914 * Logged from:
6915 *   packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
6916 */
6917message MediaProviderPermissionRequested {
6918    enum Result {
6919        UNKNOWN = 0;
6920        USER_GRANTED = 1;
6921        AUTO_GRANTED = 2;
6922        USER_DENIED = 3;
6923        USER_DENIED_WITH_PREJUDICE = 4;
6924        AUTO_DENIED = 5;
6925    }
6926
6927    // Volume type that this event pertains to
6928    optional android.stats.mediaprovider.VolumeType volume_type = 1;
6929    // UID of app that requested permission
6930    optional int32 uid = 2 [(is_uid) = true];
6931    // Number of items that were requested
6932    optional int32 item_count = 3;
6933    // Result of this request
6934    optional Result result = 4;
6935}
6936
6937/**
6938 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
6939 *
6940 * Logged from:
6941 *   packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
6942 */
6943message MediaProviderSchemaChanged {
6944    // Volume type that this event pertains to
6945    optional android.stats.mediaprovider.VolumeType volume_type = 1;
6946    // Old database version code
6947    optional int32 version_from = 2;
6948    // New database version code
6949    optional int32 version_to = 3;
6950    // Total number of files in database
6951    optional int64 item_count = 4;
6952    // Duration of schema change, normalized per file
6953    optional float normalized_duration_millis = 5;
6954}
6955
6956/**
6957 * Logs when MediaProvider has finished an idle maintenance job.
6958 *
6959 * Logged from:
6960 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
6961 */
6962message MediaProviderIdleMaintenanceFinished {
6963    // Volume type that this event pertains to
6964    optional android.stats.mediaprovider.VolumeType volume_type = 1;
6965
6966    // Total number of files in database
6967    optional int64 item_count = 2;
6968    // Duration of idle maintenance, normalized per file
6969    optional float normalized_duration_millis = 3;
6970    // Number of thumbnails found to be stale, normalized per file
6971    optional float normalized_stale_thumbnails = 4;
6972    // Number of items found to be expired, normalized per file
6973    optional float normalized_expired_media = 5;
6974}
6975
6976/**
6977 * Represents boot time event with duration in ms.
6978 *
6979 * Logged from: bootstat and various system server components. Check each enums for details.
6980 */
6981message BootTimeEventDuration {
6982    enum DurationEvent {
6983        UNKNOWN = 0;
6984        // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
6985        ABSOLUTE_BOOT_TIME = 1;
6986        // Bootloader's 1st stage execution time.
6987        // Logged from bootstat.
6988        BOOTLOADER_FIRST_STAGE_EXEC = 2;
6989        // Bootloader's 1st stage loading time.
6990        // Logged from bootstat.
6991        BOOTLOADER_FIRST_STAGE_LOAD = 3;
6992        // Bootloader's kernel loading time.
6993        // Logged from bootstat.
6994        BOOTLOADER_KERNEL_LOAD = 4;
6995        // Bootloader's 2nd stage execution time.
6996        // Logged from bootstat.
6997        BOOTLOADER_SECOND_STAGE_EXEC = 5;
6998        // Bootloader's 2nd stage loading time.
6999        // Logged from bootstat.
7000        BOOTLOADER_SECOND_STAGE_LOAD = 6;
7001        // Duration for Bootloader to show unlocked device's warning UI. This should not happen
7002        // for locked device.
7003        // Logged from bootstat.
7004        BOOTLOADER_UI_WAIT = 7;
7005        // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
7006        // Logged from bootstat.
7007        BOOTLOADER_TOTAL = 8;
7008        // Shutdown duration inside init for the reboot before the current boot up.
7009        // Logged from f/b/services/.../BootReceiver.java.
7010        SHUTDOWN_DURATION = 9;
7011        // Total time for mounting of disk devices during bootup.
7012        // Logged from f/b/services/.../BootReceiver.java.
7013        MOUNT_DEFAULT_DURATION = 10;
7014        // Total time for early stage mounting of disk devices during bootup.
7015        // Logged from f/b/services/.../BootReceiver.java.
7016        MOUNT_EARLY_DURATION = 11;
7017        // Total time for late stage mounting of disk devices during bootup.
7018        // Logged from f/b/services/.../BootReceiver.java.
7019        MOUNT_LATE_DURATION = 12;
7020        // Average time to scan non-system app after OTA
7021        // Logged from f/b/services/.../PackageManagerService.java
7022        OTA_PACKAGE_MANAGER_INIT_TIME = 13;
7023        // Time to initialize Package manager after OTA
7024        // Logged from f/b/services/.../PackageManagerService.java
7025        OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
7026        // Time to scan all system app from Package manager after OTA
7027        // Logged from f/b/services/.../PackageManagerService.java
7028        OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
7029        // Init's total time for cold boot stage.
7030        // Logged from bootstat.
7031        COLDBOOT_WAIT = 16;
7032        // Init's total time for initializing selinux.
7033        // Logged from bootstat.
7034        SELINUX_INIT = 17;
7035        // Time since last factory reset.
7036        // Logged from bootstat.
7037        FACTORY_RESET_TIME_SINCE_RESET = 18;
7038        // Init's total time spent for completing the 1st stage.
7039        // Logged from bootstat.
7040        ANDROID_INIT_STAGE_1 = 19;
7041    }
7042
7043    // Type of the event.
7044    optional DurationEvent event = 1;
7045    // Duration of the event in ms.
7046    optional int64 duration_millis = 2;
7047}
7048
7049/**
7050 * Represents the start of specific boot time event during bootup in ms. This is usually a time
7051 * since boot-up.
7052 *
7053 * Logged from: bootstat and various system server components. Check each enums for details.
7054 */
7055message BootTimeEventElapsedTime {
7056    enum ElapsedTimeEvent {
7057        UNKNOWN = 0;
7058        // Time when init starts 1st stage. Logged from bootstat.
7059        ANDROID_INIT_STAGE_1 = 1;
7060        // Time when sys.boot_completed prop is set.
7061        // Logged from bootstat.
7062        BOOT_COMPLETE = 2;
7063        // BOOT_COMPLETE for a device that uses full-disk encryption.  Note that
7064        // no devices running Android 13 or later use full-disk encryption, as
7065        // it has been replaced by file-based encryption.
7066        BOOT_COMPLETE_ENCRYPTION = 3;
7067        // BOOT_COMPLETE for a device that doesn't use full-disk encryption.
7068        BOOT_COMPLETE_NO_ENCRYPTION = 4;
7069        // Adjusted BOOT_COMPLETE for a device that uses full-disk encryption,
7070        // omitting the decryption time.
7071        BOOT_COMPLETE_POST_DECRYPT = 5;
7072        // BOOT_COMPLETE after factory reset.
7073        FACTORY_RESET_BOOT_COMPLETE = 6;
7074        // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
7075        FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
7076        // BOOT_COMPLETE_POST_DECRYPT after factory reset.
7077        FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
7078        // BOOT_COMPLETE after OTA.
7079        OTA_BOOT_COMPLETE = 9;
7080        // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
7081        OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
7082        // BOOT_COMPLETE_POST_DECRYPT after OTA.
7083        OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
7084        // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
7085        // Logged from  f/b/services/.../UserController.java
7086        FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
7087        // Time when the system starts sending BOOT_COMPLETED broadcast.
7088        // Logged from  f/b/services/.../UserController.java
7089        FRAMEWORK_BOOT_COMPLETED = 13;
7090        // Time when the package manager starts init.
7091        // Logged from f/b/services/.../SystemServer.java
7092        PACKAGE_MANAGER_INIT_START = 14;
7093        // Time when package manager is ready
7094        // Logged from f/b/services/.../SystemServer.java
7095        PACKAGE_MANAGER_INIT_READY = 15;
7096        // Represents the time when user has entered unlock credential for system with user pin.
7097        // Logged from bootstat.
7098        POST_DECRYPT = 16;
7099        // Represents the start of zygote's init.
7100        // Logged from zygote itself.
7101        ZYGOTE_INIT_START = 17;
7102        // Represents the start of secondary zygote's init.
7103        // TODO: add logging to zygote
7104        SECONDARY_ZYGOTE_INIT_START = 18;
7105        // Represents the start of system server's init.
7106        // Logged from f/b/services/.../SystemServer.java
7107        SYSTEM_SERVER_INIT_START = 19;
7108        // Represents the completion of system server's init.
7109        // Logged from f/b/services/.../SystemServer.java
7110        SYSTEM_SERVER_READY = 20;
7111        // Represents the start of launcher during boot-up.
7112        // TODO: add logging
7113        LAUNCHER_START = 21;
7114        // Represents the completion of launcher's initial rendering. User can use other apps from
7115        // launcher from this point.
7116        // TODO: add logging
7117        LAUNCHER_SHOWN = 22;
7118    }
7119
7120    // Type of the event.
7121    optional ElapsedTimeEvent event = 1;
7122    // Time since bootup for the event.
7123    // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
7124    optional int64 time_millis = 2;
7125}
7126
7127/**
7128 * Boot time events with UTC time.
7129 *
7130 * Logged from: bootstat and various system server components. Check each enums for details.
7131 */
7132message BootTimeEventUtcTime {
7133    enum UtcTimeEvent {
7134        UNKNOWN = 0;
7135        // Time of the bootstat's marking of 1st boot after the last factory reset.
7136        // Logged from bootstat.
7137        FACTORY_RESET_RESET_TIME = 1;
7138        // The time when bootstat records FACTORY_RESET_* events. This is close to
7139        // BOOT_COMPLETE time for the current bootup.
7140        // Logged from bootstat.
7141        FACTORY_RESET_CURRENT_TIME = 2;
7142        // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
7143        // Logged from bootstat.
7144        FACTORY_RESET_RECORD_VALUE = 3;
7145    }
7146
7147    // Type of the event.
7148    optional UtcTimeEvent event = 1;
7149    // UTC time for the event.
7150    optional int64 utc_time_secs = 2;
7151}
7152
7153/**
7154 * Boot time events representing specific error code during bootup.
7155 * Meaning of error code can be different per each event type.
7156 *
7157 * Logged from: bootstat and various system server components. Check each enums for details.
7158 */
7159message BootTimeEventErrorCode {
7160    enum ErrorCodeEvent {
7161        UNKNOWN = 0;
7162        // Linux error code for time() call to get the current UTC time.
7163        // Logged from bootstat.
7164        FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
7165        // Represents UmountStat before the reboot for the current boot up. Error codes defined
7166        // as UMOUNT_STAT_* from init/reboot.cpp.
7167        // Logged from f/b/services/.../BootReceiver.java.
7168        SHUTDOWN_UMOUNT_STAT = 2;
7169        // Reprepsents fie system mounting error code of /data partition for the current boot.
7170        // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
7171        // Logged from f/b/services/.../BootReceiver.java.
7172        FS_MGR_FS_STAT_DATA_PARTITION = 3;
7173    }
7174
7175    // Type of the event.
7176    optional ErrorCodeEvent event = 1;
7177    // error code defined per each event type.
7178    // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
7179    // FS_MGR_FS_STAT.
7180    optional int32 error_code = 2;
7181}
7182
7183/**
7184 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
7185 * after an OTA.
7186 *
7187 * Logged from:
7188 *  - system/update_engine/cleanup_previous_update_action.cc
7189 */
7190message SnapshotMergeReported {
7191    // Keep in sync with
7192    // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
7193    enum UpdateState {
7194        // No update or merge is in progress.
7195        NONE = 0;
7196        // An update is applying; snapshots may already exist.
7197        INITIATED = 1;
7198        // An update is pending, but has not been successfully booted yet.
7199        UNVERIFIED = 2;
7200        // The kernel is merging in the background.
7201        MERGING = 3;
7202        // Post-merge cleanup steps could not be completed due to a transient
7203        // error, but the next reboot will finish any pending operations.
7204        MERGE_NEEDS_REBOOT = 4;
7205        // Merging is complete, and needs to be acknowledged.
7206        MERGE_COMPLETED = 5;
7207        // Merging failed due to an unrecoverable error.
7208        MERGE_FAILED = 6;
7209        // The update was implicitly cancelled, either by a rollback or a flash
7210        // operation via fastboot. This state can only be returned by WaitForMerge.
7211        CANCELLED = 7;
7212    };
7213
7214    // Status codes correspond to specific failure conditions in
7215    // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.cpp
7216    //
7217    // Keep in sync with
7218    // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
7219    enum MergeFailureCode {
7220        OK = 0;
7221        READ_STATUS = 1;
7222        GET_TABLE_INFO = 2;
7223        UNKNOWN_TABLE = 3;
7224        GET_TABLE_PARAMS = 4;
7225        ACTIVATE_NEW_TABLE = 5;
7226        ACQUIRE_LOCK = 6;
7227        LIST_SNAPSHOTS = 7;
7228        WRITE_STATUS = 8;
7229        UNKNOWN_TARGET_TYPE = 9;
7230        QUERY_SNAPSHOT_STATUS = 10;
7231        EXPECTED_MERGE_TARGET = 11;
7232        UNMERGED_SECTORS_AFTER_COMPLETION = 12;
7233        UNEXPECTED_MERGE_STATE = 13;
7234        GET_COW_PATH_CONSISTENCY_CHECK = 14;
7235        OPEN_COW_CONSISTENCY_CHECK = 15;
7236        PARSE_COW_CONSISTENCY_CHECK = 16;
7237        OPEN_COW_DIRECT_CONSISTENCY_CHECK = 17;
7238        MEM_ALIGN_CONSISTENCY_CHECK = 18;
7239        DIRECT_READ_CONSISTENCY_CHECK = 19;
7240        WRONG_MERGE_COUNT_CONSISTENCY_CHECK = 20;
7241    };
7242
7243    // Status of the update after the merge attempts.
7244    optional UpdateState final_state = 1;
7245
7246    // Time to complete a merge operation in milliseconds.
7247    // A negative value corresponds to the case in which the merge operation
7248    // was interrupted and resumed (e.g. in case of a system reboot during the
7249    // merge).
7250    optional int64 duration_millis = 2;
7251
7252    // Number of reboots that occurred after issuing and before completing the
7253    // merge of all the snapshot devices.
7254    optional int32 intermediate_reboots = 3;
7255
7256    // The device has been upgraded to Virtual A/B.
7257    optional bool is_vab_retrofit = 4;
7258
7259    // Space that has been temporarily allocated in the /data partition
7260    // containing the dm-snapshot's copy-on-write data generated during a
7261    // Virtual A/B update.
7262    optional int64 cow_file_size_bytes = 5;
7263
7264    // Whether the device enables Virtual A/B compression.
7265    optional bool vab_compression_enabled = 6;
7266
7267    // Whether this update attempt uses Virtual A/B compression.
7268    optional bool vab_compression_used = 7;
7269
7270    // Total size used by COWs, including /data and the super partition.
7271    optional int64 total_cow_size_bytes = 8;
7272
7273    // Sum of the estimated COW fields in the OTA manifest.
7274    optional int64 estimated_cow_size_bytes = 9;
7275
7276    // Time from boot to sys.boot_completed, in milliseconds.
7277    optional int32 boot_complete_time_millis = 10;
7278
7279    // Time from sys.boot_completed to merge start, in milliseconds.
7280    optional int32 boot_complete_to_merge_start_time_millis = 11;
7281
7282    optional MergeFailureCode merge_failure_code = 12;
7283
7284    // Build fingerprint at the time the OTA was downloaded.
7285    optional string source_build_fingerprint = 13;
7286
7287    // Build fingerprint at the time the merge was initiated.
7288    optional string target_build_fingerprint = 14;
7289
7290    // Whether the device enabled userspace snapshots.
7291    optional bool userspace_snapshots_enabled = 15;
7292
7293    // Whether this update attempt used userspace snapshots.
7294    optional bool userspace_snapshots_used = 16;
7295
7296    // Whether the device enabled XOR compression.
7297    optional bool xor_compression_enabled = 17;
7298
7299    // Whether this update attempt used XOR compression.
7300    optional bool xor_compression_used = 18;
7301
7302    // Whether this update attempt used io_uring.
7303    optional bool iouring_used = 19;
7304}
7305
7306/**
7307 * Event representing when BlobStoreManager.Session#commit() is called
7308 *
7309 * Logged from:
7310 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
7311 */
7312message BlobCommitted {
7313    // Uid of the Blob committer
7314    optional int32 uid = 1 [(is_uid) = true];
7315
7316    // Id of the Blob committed
7317    optional int64 blob_id = 2;
7318
7319    // Size of the Blob
7320    optional int64 size = 3;
7321
7322    enum Result {
7323        UNKNOWN = 0;
7324        // Commit Succeeded
7325        SUCCESS = 1;
7326        // Commit Failed: Error occurred during commit
7327        ERROR_DURING_COMMIT = 2;
7328        // Commit Failed: Digest of the data did not match Blob digest
7329        DIGEST_MISMATCH = 3;
7330        // Commit Failed: Allowed count limit exceeded
7331        COUNT_LIMIT_EXCEEDED = 4;
7332    }
7333    optional Result result = 4;
7334}
7335
7336/**
7337 * Event representing when BlobStoreManager#acquireLease() is called
7338 *
7339 * Logged from:
7340 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
7341 */
7342message BlobLeased{
7343    // Uid of the Blob leasee
7344    optional int32 uid = 1 [(is_uid) = true];
7345
7346    // Id of the Blob leased or 0 if the Blob does not exist
7347    optional int64 blob_id = 2;
7348
7349    // Size of the Blob or 0 if the Blob does not exist
7350    optional int64 size = 3;
7351
7352    enum Result {
7353        UNKNOWN = 0;
7354        // Lease Succeeded
7355        SUCCESS = 1;
7356        // Lease Failed: Blob does not exist
7357        BLOB_DNE = 2;
7358        // Lease Failed: Leasee does not have access to the Blob
7359        ACCESS_NOT_ALLOWED = 3;
7360        // Lease Failed: Leasee requested an invalid expiry duration
7361        LEASE_EXPIRY_INVALID = 4;
7362        // Lease Failed: Leasee has exceeded the total data lease limit
7363        DATA_SIZE_LIMIT_EXCEEDED = 5;
7364        // Leasee Failed: Allowed count limit exceeded
7365        COUNT_LIMIT_EXCEEDED = 6;
7366    }
7367    optional Result result = 4;
7368}
7369
7370/**
7371 * Event representing when BlobStoreManager#openBlob() is called
7372 *
7373 * Logged from:
7374 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
7375 */
7376message BlobOpened{
7377    // Uid of the Blob opener
7378    optional int32 uid = 1 [(is_uid) = true];
7379
7380    // Id of the Blob opened or 0 if the Blob does not exist
7381    optional int64 blob_id = 2;
7382
7383    // Size of the Blob or 0 if the Blob does not exist
7384    optional int64 size = 3;
7385
7386    enum Result {
7387        UNKNOWN = 0;
7388        // Open Succeeded
7389        SUCCESS = 1;
7390        // Open Failed: Blob does not exist
7391        BLOB_DNE = 2;
7392        // Open Failed: Opener does not have access to the Blob
7393        ACCESS_NOT_ALLOWED = 3;
7394    }
7395    optional Result result = 4;
7396}
7397
7398/**
7399 * Event to track Jank for various system interactions.
7400 *
7401 * Logged from:
7402 *  frameworks/base/core/java/com/android/internal/jank/FrameTracker.java
7403 *
7404 * Next Tag: 9
7405 */
7406message UIInteractionFrameInfoReported {
7407    optional android.jank.InteractionType interaction_type = 1;
7408
7409    optional android.jank.DisplayResolution display_resolution = 8;
7410
7411    // Number of frames rendered during the interaction.
7412    optional int64 total_frames = 2;
7413
7414    // Number of frames that were skipped in rendering during the interaction.
7415    optional int64 missed_frames = 3;
7416
7417    // Number of frames that were missed in Surface Flinger during the interaction.
7418    optional int64 sf_missed_frames = 5;
7419
7420    // Number of frames that were missed in the app during the interaction.
7421    optional int64 app_missed_frames = 6;
7422
7423    // Maximum time it took to render a single frame during the interaction.
7424    optional int64 max_frame_time_nanos = 4;
7425
7426    // Maximum number of successive frames missed.
7427    optional int64 max_successive_missed_frames = 7;
7428}
7429
7430/**
7431 * Event to track various latencies in SystemUI.
7432 *
7433 * Logged from:
7434 *  frameworks/base/core/java/com/android/internal/util/LatencyTracker.java
7435 */
7436message UIActionLatencyReported {
7437    optional android.jank.ActionType action = 1;
7438
7439    optional int64 latency_millis = 2;
7440}
7441
7442//////////////////////////////////////////////////////////////////////
7443// Pulled atoms below this line //
7444//////////////////////////////////////////////////////////////////////
7445
7446/**
7447 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
7448 *
7449 * Pulled from:
7450 *   StatsCompanionService (using BatteryStats to get which interfaces are wifi)
7451 */
7452message WifiBytesTransfer {
7453    optional int32 uid = 1 [(is_uid) = true];
7454
7455    optional int64 rx_bytes = 2;
7456
7457    optional int64 rx_packets = 3;
7458
7459    optional int64 tx_bytes = 4;
7460
7461    optional int64 tx_packets = 5;
7462}
7463
7464/**
7465 * Pulls bytes transferred via wifi (separated by foreground and background usage).
7466 *
7467 * Pulled from:
7468 *   StatsCompanionService (using BatteryStats to get which interfaces are wifi)
7469 */
7470message WifiBytesTransferByFgBg {
7471    optional int32 uid = 1 [(is_uid) = true];
7472
7473    // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
7474    optional bool is_foreground = 2;
7475
7476    optional int64 rx_bytes = 3;
7477
7478    optional int64 rx_packets = 4;
7479
7480    optional int64 tx_bytes = 5;
7481
7482    optional int64 tx_packets = 6;
7483}
7484
7485/**
7486 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
7487 *
7488 * Pulled from:
7489 *   StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
7490 */
7491message MobileBytesTransfer {
7492    optional int32 uid = 1 [(is_uid) = true];
7493
7494    optional int64 rx_bytes = 2;
7495
7496    optional int64 rx_packets = 3;
7497
7498    optional int64 tx_bytes = 4;
7499
7500    optional int64 tx_packets = 5;
7501}
7502
7503/**
7504 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
7505 *
7506 * Pulled from:
7507 *   StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
7508 */
7509message MobileBytesTransferByFgBg {
7510    optional int32 uid = 1 [(is_uid) = true];
7511
7512    // 1 denotes foreground and 0 denotes background. This is called Set in
7513    // NetworkStats.
7514    optional bool is_foreground = 2;
7515
7516    optional int64 rx_bytes = 3;
7517
7518    optional int64 rx_packets = 4;
7519
7520    optional int64 tx_bytes = 5;
7521
7522    optional int64 tx_packets = 6;
7523}
7524
7525/**
7526 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
7527 * Note that the data is expected to be sliced into more dimensions in future. In other words,
7528 * the caller must not assume any row of data is one full report when filtering with a set of
7529 * matching conditions, because future data may represent with multiple rows what is currently
7530 * represented by one.
7531 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
7532 * query all the existing columns.
7533 *
7534 * Pulled from:
7535 *   StatsPullAtomService (using NetworkStatsService to get NetworkStats)
7536 */
7537message DataUsageBytesTransfer {
7538    // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
7539    // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
7540    // states combined, not including debug states. See NetworkStats#SET_*.
7541    optional int32 state = 1;
7542
7543    optional int64 rx_bytes = 2;
7544
7545    optional int64 rx_packets = 3;
7546
7547    optional int64 tx_bytes = 4;
7548
7549    optional int64 tx_packets = 5;
7550
7551    // Radio Access Technology (RAT) type of this record, should be one of
7552    // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
7553    // the record is for all rat types combined.
7554    optional int32 rat_type = 6;
7555
7556    // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
7557    // record is combined across subscriptions.
7558    optional string sim_mcc = 7;
7559    optional string sim_mnc = 8;
7560
7561    // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
7562    // See TelephonyManager#getSimCarrierId.
7563    optional int32 carrier_id = 9;
7564
7565    // Enumeration of opportunistic states with an additional ALL state indicates the record is
7566    // combined regardless of the boolean value in its field.
7567    enum DataSubscriptionState {
7568        UNKNOWN = 0; // For server side backward compatibility.
7569        ALL = 1;
7570        OPPORTUNISTIC = 2;
7571        NOT_OPPORTUNISTIC = 3;
7572    }
7573    // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
7574    // record is combined across opportunistic data subscriptions.
7575    // See {@link SubscriptionManager#setOpportunistic}.
7576    optional DataSubscriptionState opportunistic_data_sub = 10;
7577
7578    // Indicate whether NR is connected, server side could use this with RAT type to determine if
7579    // the record is for 5G NSA (Non Stand Alone) mode, where the primary cell is still LTE and
7580    // network allocates a secondary 5G cell so telephony reports RAT = LTE along with NR state as
7581    // connected.
7582    optional bool is_nr_connected = 11;
7583}
7584
7585/**
7586 * Note: This is a copy from DataUsageBytesTransfer and add a metered field.
7587 * TODO: DataUsageBytesTransfer should be eventually replaced with DataUsageBytesTransferV2.
7588 *
7589 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
7590 * Note that the data is expected to be sliced into more dimensions in future. In other words,
7591 * the caller must not assume any row of data is one full report when filtering with a set of
7592 * matching conditions, because future data may represent with multiple rows what is currently
7593 * represented by one.
7594 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
7595 * query all the existing columns.
7596 *
7597 * Pulled from:
7598 *   StatsPullAtomService (using NetworkStatsService to get NetworkStats)
7599 */
7600message DataUsageBytesTransferV2 {
7601    // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
7602    // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
7603    // states combined, not including debug states. See NetworkStats#SET_*.
7604    optional int32 state = 1;
7605
7606    optional int64 rx_bytes = 2;
7607
7608    optional int64 rx_packets = 3;
7609
7610    optional int64 tx_bytes = 4;
7611
7612    optional int64 tx_packets = 5;
7613
7614    // Radio Access Technology (RAT) type of this record, should be one of
7615    // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
7616    // the record is for all rat types combined.
7617    optional int32 rat_type = 6;
7618
7619    // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
7620    // record is combined across subscriptions.
7621    optional string sim_mcc = 7;
7622    optional string sim_mnc = 8;
7623
7624    // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
7625    // See TelephonyManager#getSimCarrierId.
7626    optional int32 carrier_id = 9;
7627
7628    // Enumeration of opportunistic states with an additional DSS_ALL state indicates the record is
7629    // combined regardless of the boolean value in its field.
7630    enum DataSubscriptionState {
7631        DSS_UNKNOWN = 0; // For server side backward compatibility.
7632        DSS_ALL = 1;
7633        DSS_OPPORTUNISTIC = 2;
7634        DSS_NOT_OPPORTUNISTIC = 3;
7635    }
7636    // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
7637    // record is combined across opportunistic data subscriptions.
7638    // See {@link SubscriptionManager#setOpportunistic}.
7639    optional DataSubscriptionState opportunistic_data_sub = 10;
7640
7641    // Indicate whether NR is connected, server side could use this with RAT type to determine if
7642    // the record is for 5G NSA (Non Stand Alone) mode, where the primary cell is still LTE and
7643    // network allocates a secondary 5G cell so telephony reports RAT = LTE along with NR state as
7644    // connected.
7645    optional bool is_nr_connected = 11;
7646
7647    // Enumeration of metered states.
7648    enum MeteredState {
7649        METERED_UNKNOWN = 0;
7650        METERED_ALL = 1;
7651        METERED_NO = 2;
7652        METERED_YES = 3;
7653    }
7654    // Mark the reported data is metered or non-metered, and METERED_ALL indicates the record is
7655    // combined across metered data.
7656    optional MeteredState metered = 12;
7657}
7658
7659/**
7660 * Pulls bytes transferred via OEM managed networks. Data is split up by which
7661 * type of OEM managed network it is, what transport it went over, and if it was
7662 * in the foreground or background.
7663 *
7664 * Pulled from:
7665 *   StatsPullAtomService
7666 */
7667 message OemManagedBytesTransfer {
7668    optional int32 uid = 1 [(is_uid) = true];
7669
7670    // 1 denotes foreground and 0 denotes background. This is called Set in
7671    // NetworkStats.
7672    optional bool is_foreground = 2;
7673
7674    // Corresponds to the type of OEM managed network, see
7675    // {@link NetworkTemplate#OEM_MANAGED_ANY} and {@code NetworkIdentity#OEM_*}.
7676    optional int32 oem_managed_type = 3;
7677
7678    // Corresponds to the type of transport the bytes were transferred over, see
7679    // {@link NetworkTemplate#transportToMatchRule} and
7680    // {@code NetworkCapabilities#TRANSPORT_*}
7681    optional int32 transport_type = 4;
7682
7683    optional int64 rx_bytes = 5;
7684
7685    optional int64 rx_packets = 6;
7686
7687    optional int64 tx_bytes = 7;
7688
7689    optional int64 tx_packets = 8;
7690  }
7691
7692/**
7693 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
7694 *
7695 * Pulled from:
7696 *   StatsCompanionService
7697 */
7698message BluetoothBytesTransfer {
7699    optional int32 uid = 1 [(is_uid) = true];
7700
7701    optional int64 rx_bytes = 2;
7702
7703    optional int64 tx_bytes = 3;
7704}
7705
7706/**
7707 * Pulls the kernel wakelock durations. This atom is adapted from
7708 * android/internal/os/KernelWakelockStats.java
7709 *
7710 * Pulled from:
7711 *   StatsCompanionService using KernelWakelockReader.
7712 */
7713message KernelWakelock {
7714    optional string name = 1;
7715
7716    optional int32 count = 2;
7717
7718    optional int32 version = 3;
7719
7720    optional int64 time_micros = 4;
7721}
7722
7723/**
7724 * Pulls power state information.
7725 * Pulled from:
7726 *   frameworks/base/services/core/java/com/android/server/powerstats/StatsPullAtomCallbackImpl.java
7727 */
7728message SubsystemSleepState {
7729    // Subsystem name
7730    optional string subsystem_name = 1;
7731    // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
7732    // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
7733    // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
7734    //    powerEntityStateName from the corresponding PowerEntityStateInfo.
7735    optional string subname = 2;
7736    // The number of times it entered, or voted for entering the sleep state
7737    optional uint64 count = 3;
7738    // The length of time spent in, or spent voting for, the sleep state
7739    optional uint64 time_millis = 4;
7740}
7741
7742/**
7743 * Pulls on-device power measurement information.
7744 * Pulled from:
7745 *   frameworks/base/services/core/java/com/android/server/powerstats/StatsPullAtomCallbackImpl.java
7746 */
7747message OnDevicePowerMeasurement {
7748    // Name of the subsystem (to which the rail belongs).
7749    optional string subsystem_name = 1;
7750
7751    // Rail name. The rail lies within the subsystem.
7752    optional string rail_name = 2;
7753
7754    // Time (in ms since boot) at which the rail energy value was measured.
7755    // This may differ slightly from the time that statsd logs this information.
7756    optional uint64 measurement_timestamp_millis = 3;
7757
7758    // Accumulated energy used via the rail since device boot in uWs.
7759    optional uint64 energy_microwatt_secs = 4;
7760}
7761
7762/**
7763 * Pulls Cpu time per cluster per frequency.
7764 * This is tracked by the timeInState eBPF program.
7765 */
7766message CpuTimePerClusterFreq {
7767    optional uint32 cluster = 1;
7768    optional uint32 freq_khz = 2;
7769    // Time spent at this frequency excluding sleep since tracking started.
7770    optional uint64 time_millis = 3;
7771}
7772
7773/**
7774 * Pulls Cpu Time Per Uid.
7775 * Note that isolated process uid time should be attributed to host uids.
7776 */
7777message CpuTimePerUid {
7778    optional int32 uid = 1 [(is_uid) = true];
7779    optional uint64 user_time_micros = 2;
7780    optional uint64 sys_time_micros = 3;
7781}
7782
7783/**
7784 * Pulls Cpu Cycles Per Uid Per Cluster.
7785 * Note that uids are transformed to reduce the number of uploaded entries. Shared GIDs are
7786 * combined under single uid LAST_SHARED_APPLICATION_GID. Individual isolated uids are excluded
7787 * because they are recycled and removed from the underlying data source. All uids are normalized
7788 * to their base uids.
7789 */
7790message CpuCyclesPerUidCluster {
7791    optional int32 uid = 1 [(is_uid) = true];
7792    optional int32 cluster = 2;
7793    // Megacycles, i.e. millions of cycles.
7794    optional int64 mcycles = 3;
7795    // Time excluding sleep since tracking started.
7796    optional int64 time_millis = 4;
7797    // Power estimate: time * average power for frequency / 1000.
7798    optional int64 power_profile_estimate = 5;
7799}
7800
7801/**
7802 * Pulls Cpu Time Per Uid per frequency.
7803 * Note that uids are transformed to reduce the number of uploaded entries. Shared GIDs are
7804 * combined under single uid LAST_SHARED_APPLICATION_GID. Individual isolated uids are excluded
7805 * because they are recycled and removed from the underlying data source. All uids are normalized
7806 * to their base uids.
7807 */
7808message CpuTimePerUidFreq {
7809    optional int32 uid = 1 [(is_uid) = true];
7810    optional uint32 freq_index = 2;
7811    optional uint64 time_millis = 3;
7812}
7813
7814/**
7815  * Pulls Cpu Cycles Per ThreadGroup Per Cluster.
7816  * This is tracked by the timeInState eBPF program.
7817  */
7818message CpuCyclesPerThreadGroupCluster {
7819    enum ThreadGroup {
7820        UNKNOWN_THREAD_GROUP = 0;
7821
7822        // System server threads serving Binder calls.
7823        SYSTEM_SERVER_BINDER = 1;
7824
7825        // All system server threads.
7826        SYSTEM_SERVER = 2;
7827
7828        // All surface flinger threads.
7829        SURFACE_FLINGER = 3;
7830    }
7831    optional ThreadGroup thread_group = 1;
7832
7833    optional int32 cluster = 2;
7834
7835    // Megacycles, i.e. millions of cycles.
7836    optional int64 mcycles = 3;
7837    // Time excluding sleep since tracking started.
7838    optional int64 time_millis = 4;
7839}
7840
7841/**
7842 * Pulls Wifi Controller Activity Energy Info
7843 */
7844message WifiActivityInfo {
7845    // timestamp(wall clock) of record creation
7846    optional uint64 timestamp_millis = 1;
7847    // stack reported state
7848    // TODO: replace this with proto enum
7849    optional int32 stack_state = 2;
7850    // tx time in millis
7851    optional uint64 controller_tx_time_millis = 3;
7852    // rx time in millis
7853    optional uint64 controller_rx_time_millis = 4;
7854    // idle time in millis
7855    optional uint64 controller_idle_time_millis = 5;
7856    // product of current(mA), voltage(V) and time(ms)
7857    optional uint64 controller_energy_used = 6;
7858}
7859
7860/**
7861 * Pulls Modem Activity Energy Info
7862 */
7863message ModemActivityInfo {
7864    // timestamp(wall clock) of record creation
7865    optional uint64 timestamp_millis = 1;
7866    // sleep time in millis.
7867    optional uint64 sleep_time_millis = 2;
7868    // idle time in millis
7869    optional uint64 controller_idle_time_millis = 3;
7870    /**
7871     * Tx power index
7872     * index 0 = tx_power < 0dBm
7873     * index 1 = 0dBm < tx_power < 5dBm
7874     * index 2 = 5dBm < tx_power < 15dBm
7875     * index 3 = 15dBm < tx_power < 20dBm
7876     * index 4 = tx_power > 20dBm
7877     */
7878    // tx time in ms at power level 0
7879    optional uint64 controller_tx_time_pl0_millis = 4;
7880    // tx time in ms at power level 1
7881    optional uint64 controller_tx_time_pl1_millis = 5;
7882    // tx time in ms at power level 2
7883    optional uint64 controller_tx_time_pl2_millis = 6;
7884    // tx time in ms at power level 3
7885    optional uint64 controller_tx_time_pl3_millis = 7;
7886    // tx time in ms at power level 4
7887    optional uint64 controller_tx_time_pl4_millis = 8;
7888    // rx time in ms at power level 5
7889    optional uint64 controller_rx_time_millis = 9;
7890    // product of current(mA), voltage(V) and time(ms)
7891    optional uint64 energy_used = 10 [deprecated=true];
7892}
7893
7894/**
7895 * Pulls Bluetooth Activity Energy Info
7896 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
7897 */
7898message BluetoothActivityInfo {
7899    // timestamp(wall clock) of record creation
7900    optional uint64 timestamp_millis = 1;
7901    // bluetooth stack state
7902    optional int32 bluetooth_stack_state = 2;
7903    // tx time in millis
7904    optional uint64 controller_tx_time_millis = 3;
7905    // rx time in millis
7906    optional uint64 controller_rx_time_millis = 4;
7907    // idle time in millis
7908    optional uint64 controller_idle_time_millis = 5;
7909    // product of current(mA), voltage(V) and time(ms)
7910    optional uint64 energy_used = 6;
7911}
7912
7913/*
7914 * Logs the memory stats for a process.
7915 *
7916 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
7917 */
7918message ProcessMemoryState {
7919    // The uid if available. -1 means not available.
7920    optional int32 uid = 1 [(is_uid) = true];
7921
7922    // The process name.
7923    // Usually package name, "system" for system server.
7924    // Provided by ActivityManagerService.
7925    optional string process_name = 2;
7926
7927    // Current OOM score adjustment. Value read from ProcessRecord.
7928    optional int32 oom_adj_score = 3;
7929
7930    // # of page-faults
7931    optional int64 page_fault = 4;
7932
7933    // # of major page-faults
7934    optional int64 page_major_fault = 5;
7935
7936    // RSS
7937    // Value is read from memory.stat, field total_rss if per-app memory
7938    // cgroups are enabled. Otherwise, value from /proc/pid/stat.
7939    optional int64 rss_in_bytes = 6;
7940
7941    // CACHE
7942    // Value is read from memory.stat, field total_cache if per-app memory
7943    // cgroups are enabled. Otherwise, 0.
7944    optional int64 cache_in_bytes = 7;
7945
7946    // SWAP
7947    // Value is read from memory.stat, field total_swap if per-app memory
7948    // cgroups are enabled. Otherwise, 0.
7949    optional int64 swap_in_bytes = 8;
7950
7951    // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
7952    optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
7953
7954    // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
7955    optional int64 start_time_nanos = 10 [deprecated = true];
7956
7957    // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
7958    optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
7959}
7960
7961/*
7962 * Logs the memory high-water mark for a process.
7963 *
7964 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
7965 * and for selected native processes.
7966 *
7967 * Pulling this atom resets high-water mark counters for all processes.
7968 */
7969message ProcessMemoryHighWaterMark {
7970    // The uid if available. -1 means not available.
7971    optional int32 uid = 1 [(is_uid) = true];
7972
7973    // The process name.
7974    // Usually package name or process cmdline.
7975    // Provided by ActivityManagerService or read from /proc/PID/cmdline.
7976    optional string process_name = 2;
7977
7978    // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
7979    // computed by converting kilobytes to bytes.
7980    optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
7981
7982    // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
7983    // /proc/PID/status.
7984    optional int32 rss_high_water_mark_in_kilobytes = 4;
7985}
7986
7987/*
7988 * Logs the memory stats for a process.
7989 *
7990 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
7991 * and for selected native processes.
7992 */
7993message ProcessMemorySnapshot {
7994    // The uid if available. -1 means not available.
7995    optional int32 uid = 1 [(is_uid) = true];
7996
7997    // The process name.
7998    // Usually package name or process cmdline.
7999    // Provided by ActivityManagerService or read from /proc/PID/cmdline.
8000    optional string process_name = 2;
8001
8002    // The pid of the process.
8003    // Allows to disambiguate instances of the process.
8004    optional int32 pid = 3;
8005
8006    // The current OOM score adjustment value.
8007    // Read from ProcessRecord for managed processes.
8008    // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
8009    optional int32 oom_score_adj = 4;
8010
8011    // The current RSS of the process.
8012    // VmRSS from /proc/pid/status.
8013    optional int32 rss_in_kilobytes = 5;
8014
8015    // The current anon RSS of the process.
8016    // RssAnon from /proc/pid/status.
8017    optional int32 anon_rss_in_kilobytes = 6;
8018
8019    // The current swap size of the process.
8020    // VmSwap from /proc/pid/status.
8021    optional int32 swap_in_kilobytes = 7;
8022
8023    // The sum of rss_in_kilobytes and swap_in_kilobytes.
8024    optional int32 anon_rss_and_swap_in_kilobytes = 8;
8025
8026    // GPU memory usage as measured by the kernel tracepoints
8027    // Equivalent to dumpsys gpu --gpumem
8028    optional int32 gpu_memory_kb = 9;
8029
8030    // Whether or not this process is hosting one or more foregound services.
8031    optional bool has_foreground_services = 10;
8032
8033    // The current rss memory in shared space.
8034    optional int32 shmem_kb = 11;
8035
8036    // The types of the components this process is hosting at the moment this
8037    // snapshot is taken.
8038    // See the available types in HostingComponentType in AppProtoEnums.
8039    optional int32 current_hosting_component_types = 12;
8040
8041    // The historical types of the components this process is or was hosting
8042    // since it's born.
8043    // See the available types in HostingComponentType in AppProtoEnums.
8044    optional int32 historical_hosting_component_types = 13;
8045}
8046
8047/*
8048 * Elapsed real time from SystemClock.
8049 */
8050message SystemElapsedRealtime {
8051    optional uint64 time_millis = 1;
8052}
8053
8054/*
8055 * Up time from SystemClock.
8056 */
8057message SystemUptime {
8058    // Milliseconds since the system was booted.
8059    // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
8060    // for external input).
8061    // It is not affected by clock scaling, idle, or other power saving mechanisms.
8062    optional uint64 uptime_millis = 1;
8063}
8064
8065/*
8066 * Reads from /proc/uid_concurrent_active_time which has the format:
8067 * active: X (X is # cores)
8068 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
8069 * [uid1]: [time-0] [time-1] [time-2] ... ...
8070 * ...
8071 * Time-N means the CPU time a UID spent running concurrently with N other processes.
8072 * The file contains a monotonically increasing count of time for a single boot.
8073 */
8074message CpuActiveTime {
8075    optional int32 uid = 1 [(is_uid) = true];
8076    optional uint64 time_millis = 2;
8077}
8078
8079/**
8080 * Reads from /proc/uid_concurrent_policy_time which has the format:
8081 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
8082 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
8083 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
8084 * ...
8085 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
8086 * The file contains a monotonically increasing count of time for a single boot.
8087 */
8088message CpuClusterTime {
8089    optional int32 uid = 1 [(is_uid) = true];
8090    optional int32 cluster_index = 2;
8091    optional uint64 time_millis = 3;
8092}
8093
8094/*
8095 * Pulls free disk space, for data, system partition and temporary directory.
8096 */
8097message DiskSpace {
8098    // available bytes in data partition
8099    optional uint64 data_available_bytes = 1;
8100    // available bytes in system partition
8101    optional uint64 system_available_bytes = 2;
8102    // available bytes in download cache or temp directories
8103    optional uint64 temp_available_bytes = 3;
8104}
8105
8106/**
8107 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
8108 *
8109 * Pulled from StatsCompanionService.java
8110 */
8111message RemainingBatteryCapacity {
8112    optional int32 charge_micro_ampere_hour = 1;
8113}
8114
8115/**
8116 * Pulls battery capacity, which is the battery capacity when full in uAh.
8117 * Pulled from:
8118 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
8119 */
8120message FullBatteryCapacity {
8121    optional int32 capacity_micro_ampere_hour = 1;
8122}
8123
8124/**
8125 * Pulls battery voltage.
8126 * Pulled from:
8127 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
8128 */
8129message BatteryVoltage {
8130    // The voltage of the battery, in millivolts.
8131    optional int32 voltage_millivolt = 1;
8132}
8133
8134/**
8135 * Pulls battery level (percent full, from 0 to 100).
8136 *
8137 * Pulled from:
8138 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
8139 */
8140message BatteryLevel {
8141    // Battery level. Should be in [0, 100].
8142    optional int32 battery_level = 1;
8143}
8144
8145/**
8146 * Pulls the temperature of various parts of the device.
8147 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
8148 *
8149 * Pulled from StatsCompanionService.java
8150 */
8151message Temperature {
8152    // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
8153    optional android.os.TemperatureTypeEnum sensor_location = 1;
8154
8155    // The name of the temperature source. Eg. CPU0
8156    optional string sensor_name = 2;
8157
8158    // Temperature in tenths of a degree C.
8159    // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
8160    optional int32 temperature_deci_celsius = 3;
8161
8162    // Relative severity of the throttling, see enum definition.
8163    optional android.os.ThrottlingSeverityEnum severity = 4;
8164}
8165
8166/**
8167 * Pulls the statistics of calls to Binder.
8168 *
8169 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
8170 * config on the device.
8171 *
8172 * Next tag: 15
8173 */
8174message BinderCalls {
8175    // UID of the process responsible for the binder transaction. It will be set if the process
8176    // executing the binder transaction attribute the transaction to another uid using
8177    // Binder.setThreadWorkSource().
8178    //
8179    // If not set, the value will be -1.
8180    optional int32 uid = 1 [(is_uid) = true];
8181    // UID of the process executing the binder transaction.
8182    optional int32 direct_caller_uid = 14;
8183    // Fully qualified class name of the API call.
8184    //
8185    // This is a system server class name.
8186    //
8187    // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
8188    // gets recycled and we have isolated uids, we might attribute the data incorrectly.
8189    // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
8190    // commonly used APIs.
8191    optional string service_class_name = 2;
8192    // Method name of the API call. It can also be a transaction code if we cannot
8193    // resolve it to a name. See Binder#getTransactionName.
8194    //
8195    // This is a system server method name.
8196    optional string service_method_name = 3;
8197    // Total number of API calls.
8198    optional int64 call_count = 4;
8199    // True if the screen was interactive PowerManager#isInteractive at the end of the call.
8200    optional bool screen_interactive = 13;
8201    // Total number of API calls we have data recorded for. If we collected data for all the calls,
8202    // call_count will be equal to recorded_call_count.
8203    //
8204    // If recorded_call_count is different than call_count, it means data collection has been
8205    // sampled. All the fields below will be sampled in this case.
8206    optional int64 recorded_call_count = 12;
8207    // Number of exceptions thrown by the API.
8208    optional int64 recorded_exception_count = 5;
8209    // Total latency of all API calls.
8210    // Average can be computed using total_latency_micros / recorded_call_count.
8211    optional int64 recorded_total_latency_micros = 6;
8212    // Maximum latency of one API call.
8213    optional int64 recorded_max_latency_micros = 7;
8214    // Total CPU usage of all API calls.
8215    // Average can be computed using total_cpu_micros / recorded_call_count.
8216    // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
8217    optional int64 recorded_total_cpu_micros = 8;
8218    // Maximum CPU usage of one API call.
8219    optional int64 recorded_max_cpu_micros = 9;
8220    // Maximum parcel reply size of one API call.
8221    optional int64 recorded_max_reply_size_bytes = 10;
8222    // Maximum parcel request size of one API call.
8223    optional int64 recorded_max_request_size_bytes = 11;
8224}
8225
8226/**
8227 * Pulls the statistics of exceptions during calls to Binder.
8228 *
8229 * Binder stats are cumulative from boot unless somebody reset the data using
8230 * > adb shell dumpsys binder_calls_stats --reset
8231 */
8232message BinderCallsExceptions {
8233    // Exception class name, e.g. java.lang.IllegalArgumentException.
8234    //
8235    // This is an exception class name thrown by the system server.
8236    optional string exception_class_name = 1;
8237    // Total number of exceptions.
8238    optional int64 exception_count = 2;
8239}
8240
8241/**
8242 * Pulls the statistics of message dispatching on HandlerThreads.
8243 *
8244 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
8245 * config on the device.
8246 *
8247 * Next tag: 11
8248 */
8249message LooperStats {
8250    // The uid that made a call to the System Server and caused the message to be enqueued.
8251    optional int32 uid = 1 [(is_uid) = true];
8252
8253    // Fully qualified class name of the handler target class.
8254    //
8255    // This field does not contain PII. This is a system server class name.
8256    optional string handler_class_name = 2;
8257
8258    // The name of the thread that runs the Looper.
8259    //
8260    // This field does not contain PII. This is a system server thread name.
8261    optional string looper_thread_name = 3;
8262
8263    // The name of the dispatched message.
8264    //
8265    // This field does not contain PII. This is a system server constant or class
8266    // name.
8267    optional string message_name = 4;
8268
8269    // Total number of successfully dispatched messages.
8270    optional int64 message_count = 5;
8271
8272    // Total number of messages that failed dispatching.
8273    optional int64 exception_count = 6;
8274
8275    // Total number of processed messages we have data recorded for. If we
8276    // collected data for all the messages, message_count will be equal to
8277    // recorded_message_count.
8278    //
8279    // If recorded_message_count is different than message_count, it means data
8280    // collection has been sampled. The fields below will be sampled in this case.
8281    optional int64 recorded_message_count = 7;
8282
8283    // Total latency of all processed messages.
8284    // Average can be computed using recorded_total_latency_micros /
8285    // recorded_message_count.
8286    optional int64 recorded_total_latency_micros = 8;
8287
8288    // Total CPU usage of all processed message.
8289    // Average can be computed using recorded_total_cpu_micros /
8290    // recorded_message_count. Total can be computed using
8291    // recorded_total_cpu_micros / recorded_message_count * message_count.
8292    optional int64 recorded_total_cpu_micros = 9;
8293
8294    // True if the screen was interactive PowerManager#isInteractive at the end of the call.
8295    optional bool screen_interactive = 10;
8296
8297    // Max recorded CPU usage of all processed messages.
8298    optional int64 recorded_max_cpu_micros = 11;
8299
8300    // Max recorded latency of all processed messages.
8301    optional int64 recorded_max_latency_micros = 12;
8302
8303    // Total number of messages we tracked the dispatching delay for. If we
8304    // collected data for all the messages, message_count will be equal to
8305    // recorded_delay_message_count.
8306    //
8307    // If recorded_delay_message_count is different than message_count, it means data
8308    // collection has been sampled or/and not all messages specified the target dispatch time.
8309    // The fields below will be sampled in this case.
8310    optional int64 recorded_delay_message_count = 13;
8311
8312    // Total dispatching delay of all processed messages.
8313    // Calculated as a difference between the target dispatching time (Message.when)
8314    // and the actual dispatching time.
8315    // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
8316    optional int64 recorded_total_delay_millis = 14;
8317
8318    // Max dispatching delay of all processed messages.
8319    // Calculated as a difference between the target dispatching time (Message.when)
8320    // and the actual dispatching time.
8321    optional int64 recorded_max_delay_millis = 15;
8322}
8323
8324/**
8325 * Pulls disk information, such as write speed and latency.
8326 */
8327message DiskStats {
8328    // Time taken to open, write 512B to, and close a file.
8329    // -1 if error performing the check.
8330    optional int64 data_write_latency_millis = 1;
8331
8332    optional bool file_based_encryption = 2;
8333
8334    // Recent disk write speed in kB/s.
8335    // -1 if error querying storageed.
8336    // 0 if data is unavailable.
8337    optional int32 recent_disk_write_speed = 3;
8338}
8339
8340
8341/**
8342 * Free and total bytes of the Data, Cache, System, and Metadata partitions.
8343 */
8344message DirectoryUsage {
8345    enum Directory {
8346        UNKNOWN = 0;
8347        DATA = 1;
8348        CACHE = 2;
8349        SYSTEM = 3;
8350        METADATA = 4;
8351    }
8352    optional Directory directory = 1;
8353    optional int64 free_bytes = 2;
8354    optional int64 total_bytes = 3;
8355}
8356
8357
8358/**
8359 * Size of an application: apk size, data size, and cache size.
8360 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
8361 * Information is only reported for apps with the primary user (user 0).
8362 * Sizes are aggregated by package name.
8363 */
8364message AppSize {
8365    // Including uids will involve modifying diskstats logic.
8366    optional string package_name = 1;
8367    // App size in bytes. -1 if unavailable.
8368    optional int64 app_size_bytes = 2;
8369    // App data size in bytes. -1 if unavailable.
8370    optional int64 app_data_size_bytes = 3;
8371    // App cache size in bytes. -1 if unavailable.
8372    optional int64 app_cache_size_bytes = 4;
8373    // Time that the cache file was produced.
8374    // Uses System.currentTimeMillis(), which is wall clock time.
8375    optional int64 cache_time_millis = 5;
8376}
8377
8378
8379/**
8380 * Size of a particular category. Eg: photos, videos.
8381 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
8382 */
8383message CategorySize {
8384    enum Category {
8385        UNKNOWN = 0;
8386        APP_SIZE = 1;
8387        APP_DATA_SIZE = 2;
8388        APP_CACHE_SIZE = 3;
8389        PHOTOS = 4;
8390        VIDEOS = 5;
8391        AUDIO = 6;
8392        DOWNLOADS = 7;
8393        SYSTEM = 8;
8394        OTHER = 9;
8395    }
8396    optional Category category = 1;
8397    // Category size in bytes.
8398    optional int64 size_bytes = 2;
8399    // Time that the cache file was produced.
8400    // Uses System.currentTimeMillis(), which is wall clock time.
8401    optional int64 cache_time_millis = 3;
8402}
8403
8404/**
8405 * Pulls per uid I/O stats. The stats are cumulative since boot.
8406 *
8407 * Read/write bytes are I/O events from a storage device
8408 * Read/write chars are data requested by read/write syscalls, and can be
8409 *   satisfied by caching.
8410 *
8411 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
8412 */
8413message DiskIo {
8414    optional int32 uid = 1 [(is_uid) = true];
8415    optional int64 fg_chars_read = 2;
8416    optional int64 fg_chars_write = 3;
8417    optional int64 fg_bytes_read = 4;
8418    optional int64 fg_bytes_write = 5;
8419    optional int64 bg_chars_read = 6;
8420    optional int64 bg_chars_write = 7;
8421    optional int64 bg_bytes_read = 8;
8422    optional int64 bg_bytes_write = 9;
8423    optional int64 fg_fsync = 10;
8424    optional int64 bg_fsync= 11;
8425}
8426
8427
8428/**
8429 * Pulls the number of fingerprints for each user.
8430 *
8431 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
8432 */
8433message NumFingerprintsEnrolled {
8434    // The associated user. Eg: 0 for owners, 10+ for others.
8435    // Defined in android/os/UserHandle.java
8436    optional int32 user = 1;
8437    // Number of fingerprints registered to that user.
8438    optional int32 num_fingerprints_enrolled = 2;
8439}
8440
8441/**
8442 * Pulls the number of faces for each user.
8443 *
8444 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
8445 */
8446message NumFacesEnrolled {
8447    // The associated user. Eg: 0 for owners, 10+ for others.
8448    // Defined in android/os/UserHandle.java
8449    optional int32 user = 1;
8450    // Number of faces registered to that user.
8451    optional int32 num_faces_enrolled = 2;
8452}
8453/**
8454 * A mapping of role holder -> role
8455 */
8456message RoleHolder {
8457    // uid of the role holder
8458    optional int32 uid = 1 [(is_uid) = true];
8459
8460    // package name of the role holder
8461    optional string package_name = 2;
8462
8463    // the role held
8464    optional string role = 3;
8465}
8466
8467message AggStats {
8468    // These are all in byte resolution.
8469    optional int64 min = 1 [deprecated = true];
8470    optional int64 average = 2 [deprecated = true];
8471    optional int64 max = 3 [deprecated = true];
8472
8473    // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
8474    // int64 fields.
8475    optional int32 mean_kb = 4;
8476    optional int32 max_kb = 5;
8477}
8478
8479// A reduced subset of process states; reducing the number of possible states allows more
8480// aggressive device-side aggregation of statistics and hence reduces metric upload size.
8481enum ProcessStateAggregated {
8482    PROCESS_STATE_UNKNOWN = 0;
8483    // Persistent system process.
8484    PROCESS_STATE_PERSISTENT = 1;
8485    // Top activity; actually any visible activity.
8486    PROCESS_STATE_TOP = 2;
8487    // Process binding to top or a foreground service.
8488    PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
8489    // Processing running a foreground service.
8490    PROCESS_STATE_FGS = 4;
8491    // Important foreground process (ime, wallpaper, etc).
8492    PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
8493    // Important background process.
8494    PROCESS_STATE_BACKGROUND = 6;
8495    // Process running a receiver.
8496    PROCESS_STATE_RECEIVER = 7;
8497    // All kinds of cached processes.
8498    PROCESS_STATE_CACHED = 8;
8499}
8500
8501// Next tag: 13
8502message ProcessStatsStateProto {
8503    optional android.service.procstats.ScreenState screen_state = 1;
8504
8505    optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
8506
8507    // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
8508    // and not frameworks/base/core/java/android/app/ActivityManager.java
8509    optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
8510
8511    optional ProcessStateAggregated process_state_aggregated = 10;
8512
8513    // Millisecond uptime duration spent in this state
8514    optional int64 duration_millis = 4 [deprecated = true];
8515    // Same as above, but with minute resolution so it fits into an int32.
8516    optional int32 duration_minutes = 11;
8517
8518    // Millisecond elapsed realtime duration spent in this state
8519    optional int64 realtime_duration_millis = 9 [deprecated = true];
8520    // Same as above, but with minute resolution so it fits into an int32.
8521    optional int32 realtime_duration_minutes = 12;
8522
8523    // # of samples taken
8524    optional int32 sample_size = 5;
8525
8526    // PSS is memory reserved for this process
8527    optional AggStats pss = 6 [deprecated = true];
8528
8529    // USS is memory shared between processes, divided evenly for accounting
8530    optional AggStats uss = 7 [deprecated = true];
8531
8532    // RSS is memory resident for this process
8533    optional AggStats rss = 8;
8534}
8535
8536// Next Tag: 8
8537message ProcessStatsProto {
8538    // Name of process.
8539    optional string process = 1;
8540
8541    // Uid of the process.
8542    optional int32 uid = 2 [(is_uid) = true];
8543
8544    // Information about how often kills occurred
8545    message Kill {
8546        // Count of excessive CPU kills
8547        optional int32 cpu = 1;
8548
8549        // Count of kills when cached
8550        optional int32 cached = 2;
8551
8552        // PSS stats during cached kill
8553        optional AggStats cached_pss = 3;
8554    }
8555    optional Kill kill = 3 [deprecated = true];
8556
8557    // Time and memory spent in various states.
8558    repeated ProcessStatsStateProto states = 5;
8559
8560    // Total time process has been running...  screen_state, memory_state, and process_state
8561    // will not be set.
8562    optional ProcessStatsStateProto total_running_state = 6;
8563
8564    // Association data for this process in this state;
8565    // each entry here is one association.
8566    repeated ProcessStatsAssociationProto assocs = 7;
8567}
8568
8569// Next Tag: 6
8570message ProcessStatsAssociationProto {
8571    // Procss Name of the associated process (client process of service binding)
8572    optional string assoc_process_name = 1;
8573
8574    // Package Name of the associated package (client package of service binding)
8575    optional string assoc_package_name = 2 [deprecated = true];
8576
8577    // UID of the associated process/package (client package of service binding)
8578    optional int32 assoc_uid = 5 [(is_uid) = true];
8579
8580    // Total count of the times this association (service binding) appeared.
8581    optional int32 total_count = 3;
8582
8583    // Uptime total duration in seconds this association (service binding) was around.
8584    optional int32 total_duration_secs = 4;
8585}
8586
8587message PackageServiceOperationStatsProto {
8588    // Operate enum: Started, Foreground, Bound, Executing
8589    optional android.service.procstats.ServiceOperationState operation = 1;
8590
8591    // Number of times the service was in this operation.
8592    optional int32 count = 2;
8593
8594    // Information about a state the service can be in.
8595    message StateStats {
8596        // Screen state enum.
8597        optional android.service.procstats.ScreenState screen_state = 1;
8598        // Memory state enum.
8599        optional android.service.procstats.MemoryState memory_state = 2;
8600
8601        // duration in milliseconds.
8602        optional int64 duration_millis = 3;
8603        // Millisecond elapsed realtime duration spent in this state
8604        optional int64 realtime_duration_millis = 4;
8605    }
8606    repeated StateStats state_stats = 3;
8607}
8608
8609message PackageServiceStatsProto {
8610    // Name of service component.
8611    optional string service_name = 1;
8612
8613    // The operation stats.
8614    // The package_name, package_uid, package_version, service_name will not be set to save space.
8615    repeated PackageServiceOperationStatsProto operation_stats = 2;
8616}
8617
8618message PackageAssociationSourceProcessStatsProto {
8619    // Uid of the process.
8620    optional int32 process_uid = 1;
8621    // Process name.
8622    optional string process_name = 2;
8623    // Package name.
8624    optional string package_name = 7;
8625    // Total count of the times this association appeared.
8626    optional int32 total_count = 3;
8627
8628    // Millisecond uptime total duration this association was around.
8629    optional int64 total_duration_millis = 4;
8630
8631    // Total count of the times this association became actively impacting its target process.
8632    optional int32 active_count = 5;
8633
8634    // Information on one source in this association.
8635    message StateStats {
8636        // Process state enum.
8637        optional android.service.procstats.ProcessState process_state = 1;
8638        // Millisecond uptime duration spent in this state
8639        optional int64 duration_millis = 2;
8640        // Millisecond elapsed realtime duration spent in this state
8641        optional int64 realtime_duration_mmillis = 3;
8642    }
8643    repeated StateStats active_state_stats = 6;
8644}
8645
8646message PackageAssociationProcessStatsProto {
8647    // Name of the target component.
8648    optional string component_name = 1;
8649    // Information on one source in this association.
8650    repeated PackageAssociationSourceProcessStatsProto sources = 2;
8651}
8652
8653
8654message ProcessStatsPackageProto {
8655    // Name of package.
8656    optional string package = 1;
8657
8658    // Uid of the package.
8659    optional int32 uid = 2;
8660
8661    // Version of the package.
8662    optional int64 version = 3;
8663
8664    // Stats for each process running with the package loaded in to it.
8665    repeated ProcessStatsProto process_stats = 4;
8666
8667    // Stats for each of the package's services.
8668    repeated PackageServiceStatsProto service_stats = 5;
8669
8670    // Stats for each association with the package.
8671    repeated PackageAssociationProcessStatsProto association_stats = 6;
8672}
8673
8674message ProcessStatsSectionProto {
8675    // Elapsed realtime at start of report.
8676    optional int64 start_realtime_millis = 1;
8677
8678    // Elapsed realtime at end of report.
8679    optional int64 end_realtime_millis = 2;
8680
8681    // CPU uptime at start of report.
8682    optional int64 start_uptime_millis = 3;
8683
8684    // CPU uptime at end of report.
8685    optional int64 end_uptime_millis = 4;
8686
8687    // System runtime library. e.g. "libdvm.so", "libart.so".
8688    optional string runtime = 5;
8689
8690    // whether kernel reports swapped pss.
8691    optional bool has_swapped_pss = 6;
8692
8693    // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
8694    enum Status {
8695        STATUS_UNKNOWN = 0;
8696        STATUS_COMPLETE = 1;
8697        STATUS_PARTIAL = 2;
8698        STATUS_SHUTDOWN = 3;
8699        STATUS_SYSPROPS = 4;
8700    }
8701    repeated Status status = 7;
8702
8703    // Number of pages available of various types and sizes, representation fragmentation.
8704    repeated ProcessStatsAvailablePagesProto available_pages = 10;
8705
8706    // Stats for each process.
8707    repeated ProcessStatsProto process_stats = 8;
8708
8709    // Stats for each package.
8710    repeated ProcessStatsPackageProto package_stats = 9;
8711}
8712
8713message ProcessStatsAvailablePagesProto {
8714    // Node these pages are in (as per /proc/pagetypeinfo)
8715    optional int32 node = 1;
8716
8717    // Zone these pages are in (as per /proc/pagetypeinfo)
8718    optional string zone = 2;
8719
8720    // Label for the type of these pages (as per /proc/pagetypeinfo)
8721    optional string label = 3;
8722
8723    // Distribution of number of pages available by order size.  First entry in array is
8724    // order 0, second is order 1, etc.  Each order increase is a doubling of page size.
8725    repeated int32 pages_per_order = 4;
8726}
8727
8728/**
8729 * Pulled from ProcessStatsService.java
8730 */
8731message ProcStats {
8732    optional ProcessStatsSectionProto proc_stats_section = 1 [(log_mode) = MODE_BYTES];
8733    // Data pulled from device into this is sometimes sharded across multiple atoms to work around
8734    // a size limit. When this happens, this shard ID will contain an increasing 1-indexed integer
8735    // with the number of this shard.
8736    optional int32 shard_id = 2;
8737}
8738
8739/**
8740 * Pulled from ProcessStatsService.java
8741 */
8742message ProcStatsPkgProc {
8743    optional ProcessStatsSectionProto proc_stats_section = 1 [(log_mode) = MODE_BYTES];
8744}
8745
8746// Next Tag: 2
8747message PackageRemoteViewInfoProto {
8748    optional string package_name = 1;
8749    // add per-package additional info here (like channels)
8750}
8751
8752// Next Tag: 2
8753message NotificationRemoteViewsProto {
8754    repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
8755}
8756
8757/**
8758 * Pulled from NotificationManagerService.java
8759 */
8760message NotificationRemoteViews {
8761    optional NotificationRemoteViewsProto notification_remote_views = 1 [(log_mode) = MODE_BYTES];
8762}
8763
8764/**
8765 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
8766 */
8767message PackageNotificationPreferences {
8768    // Uid under which the package is installed.
8769    optional int32 uid = 1 [(is_uid) = true];
8770    // Notification importance, which specifies when and how a notification is displayed.
8771    // Specified under core/java/android/app/NotificationManager.java.
8772    optional int32 importance = 2;
8773    // Lockscreen visibility as set by the user.
8774    optional int32 visibility = 3;
8775    // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
8776    // PreferencesHelper.java)
8777    optional int32 user_locked_fields = 4;
8778    // Indicates if the package importance was set by the user (rather than system default).
8779    optional bool user_set_importance = 5;
8780    // State of the full screen intent permission for this package.
8781    enum FsiState {
8782        // This package did not declare the full screen intent permission in its manifest.
8783        NOT_REQUESTED = 0;
8784        // This package has the full screen intent permission.
8785        GRANTED = 1;
8786        // This package does not have the full screen intent permission.
8787        DENIED = 2;
8788    }
8789    optional FsiState fsi_state = 6;
8790    // True if the current full screen intent permission state for this package was set by the user.
8791    // This is only set when the FSI permission is requested by the app.
8792    optional bool is_fsi_permission_user_set = 7;
8793}
8794
8795/**
8796 * Atom that contains a list of a package's channel preferences, pulled from
8797 * NotificationManagerService.java.
8798 */
8799message PackageNotificationChannelPreferences {
8800    // Uid under which the package is installed.
8801    optional int32 uid = 1 [(is_uid) = true];
8802    // Channel's ID. Should always be available.
8803    optional string channel_id = 2;
8804    // Channel's name. Should always be available.
8805    optional string channel_name = 3;
8806    // Channel's description. Optionally set by the channel creator.
8807    optional string description = 4;
8808    // Notification importance, which specifies when and how a notification is displayed. Specified
8809    // under core/java/android/app/NotificationManager.java.
8810    optional int32 importance = 5;
8811    // Bitmask representing which fields have been set by the user. See field bitmask descriptions
8812    // at core/java/android/app/NotificationChannel.java
8813    optional int32 user_locked_fields = 6;
8814    // Indicates if the channel was deleted by the app.
8815    optional bool is_deleted = 7;
8816    // Indicates if the channel was marked as a conversation by the app.
8817    optional bool is_conversation = 8;
8818    // Indicates if the channel is a conversation that was demoted by the user.
8819    optional bool is_demoted_conversation = 9;
8820    // Indicates if the channel is a conversation that was marked as important by the user.
8821    optional bool is_important_conversation = 10;
8822}
8823
8824/**
8825 * Atom that contains a list of a package's channel group preferences, pulled from
8826 * NotificationManagerService.java.
8827 */
8828message PackageNotificationChannelGroupPreferences {
8829    // Uid under which the package is installed.
8830    optional int32 uid = 1 [(is_uid) = true];
8831    // Channel Group's ID. Should always be available.
8832    optional string group_id = 2;
8833    // Channel Group's name. Should always be available.
8834    optional string group_name = 3;
8835    // Channel Group's description. Optionally set by group creator.
8836    optional string description = 4;
8837    // Indicates if notifications from this channel group are blocked.
8838    optional bool is_blocked = 5;
8839    // Bitmask representing which fields have been set by the user. See field bitmask descriptions
8840    // at core/java/android/app/NotificationChannelGroup.java
8841    optional int32 user_locked_fields = 6;
8842}
8843
8844message PowerProfileProto {
8845    optional double cpu_suspend = 1;
8846
8847    optional double cpu_idle = 2;
8848
8849    optional double cpu_active = 3;
8850
8851    message CpuCluster {
8852        optional int32 id = 1;
8853        optional double cluster_power = 2;
8854        optional int32 cores = 3;
8855        repeated int64 speed = 4;
8856        repeated double core_power = 5;
8857    }
8858
8859    repeated CpuCluster cpu_cluster = 40;
8860
8861    optional double wifi_scan = 4;
8862
8863    optional double wifi_on = 5;
8864
8865    optional double wifi_active = 6;
8866
8867    optional double wifi_controller_idle = 7;
8868
8869    optional double wifi_controller_rx = 8;
8870
8871    optional double wifi_controller_tx = 9;
8872
8873    repeated double wifi_controller_tx_levels = 10;
8874
8875    optional double wifi_controller_operating_voltage = 11;
8876
8877    optional double bluetooth_controller_idle = 12;
8878
8879    optional double bluetooth_controller_rx = 13;
8880
8881    optional double bluetooth_controller_tx = 14;
8882
8883    optional double bluetooth_controller_operating_voltage = 15;
8884
8885    optional double modem_controller_sleep = 16;
8886
8887    optional double modem_controller_idle = 17;
8888
8889    optional double modem_controller_rx = 18;
8890
8891    repeated double modem_controller_tx = 19;
8892
8893    optional double modem_controller_operating_voltage = 20;
8894
8895    optional double gps_on = 21;
8896
8897    repeated double gps_signal_quality_based = 22;
8898
8899    optional double gps_operating_voltage = 23;
8900
8901    optional double bluetooth_on = 24;
8902
8903    optional double bluetooth_active = 25;
8904
8905    optional double bluetooth_at_cmd = 26;
8906
8907    optional double ambient_display = 27;
8908
8909    optional double screen_on = 28;
8910
8911    optional double radio_on = 29;
8912
8913    optional double radio_scanning = 30;
8914
8915    optional double radio_active = 31;
8916
8917    optional double screen_full = 32;
8918
8919    optional double audio = 33;
8920
8921    optional double video = 34;
8922
8923    optional double flashlight = 35;
8924
8925    optional double memory = 36;
8926
8927    optional double camera = 37;
8928
8929    optional double wifi_batched_scan = 38;
8930
8931    optional double battery_capacity = 39;
8932}
8933
8934/**
8935 * power_profile.xml and other constants for power model calculations.
8936 * Pulled from PowerProfile.java
8937 */
8938message PowerProfile {
8939    optional PowerProfileProto power_profile = 1 [(log_mode) = MODE_BYTES];
8940}
8941
8942/**
8943 * Logs when a user restriction was added or removed.
8944 *
8945 * Logged from:
8946 *   frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
8947 */
8948message UserRestrictionChanged {
8949    // The raw string of the user restriction as defined in UserManager.
8950    // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
8951    optional string restriction = 1;
8952    // Whether the restriction is enabled or disabled.
8953    optional bool enabled = 2;
8954}
8955
8956/**
8957 * Pulls process user time and system time. Puller takes a snapshot of all pids
8958 * in the system and returns cpu stats for those that are working at the time.
8959 * Dead pids will be dropped. Kernel processes are excluded.
8960 * Min cool-down is 5 sec.
8961 */
8962message ProcessCpuTime {
8963    optional int32 uid = 1 [(is_uid) = true];
8964
8965    optional string process_name = 2;
8966    // Process cpu time in user space, cumulative from boot/process start
8967    optional int64 user_time_millis = 3;
8968    // Process cpu time in system space, cumulative from boot/process start
8969    optional int64 system_time_millis = 4;
8970}
8971
8972/**
8973 * Pulls the CPU usage for each thread.
8974 *
8975 * Read from /proc/$PID/task/$TID/time_in_state files.
8976 *
8977 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
8978 * time_in_state files not being present on some phones, have not been addressed. These should be
8979 * considered before a public release.
8980 */
8981message CpuTimePerThreadFreq {
8982    // UID that owns the process.
8983    optional int32 uid = 1 [(is_uid) = true];
8984    // ID of the process.
8985    optional int32 process_id = 2;
8986    // ID of the thread.
8987    optional int32 thread_id = 3;
8988    // Name of the process taken from `/proc/$PID/cmdline`.
8989    optional string process_name = 4;
8990    // Name of the thread taken from `/proc/$PID/task/$TID/comm`
8991    optional string thread_name = 5;
8992
8993    // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
8994    // are given in KHz, and time is given in milliseconds since the thread started. All eight
8995    // frequencies are given here as the alternative is sending eight separate atoms. This method
8996    // significantly reduces the amount of data created
8997    optional int32 frequency1_khz = 6;
8998    optional int32 time1_millis = 7;
8999    optional int32 frequency2_khz = 8;
9000    optional int32 time2_millis = 9;
9001    optional int32 frequency3_khz = 10;
9002    optional int32 time3_millis = 11;
9003    optional int32 frequency4_khz = 12;
9004    optional int32 time4_millis = 13;
9005    optional int32 frequency5_khz = 14;
9006    optional int32 time5_millis = 15;
9007    optional int32 frequency6_khz = 16;
9008    optional int32 time6_millis = 17;
9009    optional int32 frequency7_khz = 18;
9010    optional int32 time7_millis = 19;
9011    optional int32 frequency8_khz = 20;
9012    optional int32 time8_millis = 21;
9013}
9014
9015/**
9016 * Pulls information about the device's build.
9017 */
9018message BuildInformation {
9019    // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
9020    // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
9021    optional string fingerprint = 1;
9022
9023    // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
9024    optional string brand = 2;
9025
9026    // Build.PRODUCT. The name of the overall product.
9027    optional string product = 3;
9028
9029    // Build.DEVICE. The name of the industrial design.
9030    optional string device = 4;
9031
9032    // Build.VERSION.RELEASE. The user-visible version string.  E.g., "1.0" or "3.4b5" or "bananas".
9033    optional string version_release = 5;
9034
9035    // Build.ID. E.g. a label like "M4-rc20".
9036    optional string id = 6;
9037
9038    // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
9039    // represent this build.
9040    optional string version_incremental = 7;
9041
9042    // Build.TYPE. The type of build, like "user" or "eng".
9043    optional string type = 8;
9044
9045    // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
9046    optional string tags = 9;
9047}
9048
9049/**
9050 * Logs information about mismatched caller for content capture.
9051 *
9052 * Logged from:
9053 *   frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
9054 */
9055message ContentCaptureCallerMismatchReported {
9056    optional string intended_package = 1;
9057    optional string calling_package = 2;
9058}
9059
9060/**
9061 * Logs information about content capture service events.
9062 *
9063 * Logged from:
9064 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
9065 */
9066message ContentCaptureServiceEvents {
9067    // The type of event.
9068    enum Event {
9069        UNKNOWN = 0;
9070        ON_CONNECTED = 1;
9071        ON_DISCONNECTED = 2;
9072        SET_WHITELIST = 3;
9073        SET_DISABLED = 4;
9074        ON_USER_DATA_REMOVED = 5;
9075        ON_DATA_SHARE_REQUEST = 6;
9076        ACCEPT_DATA_SHARE_REQUEST = 7;
9077        REJECT_DATA_SHARE_REQUEST = 8;
9078        DATA_SHARE_WRITE_FINISHED = 9;
9079        DATA_SHARE_ERROR_IOEXCEPTION = 10;
9080        DATA_SHARE_ERROR_EMPTY_DATA = 11;
9081        DATA_SHARE_ERROR_CLIENT_PIPE_FAIL = 12;
9082        DATA_SHARE_ERROR_SERVICE_PIPE_FAIL = 13;
9083        DATA_SHARE_ERROR_CONCURRENT_REQUEST = 14;
9084        DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED = 15;
9085        ON_REMOTE_SERVICE_DIED = 16;
9086    }
9087    optional Event event = 1;
9088    // component/package of content capture service.
9089    optional string service_info = 2;
9090    // component/package of target.
9091    // it's a concatenated list of component/package for SET_WHITELIST event
9092    // separated by " ".
9093    // Deprecated: should not log app package
9094    optional string target_info = 3 [deprecated = true];
9095    // The number of packages in the allow list
9096    optional int32 set_allowlist_package_count = 4;
9097    // The number of activities in the allow list
9098    optional int32 set_allowlist_activity_count = 5;
9099}
9100
9101/**
9102 * Logs information about content capture session events.
9103 *
9104 * Logged from:
9105 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
9106 */
9107message ContentCaptureSessionEvents {
9108    // The type of event.
9109    enum Event {
9110        UNKNOWN = 0;
9111        ON_SESSION_STARTED = 1;
9112        ON_SESSION_FINISHED = 2;
9113        SESSION_NOT_CREATED = 3;
9114    }
9115    optional int32 session_id = 1;
9116    optional Event event = 2;
9117    // (n/a on session finished)
9118    optional int32 state_flags = 3;
9119    // component/package of content capture service.
9120    optional string service_info = 4;
9121    // component/package of app.
9122    // (n/a on session finished)
9123    // Deprecated: should not log app package
9124    optional string app_info = 5 [deprecated = true];
9125    optional bool is_child_session = 6;
9126}
9127
9128/**
9129 * Logs information about session being flushed.
9130 *
9131 * Logged from:
9132 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
9133 */
9134message ContentCaptureFlushed {
9135    optional int32 session_id = 1;
9136    // component/package of content capture service.
9137    optional string service_info = 2;
9138    // component/package of app.
9139    // Deprecated: should not log app package
9140    optional string app_info = 3 [deprecated = true];
9141    // session start/finish events
9142    optional int32 child_session_started = 4;
9143    optional int32 child_session_finished = 5;
9144    // count of view events.
9145    optional int32 view_appeared_count = 6;
9146    optional int32 view_disappeared_count = 7;
9147    optional int32 view_text_changed_count = 8;
9148
9149    // Flush stats.
9150    optional int32 max_events = 9;
9151    optional int32 idle_flush_freq = 10;
9152    optional int32 text_flush_freq = 11;
9153    optional int32 flush_reason = 12;
9154}
9155
9156/**
9157 * Pulls on-device BatteryStats power use calculations for the overall device.
9158 */
9159message DeviceCalculatedPowerUse {
9160    // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
9161    // BatteryStats last reset (i.e. roughly since device was last significantly charged).
9162    // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
9163    optional int64 computed_power_nano_amp_secs = 1;
9164}
9165
9166// Keep in sync with frameworks/base/core/proto/android/os/batteryusagestats.proto
9167/**
9168 * Represents a device's BatteryUsageStats, with power usage information about the device
9169 * and each app.
9170 */
9171message BatteryUsageStatsAtomsProto {
9172
9173    // The session start timestamp in UTC milliseconds since January 1, 1970, per Date#getTime().
9174    // All data is no older than this time.
9175    optional int64 session_start_millis = 1;
9176
9177    // The session end timestamp in UTC milliseconds since January 1, 1970, per Date#getTime().
9178    // All data is no more recent than this time.
9179    optional int64 session_end_millis = 2;
9180
9181    // Length that the reported data covered. This usually will be equal to the entire session,
9182    // session_end_millis - session_start_millis, but may not be if some data during this time frame
9183    // is missing.
9184    optional int64 session_duration_millis = 3;
9185
9186    // Represents usage of a consumer, storing all of its power component usage.
9187    message BatteryConsumerData {
9188        // Total power consumed by this BatteryConsumer (including all of its PowerComponents).
9189        // May not equal the sum of the PowerComponentUsage due to under- or over-estimations.
9190        // Multiply by 1/36 to obtain mAh.
9191        optional int64 total_consumed_power_deci_coulombs = 1;
9192
9193        // Represents power and time usage of a particular power component.
9194        message PowerComponentUsage {
9195            // Holds android.os.PowerComponentEnum, or custom component value between 1000 and 9999.
9196            // Evidently, if one attempts to write an int to an enum field that is out of range, it
9197            // is treated as 0, so we must make this an int32.
9198            optional int32 component = 1;
9199
9200            // Power consumed by this component. Multiply by 1/36 to obtain mAh.
9201            optional int64 power_deci_coulombs = 2;
9202
9203            optional int64 duration_millis = 3;
9204        }
9205        repeated PowerComponentUsage power_components = 2;
9206
9207        // Represents a slice of power attribution, e.g. "cpu while in the background"
9208        // or "wifi when running a background service".  Queries that care about
9209        // PowerComponentUsage slices need to be aware of all supported dimensions.
9210        // There are no roll-ups included in the slices - it is up to the clients
9211        // of this data to aggregate values as needed.
9212        message PowerComponentUsageSlice {
9213            optional PowerComponentUsage power_component = 1;
9214
9215            enum ProcessState {
9216                UNSPECIFIED = 0;
9217                FOREGROUND = 1;
9218                BACKGROUND = 2;
9219                FOREGROUND_SERVICE = 3;
9220            }
9221
9222            optional ProcessState process_state = 2;
9223        }
9224
9225        repeated PowerComponentUsageSlice slices = 3;
9226    }
9227
9228    // Total power usage for the device during this session.
9229    optional BatteryConsumerData device_battery_consumer = 4;
9230
9231    // Power usage by a uid during this session.
9232    message UidBatteryConsumer {
9233        optional int32 uid = 1 [(is_uid) = true];
9234        optional BatteryConsumerData battery_consumer_data = 2;
9235        optional int64 time_in_foreground_millis = 3;
9236        optional int64 time_in_background_millis = 4;
9237    }
9238    repeated UidBatteryConsumer uid_battery_consumers = 5;
9239
9240    // Sum of all discharge percentage point drops during the reported session.
9241    optional int32 session_discharge_percentage = 6;
9242
9243    // Total amount of time battery was discharging during the reported session
9244    optional int64 discharge_duration_millis = 7;
9245
9246    // Notes the power model used for a power component.
9247    message PowerComponentModel {
9248        // Holds android.os.PowerComponentEnum, or custom component value between 1000 and 9999.
9249        optional int32 component = 1;
9250
9251        enum PowerModel {
9252            UNDEFINED = 0;
9253            POWER_PROFILE = 1;
9254            MEASURED_ENERGY = 2;
9255        }
9256
9257        optional PowerModel power_model = 2;
9258    }
9259
9260    // The power model used for each power component.
9261    repeated PowerComponentModel component_models = 8;
9262}
9263
9264/**
9265 * Pulls on-device BatteryStats on-battery power use calculations, in the form of BatteryUsageStats,
9266 * using the best data available.
9267 *
9268 * Includes the data since the last time statsd pulled this atom (i.e. since the
9269 * last-BatteryStats-reset-prior-to-last-statsd-pull) until the most recent BatteryStats reset.
9270 *
9271 * Does NOT include data after the most recent reset (use BatteryUsageStatsSinceReset too for that).
9272 *
9273 * Pulled from BatteryManager.getBatteryUsageStats().
9274 */
9275message BatteryUsageStatsBeforeReset {
9276    optional BatteryUsageStatsAtomsProto battery_usage_stats = 1 [(log_mode) = MODE_BYTES];
9277}
9278
9279/**
9280 * Pulls on-device BatteryStats on-battery power use calculations, in the form of BatteryUsageStats,
9281 * using the best data available.
9282 *
9283 * Includes all data since the most recent BatteryStats reset event, but none prior to it.
9284 *
9285 * Pulled from BatteryManager.getBatteryUsageStats().
9286 */
9287message BatteryUsageStatsSinceReset {
9288    optional BatteryUsageStatsAtomsProto battery_usage_stats = 1 [(log_mode) = MODE_BYTES];
9289}
9290
9291/**
9292 * Pulls on-device BatteryStats on-battery power use calculations, in the form of BatteryUsageStats,
9293 * using only PowerProfile Model data (even if better data is available).
9294 *
9295 * Includes all data since the most recent BatteryStats reset event, but none prior to it.
9296 *
9297 * @see android.os.BatteryUsageStatsQuery#FLAG_BATTERY_USAGE_STATS_POWER_PROFILE_MODEL
9298 * Pulled from BatteryManager.getBatteryUsageStats().
9299 */
9300message BatteryUsageStatsSinceResetUsingPowerProfileModel {
9301    optional BatteryUsageStatsAtomsProto battery_usage_stats = 1 [(log_mode) = MODE_BYTES];
9302}
9303
9304/**
9305 * Logs device policy features.
9306 *
9307 * Logged from:
9308 *   frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
9309 *   packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
9310 */
9311message DevicePolicyEvent {
9312    // The event id - unique for each event.
9313    optional android.stats.devicepolicy.EventId event_id = 1;
9314    // The admin package name.
9315    optional string admin_package_name = 2;
9316    // A generic integer parameter.
9317    optional int32 integer_value = 3;
9318    // A generic boolean parameter.
9319    optional bool boolean_value = 4;
9320    // A parameter specifying a time period in milliseconds.
9321    optional uint64 time_period_millis = 5;
9322    // A parameter specifying a list of package names, bundle extras or string parameters.
9323    optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
9324}
9325
9326/**
9327 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
9328 *
9329 * Logged from:
9330 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9331 */
9332message DocsUILaunchReported {
9333    optional android.stats.docsui.LaunchAction launch_action = 1;
9334    optional bool has_initial_uri = 2;
9335    optional android.stats.docsui.MimeType mime_type = 3;
9336    optional android.stats.docsui.Root initial_root = 4;
9337}
9338
9339/**
9340 * Logs root/app visited event in file managers/picker. Call this when the user
9341 * taps on root/app in hamburger menu.
9342 *
9343 * Logged from:
9344 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9345 */
9346message DocsUIRootVisitedReported {
9347    optional android.stats.docsui.ContextScope scope = 1;
9348    optional android.stats.docsui.Root root = 2;
9349}
9350
9351/**
9352 * Logs file operation stats. Call this when a file operation has completed.
9353 *
9354 * Logged from:
9355 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9356 */
9357message DocsUIFileOperationReported {
9358    optional android.stats.docsui.Provider provider = 1;
9359    optional android.stats.docsui.FileOperation file_op = 2;
9360}
9361
9362/**
9363 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
9364 * mode.
9365 *
9366 * Logged from:
9367 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9368 */
9369message DocsUIFileOperationCopyMoveModeReported {
9370    optional android.stats.docsui.FileOperation file_op = 1;
9371    optional android.stats.docsui.CopyMoveOpMode mode = 2;
9372}
9373
9374
9375/**
9376 * Logs file sub operation stats. Call this when a file operation has failed.
9377 *
9378 * Logged from:
9379 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9380 */
9381message DocsUIFileOperationFailureReported {
9382    optional android.stats.docsui.Authority authority = 1;
9383    optional android.stats.docsui.SubFileOperation sub_op = 2;
9384}
9385
9386/**
9387* Logs the cancellation of a file operation. Call this when a job is canceled
9388*
9389* Logged from:
9390*     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9391*/
9392message DocsUIFileOperationCanceledReported {
9393    optional android.stats.docsui.FileOperation file_op = 1;
9394}
9395
9396/**
9397 * Logs startup time in milliseconds.
9398 *
9399 * Logged from:
9400 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9401 */
9402message DocsUIStartupMsReported {
9403    optional int32 startup_millis = 1;
9404}
9405
9406/**
9407 * Logs the action that was started by user.
9408 *
9409 * Logged from:
9410 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9411 */
9412message DocsUIUserActionReported {
9413    optional android.stats.docsui.UserAction action = 1;
9414}
9415
9416/**
9417 * Logs the invalid type when invalid scoped access is requested.
9418 *
9419 * Logged from:
9420 *     package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
9421 */
9422message DocsUIInvalidScopedAccessRequestReported {
9423    optional android.stats.docsui.InvalidScopedAccess type = 1;
9424}
9425
9426/**
9427 * Logs the package name that launches docsui picker mode.
9428 *
9429 * Logged from:
9430 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9431 */
9432message DocsUIPickerLaunchedFromReported {
9433    optional string package_name = 1;
9434}
9435
9436/**
9437 * Logs the search type.
9438 *
9439 * Logged from:
9440 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9441 */
9442message DocsUISearchTypeReported {
9443    optional android.stats.docsui.SearchType search_type = 1;
9444}
9445
9446/**
9447 * Logs the search mode.
9448 *
9449 * Logged from:
9450 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9451 */
9452message DocsUISearchModeReported {
9453    optional android.stats.docsui.SearchMode search_mode = 1;
9454}
9455
9456/**
9457 * Logs the pick result information.
9458 *
9459 * Logged from:
9460 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9461 */
9462message DocsUIPickResultReported {
9463    optional int32 total_action_count = 1;
9464    optional int64 duration_millis = 2;
9465    optional int32 file_count= 3;
9466    optional bool is_searching = 4;
9467    optional android.stats.docsui.Root picked_from = 5;
9468    optional android.stats.docsui.MimeType mime_type = 6;
9469    optional int32 repeatedly_pick_times = 7;
9470}
9471
9472/** Logs the drag and drop of files.
9473
9474 * Logged from:
9475 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9476 */
9477message DocsUIDragAndDropReported {
9478    optional bool drag_initiated_from_docsui = 1;
9479}
9480
9481/**
9482 * Logs when an app's memory is compacted.
9483 *
9484 * Logged from:
9485 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9486 */
9487message AppCompacted {
9488  // The pid of the process being compacted.
9489  optional int32 pid = 1;
9490
9491  // The name of the process being compacted.
9492  optional string process_name = 2;
9493
9494  // The type of compaction.
9495  enum Action {
9496    UNKNOWN = 0;
9497    SOME = 1;
9498    FULL = 2;
9499    PERSISTENT = 3;
9500    BFGS = 4;
9501  }
9502  optional Action action = 3;
9503
9504  // Total RSS in kilobytes consumed by the process prior to compaction.
9505  optional int64 before_rss_total_kilobytes = 4;
9506
9507  // File RSS in kilobytes consumed by the process prior to compaction.
9508  optional int64 before_rss_file_kilobytes = 5;
9509
9510  // Anonymous RSS in kilobytes consumed by the process prior to compaction.
9511  optional int64 before_rss_anon_kilobytes = 6;
9512
9513  // Swap in kilobytes consumed by the process prior to compaction.
9514  optional int64 before_swap_kilobytes = 7;
9515
9516  // Total RSS in kilobytes consumed by the process after compaction.
9517  optional int64 after_rss_total_kilobytes = 8;
9518
9519  // File RSS in kilobytes consumed by the process after compaction.
9520  optional int64 after_rss_file_kilobytes = 9;
9521
9522  // Anonymous RSS in kilobytes consumed by the process after compaction.
9523  optional int64 after_rss_anon_kilobytes = 10;
9524
9525  // Swap in kilobytes consumed by the process after compaction.
9526  optional int64 after_swap_kilobytes = 11;
9527
9528  // The time taken to perform compaction in milliseconds.
9529  optional int64 time_to_compact_millis = 12;
9530
9531  // The last compaction action performed for this app.
9532  optional Action last_action = 13;
9533
9534  // The last time that compaction was attempted on this process in milliseconds
9535  // since boot, not including sleep (see SystemClock.uptimeMillis()).
9536  optional int64 last_compact_timestamp_ms_since_boot = 14;
9537
9538  // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
9539  optional int32 oom_score_adj = 15;
9540
9541  // The process state at the time of compaction.
9542  optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
9543
9544  // Free ZRAM in kilobytes before compaction.
9545  optional int64 before_zram_free_kilobytes = 17;
9546
9547  // Free ZRAM in kilobytes after compaction.
9548  optional int64 after_zram_free_kilobytes = 18;
9549}
9550
9551message AppCompactedV2 {
9552  // UID of the process being compacted
9553  optional int32 uid = 1 [(is_uid) = true];
9554
9555  // Process state for compacted process
9556  optional int32 proc_state = 2;
9557
9558  // Current OOM Adjust at the time of compaction, this would correspond to any newly set oom adj.
9559  optional int32 current_oom_adj = 3;
9560
9561  // Delta Anon RSS reduced with compaction computed as RSS Before - RSS After.
9562  optional int64 delta_anon_rss = 4;
9563
9564  // Physical ZRAM Consumed during compaction
9565  optional int64 zram_consumed = 5;
9566
9567  // CPU time spent compacting
9568  optional float compact_cpu_time = 6;
9569
9570  // Anon RSS of the process prior to being compacted
9571  optional int64 original_anon_rss = 7;
9572
9573  // Reason for the OOM adj change
9574  optional android.app.OomChangeReasonEnum oom_change_reason = 8;
9575}
9576
9577/**
9578 * Represents an event that logs information about a successful switch to an upstream network.
9579 */
9580message UpstreamEvent {
9581  // Indicates the transport type of network.
9582  optional android.stats.connectivity.UpstreamType upstream_type = 1;
9583
9584  // The duration of network usage.
9585  optional int64 duration_millis = 2;
9586
9587  // The amount of data received from tethered clients.
9588  optional int64 tx_bytes = 3;
9589
9590  // The amount of data received from remote.
9591  optional int64 rx_bytes = 4;
9592}
9593
9594message UpstreamEvents {
9595  repeated UpstreamEvent upstream_event = 1;
9596}
9597
9598/**
9599 * Logs when a Tethering event occurs.
9600 *
9601 */
9602message NetworkTetheringReported {
9603  // Tethering error code
9604  optional android.stats.connectivity.ErrorCode error_code = 1;
9605
9606  // Tethering downstream type
9607  optional android.stats.connectivity.DownstreamType downstream_type = 2;
9608
9609  // Transport type of upstream network
9610  optional android.stats.connectivity.UpstreamType upstream_type = 3 [deprecated = true];
9611
9612  // The user type of switching tethering
9613  optional android.stats.connectivity.UserType user_type= 4;
9614
9615  // Log each transport type of upstream network event
9616  optional UpstreamEvents upstream_events = 5  [(log_mode) = MODE_BYTES];
9617
9618  // A time period that a downstreams exists
9619  optional int64 duration_millis = 6;
9620}
9621
9622/**
9623 * Logs NSD(Network service discovery) client session
9624 *
9625 * Log from:
9626 *     packages/modules/Connectivity/service-t/src/com/android/server/NsdService
9627 */
9628message NetworkNsdReported {
9629  // Indicate if the device is using the legacy or the new implementation
9630  optional bool is_legacy = 1;
9631
9632  // It is a random number to represent different clients. Each client is an app on the device.
9633  optional int32 client_id = 2;
9634
9635  // It is a increment_number to represent different transactions.
9636  // Each transaction is a request from an app client.
9637  optional int32 transaction_id = 3;
9638
9639  // Indicate the service in resolution is a known service in the discovered services cache
9640  optional bool is_known_service = 4;
9641
9642  // Record each NSD session type
9643  optional android.stats.connectivity.NsdEventType type = 5;
9644
9645  // The process duration of the event in milli-second
9646  optional int64 event_duration_millisec = 6;
9647
9648  // Record each mdns query result
9649  optional android.stats.connectivity.MdnsQueryResult query_result = 7;
9650
9651  // Count of services in cache at the end of discovery
9652  optional int32 found_service_count = 8;
9653
9654  // Count of found callback when discovery is stopped
9655  optional int32 found_callback_count = 9;
9656
9657  // Count of lost callback when discovery is stopped
9658  optional int32 lost_callback_count = 10;
9659
9660  // Record query service count before unregistered service
9661  optional int32 replied_requests_count = 11;
9662}
9663
9664/**
9665 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
9666 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
9667 *
9668 * The NetworkDnsEventReported message represents the entire lookup operation, which may
9669 * result one or more queries to the recursive DNS resolvers. Those are individually logged
9670 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
9671 * broken up by query type, transport, network interface, etc.
9672 */
9673message NetworkDnsEventReported {
9674    optional android.stats.dnsresolver.EventType event_type = 1;
9675
9676    optional android.stats.dnsresolver.ReturnCode return_code = 2;
9677
9678    // The latency in microseconds of the entire DNS lookup operation.
9679    optional int32 latency_micros = 3;
9680
9681    // Only valid for event_type = EVENT_GETADDRINFO.
9682    optional int32 hints_ai_flags = 4;
9683
9684    // Flags passed to android_res_nsend() defined in multinetwork.h
9685    // Only valid for event_type = EVENT_RESNSEND.
9686    optional int32 res_nsend_flags = 5;
9687
9688    optional android.stats.dnsresolver.NetworkType network_type = 6;
9689
9690    // The DNS over TLS mode on a specific netId.
9691    optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
9692
9693    // Additional pass-through fields opaque to statsd.
9694    // The DNS resolver Mainline module can add new fields here without requiring an OS update.
9695    optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
9696
9697    // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
9698    optional int32 sampling_rate_denom = 9;
9699}
9700
9701/**
9702 * logs the number of DNS servers supported by the protocol
9703 */
9704message NetworkDnsServerSupportReported {
9705    // The network type of the network
9706    optional android.stats.dnsresolver.NetworkType network_type = 1;
9707
9708    // The private DNS mode of the network
9709    optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 2;
9710
9711    // Stores the state of all DNS servers for this network
9712    optional android.stats.dnsresolver.Servers servers = 3 [(log_mode) = MODE_BYTES];
9713}
9714
9715/**
9716 * The NetworkDnsHandshakeReported message describes a DoT or DoH handshake operation along with
9717 * its result, cause, network latency, TLS version, etc.
9718 *
9719 */
9720message NetworkDnsHandshakeReported {
9721  optional android.stats.dnsresolver.Protocol protocol = 1;
9722
9723  optional android.stats.dnsresolver.HandshakeResult result = 2;
9724
9725  optional android.stats.dnsresolver.HandshakeCause cause = 3;
9726
9727  optional android.stats.dnsresolver.NetworkType network_type = 4;
9728
9729  optional android.stats.dnsresolver.PrivateDnsModes private_dns_mode = 5;
9730
9731  // The latency in microseconds of the entire handshake operation.
9732  optional int32 latency_micros = 6;
9733
9734  // Number of bytes sent in a handshake.
9735  optional int32 bytes_sent = 7;
9736
9737  // Number of bytes received in a handshake.
9738  optional int32 bytes_received = 8;
9739
9740  // Number of round-trips.
9741  optional int32 round_trips = 9;
9742
9743  // True if TLS session cache hit.
9744  optional bool tls_session_cache_hit = 10;
9745
9746  // 2 = TLS 1.2, 3 = TLS 1.3
9747  optional int32 tls_version = 11;
9748
9749  // True if the handshake requires verifying the private DNS provider hostname.
9750  optional bool hostname_verification = 12;
9751
9752  // Only present when protocol = PROTO_DOH.
9753  optional int32 quic_version = 13;
9754
9755  optional int32 server_index = 14;
9756
9757  // The sampling-rate of this event is 1/sampling_rate_denom.
9758  optional int32 sampling_rate_denom = 15;
9759}
9760
9761/**
9762 * logs the CapportApiData info
9763 * Logged from:
9764 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
9765 */
9766message CapportApiData {
9767    // The TTL of the network connection provided by captive portal
9768    optional int32 remaining_ttl_secs = 1;
9769
9770    // The limit traffic data of the network connection provided by captive portal
9771    optional int32 remaining_bytes = 2;
9772
9773    // Is portal url option included in the DHCP packet (Yes, No)
9774    optional bool has_portal_url = 3;
9775
9776    // Is venue info (e.g. store info, maps, flight status) included (Yes, No)
9777    optional bool has_venue_info = 4;
9778}
9779
9780/**
9781 * logs a network Probe Event
9782 * Logged from:
9783 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
9784 */
9785message ProbeEvent {
9786    // The probe type (http or https, or captive portal API...)
9787    optional android.stats.connectivity.ProbeType probe_type = 1;
9788
9789    // The latency in microseconds of the probe event
9790    optional int32 latency_micros = 2;
9791
9792    // The result of the probe event
9793    optional android.stats.connectivity.ProbeResult probe_result = 3;
9794
9795    // The CaptivePortal API info
9796    optional CapportApiData capport_api_data = 4;
9797}
9798
9799/**
9800 * log each ProbeEvent in ProbeEvents
9801 * Logged from:
9802 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
9803 */
9804message ProbeEvents {
9805    // Record probe event during the validation
9806    repeated ProbeEvent probe_event = 1;
9807}
9808
9809/**
9810 * The DHCP (Dynamic Host Configuration Protocol) session info
9811 * Logged from:
9812 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
9813 */
9814message DhcpSession {
9815    // The DHCP Feature(s) enabled in this session
9816    repeated android.stats.connectivity.DhcpFeature used_features = 1;
9817
9818    // The discover packet (re)transmit count
9819    optional int32 discover_count = 2;
9820
9821    // The request packet (re)transmit count
9822    optional int32 request_count = 3;
9823
9824    // The IPv4 address conflict count
9825    // (only be meaningful when duplicate address detection is enabled)
9826    optional int32 conflict_count = 4;
9827
9828    // The DHCP packet parsing error code in this session
9829    // (defined in android.net.metrics.DhcpErrorEvent)
9830    repeated android.stats.connectivity.DhcpErrorCode error_code = 5;
9831
9832    // The result of DHCP hostname transliteration
9833    optional android.stats.connectivity.HostnameTransResult ht_result = 6;
9834}
9835
9836/**
9837 * Logs Network IP provisioning event
9838 * Logged from:
9839 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpProvisioningMetrics.java
9840 */
9841message NetworkIpProvisioningReported {
9842    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
9843    optional android.stats.connectivity.TransportType transport_type = 1;
9844
9845    // The latency in microseconds of IP Provisioning over IPV4
9846    optional int32 ipv4_latency_micros = 2;
9847
9848    // The latency in microseconds of IP Provisioning over IPV6
9849    optional int32 ipv6_latency_micros = 3;
9850
9851    // The time duration between provisioning start and end (success or failure)
9852    optional int64 provisioning_duration_micros = 4;
9853
9854    // The specific disconnect reason for this IP provisioning
9855    optional android.stats.connectivity.DisconnectCode disconnect_code = 5;
9856
9857    // Log DHCP session info (Only valid for IPv4)
9858    optional DhcpSession dhcp_session = 6 [(log_mode) = MODE_BYTES];
9859
9860    // The random number between 0 ~ 999 for sampling
9861    optional int32 random_number = 7;
9862}
9863
9864/**
9865 * Logs Network DHCP Renew event
9866 * Logged from:
9867 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
9868 */
9869message NetworkDhcpRenewReported {
9870    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
9871    optional android.stats.connectivity.TransportType transport_type = 1;
9872
9873    // The request packet (re)transmit count
9874    optional int32 request_count = 2;
9875
9876    // The latency in microseconds of DHCP Renew
9877    optional int32 latency_micros = 3;
9878
9879    // The DHCP error code is defined in android.net.metrics.DhcpErrorEvent
9880    optional android.stats.connectivity.DhcpErrorCode error_code = 4;
9881
9882    // The result of DHCP renew
9883    optional android.stats.connectivity.DhcpRenewResult renew_result = 5;
9884
9885    // The random number between 0 ~ 999 for sampling
9886    optional int32 random_number = 6;
9887}
9888
9889/**
9890 * Logs Network Validation event
9891 * Logged from:
9892 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
9893 */
9894message NetworkValidationReported {
9895    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
9896    optional android.stats.connectivity.TransportType transport_type = 1;
9897
9898    // Record each probe event
9899    optional ProbeEvents probe_events = 2 [(log_mode) = MODE_BYTES];
9900
9901    // The result of the network validation
9902    optional android.stats.connectivity.ValidationResult validation_result = 3;
9903
9904    // The latency in microseconds of network validation
9905    optional int32 latency_micros = 4;
9906
9907    // The validation index (the first validation attempt or second, third...)
9908    optional int32 validation_index = 5;
9909
9910    // The random number between 0 ~ 999 for sampling
9911    optional int32 random_number = 6;
9912}
9913
9914/**
9915 * Logs NetworkStack Quirk event
9916 * Logged from:
9917 * packages/modules/NetworkStack/src/com/android/networkstack/
9918 */
9919message NetworkStackQuirkReported {
9920    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
9921    optional android.stats.connectivity.TransportType transport_type = 1;
9922
9923    // Record each Quirk event
9924    optional android.stats.connectivity.NetworkQuirkEvent event = 2;
9925}
9926
9927/**
9928 * Logs Neighbor Unreachability Detection event
9929 * Logged from:
9930 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpReachabilityMonitorMetrics.java
9931 */
9932message NetworkIpReachabilityMonitorReported {
9933    // Neighbor Unreachability Detection event.
9934    optional android.stats.connectivity.NudEventType event_type = 1;
9935
9936    // NUD probe based on IPv4 ARP or IPv6 ND packet.
9937    optional android.stats.connectivity.IpType ip_type = 2;
9938
9939    // NUD neighbor type, default gateway, DNS server or both.
9940    optional android.stats.connectivity.NudNeighborType neighbor_type = 3;
9941}
9942
9943/**
9944 * Logs when system default network changes.
9945 */
9946message SystemDefaultNetworkChanged {
9947    // Active transport types encoded as a 32 bit integer.
9948    // The integer will have n-th bit set if there was an active transport type of value n.
9949    // See packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
9950    optional int32 transport_types = 1 [
9951        (state_field_option).exclusive_state = true,
9952        (state_field_option).nested = false
9953    ];
9954}
9955
9956/**
9957 * Logs when a data stall event occurs.
9958 *
9959 * Log from:
9960 *     packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
9961 */
9962message DataStallEvent {
9963    // Data stall evaluation type.
9964    // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
9965    // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
9966    optional int32 evaluation_type = 1;
9967    // See definition in data_stall_event.proto.
9968    optional com.android.server.connectivity.ProbeResult validation_result = 2;
9969    // See definition in data_stall_event.proto.
9970    optional android.net.Transport network_type = 3;
9971    // See definition in data_stall_event.proto.
9972    optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
9973    // See definition in data_stall_event.proto.
9974    optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
9975    // See definition in data_stall_event.proto.
9976    optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
9977    // The tcp packets fail rate from the latest tcp polling.
9978    optional int32 tcp_fail_rate = 7;
9979    // Number of packets sent since the last received packet.
9980    optional int32 tcp_sent_since_last_recv = 8;
9981}
9982
9983/*
9984 * Logs when RescueParty resets some set of experiment flags.
9985 *
9986 * Logged from:
9987 *     frameworks/base/services/core/java/com/android/server/RescueParty.java
9988 */
9989message RescuePartyResetReported {
9990    // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
9991    optional int32 rescue_level = 1;
9992}
9993
9994/**
9995 * Logs when signed config is received from an APK, and if that config was applied successfully.
9996 * Logged from:
9997 *   frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
9998 */
9999message SignedConfigReported {
10000    enum Type {
10001        UNKNOWN_TYPE = 0;
10002        GLOBAL_SETTINGS = 1;
10003    }
10004    optional Type type = 1;
10005
10006    // The final status of the signed config received.
10007    enum Status {
10008        UNKNOWN_STATUS = 0;
10009        APPLIED = 1;
10010        BASE64_FAILURE_CONFIG = 2;
10011        BASE64_FAILURE_SIGNATURE = 3;
10012        SECURITY_EXCEPTION = 4;
10013        INVALID_CONFIG = 5;
10014        OLD_CONFIG = 6;
10015        SIGNATURE_CHECK_FAILED = 7;
10016        NOT_APPLICABLE = 8;
10017        SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
10018    }
10019    optional Status status = 2;
10020
10021    // The version of the signed config processed.
10022    optional int32 version = 3;
10023
10024    // The package name that the config was extracted from.
10025    optional string from_package = 4;
10026
10027    enum Key {
10028        NO_KEY = 0;
10029        DEBUG = 1;
10030        PRODUCTION = 2;
10031    }
10032    // Which key was used to verify the config.
10033    optional Key verified_with = 5;
10034}
10035
10036/*
10037 * Logs GNSS Network-Initiated (NI) location events.
10038 *
10039 * Logged from:
10040 *   frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
10041 */
10042message GnssNiEventReported {
10043    // The type of GnssNiEvent.
10044    enum EventType {
10045        UNKNOWN = 0;
10046        NI_REQUEST = 1;
10047        NI_RESPONSE = 2;
10048    }
10049    optional EventType event_type = 1;
10050
10051    // An ID generated by HAL to associate NI notifications and UI responses.
10052    optional int32 notification_id = 2;
10053
10054    // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
10055    optional android.server.location.GnssNiType ni_type = 3;
10056
10057    // NI requires notification.
10058    optional bool need_notify = 4;
10059
10060    // NI requires verification.
10061    optional bool need_verify = 5;
10062
10063    // NI requires privacy override, no notification/minimal trace.
10064    optional bool privacy_override = 6;
10065
10066    // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
10067    // seconds.
10068    optional int32 timeout = 7;
10069
10070    // Default response when timeout.
10071    optional android.server.location.GnssUserResponseType default_response = 8;
10072
10073    // String representing the requester of the network inititated location request.
10074    optional string requestor_id = 9;
10075
10076    // Notification message text string representing the service(for eg. SUPL-service) who sent the
10077    // network initiated location request.
10078    optional string text = 10;
10079
10080    // requestorId decoding scheme.
10081    optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
10082
10083    // Notification message text decoding scheme.
10084    optional android.server.location.GnssNiEncodingType text_encoding = 12;
10085
10086    // True if SUPL ES is enabled.
10087    optional bool is_supl_es_enabled = 13;
10088
10089    // True if GNSS location is enabled.
10090    optional bool is_location_enabled = 14;
10091
10092    // GNSS NI responses which define the response in NI structures.
10093    optional android.server.location.GnssUserResponseType user_response = 15;
10094}
10095
10096/**
10097 * Logs GNSS non-framework (NFW) location notification.
10098 *
10099 * Logged from:
10100 *   frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
10101 */
10102message GnssNfwNotificationReported {
10103    // Package name of the Android proxy application representing the non-framework entity that
10104    // requested location. Set to empty string if unknown.
10105    optional string proxy_app_package_name = 1;
10106
10107    // Protocol stack that initiated the non-framework location request.
10108    optional android.server.location.NfwProtocolStack protocol_stack = 2;
10109
10110    // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
10111    // set to empty string. This field is opaque to the framework and used for logging purposes.
10112    optional string other_protocol_stack_name = 3;
10113
10114    // Source initiating/receiving the location information.
10115    optional android.server.location.NfwRequestor requestor = 4;
10116
10117    // Identity of the endpoint receiving the location information. For example, carrier name, OEM
10118    // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
10119    // and used for logging purposes.
10120    optional string requestor_id = 5;
10121
10122    // Indicates whether location information was provided for this request.
10123    optional android.server.location.NfwResponseType response_type = 6;
10124
10125    // True if the device is in user initiated emergency session.
10126    optional bool in_emergency_mode = 7;
10127
10128    // True if cached location is provided.
10129    optional bool is_cached_location = 8;
10130
10131    // True if proxy app permission mismatch between framework and GNSS HAL.
10132    optional bool is_permission_mismatched = 9;
10133}
10134
10135/**
10136 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
10137 *
10138 * Logged from:
10139 *   frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
10140 */
10141message GnssConfigurationReported {
10142    // SUPL host name.
10143    optional string supl_host = 1;
10144
10145    // SUPL port number.
10146    optional int32 supl_port = 2;
10147
10148    // C2K host name.
10149    optional string c2k_host = 3;
10150
10151    // C2K port number.
10152    optional int32 c2k_port = 4;
10153
10154    // The SUPL version requested by Carrier.
10155    optional int32 supl_ver = 5;
10156
10157    // The SUPL mode.
10158    optional android.server.location.SuplMode supl_mode = 6;
10159
10160    // True if NI emergency SUPL restrictions is enabled.
10161    optional bool supl_es = 7;
10162
10163    // LTE Positioning Profile settings
10164    optional android.server.location.LppProfile lpp_profile = 8;
10165
10166    // Positioning protocol on A-Glonass system.
10167    optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
10168
10169    // True if emergency PDN is used. Otherwise, regular PDN is used.
10170    optional bool use_emergency_pdn_for_emergency_supl= 10;
10171
10172    // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
10173    optional android.server.location.GpsLock gps_lock = 11;
10174
10175    // Number of seconds to extend the emergency session duration post emergency call.
10176    optional int32 es_extension_sec = 12;
10177
10178    // The full list of package names of proxy Android applications representing the non-framework
10179    // location access entities (on/off the device) for which the framework user has granted
10180    // non-framework location access permission. The package names are concatenated in one string
10181    // with spaces as separators.
10182    optional string enabled_proxy_app_package_name_list = 13;
10183}
10184
10185/**
10186 * Logs GNSS PSDS downloads as defined in IGnssPsds.aidl.
10187 *
10188 * Logged from:
10189 *   frameworks/base/services/core/java/com/android/server/location/gnss/GnssPsdsDownloader.java
10190 */
10191message GnssPsdsDownloadReported {
10192    // PSDS type as defined in PsdsType.aidl
10193    optional int32 psds_type = 1;
10194}
10195
10196/**
10197 * Logs when a NFC device's error occurred.
10198 * Logged from:
10199 *     system/nfc/src/nfc/nfc/nfc_ncif.cc
10200 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
10201 */
10202message NfcErrorOccurred {
10203    enum Type {
10204        UNKNOWN = 0;
10205        CMD_TIMEOUT = 1;
10206        ERROR_NOTIFICATION = 2;
10207        AID_OVERFLOW = 3;
10208    }
10209    optional Type type = 1;
10210    // If it's nci cmd timeout, log the timeout command.
10211    optional uint32 nci_cmd = 2;
10212
10213    optional uint32 error_ntf_status_code = 3;
10214}
10215
10216/**
10217 * Logs when a NFC device's state changed event
10218 * Logged from:
10219 *     packages/apps/Nfc/src/com/android/nfc/NfcService.java
10220 */
10221message NfcStateChanged {
10222    enum State {
10223        UNKNOWN = 0;
10224        OFF = 1;
10225        ON = 2;
10226        ON_LOCKED = 3; // Secure Nfc enabled.
10227        CRASH_RESTART = 4; // NfcService watchdog timeout restart.
10228    }
10229    optional State state = 1 [
10230        (state_field_option).exclusive_state = true,
10231        (state_field_option).nested = false
10232    ];
10233}
10234
10235/**
10236 * Logs when a NFC Beam Transaction occurred.
10237 * Logged from:
10238 *     packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
10239 */
10240message NfcBeamOccurred {
10241    enum Operation {
10242        UNKNOWN = 0;
10243        SEND = 1;
10244        RECEIVE = 2;
10245    }
10246    optional Operation operation = 1;
10247}
10248
10249/**
10250 * Logs when a NFC Card Emulation Transaction occurred.
10251 * Logged from:
10252 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
10253 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
10254 */
10255message NfcCardemulationOccurred {
10256    enum Category {
10257        UNKNOWN = 0;
10258        HCE_PAYMENT = 1;
10259        HCE_OTHER = 2;
10260        OFFHOST = 3;
10261        OFFHOST_PAYMENT = 4;
10262        OFFHOST_OTHER = 5;
10263    }
10264    // Transaction belongs to HCE payment or HCE other category, or offhost.
10265    optional Category category = 1;
10266    // SeName from transaction: SIMx, eSEx, HCE, HCEF.
10267    optional string se_name = 2;
10268
10269    optional int32 uid = 3 [(is_uid) = true];
10270}
10271
10272/**
10273 * Logs when a NFC Tag event occurred.
10274 * Logged from:
10275 *     packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
10276 */
10277message NfcTagOccurred {
10278    enum Type {
10279        UNKNOWN = 0;
10280        URL = 1;
10281        BT_PAIRING = 2;
10282        PROVISION = 3;
10283        WIFI_CONNECT = 4;
10284        APP_LAUNCH = 5;
10285        OTHERS = 6;
10286        FOREGROUND_DISPATCH = 7;
10287    }
10288    optional Type type = 1;
10289
10290    optional int32 uid = 2 [(is_uid) = true];
10291    // Supported RF Technologies of the Tag
10292    repeated android.nfc.RFTechnologyType rf_types = 3;
10293    // Use for BT_PAIRING Type
10294    optional android.bluetooth.MajorClassEnum bt_device_type = 4;
10295    // Use for BT_PAIRING Type
10296    // Should be empty for HEALTH and UNKNOWN MajorClassEnum
10297    optional string bt_device_info = 5;
10298}
10299
10300/**
10301 * Logs NFC tag type when tag occurred
10302 * Logged from:
10303 *     packages/apps/Nfc/nci/jni/NfcTag.cpp
10304 */
10305message NfcTagTypeOccurred {
10306    optional android.nfc.NfcTagType type = 1;
10307}
10308
10309/**
10310 * Logs when Hce transaction triggered
10311 * Logged from:
10312 *     system/nfc/src/nfc/nfc/nfc_ncif.cc
10313 */
10314message NfcHceTransactionOccurred {
10315    // The latency period(in microseconds) it took for the first HCE data
10316    // exchange.
10317    optional uint32 latency_micros = 1;
10318}
10319
10320/**
10321 * Logs when AID conflict occurred
10322 * Logged from:
10323 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
10324*/
10325message NfcAIDConflictOccurred {
10326    optional string conflicting_aid = 1;
10327}
10328
10329/**
10330 * Logs when reader app conflict occurred
10331 * Logged from:
10332 *     packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
10333*/
10334message NfcReaderConflictOccurred {
10335}
10336
10337/**
10338 * Logs when user changed screen resolution
10339 * Logged from:
10340 *     packages/apps/Settings/src/com/android/settings/display/ScreenResolutionFragment.java
10341*/
10342message UserSelectedResolution {
10343    optional int32 display_id = 1;
10344    // display resolution
10345    optional int32 width = 2;
10346    optional int32 height = 3;
10347}
10348
10349/**
10350 * Logs when SecureElement state event changed
10351 * Logged from:
10352 *     packages/apps/SecureElement/src/com/android/se/Terminal.java
10353 */
10354message SeStateChanged {
10355    enum State {
10356        UNKNOWN = 0;
10357        INITIALIZED = 1;
10358        DISCONNECTED = 2;
10359        CONNECTED = 3;
10360        HALCRASH = 4;
10361    }
10362    optional State state = 1;
10363
10364    optional string state_change_reason = 2;
10365    // SIMx or eSEx.
10366    optional string terminal = 3;
10367}
10368
10369/**
10370 * Information about a permission grant request
10371 */
10372message PermissionGrantRequestResultReported {
10373    // unique value identifying an API call. A API call might result in multiple of these atoms
10374    optional int64 request_id = 1;
10375
10376    // UID of package requesting the permission grant
10377    optional int32 uid = 2 [(is_uid) = true];
10378
10379    // Name of package requesting the permission grant
10380    optional string package_name = 3;
10381
10382    // The permission to be granted
10383    optional string permission_name = 4;
10384
10385    // If the permission was explicitly requested via the API or added by the system
10386    optional bool is_implicit = 5;
10387
10388    enum Result {
10389        UNDEFINED = 0;
10390        // permission request was ignored
10391        IGNORED = 1;
10392        // permission request was ignored because it was user fixed
10393        IGNORED_USER_FIXED = 2;
10394        // permission request was ignored because it was policy fixed
10395        IGNORED_POLICY_FIXED = 3;
10396        // permission was granted by user action
10397        USER_GRANTED = 4;
10398        // permission was automatically granted
10399        AUTO_GRANTED = 5;
10400        // permission was denied by user action
10401        USER_DENIED = 6;
10402        // permission was denied with prejudice by the user
10403        USER_DENIED_WITH_PREJUDICE = 7;
10404        // permission was automatically denied
10405        AUTO_DENIED = 8;
10406        // permission request was ignored because permission is restricted
10407        IGNORED_RESTRICTED_PERMISSION = 9;
10408        // one time permission was granted by user action
10409        USER_GRANTED_ONE_TIME = 10;
10410        // user ignored request by leaving the request screen without choosing any option
10411        USER_IGNORED = 11;
10412        // user granted the permission after being linked to settings
10413        USER_GRANTED_IN_SETTINGS = 12;
10414        // user denied the permission after being linked to settings
10415        USER_DENIED_IN_SETTINGS = 13;
10416        // user denied the permission with prejudice after being linked to settings
10417        USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
10418        // permission was automatically revoked after one-time permission expired
10419        AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
10420        // permission was automatically revoked for unused app
10421        AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
10422        // the user selected media with the photo picker
10423        PHOTOS_SELECTED = 17;
10424    }
10425    // The result of the permission grant
10426    optional Result result = 6;
10427
10428    // Whether Permission Rationale was shown on grant dialog
10429    optional bool permission_rationale_shown = 7;
10430}
10431
10432/**
10433 * Logs when Omapi API used
10434 * Logged from:
10435 *     packages/apps/SecureElement/src/com/android/se/Terminal.java
10436 */
10437message SeOmapiReported {
10438    enum Operation {
10439        UNKNOWN = 0;
10440        OPEN_CHANNEL = 1;
10441    }
10442    optional Operation operation = 1;
10443    // SIMx or eSEx.
10444    optional string terminal = 2;
10445
10446    optional string package_name = 3;
10447}
10448
10449/**
10450  * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
10451  * The dispatch latency is the dispatchClockTime - enqueueClockTime.
10452  * Logged from:
10453  *   frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
10454  */
10455message BroadcastDispatchLatencyReported {
10456    optional int64 dispatch_latency_millis = 1;
10457}
10458
10459/**
10460   * Logs AttentionManagerService attention check result.
10461   *
10462   * Logged from:
10463   *   frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
10464   */
10465message AttentionManagerServiceResultReported {
10466    // See core/java/android/service/attention/AttentionService.java
10467    enum AttentionCheckResult {
10468        UNKNOWN = 20;
10469        ATTENTION_SUCCESS_ABSENT = 0;
10470        ATTENTION_SUCCESS_PRESENT = 1;
10471        ATTENTION_FAILURE_UNKNOWN = 2;
10472        ATTENTION_FAILURE_CANCELLED = 3;
10473        ATTENTION_FAILURE_PREEMPTED = 4;
10474        ATTENTION_FAILURE_TIMED_OUT = 5;
10475        ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
10476    }
10477    optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
10478}
10479
10480/**
10481 * Logs when an adb connection changes state.
10482 *
10483 * Logged from:
10484 *     frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
10485 */
10486message AdbConnectionChanged {
10487    // The last time this system connected via adb, or 0 if the 'always allow' option was not
10488    // previously selected for this system.
10489    optional int64 last_connection_time_millis = 1;
10490
10491    // The time in ms within which a subsequent connection from an 'always allow' system is allowed
10492    // to reconnect via adb without user interaction.
10493    optional int64 auth_window_millis = 2;
10494
10495    // The state of the adb connection from frameworks/proto_logging/stats/enums/debug/enums.proto.
10496    optional android.debug.AdbConnectionStateEnum state = 3;
10497
10498    // True if the 'always allow' option was selected for this system.
10499    optional bool always_allow = 4;
10500}
10501
10502/*
10503 * Logs the reported speech DSP status.
10504 *
10505 * Logged from:
10506 *  Vendor audio implementation.
10507 */
10508message SpeechDspStatReported {
10509    // The total Speech DSP uptime in milliseconds.
10510    optional int32 total_uptime_millis = 1;
10511    // The total Speech DSP downtime in milliseconds.
10512    optional int32 total_downtime_millis = 2;
10513    optional int32 total_crash_count = 3;
10514    optional int32 total_recover_count = 4;
10515}
10516
10517/**
10518 * Logs USB connector contaminant status.
10519 *
10520 * Logged from: USB Service.
10521 */
10522message UsbContaminantReported {
10523    optional string id = 1;
10524    optional android.service.ContaminantPresenceStatus status = 2;
10525}
10526
10527/**
10528 * This atom is for debugging purpose.
10529 */
10530message DebugElapsedClock {
10531    // Monotically increasing value for each pull.
10532    optional int64 pull_count = 1;
10533    // Time from System.elapsedRealtime.
10534    optional int64 elapsed_clock_millis = 2;
10535    // Time from System.elapsedRealtime.
10536    optional int64 same_elapsed_clock_millis = 3;
10537    // Diff between current elapsed time and elapsed time from previous pull.
10538    optional int64 elapsed_clock_diff_millis = 4;
10539
10540    enum Type {
10541      TYPE_UNKNOWN = 0;
10542      ALWAYS_PRESENT = 1;
10543      PRESENT_ON_ODD_PULLS = 2;
10544    }
10545    // Type of behavior for the pulled data.
10546    optional Type type = 5;
10547}
10548
10549/**
10550 * This atom is for debugging purpose.
10551 */
10552message DebugFailingElapsedClock {
10553    // Monotically increasing value for each pull.
10554    optional int64 pull_count = 1;
10555    // Time from System.elapsedRealtime.
10556    optional int64 elapsed_clock_millis = 2;
10557    // Time from System.elapsedRealtime.
10558    optional int64 same_elapsed_clock_millis = 3;
10559    // Diff between current elapsed time and elapsed time from previous pull.
10560    optional int64 elapsed_clock_diff_millis = 4;
10561}
10562
10563/** Logs System UI bubbles event changed.
10564 *
10565 * Logged from:
10566 *     frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen
10567 */
10568message SplitscreenUIChanged {
10569    // User interactions with splitscreen
10570    enum Action {
10571        UNKNOWN_ACTION = 0;
10572        ENTER = 1;
10573        EXIT = 2;
10574        APP_CHANGE = 3;
10575        RESIZE = 4;
10576        SWAP = 5;
10577    }
10578
10579    // The physical side on the device of the split
10580    enum Position {
10581        UNKNOWN_POSITION = 0;
10582        LEFT = 1;
10583        RIGHT = 2;
10584        TOP = 3;
10585        BOTTOM = 4;
10586    }
10587
10588    // The reason for entering splitscreen
10589    enum EnterReason {
10590        UNKNOWN_ENTER = 0;
10591        OVERVIEW = 1; // Deprecated, use LAUNCHER
10592        DRAG_LEFT = 2;
10593        DRAG_TOP = 3;
10594        DRAG_RIGHT = 4;
10595        DRAG_BOTTOM = 5;
10596        LAUNCHER = 6;
10597        MULTI_INSTANCE = 7;
10598        NOTIFICATIONS = 8;
10599    }
10600
10601    // The reason for exiting splitscreen
10602    enum ExitReason {
10603        UNKNOWN_EXIT = 0;
10604        DRAG_DIVIDER = 1;
10605        RETURN_HOME = 2;
10606        SCREEN_LOCKED = 3;
10607        SCREEN_LOCKED_SHOW_ON_TOP = 4;
10608        DEVICE_FOLDED = 5;
10609        ROOT_TASK_VANISHED = 6;
10610        APP_FINISHED = 7;
10611        APP_DOES_NOT_SUPPORT_MULTIWINDOW = 8;
10612        CHILD_TASK_ENTER_PIP = 9;
10613        RECREATE_SPLIT = 10;
10614        FULLSCREEN_SHORTCUT = 11;
10615    }
10616
10617    // The event action
10618    optional Action action = 1;
10619    // What triggered splitscreen (if the action is ENTER)
10620    optional EnterReason enter_reason = 2;
10621    // What triggered leaving splitscreen (if the action is EXIT)
10622    optional ExitReason exit_reason = 3;
10623    // The ratio of split between the main/side stages
10624    optional float split_ratio = 4;
10625    // Data about the main stage in split
10626    optional Position main_stage_position = 5;
10627    optional int32 main_stage_uid = 6 [(is_uid) = true];
10628    // Data about the side stage in split
10629    optional Position side_stage_position = 7;
10630    optional int32 side_stage_uid = 8 [(is_uid) = true];
10631    // The drag session id (if the enter_trigger was DRAG)
10632    optional int32 drag_instance_id = 9;
10633    // An identifier used to identify a splitscreen session
10634    optional int32 instance_id = 10;
10635}
10636
10637/** Logs System UI bubbles event changed.
10638 *
10639 * Logged from:
10640 *     frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles
10641 */
10642message BubbleUIChanged {
10643
10644    // The app package that is posting the bubble.
10645    optional string package_name = 1;
10646
10647    // The notification channel that is posting the bubble.
10648    optional string notification_channel = 2;
10649
10650    // The notification id associated with the posted bubble.
10651    optional int32 notification_id = 3;
10652
10653    // The position of the bubble within the bubble stack.
10654    optional int32 position = 4;
10655
10656    // The total number of bubbles within the bubble stack.
10657    optional int32 total_number = 5;
10658
10659    // User interactions with the bubble.
10660    enum Action {
10661        UNKNOWN = 0;
10662        POSTED = 1;
10663        UPDATED = 2;
10664        EXPANDED = 3;
10665        COLLAPSED = 4;
10666        DISMISSED = 5;
10667        STACK_DISMISSED = 6;
10668        STACK_MOVED = 7;
10669        HEADER_GO_TO_APP = 8;
10670        HEADER_GO_TO_SETTINGS = 9;
10671        PERMISSION_OPT_IN = 10;
10672        PERMISSION_OPT_OUT = 11;
10673        PERMISSION_DIALOG_SHOWN = 12;
10674        SWIPE_LEFT = 13;
10675        SWIPE_RIGHT = 14;
10676        STACK_EXPANDED = 15;
10677        FLYOUT = 16;
10678    }
10679    optional Action action = 6;
10680
10681    // Normalized screen position of the bubble stack. The range is between 0 and 1.
10682    optional float normalized_x_position = 7;
10683    optional float normalized_y_position = 8;
10684
10685    // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
10686    optional bool is_unread = 9;
10687
10688    // Whether the bubble is an on-going one.
10689    optional bool is_ongoing = 10;
10690
10691    // Whether the bubble is produced by an app running in foreground.
10692    // This is deprecated and the value should be ignored.
10693    optional bool is_foreground = 11 [deprecated = true];
10694}
10695
10696/**
10697  * Logs System UI bubbles developer errors.
10698  *
10699  * Logged from:
10700  *   frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
10701  */
10702message BubbleDeveloperErrorReported {
10703
10704    // The app package that is posting the bubble.
10705    optional string package_name = 1;
10706
10707    // Bubble developer error type enums.
10708    enum Error {
10709        UNKNOWN = 0;
10710        ACTIVITY_INFO_MISSING = 1;
10711        ACTIVITY_INFO_NOT_RESIZABLE = 2;
10712        DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
10713    }
10714    optional Error error = 2 [default = UNKNOWN];
10715}
10716
10717/**
10718 * Logs that a job-specific constraint for a scheduled job has changed.
10719 * DeviceWideJobConstraintChanged will cover constraints that are normally the same for all jobs.
10720 *
10721 * Logged from:
10722 *     frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
10723 */
10724message ScheduledJobConstraintChanged {
10725    repeated AttributionNode attribution_node = 1;
10726
10727    // Name of the job.
10728    optional string job_name = 2;
10729
10730    optional com.android.server.job.ConstraintEnum constraint = 3;
10731
10732    enum State {
10733        UNKNOWN = 0;
10734        UNSATISFIED = 1;
10735        SATISFIED = 2;
10736    }
10737    optional State state = 4;
10738}
10739
10740/**
10741 * Logs that a device-state-level JobScheduler constraint has changed. This doesn't take individual
10742 * job or app characteristics into account. Individual jobs may have a different satisfaction value
10743 * based on special policies. Individual job constraints (eg. connectivity or prefetch) are not
10744 * logged in this atom.
10745 *
10746 * Logged from:
10747 *     frameworks/base/services/core/java/com/android/server/job/controllers/<*>.java
10748 */
10749message DeviceWideJobConstraintChanged {
10750    optional com.android.server.job.ConstraintEnum constraint = 1 [
10751        (state_field_option).primary_field = true,
10752        (is_uid) = false
10753    ];
10754
10755    enum State {
10756        UNKNOWN = 0;
10757        UNSATISFIED = 1;
10758        SATISFIED = 2;
10759    }
10760    optional State state = 2 [
10761        (state_field_option).exclusive_state = true,
10762        (state_field_option).nested = false
10763    ];
10764}
10765
10766/**
10767 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
10768 * returns true.
10769 *
10770 * Logged from:
10771 *   frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
10772 */
10773message ScreenTimeoutExtensionReported {
10774    // Describes how many times in a row did the power manager reset the screen off timeout.
10775    optional uint32 consecutive_timeout_extended_count = 1;
10776}
10777
10778/*
10779* Logs number of milliseconds it takes to start a process.
10780* The definition of app process start time is from the app launch time to
10781* the time that Zygote finished forking the app process and loaded the
10782* application package's java classes.
10783
10784* This metric is different from AppStartOccurred which is for foreground
10785* activity only.
10786
10787* ProcessStartTime can report all processes (both foreground and background)
10788* start time.
10789*
10790* Logged from:
10791*   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
10792*/
10793message ProcessStartTime {
10794    // The uid of the ProcessRecord.
10795    optional int32 uid = 1 [(is_uid) = true];
10796
10797    // The process pid.
10798    optional int32 pid = 2;
10799
10800    // The process name.
10801    // Usually package name, "system" for system server.
10802    // Provided by ActivityManagerService.
10803    // Do not fetch this field from device to save storage space, use uid field induced
10804    // package name as process name.
10805    optional string process_name = 3;
10806
10807    enum StartType {
10808        UNKNOWN = 0;
10809        WARM = 1;
10810        HOT = 2;
10811        COLD = 3;
10812    }
10813
10814    // The start type.
10815    optional StartType type = 4;
10816
10817    // The elapsed realtime at the start of the process.
10818    optional int64 process_start_time_millis = 5;
10819
10820    // Number of milliseconds it takes to reach bind application.
10821    optional int32 bind_application_delay_millis = 6;
10822
10823    // Number of milliseconds it takes to finish start of the process.
10824    optional int32 process_start_delay_millis = 7;
10825
10826    // hostingType field in ProcessRecord, the component type such as "activity",
10827    // "service", "content provider", "broadcast" or other strings.
10828    // deprecatd by enum type field hosting_type_id to reduce storage space usage by
10829    // string type.
10830    // Do not fetch this field from device to save storage space.
10831    optional string hosting_type = 8 [deprecated = true];
10832
10833    // hostingNameStr field in ProcessRecord. The component class name that runs
10834    // in this process.
10835    // Do not fetch this field from device to save storage space.
10836    optional string hosting_name = 9;
10837
10838    // Broadcast action name.
10839    optional string broadcast_action_name = 10;
10840
10841    enum HostingTypeId {
10842        HOSTING_TYPE_UNKNOWN = 0;
10843        HOSTING_TYPE_ACTIVITY = 1;
10844        HOSTING_TYPE_ADDED_APPLICATION = 2;
10845        HOSTING_TYPE_BACKUP = 3;
10846        HOSTING_TYPE_BROADCAST = 4;
10847        HOSTING_TYPE_CONTENT_PROVIDER = 5;
10848        HOSTING_TYPE_LINK_FAIL = 6;
10849        HOSTING_TYPE_ON_HOLD = 7;
10850        HOSTING_TYPE_NEXT_ACTIVITY = 8;
10851        HOSTING_TYPE_NEXT_TOP_ACTIVITY = 9;
10852        HOSTING_TYPE_RESTART = 10;
10853        HOSTING_TYPE_SERVICE = 11;
10854        HOSTING_TYPE_SYSTEM = 12;
10855        HOSTING_TYPE_TOP_ACTIVITY = 13;
10856        HOSTING_TYPE_EMPTY = 14;
10857    }
10858
10859    optional HostingTypeId hosting_type_id = 11;
10860
10861    enum TriggerType {
10862        TRIGGER_TYPE_UNKNOWN = 0;
10863        TRIGGER_TYPE_ALARM = 1;
10864        TRIGGER_TYPE_PUSH_MESSAGE = 2;
10865        TRIGGER_TYPE_PUSH_MESSAGE_OVER_QUOTA = 3;
10866        TRIGGER_TYPE_JOB = 4;
10867    }
10868
10869    optional TriggerType trigger_type = 12;
10870}
10871
10872/**
10873 * Track Media Codec usage (nested proto version)
10874 *   This atom is being deprecated in favor of MediaCodecReported which has a
10875 *   flattened CodecData to enable field filtering. The data is identical
10876 *   except MediaCodecReported also has the playback_duration field.
10877 * Logged from:
10878 *   frameworks/av/media/libstagefright/MediaCodec.cpp
10879 *   frameworks/av/services/mediaanalytics/statsd_codec.cpp
10880 */
10881message MediametricsCodecReported {
10882    optional int64 timestamp_nanos = 1;
10883    optional string package_name = 2;
10884    optional int64 package_version_code = 3;
10885    optional int64 media_apex_version = 4;
10886
10887    optional android.stats.mediametrics_message.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
10888}
10889
10890/**
10891 * Track Media Codec usage
10892 *   This atom is the new version of MediametricsCodecReported and has a
10893 *   flattened CodecData to enable field filtering. The data is identical
10894 *   except for the addition of the playback_duration field.
10895 * Logged from:
10896 *   frameworks/av/media/libstagefright/MediaCodec.cpp
10897 *   frameworks/av/services/mediaanalytics/statsd_codec.cpp
10898 *
10899 * Next Tag: 80
10900 */
10901message MediaCodecReported {
10902    optional int64 timestamp_nanos = 1;
10903    // The inclusion of package name in a metric should be carefully analyzed to
10904    // determine if it is absolutely necessary for system health. It is strongly
10905    // discouraged to collect the package name along with other metrics (e.g.
10906    // playback duration).
10907    optional string package_name = 2;
10908    optional int64 package_version_code = 3;
10909    optional int64 media_apex_version = 4;
10910    // The name of the codec.
10911    // eg. `OMX.google.aac.decoder`
10912    optional string codec = 5;
10913    // The mime type. e.g. "audio/vorbis"
10914    optional string mime = 6;
10915    // The codec mode. i.e. video or audio.
10916    optional string mode = 7;
10917    // 1 if this is an encoder, 0 if this is a decoder.
10918    optional int32 encoder = 8;
10919    // 0, 1
10920    optional int32 secure = 9;
10921    // The video width in pixels.
10922    optional int32 width = 10;
10923    // The video height in pixels.
10924    optional int32 height = 11;
10925    // The rotation of the video in degrees
10926    // 0, 90, 180, 270
10927    optional int32 rotation = 12;
10928    // 1 if the codec uses crypto/drm, 0 otherwise.
10929    optional int32 crypto = 13;
10930    // The codec profile. The values are dependent on the codec type.
10931    // 0..n
10932    optional int32 profile = 14;
10933    // The coding level. The values are dependent on the codec type.
10934    // 0..n
10935    optional int32 level = 15;
10936    // The maximum allowed width during a particular codec session.
10937    // 0..n
10938    optional int32 max_width = 16;
10939    // The maximum allowed height during a particular codec session.
10940    // 0..n
10941    optional int32 max_height = 17;
10942    // Indicating which error condition caused the codec to reset to an
10943    // uninitialized state.
10944    optional int32 error_code = 18;
10945    // The error state.
10946    // The emitted values are descriptive:  UNINITIALIZED, INITIALIZING,
10947    // INITIALIZED, CONFIGURING, CONFIGURED, STARTING, STARTED, FLUSHING, FLUSHED,
10948    // STOPPING, and RELEASING.
10949    // In the event of an internal codec error setting the state outside of these
10950    // values, the invalid value will be encoded as a string (e.g., “17”).
10951    optional string error_state = 19;
10952    // The max latency in us.
10953    // The latency is from the time when the MediaCodec sends the ‘raw’ frame to
10954    // the media codec service to when the decoded frame arrives back in
10955    // MediaCodec’s possession.
10956    optional int64 latency_max = 20;
10957    // The min latency in us.
10958    optional int64 latency_min = 21;
10959    // The average latency in us.
10960    optional int64 latency_avg = 22;
10961    // The number of buffers included in the avg/min/max calculation above.
10962    optional int64 latency_count = 23;
10963    // The number of packets received back from the code where a latency could not
10964    // be determined, and therefore they aren't included in the avg/min/max
10965    // calculations above.
10966    optional int64 latency_unknown = 24;
10967    // Error returned by queueInputBuffer.
10968    optional int32 queue_input_buffer_error = 25;
10969    // Error returned by queueSecureInputBuffer.
10970    optional int32 queue_secure_input_buffer_error = 26;
10971    // These modes are primarily for videos.
10972    // CQ = constant quality
10973    // CBR = constant bit rate
10974    // VBR = variable bitrate
10975    optional string bitrate_mode = 27;
10976    optional int32 bitrate = 28;
10977    // 0..n
10978    optional int64 lifetime_millis = 29;
10979    optional int64 playback_duration_seconds = 30;
10980    optional string log_session_id = 31;
10981    optional int32 channel_count = 32;
10982    optional int32 sample_rate = 33;
10983    optional int64 video_encode_bytes = 34;
10984    optional int64 video_encode_frames = 35;
10985    optional int64 video_input_bytes = 36;
10986    optional int64 video_input_frames = 37;
10987    optional int64 video_encode_duration_us = 38;
10988    optional int32 color_format = 39;
10989    optional float frame_rate = 40;
10990    optional float capture_rate = 41;
10991    optional float operating_rate = 42;
10992    optional int32 priority = 43;
10993    optional int32 video_qp_i_min = 44;
10994    optional int32 video_qp_i_max = 45;
10995    optional int32 video_qp_p_min = 46;
10996    optional int32 video_qp_p_max = 47;
10997    optional int32 video_qp_b_min = 48;
10998    optional int32 video_qp_b_max = 49;
10999    optional int32 original_bitrate = 50;
11000    optional int32 shaping_enhanced = 51;
11001    optional int32 original_video_qp_i_min = 52;
11002    optional int32 original_video_qp_i_max = 53;
11003    optional int32 original_video_qp_p_min = 54;
11004    optional int32 original_video_qp_p_max = 55;
11005    optional int32 original_video_qp_b_min = 56;
11006    optional int32 original_video_qp_b_max = 57;
11007    optional int32 config_color_standard = 58;
11008    optional int32 config_color_range = 59;
11009    optional int32 config_color_transfer = 60;
11010    optional int32 parsed_color_standard = 61;
11011    optional int32 parsed_color_range = 62;
11012    optional int32 parsed_color_transfer = 63;
11013    optional int32 hdr_static_info = 64;
11014    optional int32 hdr10_plus_info = 65;
11015    optional int32 hdr_format = 66;
11016    // Randomly generated Codec ID for:
11017    // - correlating MediaCodecStarted and MediaCodecStopped for
11018    // more codec configuration parameters.
11019    // @since U
11020    optional int64 codec_id = 67;
11021    optional int32 array_mode = 68;
11022    optional int32 operation_mode = 69;
11023    optional int32 output_surface = 70;
11024    optional int32 app_max_input_size = 71;
11025    optional int32 used_max_input_size = 72;
11026    optional int32 codec_max_input_size = 73;
11027    optional int32 flush_count = 74;
11028    optional int32 set_surface_count = 75;
11029    optional int32 resolution_change_count = 76;
11030    optional int32 component_color_format = 77;
11031    // caller_uid replaces packagename
11032    // @Since U-QPR2
11033    optional int32 caller_uid = 78 [(is_uid) = true];
11034    optional int64 pixel_format = 79;
11035    // !!! WARNING
11036    // Keep synchronized with MediametricsCodecReported.CodecData in
11037    // mediametrics_message.proto.
11038    // Also keep AStatsEvent serialization synchronized in statsd_codec.cpp
11039    // !!! WARNING
11040}
11041
11042/**
11043 * Track Media Extractor (pulling video/audio streams out of containers) usage
11044 * Logged from:
11045 *   frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
11046 *   frameworks/av/services/mediaanalytics/statsd_extractor.cpp
11047 */
11048message MediametricsExtractorReported {
11049    optional int64 timestamp_nanos = 1;
11050    optional string package_name = 2;
11051    optional int64 package_version_code = 3;
11052    optional int64 media_apex_version = 4;
11053
11054    optional android.stats.mediametrics_message.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11055}
11056
11057/**
11058 * Track MediaParser (parsing video/audio streams from containers) usage
11059 * Logged from:
11060 *
11061 *   frameworks/av/services/mediametrics/statsd_mediaparser.cpp
11062 *   frameworks/base/apex/media/framework/jni/android_media_MediaParserJNI.cpp
11063 */
11064message MediametricsMediaParserReported {
11065    optional int64 timestamp_nanos = 1;
11066    optional string package_name = 2;
11067    optional int64 package_version_code = 3;
11068
11069    // MediaParser specific data.
11070    /**
11071     * The name of the parser selected for parsing the media, or an empty string
11072     * if no parser was selected.
11073     */
11074    optional string parser_name = 4;
11075    /**
11076     * Whether the parser was created by name. 1 represents true, and 0
11077     * represents false.
11078     */
11079    optional int32 created_by_name = 5;
11080    /**
11081     * The parser names in the sniffing pool separated by "|".
11082     */
11083    optional string parser_pool = 6;
11084    /**
11085     * The fully qualified name of the last encountered exception, or an empty
11086     * string if no exception was encountered.
11087     */
11088    optional string last_exception = 7;
11089    /**
11090     * The size of the parsed media in bytes, or -1 if unknown. Note this value
11091     * contains intentional random error to prevent media content
11092     * identification.
11093     */
11094    optional int64 resource_byte_count = 8;
11095    /**
11096     * The duration of the media in milliseconds, or -1 if unknown. Note this
11097     * value contains intentional random error to prevent media content
11098     * identification.
11099     */
11100    optional int64 duration_millis = 9;
11101    /**
11102     * The MIME types of the tracks separated by "|".
11103     */
11104    optional string track_mime_types = 10;
11105    /**
11106     * The tracks' RFC 6381 codec strings separated by "|".
11107     */
11108    optional string track_codecs = 11;
11109    /**
11110     * Concatenation of the parameters altered by the client, separated by "|".
11111     */
11112    optional string altered_parameters = 12;
11113    /**
11114     * The video width in pixels, or -1 if unknown or not applicable.
11115     */
11116    optional int32 video_width = 13;
11117    /**
11118     * The video height in pixels, or -1 if unknown or not applicable.
11119     */
11120    optional int32 video_height = 14;
11121    /**
11122     * Session id for correlating playback metrics.
11123     */
11124    optional string log_session_id = 15;
11125}
11126
11127/**
11128 * Track how we arbitrate between microphone/input requests.
11129 * Logged from
11130 *   frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
11131 *   frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
11132 */
11133message MediametricsAudiopolicyReported {
11134    optional int64 timestamp_nanos = 1;
11135    optional string package_name = 2;
11136    optional int64 package_version_code = 3;
11137    optional int64 media_apex_version = 4;
11138
11139    optional android.stats.mediametrics_message.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11140}
11141
11142/**
11143 * Track how we arbitrate between microphone requests.
11144 * Logged from
11145 *   frameworks/av/media/libaudioclient/AudioRecord.cpp
11146 *   frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
11147 */
11148message MediametricsAudiorecordReported {
11149    optional int64 timestamp_nanos = 1;
11150    optional string package_name = 2;
11151    optional int64 package_version_code = 3;
11152    optional int64 media_apex_version = 4;
11153
11154    optional android.stats.mediametrics_message.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11155
11156    // Android S
11157    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
11158    // An empty string means no session id is set.
11159    optional string log_session_id = 6;
11160}
11161
11162/**
11163 * Track how we arbitrate between microphone/input requests.
11164 * Logged from
11165 *   frameworks/av/media/libnblog/ReportPerformance.cpp
11166 *   frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
11167 */
11168message MediametricsAudiothreadReported {
11169    optional int64 timestamp_nanos = 1;
11170    optional string package_name = 2;
11171    optional int64 package_version_code = 3;
11172    optional int64 media_apex_version = 4;
11173
11174    optional android.stats.mediametrics_message.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11175}
11176
11177/**
11178 * Track how we arbitrate between microphone/input requests.
11179 * Logged from
11180 *   frameworks/av/media/libaudioclient/AudioTrack.cpp
11181 *   frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
11182 */
11183message MediametricsAudiotrackReported {
11184    optional int64 timestamp_nanos = 1;
11185    optional string package_name = 2;
11186    optional int64 package_version_code = 3;
11187    optional int64 media_apex_version = 4;
11188
11189    optional android.stats.mediametrics_message.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11190
11191    // Android S
11192    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
11193    // An empty string means no session id is set.
11194    optional string log_session_id = 6;
11195}
11196
11197/**
11198 * Track information about a MIDI Device.
11199 * This is logged when device connections close or devices are disconnected.
11200 * This is used to evaluate MIDI activity.
11201 *
11202 * Logged from
11203 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
11204 */
11205message MediametricsMidiDeviceCloseReported {
11206    // The UID of the app or service that disconnects the device
11207    optional int32 uid = 1;
11208    // Device Id from MidiDeviceInfo. After a restart, this starts at 1 for the first device.
11209    // This increments each time a new MIDI device is added.
11210    // See Id in frameworks/base/media/java/android/media/midi/MidiDeviceInfo.java
11211    optional int32 midi_device_id = 2;
11212    // Input port count as defined in MidiDeviceInfo.java
11213    optional int32 input_port_count = 3;
11214    // Output port count as defined in MidiDeviceInfo.java
11215    optional int32 output_port_count = 4;
11216    // Type of device (USB, Virtual, Bluetooth)
11217    optional android.media.midi.MidiDeviceInfoType device_type = 5;
11218    // Whether the device is shared to other apps. Uses MidiDeviceInfo.isPrivate().
11219    optional bool is_shared = 6;
11220    // Whether Universal MIDI Packets are used for this device by default.
11221    // Uses MidiDeviceInfo.getDefaultProtocol()
11222    optional bool supports_ump = 7;
11223    // Whether ALSA is used by this device.
11224    // Checks whether MidiDeviceInfo.getProperties() contains PROPERTY_ALSA_CARD.
11225    optional bool using_alsa = 8;
11226    // Duration in nanoseconds in which there was an open device connection.
11227    optional int64 duration_ns = 9;
11228    // Number of times this device had an add device connection attempt.
11229    optional int32 opened_count = 10;
11230    // Number of times this device had a remove device connection attempt.
11231    optional int32 closed_count = 11;
11232    // Whether the device has disconnected.
11233    optional bool device_disconnected = 12;
11234    // Number of bytes passed from the input ports of the device.
11235    optional int32 total_input_bytes = 13;
11236    // Number of bytes passed from the output ports of the device.
11237    optional int32 total_output_bytes = 14;
11238}
11239
11240/**
11241 * Track information about DRM framework performance
11242 * Logged from
11243 *   frameworks/av/drm/libmediadrm/DrmHal.cpp
11244 *   frameworks/av/services/mediaanalytics/statsd_drm.cpp
11245 */
11246message MediametricsMediadrmReported {
11247    optional int64 timestamp_nanos = 1;
11248    optional string package_name = 2;
11249    optional int64 package_version_code = 3;
11250    optional int64 media_apex_version = 4;
11251
11252    // vendor+description tell about which DRM plugin is in use on this device
11253    optional string vendor = 5;
11254    optional string description = 6;
11255    // from frameworks/av/drm/libmediadrm/protos/metrics.proto
11256    optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
11257}
11258
11259/**
11260 * Track information about the widevine DRM plugin performance
11261 * Logged from
11262 *   vendor/widevine/libwvdrmengine/cdm/metrics
11263 *   frameworks/av/services/mediaanalytics/statsd_drm.cpp
11264 *
11265 * TODO b/182382094 -remove after migrated mediadrm metrics
11266 * reporting to statsd.
11267 */
11268message MediametricsDrmWidevineReported {
11269    optional int64 timestamp_nanos = 1;
11270    optional string package_name = 2;
11271    optional int64 package_version_code = 3;
11272    optional int64 media_apex_version = 4;
11273
11274    optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11275}
11276
11277/**
11278 * Track information about recordings (e.g. camcorder)
11279 * Logged from
11280 *   frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
11281 *   frameworks/av/services/mediaanalytics/statsd_recorder.cpp
11282 */
11283message MediametricsRecorderReported {
11284    optional int64 timestamp_nanos = 1;
11285    optional string package_name = 2;
11286    optional int64 package_version_code = 3;
11287    optional int64 media_apex_version = 4;
11288
11289    optional android.stats.mediametrics_message.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11290}
11291
11292/**
11293 * Track Media Player usage
11294 * Logged from:
11295 *   frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
11296 *   frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
11297 */
11298message MediametricsNuPlayerReported {
11299    optional int64 timestamp_nanos = 1;
11300    optional string package_name = 2;
11301    optional int64 package_version_code = 3;
11302    optional int64 media_apex_version = 4;
11303
11304    optional android.stats.mediametrics_message.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
11305}
11306
11307/**
11308 * Track Legacy DRM usage
11309 * Logged from
11310 *   frameworks/av/drm/drmserver/DrmManager.cpp
11311 */
11312message MediametricsDrmManagerReported {
11313    optional int64 timestamp_nanos = 1;
11314    optional string package_name = 2;
11315    optional int64 package_version_code = 3;
11316    optional int64 media_apex_version = 4;
11317
11318    enum Method {
11319        METHOD_NOT_FOUND       = -1;
11320        GET_CONSTRAINTS        =  0;
11321        GET_METADATA           =  1;
11322        CAN_HANDLE             =  2;
11323        PROCESS_DRM_INFO       =  3;
11324        ACQUIRE_DRM_INFO       =  4;
11325        SAVE_RIGHTS            =  5;
11326        GET_ORIGINAL_MIME_TYPE =  6;
11327        GET_DRM_OBJECT_TYPE    =  7;
11328        CHECK_RIGHTS_STATUS    =  8;
11329        REMOVE_RIGHTS          =  9;
11330        REMOVE_ALL_RIGHTS      = 10;
11331        OPEN_CONVERT_SESSION   = 11;
11332        OPEN_DECRYPT_SESSION   = 12;
11333    }
11334
11335    // plugin_id+description inform which Legacy DRM plugins are still in use on device
11336    optional string plugin_id = 5;
11337    optional string description = 6;
11338    optional Method method = 7;
11339    optional string mime_types = 8;
11340
11341    optional int64 get_constraints_count =  9;
11342    optional int64 get_metadata_count = 10;
11343    optional int64 can_handle_count = 11;
11344    optional int64 process_drm_info_count = 12;
11345    optional int64 acquire_drm_info_count = 13;
11346    optional int64 save_rights_count = 14;
11347    optional int64 get_original_mime_type_count = 15;
11348    optional int64 get_drm_object_type_count = 16;
11349    optional int64 check_rights_status_count = 17;
11350    optional int64 remove_rights_count = 18;
11351    optional int64 remove_all_rights_count = 19;
11352    optional int64 open_convert_session_count = 20;
11353    optional int64 open_decrypt_session_count = 21;
11354}
11355
11356/**
11357 * State of a all permission requested by a all package
11358 * Pulled from: StatsCompanionService
11359*/
11360message DangerousPermissionState {
11361    // Name of the permission
11362    optional string permission_name = 1;
11363
11364    // Uid of the package
11365    optional int32 uid = 2 [(is_uid) = true];
11366
11367    // Package requesting the permission
11368    optional string package_name = 3;
11369
11370    // If the permission is granted to the uid
11371    optional bool is_granted = 4;
11372
11373    // Permission flags as per android.content.pm.PermissionFlags
11374    optional int32 permission_flags = 5;
11375
11376    // Permission protection flags as per android.content.pm.PermissionInfo.ProtectionFlags
11377    optional int32 protection_flags = 6;
11378}
11379
11380/**
11381 * Logs when a package is denied access to a device identifier based on the new access requirements.
11382 *
11383 * Logged from:
11384 *     frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
11385 */
11386message DeviceIdentifierAccessDenied {
11387    // The name of the package denied access to the requested device identifier.
11388    optional string package_name = 1;
11389
11390    // The name of the device identifier method the package attempted to invoke.
11391    optional string method_name = 2;
11392
11393    // True if the package is preinstalled.
11394    // Starting from Android 11, this boolean is not set and will always be false.
11395    optional bool is_preinstalled = 3 [deprecated = true];
11396
11397    // True if the package is privileged.
11398    // Starting from Android 11, this boolean is not set and will always be false.
11399    optional bool is_priv_app = 4 [deprecated = true];
11400}
11401
11402/**
11403 * Pulls the ongoing mainline install train version code.
11404 * Pulled from StatsCompanionService
11405 */
11406message TrainInfo {
11407    optional int64 train_version_code = 1;
11408
11409    optional TrainExperimentIds train_experiment_id = 2 [(log_mode) = MODE_BYTES];
11410
11411    optional string train_name = 3;
11412
11413    enum Status {
11414        UNKNOWN = 0;
11415        INSTALL_REQUESTED = 1;
11416        INSTALL_STARTED = 2;
11417        INSTALL_STAGED_NOT_READY = 3;
11418        INSTALL_STAGED_READY = 4;
11419        INSTALL_SUCCESS = 5;
11420        // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
11421        // and INSTALL_FAILURE_COMMIT.
11422        INSTALL_FAILURE = 6  [deprecated = true];
11423        // This enum is for installs that are manually cancelled via the Manual Update UI.
11424        INSTALL_CANCELLED = 7;
11425        INSTALLER_ROLLBACK_REQUESTED = 8;
11426        INSTALLER_ROLLBACK_INITIATED = 9;
11427        INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
11428        INSTALLER_ROLLBACK_STAGED = 11;
11429        INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
11430        INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
11431        INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
11432        INSTALLER_ROLLBACK_SUCCESS = 15;
11433        INSTALLER_ROLLBACK_FAILURE = 16;
11434        INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
11435        INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
11436        INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
11437        INSTALL_STAGED_CANCEL_REQUESTED = 20;
11438        INSTALL_STAGED_CANCEL_SUCCESS = 21;
11439        INSTALL_STAGED_CANCEL_FAILURE = 22;
11440        INSTALL_FAILURE_DOWNLOAD = 23;
11441        INSTALL_FAILURE_STATE_MISMATCH = 24;
11442        INSTALL_FAILURE_COMMIT = 25;
11443        REBOOT_TRIGGERED = 26;
11444    }
11445    optional Status status = 4;
11446}
11447
11448/*
11449 * Information about the time zone data on a device.
11450 */
11451message TimeZoneDataInfo {
11452    // A version identifier for the data set on device. e.g. "2018i"
11453    optional string tzdb_version = 1;
11454}
11455
11456/**
11457 * Logs the GPU stats global health information.
11458 *
11459 * Logged from:
11460 *   frameworks/native/services/gpuservice/gpustats/
11461 */
11462message GpuStatsGlobalInfo {
11463    // Package name of the gpu driver.
11464    optional string driver_package_name = 1;
11465
11466    // Version name of the gpu driver.
11467    optional string driver_version_name = 2;
11468
11469    // Version code of the gpu driver.
11470    optional int64 driver_version_code = 3;
11471
11472    // Build time of the gpu driver in UTC as seconds since January 1, 1970.
11473    optional int64 driver_build_time = 4;
11474
11475    // Total count of the gl driver gets loaded.
11476    optional int64 gl_loading_count = 5;
11477
11478    // Total count of the gl driver fails to be loaded.
11479    optional int64 gl_loading_failure_count = 6;
11480
11481    // Total count of the Vulkan driver gets loaded.
11482    optional int64 vk_loading_count = 7;
11483
11484    // Total count of the Vulkan driver fails to be loaded.
11485    optional int64 vk_loading_failure_count = 8;
11486
11487    // Api version of the system Vulkan driver.
11488    optional int32 vulkan_version = 9;
11489
11490    // Api version of the system CPU Vulkan driver.
11491    optional int32 cpu_vulkan_version = 10;
11492
11493    // Api version of the system GLES driver.
11494    optional int32 gles_version = 11;
11495
11496    // Total count of the angle driver gets loaded.
11497    optional int64 angle_loading_count = 12;
11498
11499    // Total count of the angle driver fails to be loaded.
11500    optional int64 angle_loading_failure_count = 13;
11501}
11502
11503/**
11504 * GPU driver loading time info.
11505 */
11506message GpuDriverLoadingTime {
11507    // List of all the driver loading times for this app. The list size is
11508    // capped at 16 (GpuStats::MAX_NUM_LOADING_TIMES).
11509    repeated int64 driver_loading_time = 1;
11510}
11511
11512/**
11513 * Logs the GPU stats per app health information.
11514 *
11515 * Logged from:
11516 *   frameworks/native/services/gpuservice/gpustats/
11517 */
11518message GpuStatsAppInfo {
11519    // Package name of the application that loads the gpu driver. Total number
11520    // of different packages is capped at 100.
11521    optional string app_package_name = 1;
11522
11523    // Version code of the gpu driver this app loads.
11524    optional int64 driver_version_code = 2;
11525
11526    // gl driver loading time info.
11527    optional GpuDriverLoadingTime gl_driver_loading_time = 3
11528            [(android.os.statsd.log_mode) = MODE_BYTES];
11529
11530    // Vulkan driver loading time info.
11531    optional GpuDriverLoadingTime vk_driver_loading_time = 4
11532            [(android.os.statsd.log_mode) = MODE_BYTES];
11533
11534    // Angle driver loading time info.
11535    optional GpuDriverLoadingTime angle_driver_loading_time = 5
11536            [(android.os.statsd.log_mode) = MODE_BYTES];
11537
11538    // CPU Vulkan implementation is in use.
11539    optional bool cpu_vulkan_in_use = 6;
11540
11541    // App is not doing pre-rotation correctly.
11542    optional bool false_prerotation = 7;
11543
11544    // App creates GLESv1 context.
11545    optional bool gles_1_in_use = 8;
11546
11547    // ANGLE in use for the app.
11548    optional bool angle_in_use = 9;
11549
11550    // App created a GLES context.
11551    // Introduced in Android 14.
11552    optional bool created_gles_context = 10;
11553
11554    // App created a Vulkan device.
11555    // Introduced in Android 14.
11556    optional bool created_vulkan_device = 11;
11557
11558    // App created a Vulkan swapchain.
11559    // Introduced in Android 14.
11560    optional bool created_vulkan_swapchain = 12;
11561
11562    // Vulkan API version information from applicationInfo.
11563    // Introduced in Android 14.
11564    optional int32 vulkan_api_version = 13;
11565
11566    // Bitmask of enabled features when creating Vulkan devices.
11567    // Introduced in Android 14.
11568    optional int64 vulkan_device_features_enabled = 14;
11569
11570    // Hash values of enabled Vulkan instance extensions.
11571    // The list size is capped at 100 (GpuStatsAppInfo::MAX_NUM_EXTENSIONS).
11572    // Introduced in Android 14.
11573    repeated int32 vulkan_instance_extensions_enabled = 15;
11574
11575    // Hash values of enabled Vulkan device extensions.
11576    // The list size is capped at 100 (GpuStatsAppInfo::MAX_NUM_EXTENSIONS).
11577    // Introduced in Android 14.
11578    repeated int32 vulkan_device_extensions_enabled = 16;
11579}
11580
11581/*
11582 * Logs the size of the system ion heap.
11583 *
11584 * Pulled from StatsCompanionService.
11585 */
11586message SystemIonHeapSize {
11587    // Deprecated due to limited support of ion stats in debugfs.
11588    // Use `IonHeapSize` instead.
11589    option deprecated = true;
11590
11591    // Size of the system ion heap in bytes.
11592    // Read from debugfs.
11593    optional int64 size_in_bytes = 1;
11594}
11595
11596/*
11597 * Logs the total size of the ion heap.
11598 *
11599 * Pulled from StatsCompanionService.
11600 */
11601message IonHeapSize {
11602    // Total size of all ion heaps in kilobytes.
11603    // Read from: /sys/kernel/ion/total_heaps_kb.
11604    optional int32 total_size_kb = 1;
11605}
11606
11607/*
11608 * Logs the per-process size of the system ion heap.
11609 *
11610 * Pulled from StatsCompanionService.
11611 */
11612message ProcessSystemIonHeapSize {
11613    // The uid if available. -1 means not available.
11614    optional int32 uid = 1 [(is_uid) = true];
11615
11616    // The process name (from /proc/PID/cmdline).
11617    optional string process_name = 2;
11618
11619    // Sum of sizes of all allocations.
11620    optional int32 total_size_in_kilobytes = 3;
11621
11622    // Number of allocations.
11623    optional int32 allocation_count = 4;
11624
11625    // Size of the largest allocation.
11626    optional int32 max_size_in_kilobytes = 5;
11627}
11628
11629/*
11630 * Logs system-wide (primarily kernel) memory stats. Sourced from
11631 * /proc/meminfo unless explicitly stated otherwise.
11632 *
11633 * Pulled from StatsCompanionService.
11634 */
11635message SystemMemory {
11636    // /proc/meminfo SUnreclaim
11637    optional int32 unreclaimable_slab_kb = 1;
11638
11639    // /proc/meminfo VmallocUsed
11640    optional int32 vmalloc_used_kb = 2;
11641
11642    // /proc/meminfo PageTables
11643    optional int32 page_tables_kb = 3;
11644
11645    // /proc/meminfo KernelStack
11646    optional int32 kernel_stack_kb = 4;
11647
11648    // Total unreclaimable ion.
11649    // Reported from os.Debug.getIonHeapsSizeKb (R+)
11650    optional int32 total_ion_kb = 5;
11651
11652    // Measures for the amount of memory we could not account for.
11653    // Essentially points to kernel allocations (as all userspace allocs are
11654    // already tracked).
11655    // Device-specific.
11656    optional int32 unaccounted_kb = 6;
11657
11658    // GPU kernel driver allocations.
11659    // Can overlap with ion memory.
11660    // Reported from os.Debug.getGpuTotalUsageKb (S+)
11661    optional int32 gpu_total_usage_kb = 7;
11662
11663    // GPU kernel driver private allocations.
11664    // Does not overlap with ion memory
11665    // Computed as total usage - Debug.getGpuDmaBufUsageKb()
11666    // Only available on supported kernel versions (5.4+)
11667    optional int32 gpu_private_usage_kb = 8;
11668
11669    // Total DMABUF memory allocations
11670    // Reported from os.Debug.getDmabufTotalExportedKb (S+)
11671    optional int32 dmabuf_total_exported_kb = 9;
11672
11673    // Total shmem allocations
11674    optional int32 shmem_kb = 10;
11675
11676    // Total usable memory
11677    optional int32 total_kb = 11;
11678
11679    // Memory not in use
11680    optional int32 free_kb = 12;
11681
11682    // Memory available for starting new applications without swapping
11683    optional int32 available_kb = 13;
11684
11685    // Memory in active use
11686    optional int32 active_kb = 14;
11687
11688    // Memory not in active use (swappable/reclaimable)
11689    optional int32 inactive_kb = 15;
11690
11691    // Anonymous memory in active use
11692    optional int32 active_anon_kb = 16;
11693
11694    // Anonymous memory not in active use
11695    optional int32 inactive_anon_kb = 17;
11696
11697    // Page cache memory in active use
11698    optional int32 active_file_kb = 18;
11699
11700    // Page cache memory not in active use
11701    optional int32 inactive_file_kb = 19;
11702
11703    // Total swap
11704    optional int32 swap_total_kb = 20;
11705
11706    // Free swap
11707    optional int32 swap_free_kb = 21;
11708
11709    // Total amount of CMA reserved for the kernel
11710    optional int32 cma_total_kb = 22;
11711
11712    // CMA free for the kernel to use
11713    optional int32 cma_free_kb = 23;
11714}
11715
11716/*
11717 * Log dmabuf memory retained by userspace processes.
11718 * Pulled from StatsPullAtomService.
11719 */
11720 message ProcessDmabufMemory {
11721  // The uid if available. -1 means not available.
11722  optional int32 uid = 1 [(is_uid) = true];
11723
11724  // The process name (from ActivityManager).
11725  optional string process_name = 2;
11726
11727  // OOM adj score.
11728  optional int32 oom_adj_score = 3;
11729
11730  // Size of dmabufs retained by the process. The buffers are either mapped,
11731  // retained via an fd, or both.
11732  // Only available on supported kernel versions (5.4+). When unavailable, set
11733  // to -1.
11734  optional int32 retained_dmabuf_kb = 4;
11735
11736  // Number of buffers retained by the process (mapped / fd).
11737  // Only available on supported kernel versions (5.4+). When unavailable, set
11738  // to -1.
11739  optional int32 retained_dmabuf_count = 5;
11740
11741  // Size of dmabufs mapped to the process address space.
11742  optional int32 mapped_dmabuf_kb = 6 [deprecated = true];
11743
11744  // Number of dmabufs mapped to the process address space.
11745  optional int32 mapped_dmabuf_count = 7 [deprecated = true];
11746
11747  // Size of dmabufs mapped to the process address space that are also
11748  // mapped to the SurfaceFlinger address space. This indicates memory
11749  // being used by graphics compositing layers. If this data row pertains
11750  // to SurfaceFlinger itself, then the below field holds the size of all
11751  // dmabuifs that are shared with any other process. The delta between
11752  // this field and retained_dmabuf_kb, above, is private dmabufs that
11753  // SurfaceFlinger is holding but are not shared with other processes.
11754  optional int32 surfaceflinger_shared_dmabuf_kb = 8;
11755  // As above, but total number of all dmabufs shared with SurfaceFlinger.
11756  optional int32 surfaceflinger_shared_dmabuf_count = 9;
11757}
11758
11759/**
11760 * Push network stack events.
11761 *
11762 * Log from:
11763 *     frameworks/base/packages/NetworkStack/
11764 */
11765message NetworkStackReported {
11766    // The id that indicates the event reported from NetworkStack.
11767    optional int32 event_id = 1;
11768    // The data for the reported events.
11769    optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
11770}
11771
11772/**
11773 * Logs the apps that are installed on the external storage.
11774 * Pulled from:
11775 *   StatsCompanionService
11776 */
11777message AppsOnExternalStorageInfo {
11778    // The type of the external storage.
11779    optional android.stats.storage.ExternalStorageType external_storage_type = 1;
11780    // The name of the package that is installed on the external storage.
11781    optional string package_name = 2;
11782}
11783
11784/**
11785 * Logs the settings related to Face.
11786 * Logged from:
11787 *   frameworks/base/services/core/java/com/android/server/stats
11788 */
11789message FaceSettings {
11790    // Whether or not face unlock is allowed on Keyguard.
11791    optional bool unlock_keyguard_enabled = 1;
11792    // Whether or not face unlock dismisses the Keyguard.
11793    optional bool unlock_dismisses_keyguard = 2;
11794    // Whether or not face unlock requires attention.
11795    optional bool unlock_attention_required = 3;
11796    // Whether or not face unlock is allowed for apps (through BiometricPrompt).
11797    optional bool unlock_app_enabled = 4;
11798    // Whether or not face unlock always requires user confirmation.
11799    optional bool unlock_always_require_confirmation = 5;
11800    // Whether or not a diverse set of poses are required during enrollment.
11801    optional bool unlock_diversity_required = 6;
11802}
11803
11804/**
11805 * Logs cooling devices maintained by the kernel.
11806 *
11807 * Pulled from StatsCompanionService.java
11808 */
11809message CoolingDevice {
11810    // The type of cooling device being reported. Eg. CPU, GPU...
11811    optional android.os.CoolingTypeEnum device_location = 1;
11812    // The name of the cooling device source. Eg. CPU0
11813    optional string device_name = 2;
11814    // Current throttle state of the cooling device. The value can any unsigned
11815    // integer between 0 and max_state defined in its driver. 0 means device is
11816    // not in throttling, higher value means deeper throttling.
11817    optional int32 state = 3;
11818}
11819
11820/**
11821 * Intelligence has several counter-type events that don't warrant a
11822 * full separate atom. These are primarily API call counters but also include
11823 * counters for feature usage and specific failure modes.
11824 *
11825 * Logged from the Intelligence mainline module.
11826 */
11827message IntelligenceEventReported {
11828  // The event type.
11829  optional android.stats.intelligence.EventType event_id = 1;
11830  // Success, failure.
11831  optional android.stats.intelligence.Status status = 2;
11832  // How many times the event occured (to report a batch of high frequency events).
11833  optional int32 count = 3;
11834  // How long the event took (sum of durations if count > 1)
11835  optional int64 duration_millis = 4;
11836}
11837
11838/**
11839 * Logs when Car Power state changed.
11840 *
11841 * Logged from:
11842 *   packages/services/Car/service/src/com/android/car/CarStatsLog.java
11843 */
11844message CarPowerStateChanged {
11845    // States come from CpmsState in CarPowerManagementService.java.
11846    enum State {
11847       WAIT_FOR_VHAL = 0;
11848       ON = 1;
11849       SHUTDOWN_PREPARE = 2;
11850       WAIT_FOR_FINISH = 3;
11851       SUSPEND = 4;
11852       SIMULATE_SLEEP = 5;
11853    }
11854    optional State state = 1;
11855}
11856
11857/**
11858 * Logs when Car User Hal is requested to switch/create/remove user.
11859 *
11860 * Logged from:
11861 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
11862 */
11863message CarUserHalModifyUserRequestReported {
11864    // Request id for the request.
11865    optional int32 request_id = 1;
11866    // Request type.
11867    enum RequestType {
11868        UNKNOWN = 0;
11869        // Car user manager requested user switch.
11870        SWITCH_REQUEST_ANDROID = 1;
11871        // OEM requested User switch.
11872        SWITCH_REQUEST_OEM = 2;
11873        // Hal switch requested after android switch using activity manager.
11874        SWITCH_REQUEST_LEGACY = 3;
11875        // Create User
11876        CREATE_REQUEST = 4;
11877        // Remove User
11878        REMOVE_REQUEST = 5;
11879    }
11880    optional RequestType request_type = 2;
11881    // Android User id of the current user which can only be 0, 10, 11 and so on.
11882    // -1 if not available.
11883    optional int32 user_id = 3;
11884    // VHAL flags of the current user. (-1 if not available)
11885    optional int32 user_flags = 4;
11886    // Android User id of the target user for switch/create/remove. It can only
11887    // be 0, 10, 11 and so on. -1 if not available.
11888    optional int32 target_user_id = 5;
11889    // VHAL flags of the target user for switch/create/remove. (-1 if not available)
11890    optional int32 target_user_flags = 6;
11891    // Request timeout Milliseconds (-1 if not available)
11892    optional int32 timeout_millis = 7;
11893}
11894
11895/**
11896 * Logs when Car User Hal responds to switch/create user request.
11897 *
11898 * Logged from:
11899 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
11900 */
11901message CarUserHalModifyUserResponseReported {
11902    // Request id of the request associated with the response.
11903    optional int32 request_id = 1;
11904    // Car user hal callback status.
11905    enum CallbackStatus {
11906        UNKNOWN = 0;
11907        // Hal response was invalid.
11908        INVALID = 1;
11909        // Hal response was ok.
11910        OK = 2;
11911        // Hal timeout during set call.
11912        HAL_SET_TIMEOUT = 3;
11913        // Hal response timeout.
11914        HAL_RESPONSE_TIMEOUT = 4;
11915        // Hal responded with wrong info.
11916        WRONG_HAL_RESPONSE = 5;
11917        // Hal is processing multiple requests simultaneously.
11918        CONCURRENT_OPERATION = 6;
11919    }
11920    optional CallbackStatus callback_status = 2;
11921
11922    // Hal request status for user switch/create/remove.
11923    enum HalRequestStatus {
11924        UNSPECIFIED = 0;
11925        // Hal request for user switch/create is successful.
11926        SUCCESS = 1;
11927        // Hal request for user switch/create failed.
11928        FAILURE = 2;
11929    }
11930    optional HalRequestStatus request_status = 3;
11931}
11932
11933/**
11934 * Logs when post switch response is posted to Car User Hal.
11935 *
11936 * Logged from:
11937 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
11938 */
11939message CarUserHalPostSwitchResponseReported {
11940    // Request id.
11941    optional int32 request_id = 1;
11942
11943    // Android user switch status.
11944    enum UserSwitchStatus {
11945        UNKNOWN = 0;
11946        // Android user switch is successful.
11947        SUCCESS = 1;
11948        // Android user switch failed.
11949        FAILURE = 2;
11950    }
11951    optional UserSwitchStatus switch_status = 2;
11952}
11953
11954/**
11955 * Logs when initial user information is requested from Car User Hal.
11956 *
11957 * Logged from:
11958 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
11959 */
11960message CarUserHalInitialUserInfoRequestReported {
11961    // Request id for the request.
11962    optional int32 request_id = 1;
11963
11964    // Request type for initial user information.
11965    enum InitialUserInfoRequestType {
11966        UNKNOWN = 0;
11967        // At the first time Android was booted (or after a factory reset).
11968        FIRST_BOOT = 1;
11969        // At the first time Android was booted after the system was updated.
11970        FIRST_BOOT_AFTER_OTA = 2;
11971        // When Android was booted "from scratch".
11972        COLD_BOOT = 3;
11973        // When Android was resumed after the system was suspended to memory.
11974        RESUME = 4;
11975    }
11976    optional InitialUserInfoRequestType request_type = 2;
11977    // Request timeout Milliseconds (-1 if not available)
11978    optional int32 timeout_millis = 3;
11979}
11980
11981/**
11982 * Logs when Car User Hal responds to initial user information requests.
11983 *
11984 * Logged from:
11985 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
11986 */
11987message CarUserHalInitialUserInfoResponseReported {
11988    // Request id of the request associated with the response.
11989    optional int32 request_id = 1;
11990    // Car user hal callback status.
11991    enum CallbackStatus {
11992        UNKNOWN = 0;
11993        // Hal response was invalid.
11994        INVALID = 1;
11995        // Hal response was ok.
11996        OK = 2;
11997        // Hal timeout during set call.
11998        HAL_SET_TIMEOUT = 3;
11999        // Hal response timeout.
12000        HAL_RESPONSE_TIMEOUT = 4;
12001        // Hal responded with wrong info.
12002        WRONG_HAL_RESPONSE = 5;
12003        // Hal is processing multiple requests simultaneously.
12004        CONCURRENT_OPERATION = 6;
12005    }
12006    optional CallbackStatus callback_status = 2;
12007    // Response for initial user information request.
12008    enum InitialUserInfoResponseAction {
12009        UNSPECIFIED = 0;
12010        // Let the Android System decide what to do.
12011        DEFAULT = 1;
12012        // Switch to an existing Android user.
12013        SWITCH = 2;
12014        // Create a new Android user (and switch to it).
12015        CREATE = 3;
12016    }
12017    optional InitialUserInfoResponseAction response_action = 3;
12018    // Android User id of the target user which can only be 0, 10, 11 and so on.
12019    // -1 if not available.
12020    optional int32 target_user = 4;
12021    // VHAL flags of the current user. (-1 if not available)
12022    optional int32 target_user_flags = 5;
12023    // User locales
12024    optional string user_locales = 6;
12025}
12026
12027/**
12028 * Logs when set user association is requested from Car User Hal.
12029 *
12030 * Logged from:
12031 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
12032 */
12033message CarUserHalUserAssociationRequestReported {
12034    // Request id for the request.
12035    optional int32 request_id = 1;
12036    // Request type.
12037    enum RequestType {
12038        UNKNOWN = 0;
12039        // For setting user association information.
12040        SET = 1;
12041        // For getting user association information.
12042        GET = 2;
12043    }
12044    optional RequestType request_type = 2;
12045    // Android User id of the current user which can only be 0, 10, 11 and so on.
12046    // -1 if not available.
12047    optional int32 current_user_id = 3;
12048    // VHAL flags of the current user. (-1 if not available)
12049    optional int32 current_user_flags = 4;
12050    // Number of the set associations requested.
12051    optional int32 number_associations = 5;
12052    // Concatenated string for the types from set associations request.
12053    // This is a string converted from an array of integers.
12054    optional string user_identification_association_types = 6;
12055    // Concatenated string for the values from set associations request.
12056    // This is a string converted from an array of integers.
12057    optional string user_identification_association_values = 7;
12058}
12059
12060/**
12061 * Logs when Car User Hal responds to set user association requests.
12062 *
12063 * Logged from:
12064 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
12065 */
12066message CarUserHalSetUserAssociationResponseReported {
12067    // Request id of the request associated with the response.
12068    optional int32 request_id = 1;
12069    // Car user hal callback status.
12070    enum CallbackStatus {
12071        UNKNOWN = 0;
12072        // Hal response was invalid.
12073        INVALID = 1;
12074        // Hal response was ok.
12075        OK = 2;
12076        // Hal timeout during set call.
12077        HAL_SET_TIMEOUT = 3;
12078        // Hal response timeout.
12079        HAL_RESPONSE_TIMEOUT = 4;
12080        // Hal responded with wrong info.
12081        WRONG_HAL_RESPONSE = 5;
12082        // Hal is processing multiple requests simultaneously.
12083        CONCURRENT_OPERATION = 6;
12084    }
12085    optional CallbackStatus callback_status = 2;
12086    // Number of the set associations in the response.
12087    optional int32 number_associations = 3;
12088    // Concatenated string for the types from set associations request.
12089    // This is a string converted from an array of integers.
12090    optional string user_identification_association_types = 4;
12091    // Concatenated string for the values from set associations request.
12092    // This is a string converted from an array of integers.
12093    optional string user_identification_association_values = 5;
12094}
12095
12096/**
12097 * Logs whether GarageMode is entered.
12098 *
12099 * Logged from:
12100 *   packages/services/Car/service/src/com/android/car/CarStatsLog.java
12101 */
12102message GarageModeInfo {
12103    // Whether GarageMode is entered.
12104    optional bool is_garage_mode = 1;
12105}
12106
12107/**
12108 * Historical app ops data per package.
12109 */
12110message AppOps {
12111    // Uid of the package requesting the op
12112    optional int32 uid = 1 [(is_uid) = true];
12113
12114    // Name of the package performing the op
12115    optional string package_name = 2;
12116
12117    // operation id
12118    optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
12119
12120    // The number of times the op was granted while the app was in the
12121    // foreground (only for trusted requests)
12122    optional int64 trusted_foreground_granted_count = 4;
12123
12124    // The number of times the op was granted while the app was in the
12125    // background (only for trusted requests)
12126    optional int64 trusted_background_granted_count = 5;
12127
12128    // The number of times the op was rejected while the app was in the
12129    // foreground (only for trusted requests)
12130    optional int64 trusted_foreground_rejected_count = 6;
12131
12132    // The number of times the op was rejected while the app was in the
12133    // background (only for trusted requests)
12134    optional int64 trusted_background_rejected_count = 7;
12135
12136    // For long-running operations, total duration of the operation
12137    // while the app was in the foreground (only for trusted requests)
12138    optional int64 trusted_foreground_duration_millis = 8;
12139
12140    // For long-running operations, total duration of the operation
12141    // while the app was in the background (only for trusted requests)
12142    optional int64 trusted_background_duration_millis = 9;
12143
12144    // Whether AppOps is guarded by Runtime permission
12145    optional bool is_runtime_permission = 10;
12146}
12147
12148/**
12149 * Historical app ops data per package and attribution tag.
12150 */
12151message AttributedAppOps {
12152    // Uid of the package requesting the op
12153    optional int32 uid = 1 [(is_uid) = true];
12154
12155    // Name of the package performing the op
12156    optional string package_name = 2;
12157
12158    // tag; provided by developer when accessing related API, limited at 50 chars by API.
12159    // Attributions must be provided through manifest using <attribution> tag available in R and
12160    // above.
12161    optional string tag = 3;
12162
12163    // operation id
12164    optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
12165
12166    // The number of times the op was granted while the app was in the
12167    // foreground (only for trusted requests)
12168    optional int64 trusted_foreground_granted_count = 5;
12169
12170    // The number of times the op was granted while the app was in the
12171    // background (only for trusted requests)
12172    optional int64 trusted_background_granted_count = 6;
12173
12174    // The number of times the op was rejected while the app was in the
12175    // foreground (only for trusted requests)
12176    optional int64 trusted_foreground_rejected_count = 7;
12177
12178    // The number of times the op was rejected while the app was in the
12179    // background (only for trusted requests)
12180    optional int64 trusted_background_rejected_count = 8;
12181
12182    // For long-running operations, total duration of the operation
12183    // while the app was in the foreground (only for trusted requests)
12184    optional int64 trusted_foreground_duration_millis = 9;
12185
12186    // For long-running operations, total duration of the operation
12187    // while the app was in the background (only for trusted requests)
12188    optional int64 trusted_background_duration_millis = 10;
12189
12190    // Whether AppOps is guarded by Runtime permission
12191    optional bool is_runtime_permission = 11;
12192
12193    // Sampling rate used on device, from 0 to 100
12194    optional int32 sampling_rate = 12;
12195}
12196
12197/**
12198 * Location Manager API Usage information(e.g. API under usage,
12199 * API call's parameters).
12200 * Logged from:
12201 *  frameworks/base/services/core/java/com/android/server/LocationManagerService.java
12202 */
12203message LocationManagerApiUsageReported {
12204
12205    // Indicating if usage starts or usage ends.
12206    optional android.stats.location.UsageState state = 1;
12207
12208    // LocationManagerService's API in use.
12209    // We can identify which API from LocationManager is
12210    // invoking current LMS API by the combination of
12211    // API parameter(e.g. is_listener_null, is_intent_null,
12212    // is_location_request_null)
12213    optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
12214
12215    // Name of the package calling the API.
12216    optional string calling_package_name = 3;
12217
12218    // Type of the location provider.
12219    optional android.stats.location.ProviderType provider = 4;
12220
12221    // Quality of the location request
12222    optional android.stats.location.LocationRequestQuality quality = 5;
12223
12224    // The desired interval for active location updates, in milliseconds.
12225    // Bucketized to reduce cardinality.
12226    optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
12227
12228    // Minimum distance between location updates, in meters.
12229    // Bucketized to reduce cardinality.
12230    optional android.stats.location.SmallestDisplacementBucket
12231            bucketized_smallest_displacement = 7;
12232
12233    // The number of location updates.
12234    optional int64 num_updates = 8;
12235
12236    // The request expiration time, in millisecond since boot.
12237    // Bucketized to reduce cardinality.
12238    optional android.stats.location.ExpirationBucket
12239            bucketized_expire_in = 9;
12240
12241    // Type of Callback passed in for this API.
12242    optional android.stats.location.CallbackType callback_type = 10;
12243
12244    // The radius of the central point of the alert
12245    // region, in meters. Only for API REQUEST_GEOFENCE.
12246    // Bucketized to reduce cardinality.
12247    optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
12248
12249    // Activity Importance of API caller.
12250    // Categorized to 3 types that are interesting from location's perspective.
12251    optional android.stats.location.ActivityImportance activiy_importance = 12;
12252
12253    // Attribution tag passed to this API.
12254    optional string attribution_tag = 13;
12255}
12256
12257/**
12258 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
12259 */
12260message ReviewPermissionsFragmentResultReported {
12261    // unique value identifying a permission group change. A permission group change might result
12262    // in multiple of these atoms
12263    optional int64 change_id = 1;
12264
12265    // UID of package the permission belongs to
12266    optional int32 uid = 2 [(is_uid) = true];
12267
12268    // Name of package the permission belongs to
12269    optional string package_name = 3;
12270
12271    // The permission to be granted
12272    optional string permission_name = 4;
12273
12274    // The result of the permission grant
12275    optional bool permission_granted = 5;
12276}
12277
12278/**
12279* Information about results of permission upgrade by RuntimePermissionsUpgradeController
12280* Logged from: RuntimePermissionUpdgradeController
12281*/
12282message RuntimePermissionsUpgradeResult {
12283    // Permission granted as result of upgrade
12284    optional string permission_name = 1;
12285
12286    // UID of package granted permission
12287    optional int32 uid = 2 [(is_uid) = true];
12288
12289    // Name of package granted permission
12290    optional string package_name = 3;
12291}
12292
12293/**
12294* Information about a buttons presented in GrantPermissionsActivity and choice made by user
12295*/
12296message GrantPermissionsActivityButtonActions {
12297    // Permission granted as result of upgrade
12298    optional string permission_group_name = 1;
12299
12300    // UID of package granted permission
12301    optional int32 uid = 2 [(is_uid) = true];
12302
12303    // Name of package requesting permission
12304    optional string package_name = 3;
12305
12306    // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
12307    // LABEL_ constants in GrantPermissionActivity.java
12308    optional int32 buttons_presented = 4;
12309
12310    // Button clicked by user - same as bit flags in buttons_presented with only single bit set
12311    optional int32 button_clicked = 5;
12312
12313    // id which identifies single session of user interacting with permission controller
12314    optional int64 session_id = 6;
12315
12316    // Target SDK of the package
12317    optional int32 target_sdk = 7;
12318
12319    // Selected precision of the location permission - bit flags indicate which
12320    // locations were chosen
12321    optional int32 selected_precision = 8;
12322
12323    // Whether Permission Rationale was shown on grant permission activity
12324    optional bool permission_rationale_shown = 9;
12325}
12326
12327/**
12328 * Information about LocationAccessCheck notification presented to user
12329 */
12330message LocationAccessCheckNotificationAction {
12331
12332    // id which identifies single session of user interacting with permission controller
12333    optional int64 session_id = 1;
12334
12335    // Uid of package for which location access check is presented
12336    optional int32 package_uid = 2;
12337
12338    // Name of package for which location access check is presented
12339    optional string package_name = 3;
12340
12341    enum Result {
12342        UNDEFINED = 0;
12343        // notification was presented to the user
12344        NOTIFICATION_PRESENTED = 1;
12345        // notification was declined by the user
12346        NOTIFICATION_DECLINED = 2;
12347        // notification was clicked by the user
12348        NOTIFICATION_CLICKED = 3;
12349    }
12350
12351    // View / interaction recorded
12352    optional Result result = 4;
12353}
12354
12355/**
12356 * Information about a permission grant or revoke made by user inside AppPermissionFragment
12357 */
12358message AppPermissionFragmentActionReported {
12359    // id which identifies single session of user interacting with permission controller
12360    optional int64 session_id = 1;
12361
12362    // unique value identifying a permission group change. A permission group change might result
12363    // in multiple of these atoms
12364    optional int64 change_id = 2;
12365
12366    // UID of package the permission belongs to
12367    optional int32 uid = 3 [(is_uid) = true];
12368
12369    // Name of package the permission belongs to
12370    optional string package_name = 4;
12371
12372    // The permission to be granted
12373    optional string permission_name = 5;
12374
12375    // The result of the permission grant
12376    optional bool permission_granted = 6;
12377
12378    // State of Permission Flags after grant as per android.content.pm.PermissionFlags
12379    optional int32 permission_flags = 7;
12380
12381    enum Button {
12382        UNDEFINED = 0;
12383        // Allow button
12384        ALLOW = 1;
12385        // Deny button
12386        DENY = 2;
12387        // Ask every time button
12388        ASK_EVERY_TIME = 3;
12389        // Allow all the time button
12390        ALLOW_ALWAYS = 4;
12391        // Allow only while using the app button
12392        ALLOW_FOREGROUND = 5;
12393        // Same is Deny button but shown in while in use dialog
12394        DENY_FOREGROUND = 6;
12395        // Switch button set to ON for location accuracy
12396        GRANT_FINE_LOCATION = 7;
12397        // Switch button set to OFF for location accuracy
12398        REVOKE_FINE_LOCATION = 8;
12399        // The user has selected photos/videos from the photo picker
12400        PHOTOS_SELECTED = 9;
12401        // User selects Permission Rationale label
12402        PERMISSION_RATIONALE = 10;
12403    }
12404
12405    // Button pressed in the dialog
12406    optional Button button_pressed = 8;
12407}
12408
12409/**
12410* Information about a AppPermissionFragment viewed by user
12411*/
12412message AppPermissionFragmentViewed {
12413    // id which identifies single session of user interacting with permission controller
12414    optional int64 session_id = 1;
12415
12416    // UID of package for which permissions are viewed
12417    optional int32 uid = 2 [(is_uid) = true];
12418
12419    // Name of package for which permissions are viewed
12420    optional string package_name = 3;
12421
12422    // Permission group viewed
12423    optional string permission_group_name = 4;
12424
12425    // Whether Permission Rationale was shown on app permission fragment
12426    optional bool permission_rationale_shown = 5;
12427}
12428
12429/**
12430* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
12431* the log retains the old fragment name.
12432*/
12433message AppPermissionsFragmentViewed {
12434    // id which identifies single session of user interacting with permission controller
12435    optional int64 session_id = 1;
12436
12437    // id which identifies single view as every view might have several logging records
12438    // with different package information attached
12439    optional int64 view_id = 2;
12440
12441    // Permission group viewed
12442    optional string permission_group_name = 3;
12443
12444    // UID of package for which permissions are viewed
12445    optional int32 uid = 4 [(is_uid) = true];
12446
12447    // Name of package for which permissions are viewed
12448    optional string package_name = 5;
12449
12450    // Category in which permission is included
12451    enum Category {
12452      UNDEFINED = 0;
12453      ALLOWED = 1;
12454      ALLOWED_FOREGROUND = 2;
12455      DENIED = 3;
12456    }
12457    optional Category category = 6;
12458}
12459/**
12460* Information about a PermissionAppsFragment viewed by user.
12461* Logged from ui/handheld/PermissionAppsFragment.java
12462*/
12463message PermissionAppsFragmentViewed {
12464    // id which identifies single session of user interacting with permission controller
12465    optional int64 session_id = 1;
12466
12467    // id which identifies single view as every view might have several logging records
12468    // with different package information attached
12469    optional int64 view_id = 2;
12470
12471    // Permission group viewed
12472    optional string permission_group_name = 3;
12473
12474    // UID of package for which permissions are viewed
12475    optional int32 uid = 4 [(is_uid) = true];
12476
12477    // Name of package for which permissions are viewed
12478    optional string package_name = 5;
12479
12480    // Category in which app is included
12481    enum Category {
12482        UNDEFINED = 0;
12483        ALLOWED = 1;
12484        ALLOWED_FOREGROUND = 2;
12485        DENIED = 3;
12486    }
12487    optional Category category = 6;
12488}
12489
12490/**
12491* Log that the Auto Revoke notification has been clicked
12492* Logged from ui/ManagePermissionsActivity
12493*/
12494message AutoRevokeNotificationClicked {
12495    // id which identifies single session of user interacting with permission controller
12496    optional int64 session_id = 1;
12497}
12498
12499/**
12500* Log that an app has been displayed on the auto revoke page, and lists one permission that was
12501* auto revoked for it.
12502* Logged from ui/handheld/AutoRevokeFragment
12503*/
12504message AutoRevokeFragmentAppViewed {
12505    // id which identifies single session of user interacting with permission controller
12506    optional int64 session_id = 1;
12507
12508    // UID of package for which permissions are viewed
12509    optional int32 uid = 2 [(is_uid) = true];
12510
12511    // Name of package for which permissions are viewed
12512    optional string package_name = 3;
12513
12514    // The name of a permission group that has been revoked
12515    optional string permission_group_name = 4;
12516
12517    // The age of the app- more than three months old, or more than six months
12518    enum Age {
12519        UNDEFINED = 0;
12520        NEWER_BUCKET = 1;
12521        OLDER_BUCKET = 2;
12522    }
12523
12524    // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
12525    optional Age age = 5;
12526}
12527
12528/**
12529* Log that the user has interacted with an app on the auto revoke fragment
12530* Logged from ui/handheld/AutoRevokeFragment
12531*/
12532message AutoRevokedAppInteraction {
12533    // id which identifies single session of user interacting with permission controller
12534    optional int64 session_id = 1;
12535
12536    // UID of package for which permissions are viewed
12537    optional int32 uid = 2 [(is_uid) = true];
12538
12539    // Name of package for which permissions are viewed
12540    optional string package_name = 3;
12541
12542    enum Action {
12543        UNDEFINED = 0;
12544        REMOVE = 1;
12545        OPEN = 2;
12546        APP_INFO = 3;
12547        PERMISSIONS = 4;
12548        REMOVE_IN_SETTINGS = 5;
12549        OPEN_IN_SETTINGS = 6;
12550    }
12551
12552    // The action the user took to interact with the app
12553    optional Action action = 4;
12554}
12555
12556/**
12557* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
12558* auto revoke, or that the auto revoke switch has been changed
12559* Logged from ui/handheld/AppPermissionGroupsFragment
12560 */
12561message AppPermissionGroupsFragmentAutoRevokeAction {
12562    // id which identifies single session of user interacting with permission controller
12563    optional int64 session_id = 1;
12564
12565    // UID of package for which permissions are viewed
12566    optional int32 uid = 2 [(is_uid) = true];
12567
12568    // Name of package for which permissions are viewed
12569    optional string package_name = 3;
12570
12571    enum Action {
12572        UNDEFINED = 0;
12573        OPENED_FOR_AUTO_REVOKE = 1;
12574        OPENED_FROM_INTENT = 2;
12575        SWITCH_ENABLED = 3;
12576        SWITCH_DISABLED = 4;
12577    }
12578
12579    // The action the user took to interact with the fragment
12580    optional Action action = 4;
12581}
12582
12583/**
12584 * Logs when there is a smart selection related event.
12585 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
12586 * Logged from: TextClassifierEventLogger.java
12587 */
12588message TextSelectionEvent {
12589    // A session ID.
12590    optional string session_id = 1;
12591
12592    // Event type of this event.
12593    optional android.stats.textclassifier.EventType event_type = 2;
12594
12595    // Name of the annotator model that is involved in this event.
12596    optional string model_name = 3;
12597
12598    // Type of widget that was involved in triggering this event.
12599    optional android.stats.textclassifier.WidgetType widget_type = 4;
12600
12601    // Index of this event in a session.
12602    optional int32 event_index = 5;
12603
12604    // Entity type that is involved.
12605    optional string entity_type = 6;
12606
12607    // Relative word index of the start of the selection.
12608    optional int32 relative_word_start_index = 7;
12609
12610    // Relative word (exclusive) index of the end of the selection.
12611    optional int32 relative_word_end_index = 8;
12612
12613    // Relative word index of the start of the smart selection.
12614    optional int32 relative_suggested_word_start_index = 9;
12615
12616    // Relative word (exclusive) index of the end of the smart selection.
12617    optional int32 relative_suggested_word_end_index = 10;
12618
12619    // Name of source package.
12620    optional string package_name = 11;
12621
12622    // Name of the LangID model that is involved in this event.
12623    optional string langid_model_name = 12;
12624}
12625
12626/**
12627 * Logs when there is a smart linkify related event.
12628 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
12629 * Logged from: TextClassifierEventLogger.java
12630 */
12631message TextLinkifyEvent {
12632    // A session ID.
12633    optional string session_id = 1;
12634
12635    // Event type of this event.
12636    optional android.stats.textclassifier.EventType event_type = 2;
12637
12638    // Name of the annotator model that is involved in this event.
12639    optional string model_name = 3;
12640
12641    // Type of widget that was involved in triggering this event.
12642    optional android.stats.textclassifier.WidgetType widget_type = 4;
12643
12644    // Index of this event in a session.
12645    optional int32 event_index = 5;
12646
12647    // Entity type that is involved.
12648    optional string entity_type = 6;
12649
12650    // Number of links detected.
12651    optional int32 num_links = 7;
12652
12653    // The total length of all links.
12654    optional int32 linked_text_length = 8;
12655
12656    // Length of input text.
12657    optional int32 text_length = 9;
12658
12659    // Time spent on generating links in ms.
12660    optional int64 latency_millis = 10;
12661
12662    // Name of source package.
12663    optional string package_name = 11;
12664
12665    // Name of the LangID model that is involved in this event.
12666    optional string langid_model_name = 12;
12667}
12668
12669/**
12670 * Logs when there is a conversation actions related event.
12671 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
12672 * Logged from: TextClassifierEventLogger.java
12673 */
12674message ConversationActionsEvent {
12675    // A session ID.
12676    optional string session_id = 1;
12677
12678    // Event type of this event.
12679    optional android.stats.textclassifier.EventType event_type = 2;
12680
12681    // Name of the actions model that is involved in this event.
12682    optional string model_name = 3;
12683
12684    // Type of widget that was involved in triggering this event.
12685    optional android.stats.textclassifier.WidgetType widget_type = 4;
12686
12687    // The first entity type that is involved.
12688    optional string first_entity_type = 5;
12689
12690    // The second entity type that is involved.
12691    optional string second_entity_type = 6;
12692
12693    // The third entity type that is involved.
12694    optional string third_entity_type = 7;
12695
12696    // The score of the first entity type.
12697    optional float score = 8;
12698
12699    // Name of source package.
12700    optional string package_name = 9;
12701
12702    // Name of the annotator model that is involved in this event.
12703    optional string annotator_model_name = 10;
12704
12705    // Name of the LangID model that is involved in this event.
12706    optional string langid_model_name = 11;
12707}
12708
12709/**
12710 * Logs when there is a language detection related event.
12711 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
12712 * Logged from: TextClassifierEventLogger.java
12713 */
12714message LanguageDetectionEvent {
12715    // A session ID.
12716    optional string session_id = 1;
12717
12718    // Event type of this event.
12719    optional android.stats.textclassifier.EventType event_type = 2;
12720
12721    // Name of the language detection model that is involved in this event.
12722    optional string model_name = 3;
12723
12724    // Type of widget that was involved in triggering this event.
12725    optional android.stats.textclassifier.WidgetType widget_type = 4;
12726
12727    // Detected language.
12728    optional string language_tag = 5;
12729
12730    // Score of the detected language.
12731    optional float score = 6;
12732
12733    // Position of this action.
12734    optional int32 action_index = 7;
12735
12736    // Name of source package.
12737    optional string package_name = 8;
12738}
12739
12740/**
12741 * Information about an OTA update attempt by update_engine.
12742 * Logged from platform/system/update_engine/metrics_reporter_android.cc
12743 */
12744message UpdateEngineUpdateAttemptReported {
12745    // The number of attempts for the update engine to apply a given payload.
12746    optional int32 attempt_number = 1;
12747
12748    optional android.stats.otaupdate.PayloadType payload_type = 2;
12749
12750    // The total time in minutes for the update engine to apply a given payload.
12751    // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
12752    // it's increased when the system is sleeping.
12753    optional int32 duration_boottime_in_minutes = 3;
12754
12755    // The total time in minutes for the update engine to apply a given payload.
12756    // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
12757    // and it's not increased when the system is sleeping.
12758    optional int32 duration_monotonic_in_minutes = 4;
12759
12760    // The size of the payload in MiBs.
12761    optional int32 payload_size_mib = 5;
12762
12763    // The attempt result reported by the update engine for an OTA update.
12764    optional android.stats.otaupdate.AttemptResult attempt_result = 6;
12765
12766    // The error code reported by the update engine after an OTA update attempt
12767    // on A/B devices.
12768    optional android.stats.otaupdate.ErrorCode error_code = 7;
12769
12770    // The build fingerprint of the source system. The value is read from a
12771    // system property when the device takes the update. e.g.
12772    // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
12773    optional string source_fingerprint = 8;
12774
12775    // Size of super partition.
12776    optional int64 super_partition_size_bytes = 9;
12777
12778    // Size of current slot within the super partition.
12779    optional int64 slot_size_bytes = 10;
12780
12781    // Free space available in the super partition.
12782    optional int64 super_free_space_bytes = 11;
12783
12784    // Whether the device enables Virtual A/B compression.
12785    optional bool vab_compression_enabled = 12;
12786
12787    // Whether this update attempt uses Virtual A/B compression.
12788    optional bool vab_compression_used = 13;
12789}
12790
12791/**
12792 * Information about all the attempts the device make before finishing the
12793 * successful update.
12794 * Logged from platform/system/update_engine/metrics_reporter_android.cc
12795 */
12796message UpdateEngineSuccessfulUpdateReported {
12797    // The number of attempts for the update engine to apply the payload for a
12798    // successful update.
12799    optional int32 attempt_count = 1;
12800
12801    optional android.stats.otaupdate.PayloadType payload_type = 2;
12802
12803    optional int32 payload_size_mib = 3;
12804
12805    // The total number of bytes downloaded by update_engine since the last
12806    // successful update.
12807    optional int32 total_bytes_downloaded_mib = 4;
12808
12809    // The ratio in percentage of the over-downloaded bytes compared to the
12810    // total bytes needed to successfully install the update. e.g. 200 if we
12811    // download 200MiB in total for a 100MiB package.
12812    optional int32 download_overhead_percentage = 5;
12813
12814    // The total time in minutes for the update engine to apply the payload for a
12815    // successful update.
12816    optional int32 total_duration_minutes = 6;
12817
12818    // The number of reboot of the device during a successful update.
12819    optional int32 reboot_count = 7;
12820
12821    // Whether on device verity computation is enabled
12822    optional bool fec_enabled = 8;
12823
12824    // Whether on device hash tree computation is enabled
12825    optional bool hash_tree_enabled = 9;
12826
12827}
12828
12829/**
12830 * Reported when a client requests to prepare for resume on reboot.
12831 *
12832 * Logged from:
12833 *   frameworks/base/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
12834 */
12835message RebootEscrowPreparationReported {
12836  enum Result {
12837    ROR_NEED_PREPARATION = 0;
12838    ROR_SKIP_PREPARATION_AND_NOTIFY = 1;
12839    ROR_SKIP_PREPARATION_NOT_NOTIFY = 2;
12840  }
12841
12842  // The uid of the client who requests ror.
12843  optional int32 requesting_uid = 1 [(is_uid) = true];
12844
12845  optional Result result = 2;
12846
12847  // The number of clients who has requested ror, including the current caller.
12848  optional int32 requested_client_count = 3;
12849}
12850
12851/**
12852 * Reported when the lock screen knowledge factor is captured, while there are clients of
12853 * resume on reboot to notify.
12854 *
12855 * Logged from:
12856 *   frameworks/base/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
12857 */
12858message RebootEscrowLskfCaptureReported {
12859  // The uid of the client to notify about the Lskf capture.
12860  optional int32 uid_to_notify = 1 [(is_uid) = true];
12861
12862  // The total number of clients who have requested ror.
12863  optional int32 requested_client_count = 2;
12864
12865  // The duration between RoR request - current LSKF capture event.
12866  optional int32 duration_ror_requested_to_lskf_captured_seconds = 3;
12867}
12868
12869/* Reported when a client (e.g. gmscore) requests to reboot with Resume on Reboot.
12870 *
12871 * Logged from:
12872 *   frameworks/base/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
12873 */
12874message RebootEscrowRebootReported {
12875  optional int32 error_code = 1;
12876
12877  // The uid of clients who requested the reboot
12878  optional int32 request_uid = 2 [(is_uid) = true];
12879
12880  // All clients that have prepared for RoR before this reboot
12881  optional int32 prepared_clients_count = 3;
12882
12883  // The RoR request count for the client who requests reboot.
12884  optional int32 request_count = 4;
12885
12886  // Whether the reboot request assumes a slot switch on a/b devices.
12887  optional bool slot_switch = 5;
12888
12889  // True if the DeviceConfig shows the device is using server based RoR.
12890  optional bool server_based = 6;
12891
12892  // The duration between last LSKF captured - reboot requests
12893  optional int32 duration_lskf_captured_to_reboot_seconds = 7;
12894
12895  // The count of LSKF captured since preparation
12896  optional int32 lskf_captured_counts = 8;
12897}
12898
12899/**
12900 * Logs stats for AppSearch function calls
12901 */
12902message AppSearchCallStatsReported {
12903    // The sampling interval for this specific type of stats
12904    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
12905    optional int32 sampling_interval = 1;
12906
12907    // # of previous skipped sample for this specific type of stats
12908    // We can't push atoms too closely, so some samples might be skipped
12909    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
12910    // For example, the true count of an event could be estimated as:
12911    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
12912    optional int32 num_skipped_sample = 2;
12913
12914    // Package UID of the application.
12915    optional int32 uid = 3 [(is_uid) = true];
12916
12917    // Hash of the database name within AppSearch
12918    optional int32 database = 4;
12919
12920    // The status code for the call or internal state.
12921    // Needs to be sync with AppSearchResult#ResultCode in
12922    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
12923    optional int32 status_code = 5;
12924
12925    // Overall time used for the end-to-end function call in AppSearch.
12926    // It doesn't include binder latency
12927    optional int32 total_latency_millis = 6;
12928
12929    // Type of the function call value is in sync with
12930    // frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/stats/CallStats.java
12931    optional int32 call_type = 7;
12932
12933    // Estimated binder latency (estimated as single-trip time * 2)
12934    optional int32 estimated_binder_latency_millis = 8;
12935
12936    // Number of operations succeeded for batch operations.
12937    optional int32 num_operations_succeeded = 9;
12938
12939    // Number of operations failed for batch operations.
12940    optional int32 num_operations_failed = 10;
12941
12942    // Number of actual API calls reported in this atom.
12943    optional int32 num_reported_calls = 11;
12944}
12945
12946/**
12947 * Logs detailed stats for putting a single document in AppSearch
12948 */
12949message AppSearchPutDocumentStatsReported {
12950    // The sampling interval for this specific type of stats
12951    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
12952    optional int32 sampling_interval = 1;
12953
12954    // # of previous skipped sample for this specific type of stats
12955    // We can't push atoms too closely, so some samples might be skipped
12956    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
12957    // For example, the true count of an event could be estimated as:
12958    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
12959    optional int32 num_skipped_sample = 2;
12960
12961    // Package UID of the application.
12962    optional int32 uid = 3 [(is_uid) = true];
12963
12964    // Hash of the database name within AppSearch
12965    optional int32 database = 4;
12966
12967    // Needs to be sync with AppSearchResult#ResultCode in
12968    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
12969    optional int32 status_code = 5;
12970
12971    // Overall time used for a put_document
12972    optional int32 total_latency_millis = 6;
12973
12974    // Time used to generate a document proto from a Bundle.
12975    optional int32 generate_document_proto_latency_millis = 7;
12976
12977    // Time used to rewrite types and namespaces in the document.
12978    optional int32 rewrite_document_types_latency_millis = 8;
12979
12980    // Overall time used for the native function call.
12981    optional int32 native_latency_millis = 9;
12982
12983    // Time used to store the document.
12984    optional int32 native_document_store_latency_millis = 10;
12985
12986    // Time used to index the document. It doesn't include the time to
12987    // merge indices.
12988    optional int32 native_index_latency_millis = 11;
12989
12990    // Time used to merge the indices.
12991    optional int32 native_index_merge_latency_millis = 12;
12992
12993    // Document size in bytes.
12994    optional int32 native_document_size_bytes = 13;
12995
12996    // Number of tokens added to the index.
12997    optional int32 native_num_tokens_indexed = 14;
12998
12999    // Whether the max number of tokens exceeded.
13000    optional bool native_exceeded_max_num_tokens = 15;
13001}
13002
13003/**
13004 * Logs detailed stats for AppSearch Initialize
13005 */
13006message AppSearchInitializeStatsReported {
13007    // The sampling interval for this specific type of stats
13008    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
13009    optional int32 sampling_interval = 1;
13010
13011    // # of previous skipped sample for this specific type of stats
13012    // We can't push atoms too closely, so some samples might be skipped
13013    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
13014    // For example, the true count of an event could be estimated as:
13015    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
13016    optional int32 num_skipped_sample = 2;
13017
13018    // Package UID of the application.
13019    optional int32 uid = 3 [(is_uid) = true];
13020
13021    // Initialize status code
13022    // Needs to be sync with AppSearchResult#ResultCode in
13023    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13024    optional int32 status_code = 4;
13025
13026    // Overall time used for initialization, not including binder latency.
13027    optional int32 total_latency_millis = 5;
13028
13029    // Whether the initialize() detects desyncs.
13030    // Desync happens if we lose the visibility doc.
13031    optional bool has_desync = 6;
13032
13033    // Time used to read and process the schema and namespaces.
13034    optional int32 prepare_schema_and_namespaces_latency_millis = 7;
13035
13036    // Time used to read and process the visibility file.
13037    optional int32 prepare_visibility_file_latency_millis = 8;
13038
13039    // Overall time used for the native function call.
13040    optional int32 native_latency_millis = 9;
13041
13042    // Needs to be sync with RecoveryCause in google3/third_party/icing/proto/logging.proto
13043    optional int32 native_document_store_recovery_cause = 10;
13044
13045    // Needs to be sync with RecoveryCause in google3/third_party/icing/proto/logging.proto
13046    optional int32 native_index_restoration_cause = 11;
13047
13048    // Needs to be sync with RecoveryCause in google3/third_party/icing/proto/logging.proto
13049    optional int32 native_schema_store_recovery_cause = 12;
13050
13051    // Time used to recover the document store.
13052    optional int32 native_document_store_recovery_latency_millis = 13;
13053
13054    // Time used to restore the index.
13055    optional int32 native_index_restoration_latency_millis = 14;
13056
13057    // Time used to recover the schema store.
13058    optional int32 native_schema_store_recovery_latency_millis = 15;
13059
13060    // Needs to be sync with DocumentStoreDataStatus in google3/third_party/icing/proto/logging.proto
13061    optional int32 native_document_store_data_status = 16;
13062
13063    // Number of documents currently in document store. Those may
13064    // include alive, deleted, and expired documents.
13065    optional int32 native_num_documents = 17;
13066
13067    // Number of schema types currently in the schema store.
13068    optional int32 native_num_schema_types = 18;
13069
13070    // Whether we had to reset the index, losing all data, during initialization.
13071    optional bool has_reset = 19;
13072
13073    // The status code of the reset operation if has_reset is true.
13074    // Needs to be sync with AppSearchResult#ResultCode in
13075    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13076    optional int32 reset_status_code = 20;
13077}
13078
13079/**
13080 * Logs detailed stats for querying in AppSearch
13081 *
13082 * Next tag: 33
13083 */
13084message AppSearchQueryStatsReported {
13085    // The sampling interval for this specific type of stats
13086    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
13087    optional int32 sampling_interval = 1;
13088
13089    // # of previous skipped sample for this specific type of stats
13090    // We can't push atoms too closely, so some samples might be skipped
13091    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
13092    // For example, the true count of an event could be estimated as:
13093    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
13094    optional int32 num_skipped_sample = 2;
13095
13096    // Package UID of the application.
13097    optional int32 uid = 3 [(is_uid) = true];
13098
13099    // Hash of the database name within AppSearch
13100    optional int32 database = 4;
13101
13102    // Needs to be sync with AppSearchResult#ResultCode in
13103    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13104    optional int32 status_code = 5;
13105
13106    // Overall time used for query which doesn't include estimated binder latency
13107    optional int32 total_latency_millis = 6;
13108
13109    // Time used to rewrite the search spec.
13110    optional int32 rewrite_search_spec_latency_millis = 7;
13111
13112    // Time used to rewrite the search results.
13113    optional int32 rewrite_search_result_latency_millis = 8;
13114
13115    // Whether it is a global query.
13116    // Needs to be sync with QueryStats#VisibilityScope in
13117    // frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/stats/QueryStats.java
13118    optional int32 visibility_scope = 9;
13119
13120    // Overall time used for the native function call.
13121    optional int32 native_latency_millis = 10;
13122
13123    // Number of terms in the query string.
13124    optional int32 native_num_terms = 11;
13125
13126    // Length of the query string.
13127    optional int32 native_query_length = 12;
13128
13129    // Number of namespaces filtered.
13130    optional int32 native_num_namespaces_filtered = 13;
13131
13132    // Number of schema types filtered.
13133    optional int32 native_num_schema_types_filtered = 14;
13134
13135    // The requested number of results in one page.
13136    optional int32 native_requested_page_size = 15;
13137
13138    // The actual number of results returned in the current page.
13139    optional int32 native_num_results_returned_current_page = 16;
13140
13141    // Whether the function call is querying the first page. If it's
13142    // not, Icing will fetch the results from cache so that some steps
13143    // may be skipped.
13144    optional bool native_is_first_page = 17;
13145
13146    // Time used to parse the query, including 2 parts: tokenizing and
13147    // transforming tokens into an iterator tree.
13148    optional int32 native_parse_query_latency_millis = 18;
13149
13150    // Strategy of scoring and ranking.
13151    // Needs to be sync with RankingStrategy.Code in google3/third_party/icing/proto/scoring.proto
13152    optional int32 native_ranking_strategy = 19;
13153
13154    // Number of documents scored.
13155    optional int32 native_num_documents_scored = 20;
13156
13157    // Time used to score the raw results.
13158    optional int32 native_scoring_latency_millis = 21;
13159
13160    // Time used to rank the scored results.
13161    optional int32 native_ranking_latency_millis = 22;
13162
13163    // Time used to fetch the document protos. Note that it includes the
13164    // time to snippet if "native_num_results_with_snippets" is NOT zero.
13165    optional int32 native_document_retrieval_latency_millis = 23;
13166
13167    // How many snippets are calculated.
13168    optional int32 native_num_results_with_snippets = 24;
13169
13170    // Time passed while waiting to acquire the lock during Java function calls.
13171    optional int32 java_lock_acquisition_latency_millis = 25;
13172
13173    // Time spent on ACL checking. This is the time spent filtering namespaces
13174    // based on package permissions and Android permission access.
13175    optional int32 acl_check_latency_millis = 26;
13176
13177    // Time passed while waiting to acquire the lock during native function calls.
13178    optional int32 native_lock_acquisition_latency_millis = 27;
13179
13180    // Time used to send data across the JNI boundary from java to native side.
13181    optional int32 java_to_native_jni_latency_millis = 28;
13182
13183    // Time used to send data across the JNI boundary from native to java side.
13184    optional int32 native_to_java_jni_latency_millis = 29;
13185
13186    // The type of the join query.
13187    //
13188    // Needs to be sync with AppSearchSchema#JoinableValueType in
13189    // packages/modules/AppSearch/framework/java/external/android/app/appsearch/AppSearchSchema.java
13190    optional int32 join_type = 30;
13191
13192    // How many total documents were joined to the parent documents.
13193    optional int32 native_num_joined_results_current_page = 31;
13194
13195    // Time taken to join child documents to parent documents.
13196    optional int32 native_join_latency_millis = 32;
13197}
13198
13199/**
13200 * Logs detailed stats for remove in AppSearch
13201 */
13202message AppSearchRemoveStatsReported {
13203    // The sampling interval for this specific type of stats
13204    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
13205    optional int32 sampling_interval = 1;
13206
13207    // # of previous skipped sample for this specific type of stats
13208    // We can't push atoms too closely, so some samples might be skipped
13209    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
13210    // For example, the true count of an event could be estimated as:
13211    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
13212    optional int32 num_previous_skipped_sample = 2;
13213
13214    // Package UID of the application.
13215    optional int32 uid = 3 [(is_uid) = true];
13216
13217    // Hash of the database name within AppSearch
13218    optional int32 database = 4;
13219
13220    // Needs to be sync with AppSearchResult#ResultCode in
13221    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13222    optional int32 status_code = 5;
13223
13224    // Overall time used for remove including the binder latency
13225    optional int32 total_latency_millis = 6;
13226
13227    // Overall time used for the native function call.
13228    optional int32 native_latency_millis = 7;
13229
13230    // Used to indicate what kind of delete(namespace, schemaType etc) calls deleteByQuery here.
13231    // Needs to be sync with external/icing/proto/icing/proto/logging.proto#DeleteStatsProto
13232    optional int32 native_delete_type = 8;
13233
13234    // Number of documents deleted by this call.
13235    optional int32 native_num_documents_deleted = 9;
13236}
13237
13238/**
13239 * Logs detailed stats for optimization in AppSearch.
13240 *
13241 * stats pushed from:
13242 *   frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
13243 *
13244 * Next tag: 14
13245 */
13246message AppSearchOptimizeStatsReported {
13247    // The sampling interval for this specific type of stats
13248    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
13249    optional int32 sampling_interval = 1;
13250
13251    // # of previous skipped sample for this specific type of stats
13252    // We can't push atoms too closely, so some samples might be skipped
13253    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
13254    // For example, the true count of an event could be estimated as:
13255    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
13256    optional int32 num_previous_skipped_sample = 2;
13257
13258    // Needs to be sync with AppSearchResult#ResultCode in
13259    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13260    optional int32 status_code = 3;
13261
13262    // Overall time used for remove including the binder latency
13263    optional int32 total_latency_millis = 4;
13264
13265    // Overall time used for the native function call.
13266    optional int32 native_latency_millis = 5;
13267
13268    // Time used to optimize the document store in millis.
13269    optional int32 native_document_store_optimize_latency_millis = 6;
13270
13271    // Time used to restore the index in millis.
13272    optional int32 native_index_restoration_latency_millis = 7;
13273
13274    // Number of documents before the optimization.
13275    optional int32 native_num_original_documents = 8;
13276
13277    // Number of documents deleted during the optimization.
13278    optional int32 native_num_deleted_documents = 9;
13279
13280    // Number of documents expired during the optimization.
13281    optional int32 native_num_expired_documents = 10;
13282
13283    // Size of storage in bytes before the optimization.
13284    optional int64 native_storage_size_before_bytes = 11;
13285
13286    // Size of storage in bytes after the optimization.
13287    optional int64 native_storage_size_after_bytes = 12;
13288
13289    // The amount of time in millis since the last optimization ran.
13290    optional int64 native_time_since_last_optimize_millis = 13;
13291}
13292
13293/**
13294 * Logs detailed stats for setting schema in AppSearch.
13295 *
13296 * stats pushed from:
13297 *   frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
13298 *
13299 * Next tag: 26
13300 */
13301message AppSearchSetSchemaStatsReported {
13302    // The sampling interval for this specific type of stats
13303    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
13304    optional int32 sampling_interval = 1;
13305
13306    // # of previous skipped sample for this specific type of stats
13307    // We can't push atoms too closely, so some samples might be skipped
13308    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
13309    // For example, the true count of an event could be estimated as:
13310    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
13311    optional int32 num_skipped_sample = 2;
13312
13313    // Package UID of the application.
13314    optional int32 uid = 3 [(is_uid) = true];
13315
13316    // Hash of the database name within AppSearch
13317    optional int32 database = 4;
13318
13319    // Needs to be sync with AppSearchResult#ResultCode in
13320    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
13321    optional int32 status_code = 5;
13322
13323    // Overall time used for setting schema including the binder latency
13324    optional int32 total_latency_millis = 6;
13325
13326    // Number of newly added schema types
13327    optional int32 new_type_count = 7;
13328
13329    // Number of deleted schema types
13330    optional int32 deleted_type_count = 8;
13331
13332    // Number of compatible schema type changes
13333    optional int32 compatible_type_change_count = 9;
13334
13335    // Number of index-incompatible schema type changes
13336    optional int32 index_incompatible_type_change_count = 10;
13337
13338    // Number of backwards-incompatible schema type changes
13339    optional int32 backwards_incompatible_type_change_count = 11;
13340
13341    // Time used for verifying the incoming call.
13342    optional int32  verify_incoming_call_latency_millis = 12;
13343
13344    // Time used for creating or waiting the user executor.
13345    optional int32  executor_acquisition_latency_millis = 13;
13346
13347    // Time used for rebuilding objects from bundles.
13348    optional int32  rebuild_from_bundle_latency_millis = 14;
13349
13350    // Time passed while waiting to acquire the lock during Java function calls.
13351    optional int32  java_lock_acquisition_latency_millis = 15;
13352
13353    // Time used for the rewrite schema to proto.
13354    optional int32  rewrite_schema_latency_millis = 16;
13355
13356    // Overall time used for the native function call.
13357    optional int32  total_native_latency_millis = 17;
13358
13359    // Time used for the apply visibility settings function call.
13360    optional int32  visibility_setting_latency_millis = 18;
13361
13362    // Time used for the dispatch change notification function call.
13363    optional int32  dispatch_change_notifications_latency_millis = 19;
13364
13365    // Time used for the optimization function call.
13366    optional int32  mOptimize_latency_millis = 20;
13367
13368    /** Whether this package is observed. */
13369    optional bool is_package_observed = 21;
13370
13371    /** Time used for the get old schema. */
13372    optional int32  get_old_schema_latency_millis = 22;
13373
13374    /** Time used for the get registered observer function call. */
13375    optional int32  get_observer_latency_millis = 23;
13376
13377    /** Time used for the preparing change notification action. */
13378    optional int32  preparing_change_notification_latency_millis = 24;
13379
13380    // Type of the SetSchema call relative to SchemaMigration case.
13381    // This is in sync with
13382    // packages/modules/AppSearch/service/java/com/android/server/appsearch/external/localstorage/stats/SetSchemaStats.java
13383    optional int32 schema_migration_call_type = 25;
13384}
13385
13386/**
13387 * Logs detailed stats for schema migration in AppSearch.
13388 *
13389 * stats pushed from:
13390 *   packages/modules/AppSearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
13391 *
13392 * Next tag: 15
13393 */
13394message AppSearchSchemaMigrationStatsReported {
13395    // The sampling interval for this specific type of stats
13396    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
13397    optional int32 sampling_interval = 1;
13398
13399    // # of previous skipped sample for this specific type of stats
13400    // We can't push atoms too closely, so some samples might be skipped
13401    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
13402    // For example, the true count of an event could be estimated as:
13403    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
13404    optional int32 num_skipped_sample = 2;
13405
13406    // Package UID of the application.
13407    optional int32 uid = 3 [(is_uid) = true];
13408
13409    // Hash of the database name within AppSearch
13410    optional int32 database = 4;
13411
13412    // Needs to be sync with AppSearchResult#ResultCode in
13413    // packages/modules/AppSearch/framework/java/external/android/app/appsearch/AppSearchResult.java
13414    optional int32 status_code = 5;
13415
13416    // Overall time used for setting schema including the binder latency
13417    optional int32 total_latency_millis = 6;
13418
13419    // Overall time used for getting schema during schema migration
13420    optional int32 schema_migration_get_schema_latency_millis = 7;
13421
13422    // Overall time used for querying and transforming documents during schema migration
13423    optional int32 schema_migration_query_and_transform_latency_millis = 8;
13424
13425    // Overall time used for first setSchema during schema migration
13426    optional int32 schema_migration_first_set_schema_latency_millis = 9;
13427
13428    // Overall time used for second setSchema during schema migration
13429    optional int32 schema_migration_second_set_schema_latency_millis = 10;
13430
13431    // Overall time used for saving documents during schema migration
13432    optional int32 schema_migration_save_document_latency_millis = 11;
13433
13434    // Number of document that need to be migrated to another version
13435    optional int32 total_need_migrated_document_count = 12;
13436
13437    // Number of successfully migrated and saved in Icing
13438    optional int32 total_success_migrated_document_count = 13;
13439
13440    // Number of migration failure during schema migration
13441    optional int32 schema_migration_failure_count = 14;
13442}
13443
13444// Reports information in external/icing/proto/icing/proto/storage.proto#DocumentStorageInfoProto
13445// Next tag: 15
13446message AppSearchDocumentStorageInfo {
13447    // Total number of alive documents.
13448    optional int32 num_alive_documents = 1;
13449
13450    // Total number of deleted documents.
13451    optional int32 num_deleted_documents = 2;
13452
13453    // Total number of expired documents.
13454    optional int32 num_expired_documents = 3;
13455
13456    // Total size of the document store in bytes. Will be set to -1 if an IO error
13457    // is encountered while calculating this field.
13458    optional int64 document_store_size_bytes = 4;
13459
13460    // Total size of the ground truth in bytes. The ground truth may
13461    // include deleted or expired documents. Will be set to -1 if an IO error is
13462    // encountered while calculating this field.
13463    optional int64 document_log_size_bytes = 5;
13464
13465    // Size of the key mapper in bytes. Will be set to -1 if an IO error is
13466    // encountered while calculating this field.
13467    optional int64 key_mapper_size_bytes = 6;
13468
13469    // Size of the document id mapper in bytes. Will be set to -1 if an IO error
13470    // is encountered while calculating this field.
13471    optional int64 document_id_mapper_size_bytes = 7;
13472
13473    // Size of the score cache in bytes. Will be set to -1 if an IO error is
13474    // encountered while calculating this field.
13475    optional int64 score_cache_size_bytes = 8;
13476
13477    // Size of the filter cache in bytes. Will be set to -1 if an IO error is
13478    // encountered while calculating this field.
13479    optional int64 filter_cache_size_bytes = 9;
13480
13481    // Size of the corpus mapper in bytes. Will be set to -1 if an IO error is
13482    // encountered while calculating this field.
13483    optional int64 corpus_mapper_size_bytes = 10;
13484
13485    // Size of the corpus score cache in bytes. Will be set to -1 if an IO error
13486    // is encountered while calculating this field.
13487    optional int64 corpus_score_cache_size_bytes = 11;
13488
13489    // Size of the namespace id mapper in bytes. Will be set to -1 if an IO error
13490    // is encountered while calculating this field.
13491    optional int64 namespace_id_mapper_size_bytes = 12;
13492
13493    // Number of namespaces seen from the current documents.
13494    optional int32 num_namespaces = 13;
13495
13496    // Storage information of each namespace is not included due to that it has string field.
13497
13498    reserved 14;
13499}
13500
13501// Reports information in external/icing/proto/icing/proto/storage.proto#SchemaStoreStorageInfoProto
13502// Next tag: 5
13503message AppSearchSchemaStoreStorageInfo {
13504    // Size of the schema store in bytes. Will be set to -1 if an IO error is
13505    // encountered while calculating this field.
13506    optional int64 schema_store_size_bytes = 1;
13507
13508    // Total number of schema types.
13509    optional int32 num_schema_types = 2;
13510
13511    // Total number of all sections across all types
13512    optional int32 num_total_sections = 3;
13513
13514    // Total number of types at the current section limit.
13515    optional int32 num_schema_types_sections_exhausted = 4;
13516}
13517
13518// Reports information in external/icing/proto/icing/proto/storage.proto#IndexStorageInfoProto
13519// Next tag: 9
13520message AppSearchIndexStorageInfo {
13521    // Total size of the index in bytes. Will be set to -1 if an IO error is
13522    // encountered while calculating this field.
13523    optional int64 index_size_bytes = 1;
13524
13525    // Size of the lite index lexicon in bytes. Will be set to -1 if an IO error
13526    // is encountered while calculating this field.
13527    optional int64 lite_index_lexicon_size_bytes = 2;
13528
13529    // Size of the lite index hit buffer in bytes. Will be set to -1 if an IO
13530    // error is encountered while calculating this field.
13531    optional int64 lite_index_hit_buffer_size_bytes = 3;
13532
13533    // Size of the main index lexicon in bytes. Will be set to -1 if an IO error
13534    // is encountered while calculating this field.
13535    optional int64 main_index_lexicon_size_bytes = 4;
13536
13537    // Size of the main index storage in bytes. Will be set to -1 if an IO error
13538    // is encountered while calculating this field.
13539    optional int64 main_index_storage_size_bytes = 5;
13540
13541    // Size of one main index block in bytes.
13542    optional int64 main_index_block_size_bytes = 6;
13543
13544    // Number of main index blocks.
13545    optional int32 num_blocks = 7;
13546
13547    // Percentage of the main index blocks that are free, assuming
13548    // allocated blocks are fully used.
13549    optional float min_free_fraction = 8;
13550}
13551
13552/**
13553 * Pulls information about storage information per user from AppSearch
13554 *
13555 * Pulled from:
13556 *   frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
13557 *
13558 * Next tag: 6
13559 */
13560message AppSearchStorageInfo {
13561    // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
13562    // This is mainly used as a dimension for the metric, but it can also tell us if
13563    // the StorageInfo is for a primary user or secondary user.
13564    optional int32 user = 1;
13565
13566    // Total size of Icing’s storage in bytes. Will be set to -1 if an IO error is
13567    // encountered while calculating this field.
13568    optional int64 total_storage_size_bytes = 2;
13569
13570    // Storage information of the document store.
13571    optional AppSearchDocumentStorageInfo document_storage_info = 3
13572        [(android.os.statsd.log_mode) = MODE_BYTES];
13573
13574    // Storage information of the schema store.
13575    optional AppSearchSchemaStoreStorageInfo schema_store_storage_info = 4
13576        [(android.os.statsd.log_mode) = MODE_BYTES];
13577
13578    // Storage information of the index.
13579    optional AppSearchIndexStorageInfo index_storage_info = 5
13580        [(android.os.statsd.log_mode) = MODE_BYTES];
13581}
13582
13583
13584/**
13585 * Reported when AppSearch Contacts Indexer syncs the contacts data from CP2 to AppSearch
13586 *
13587 * Reported from:
13588 *   packages/modules/AppSearch/service/java/com/android/server/appsearch/contactsindexer/ContactsIndexerManagerService.java
13589 *
13590 * Next tag: 11
13591 */
13592message ContactsIndexerUpdateStatsReported {
13593    enum UpdateType {
13594      UNKNOWN = 0;
13595      DELTA = 1;
13596      FULL = 2;
13597    }
13598
13599    // Type of the update
13600    optional UpdateType update_type = 1;
13601
13602    // Latency for the update in millis
13603    optional int32 total_latency_millis = 2;
13604
13605    // Status code to indicate whether the insert new contacts, or update
13606    // existing contacts succeeds, or fails and why
13607    // In case of success, it only contains OK.
13608    // In case of failures, it contains all the possible errors we get.
13609    repeated int32 update_status_codes = 3;
13610
13611    // Status code to indicate whether the delete succeeds, or fails and why
13612    // In case of success, it only contains OK.
13613    // In case of failures, it contains all the possible errors we get.
13614    repeated int32 delete_status_codes = 4;
13615
13616    // Number of new contacts to be updated.
13617    optional int32 number_of_new_contacts_to_be_updated = 5;
13618
13619    // Number of old and new contacts has been successfully updated.
13620    optional int32 number_of_contacts_update_succeeded = 6;
13621
13622    // Number of old contacts has been successfully deleted.
13623    optional int32 number_of_contacts_delete_succeeded = 7;
13624
13625    // Number of old contacts skipped during this update due to no
13626    // significant change.
13627    optional int32 number_of_contacts_update_skipped = 8;
13628
13629    // Number of old and new contacts failed to be updated
13630    optional int32 number_of_contacts_update_failed = 9;
13631
13632    // Number of old contacts failed to be deleted
13633    optional int32 number_of_contacts_delete_failed = 10;
13634}
13635
13636/**
13637 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
13638 * key to indicate whether it was successful or not.
13639 *
13640 * Logged from:
13641 *   frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
13642 */
13643message RebootEscrowRecoveryReported {
13644    // Type of the resume on reboot backend provider.
13645    enum ServiceType {
13646        UNKNOWN = 0;
13647        HAL = 1;
13648        SERVER_BASED = 2;
13649    }
13650
13651    // Whether the vbmeta digest of the current slot matches a precomputed value before reboot.
13652    enum VbmetaDigestStatus {
13653        MATCH_EXPECTED_SLOT = 0;
13654        MATCH_FALLBACK_SLOT = 1;
13655        MISMATCH = 2;
13656    }
13657
13658    optional bool successful = 1;
13659    // The error code for escrow data recovery failure
13660    optional int32 error_code = 2;
13661
13662    optional ServiceType type = 3;
13663
13664    // Number of retries to unwrap the escrow key asynchronously.
13665    optional int32 get_escrow_key_retry_count = 4;
13666
13667    // The duration between storing of reboot escrow key ->
13668    // use of reboot escrow key to unlock CE after reboot
13669    optional int32 duration_escrow_key_storage_to_unlock_seconds = 5;
13670
13671    optional VbmetaDigestStatus vbmeta_digest_status = 6;
13672
13673    // The duration between boot complete -> CE unlock
13674    optional int32 duration_boot_complete_to_unlock_seconds = 7;
13675}
13676
13677/**
13678 * Global display pipeline metrics reported by SurfaceFlinger.
13679 * Metrics exist beginning in Android 11.
13680 * There is a copy of this proto in timestats_atoms.proto in SurfaceFlinger.
13681 * That proto must be updated if this atom is updated.
13682 *
13683 * Pulled from:
13684 *    frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
13685 */
13686message SurfaceflingerStatsGlobalInfo {
13687    // Aggregated refresh rate buckets that layers were presenting at. Buckets
13688    // are defined in SurfaceFlinger and are tracked per device.
13689    // Introduced in Android 12.
13690    // This is intended to be used as a dimenstion in collecting per-refresh rate
13691    // jank statistics.
13692    optional int32 display_refresh_rate_bucket = 18;
13693    // Aggregated render rate buckets that layers were overridden to run at.
13694    // Buckets are defined in SurfaceFlinger and are tracked per device.
13695    // Introduced in Android 12.
13696    // This is intended to be used as a dimension in collecting per-render rate
13697    // jank statistics.
13698    optional int32 render_rate_bucket = 21;
13699    // Total number of frames presented during the tracing period
13700    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13701    // using render_rate_bucket as a dimension.
13702    optional int64 total_frames = 1;
13703    // Total number of frames missed
13704    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13705    // using render_rate_bucket as a dimension.
13706    optional int64 missed_frames = 2;
13707    // Total number of frames that fell back to client composition
13708    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13709    // using render_rate_bucket as a dimension.
13710    optional int64 client_composition_frames = 3;
13711    // Total time the display was turned on
13712    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13713    // using render_rate_bucket as a dimension.
13714    optional int64 display_on_millis = 4;
13715    // Total time that was spent performing animations.
13716    // This is derived from the present-to-present layer histogram.
13717    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13718    // using render_rate_bucket as a dimension.
13719    optional int64 animation_millis = 5;
13720    // Total number of event connections tracked by SurfaceFlinger at the time
13721    // of this pull. If this number grows prohibitively large, then this can
13722    // cause jank due to resource contention.
13723    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13724    // using render_rate_bucket as a dimension.
13725    optional int32 event_connection_count = 6;
13726    // Set of timings measured from when SurfaceFlinger began compositing a
13727    // frame, until the frame was requested to be presented to the display. This
13728    // measures SurfaceFlinger's total CPU walltime on the critical path per
13729    // frame.
13730    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13731    // using render_rate_bucket as a dimension.
13732    optional FrameTimingHistogram frame_duration = 7
13733        [(android.os.statsd.log_mode) = MODE_BYTES];
13734    // Set of timings measured from when SurfaceFlinger first began using the
13735    // GPU to composite a frame, until the GPU has finished compositing that
13736    // frame. This measures the total additional time SurfaceFlinger needed to
13737    // perform due to falling back into GPU composition.
13738    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13739    // using render_rate_bucket as a dimension.
13740    optional FrameTimingHistogram render_engine_timing = 8
13741        [(android.os.statsd.log_mode) = MODE_BYTES];
13742    // Number of frames where SF saw a frame, based on its frame timeline.
13743    // Frame timelines may include transactions without updating buffer contents.
13744    // Introduced in Android 12.
13745    optional int32 total_timeline_frames = 9;
13746    // Number of frames where SF saw a janky frame.
13747    // Introduced in Android 12.
13748    optional int32 total_janky_frames = 10;
13749    // Number of janky frames where SF spent a long time on the CPU.
13750    // Introduced in Android 12.
13751    optional int32 total_janky_frames_with_long_cpu = 11;
13752    // Number of janky frames where SF spent a long time on the GPU.
13753    // Introduced in Android 12.
13754    optional int32 total_janky_frames_with_long_gpu = 12;
13755    // Number of janky frames where SF missed the frame deadline, but there
13756    // was not an attributed reason (e.g., maybe HWC missed?)
13757    // Introduced in Android 12.
13758    optional int32 total_janky_frames_sf_unattributed = 13;
13759    // Number of janky frames where the app missed the frame deadline, but
13760    // there was not an attributed reason
13761    // Introduced in Android 12.
13762    optional int32 total_janky_frames_app_unattributed = 14;
13763    // Number of janky frames that were caused because of scheduling errors in
13764    // SF that resulted in early present (e.g., SF sending a buffer to the
13765    // composition engine earlier than expected, resulting in a present that is
13766    // one vsync early)
13767    // Introduced in Android 12.
13768    optional int32 total_janky_frames_sf_scheduling = 15;
13769    // Number of frames that were classified as jank because of possible drift in
13770    // vsync predictions.
13771    // Introduced in Android 12.
13772    optional int32 total_jank_frames_sf_prediction_error = 16;
13773    // Number of janky frames where the app was in a buffer stuffed state (more
13774    // than one buffer ready to be presented at the same vsync). Usually caused
13775    // when the first frame is unusually long, the following frames enter into a
13776    // stuffed state.
13777    // Introduced in Android 12.
13778    optional int32 total_jank_frames_app_buffer_stuffing = 17;
13779    // Buckets of timings in ms by which SurfaceFlinger's deadline was missed
13780    // while latching and presenting frames.
13781    // Introduced in Android 12.
13782    optional FrameTimingHistogram sf_deadline_misses = 19
13783        [(android.os.statsd.log_mode) = MODE_BYTES];
13784    // Buckets of timings in ms by which the Vsync prediction drifted, when
13785    // compared to the actual hardware vsync.
13786    // Introduced in Android 12.
13787    optional FrameTimingHistogram sf_prediction_errors = 20
13788        [(android.os.statsd.log_mode) = MODE_BYTES];
13789
13790    // Next ID: 22
13791}
13792
13793/**
13794 * Per-layer display pipeline metrics reported by SurfaceFlinger.
13795 * Metrics exist beginning in Android 11.
13796 * The number of layers uploaded may be restricted due to size limitations.
13797 * There is a copy of this proto in timestats_atoms.proto in SurfaceFlinger.
13798 * That proto must be updated if this atom is updated.
13799 *
13800 * Pulled from:
13801 *    frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
13802 */
13803message SurfaceflingerStatsLayerInfo {
13804    // UID of the application who submitted this layer for presentation
13805    // This is intended to be used as a dimension for surfacing rendering
13806    // statistics to applications.
13807    // Introduced in Android 12.
13808    optional int32 uid = 12 [(is_uid) = true];
13809    // Refresh rate bucket that the layer was presenting at. Buckets are
13810    // defined in SurfaceFlinger and are tracked per device.
13811    // Introduced in Android 12.
13812    // This is intended to be used as a dimension in collecting per-refresh rate
13813    // jank statistics
13814    optional int32 display_refresh_rate_bucket = 22;
13815    // Render rate bucket that the layer was submitting frames at. Buckets are
13816    // defined in SurfaceFlinger and are tracked per device.
13817    // Introduced in Android 12.
13818    // This is intended to be used as a dimension in collecting per-render rate
13819    // jank statistics.
13820    optional int32 render_rate_bucket = 23;
13821
13822    // Game modes are used only for integrating with GameManager.
13823    enum GameMode {
13824         GAME_MODE_UNSPECIFIED = 0;
13825         GAME_MODE_UNSUPPORTED = 1;
13826         GAME_MODE_STANDARD = 2;
13827         GAME_MODE_PERFORMANCE = 3;
13828         GAME_MODE_BATTERY = 4;
13829         GAME_MODE_CUSTOM = 5;
13830    }
13831
13832    // Game mode that the layer was running at. Used to track user engagement
13833    // in different modes. The modes are defined in GameManager.java
13834    // All non-game layers will have this field set to UNSUPPORTED.
13835    // Introduced in Android 12
13836    // This is intended to be used as a dimension in collecting per-game mode
13837    // fps and frame related metrics.
13838    optional GameMode game_mode = 26;
13839    // The layer for this set of metrics
13840    // In many scenarios the package name is included in the layer name, e.g.,
13841    // layers created by Window Manager. But this is not a guarantee - in the
13842    // general case layer names are arbitrary debug names.
13843    optional string layer_name = 1;
13844    // Total number of frames presented
13845    optional int64 total_frames = 2;
13846    // Total number of dropped frames while latching a buffer for this layer.
13847    optional int64 dropped_frames = 3;
13848    // Set of timings measured between successive presentation timestamps.
13849    optional FrameTimingHistogram present_to_present = 4
13850        [(android.os.statsd.log_mode) = MODE_BYTES];
13851    // Variability histogram of present_to_present timings.
13852    optional FrameTimingHistogram present_to_present_delta = 27
13853        [(android.os.statsd.log_mode) = MODE_BYTES];
13854    // Set of timings measured from when an app queued a buffer for
13855    // presentation, until the buffer was actually presented to the
13856    // display.
13857    optional FrameTimingHistogram post_to_present = 5
13858        [(android.os.statsd.log_mode) = MODE_BYTES];
13859    // Set of timings measured from when a buffer is ready to be presented,
13860    // until the buffer was actually presented to the display.
13861    optional FrameTimingHistogram acquire_to_present = 6
13862        [(android.os.statsd.log_mode) = MODE_BYTES];
13863    // Set of timings measured from when a buffer was latched by
13864    // SurfaceFlinger, until the buffer was presented to the display
13865    optional FrameTimingHistogram latch_to_present = 7
13866        [(android.os.statsd.log_mode) = MODE_BYTES];
13867    // Set of timings measured from the desired presentation to the actual
13868    // presentation time
13869    optional FrameTimingHistogram desired_to_present = 8
13870        [(android.os.statsd.log_mode) = MODE_BYTES];
13871    // Set of timings measured from when an app queued a buffer for
13872    // presentation, until the buffer was ready to be presented.
13873    optional FrameTimingHistogram post_to_acquire = 9
13874        [(android.os.statsd.log_mode) = MODE_BYTES];
13875    // Frames missed latch because the acquire fence didn't fire
13876    optional int64 late_acquire_frames = 10;
13877    // Frames latched early because the desired present time was bad
13878    optional int64 bad_desired_present_frames = 11;
13879    // Number of frames where SF saw a frame, based on its frame timeline.
13880    // Frame timelines may include transactions without updating buffer contents.
13881    // Introduced in Android 12.
13882    optional int32 total_timeline_frames = 13;
13883    // Number of frames where SF saw a janky frame.
13884    // Introduced in Android 12.
13885    optional int32 total_janky_frames = 14;
13886    // Number of janky frames where SF spent a long time on the CPU.
13887    // Introduced in Android 12.
13888    optional int32 total_janky_frames_with_long_cpu = 15;
13889    // Number of janky frames where SF spent a long time on the GPU.
13890    // Introduced in Android 12.
13891    optional int32 total_janky_frames_with_long_gpu = 16;
13892    // Number of janky frames where SF missed the frame deadline, but there
13893    // was not an attributed reason (e.g., maybe HWC missed?)
13894    // Introduced in Android 12.
13895    optional int32 total_janky_frames_sf_unattributed = 17;
13896    // Number of janky frames where the app missed the frame deadline, but
13897    // there was not an attributed reason
13898    // Introduced in Android 12.
13899    optional int32 total_janky_frames_app_unattributed = 18;
13900    // Number of janky frames that were caused because of scheduling errors in
13901    // SF that resulted in early present (e.g., SF sending a buffer to the
13902    // composition engine earlier than expected, resulting in a present that is
13903    // one vsync early)
13904    // Introduced in Android 12.
13905    optional int32 total_janky_frames_sf_scheduling = 19;
13906    // Number of frames that were classified as jank because of possible drift in
13907    // vsync predictions.
13908    // Introduced in Android 12.
13909    optional int32 total_jank_frames_sf_prediction_error = 20;
13910    // Number of janky frames where the app was in a buffer stuffed state (more
13911    // than one buffer ready to be presented at the same vsync). Usually caused
13912    // when the first frame is unusually long, the following frames enter into a
13913    // stuffed state.
13914    // Introduced in Android 12.
13915    optional int32 total_jank_frames_app_buffer_stuffing = 21;
13916
13917    /**
13918     * Encapsulates the FrameRateVote information sent by the application while
13919     * calling setFrameRate.
13920     * Metrics exist beginning in Android 12.
13921     */
13922    message SetFrameRateVote {
13923        // The desired frame rate the application wishes to run on.
13924        optional float frame_rate = 1;
13925
13926        enum FrameRateCompatibility {
13927            FRAME_RATE_UNDEFINED = 0;
13928            FRAME_RATE_DEFAULT = 1;
13929            FRAME_RATE_EXACT_OR_MULTIPLE = 2;
13930        }
13931
13932        // Specifies how to interpret the frame rate associated with the layer.
13933        // Defined in Layer.h
13934        optional FrameRateCompatibility frame_rate_compatibility = 2;
13935
13936        enum Seamlessness {
13937            SEAMLESS_UNDEFINED = 0;
13938            SEAMLESS_SHOULD_BE_SEAMLESS = 1;
13939            SEAMLESS_NOT_REQUIRED = 2;
13940        }
13941        // Indicates whether seamless refresh rate switch is required or not.
13942        optional Seamlessness seamlessness = 3;
13943    }
13944
13945    // The last frame rate vote set by the application.
13946    // Introduced in Android 12.
13947    optional SetFrameRateVote set_frame_rate_vote = 24
13948        [(android.os.statsd.log_mode) = MODE_BYTES];
13949    // Buckets of timings in ms by which the app deadline was missed while
13950    // submitting work for a frame.
13951    // Introduced in Android 12.
13952    optional FrameTimingHistogram app_deadline_misses = 25
13953        [(android.os.statsd.log_mode) = MODE_BYTES];
13954
13955    // Next ID: 28
13956}
13957
13958/**
13959 * Histogram of frame counts bucketed by time in milliseconds.
13960 * Because of size limitations, we hard-cap the number of buckets, with
13961 * buckets for corresponding to larger milliseconds being less precise.
13962 */
13963message FrameTimingHistogram {
13964    // Timings in milliseconds that describes a set of histogram buckets
13965    repeated int32 time_millis_buckets = 1;
13966    // Number of frames that match to each time_millis, i.e. the bucket
13967    // contents
13968    // It's required that len(time_millis) == len(frame_count)
13969    repeated int64 frame_counts = 2;
13970}
13971
13972/**
13973 * Janky event as reported by SurfaceFlinger.
13974 * This event is intended to be consumed by a Perfetto subscriber for
13975 * automated trace collection.
13976 *
13977 * Logged from:
13978 *    frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
13979 */
13980message DisplayJankReported {
13981    // Informational field for how long the janky event lasted in milliseconds
13982    optional int64 event_duration_millis = 1;
13983    // Number of frame deadlines missed, where SurfaceFlinger failed to update
13984    // the display on time.
13985    optional int32 present_deadlines_missed = 2;
13986}
13987
13988message CameraStreamProto {
13989    // The stream width (in pixels)
13990    optional int32 width = 1;
13991    // The stream height (in pixels)
13992    optional int32 height = 2;
13993    // The format of the stream
13994    optional int32 format = 3;
13995    // The dataspace of the stream
13996    optional int32 data_space = 4;
13997    // The usage flag of the stream
13998    optional int64 usage = 5;
13999
14000    // The number of requests for this stream
14001    optional int64 request_count = 6;
14002    // The number of buffer error for this stream
14003    optional int64 error_count = 7;
14004    // The capture latency of first request for this stream
14005    optional int32 first_capture_latency_millis = 8;
14006
14007    // The maximum number of hal buffers
14008    optional int32 max_hal_buffers = 9;
14009    // The maximum number of app buffers
14010    optional int32 max_app_buffers = 10;
14011
14012    // Type of stream histogram
14013    // 1: Capture latency: bin size in milliseconds
14014    enum HistogramType {
14015        UNKNOWN = 0;
14016        CAPTURE_LATENCY = 1;
14017    }
14018    optional HistogramType histogram_type = 11;
14019    // The boundary values between histogram bins
14020    // Expected number of fields: 9
14021    repeated float histogram_bins = 12;
14022    // The frame counts for each histogram bins
14023    // Expected number of fields: 10
14024    repeated int64 histogram_counts = 13;
14025    // The dynamic range profile of the stream
14026    optional int64 dynamic_range_profile = 14;
14027    // The stream use case
14028    optional int64 stream_use_case = 15;
14029    // The color space
14030    optional int32 color_space = 16;
14031}
14032
14033/**
14034 * Information about camera facing and API level usage.
14035 * Logged from:
14036 *   frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
14037 */
14038message CameraActionEvent {
14039    // Camera session duration in milliseconds if action is SESSION.
14040    // 0 if action is OPEN or CLOSE.
14041    optional int64 duration_millis = 1;
14042
14043    // Camera API level used.
14044    // 1 for camera1 API, and 2 for camera2 API.
14045    optional int32 api_level = 2;
14046
14047    // Name of client package
14048    optional string package_name = 3;
14049
14050    // Camera facing
14051    enum Facing {
14052        UNKNOWN = 0;
14053        BACK = 1;
14054        FRONT = 2;
14055        EXTERNAL = 3;
14056    }
14057    optional Facing facing = 4;
14058
14059    // Camera ID
14060    optional string camera_id = 5;
14061
14062    // Camera action type
14063    enum Action {
14064        UNKNOWN_ACTION = 0;
14065        OPEN = 1;
14066        CLOSE = 2;
14067        SESSION = 3;
14068    }
14069    optional Action action = 6;
14070
14071    // Whether the client is accessing camera using ndk
14072    optional bool is_ndk = 7;
14073
14074    // Action OPEN: Open latency
14075    // Action CLOSE: Close latency
14076    // Action SESSION: Camera session creation duration.
14077    //                 If this entry is reusing an existing session, the value is -1.
14078    optional int32 latency_millis = 8;
14079
14080    // session type: 0 for normal mode, 1 for constrained high speed mode
14081    optional int32 operating_mode = 9;
14082
14083    // If actioh is SESSION: number of internal reconfigurations
14084    // Else: 0
14085    optional int32 internal_reconfig = 10;
14086
14087    // Number of requests for this capture session. Only applicable to SESSION
14088    // action.
14089    optional int64 request_count = 11;
14090    // Number of result errors. Only applicable to SESSION action.
14091    optional int64 result_error_count = 12;
14092    // Whether the device runs into error state.
14093    optional bool device_error = 13;
14094
14095    // If action is SESSION: Stream states
14096    // Else: stream_count = 0
14097    optional int32 stream_count = 14;
14098    optional CameraStreamProto stream_1 = 15 [(log_mode) = MODE_BYTES];
14099    optional CameraStreamProto stream_2 = 16 [(log_mode) = MODE_BYTES];
14100    optional CameraStreamProto stream_3 = 17 [(log_mode) = MODE_BYTES];
14101    optional CameraStreamProto stream_4 = 18 [(log_mode) = MODE_BYTES];
14102    optional CameraStreamProto stream_5 = 19 [(log_mode) = MODE_BYTES];
14103
14104    // User tag string for this session
14105    optional string user_tag = 20;
14106
14107    // Video stabilization mode
14108    // Original type: uint8_t
14109    optional int32 video_stabilization_mode = 21 [default = -1];
14110
14111    // Identifier to correlate different Action events to each other
14112    // Not unique. Must be used with build fingerprint to generate a
14113    // good enough identifier.
14114    optional int64 log_id = 22;
14115
14116    // 0 for OPEN and CLOSE
14117    // ordinal of the SESSION between OPEN and CLOSE
14118    optional int32 session_idx = 23;
14119
14120    // Start: Extension metrics.
14121    // These will only be set for SESSION which use camera2 extensions
14122
14123    // Should match CameraExtensionCharacteristics#EXTENSION_*
14124    enum ExtensionSessionType {
14125        EXTENSION_NONE = -1;
14126        EXTENSION_AUTOMATIC = 0;
14127        EXTENSION_FACE_RETOUCH = 1;
14128        EXTENSION_BOKEH = 2;
14129        EXTENSION_HDR = 3;
14130        EXTENSION_NIGHT = 4;
14131
14132    }
14133
14134    // Type of camera extension being used
14135    optional ExtensionSessionType ext_type = 24 [default = EXTENSION_NONE];
14136
14137    // Whether advanced extensions session is being used
14138    optional bool ext_is_advanced = 25;
14139    // End: Extension Metrics
14140}
14141
14142/**
14143 * Logs when a compatibility change is affecting an app.
14144 *
14145 * Logged from:
14146 *   frameworks/base/core/java/android/app/AppCompatCallbacks.java and
14147 *   frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
14148 */
14149message AppCompatibilityChangeReported {
14150    // The UID of the app being affected by the compatibilty change.
14151    optional int32 uid = 1 [(is_uid) = true];
14152
14153    // The ID of the change affecting the app.
14154    optional int64 change_id = 2;
14155
14156    enum State {
14157        UNKNOWN_STATE = 0;
14158        ENABLED = 1;
14159        DISABLED = 2;
14160        LOGGED = 3;
14161    }
14162
14163    // The state of the change - if logged from gating whether it was enabled or disabled, or just
14164    // logged otherwise.
14165    optional State state = 3;
14166
14167    enum Source {
14168        UNKNOWN_SOURCE = 0;
14169        APP_PROCESS = 1;
14170        SYSTEM_SERVER = 2;
14171    }
14172
14173    // Where it was logged from.
14174    optional Source source = 4;
14175
14176}
14177
14178/**
14179 * Logged from
14180 *     external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
14181 *     external/perfetto/src/tracing/service/tracing_service_impl.cc
14182 */
14183message PerfettoUploaded {
14184    // TODO(lalitm): many of the atoms below should be renamed to have a
14185    // "PERFETTO_CMD" prefix to make clear they are specific to perfetto_cmd.
14186    // This state exists because of legacy reasons (i.e. these values existed
14187    // before go/perfetto-monitoring was a thing).
14188    // Next id: 53.
14189    enum Event {
14190        PERFETTO_UNDEFINED = 0;
14191
14192        // Checkpoints inside perfetto_cmd before tracing is finished.
14193        PERFETTO_TRACE_BEGIN = 1;
14194        PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
14195        PERFETTO_ON_CONNECT = 3;
14196
14197        // Guardrails inside perfetto_cmd before tracing is finished.
14198        PERFETTO_ON_TIMEOUT = 16;
14199        PERFETTO_CMD_USER_BUILD_TRACING_NOT_ALLOWED = 43;
14200        PERFETTO_CMD_FAILED_TO_INIT_GUARDRAIL_STATE = 44;
14201        PERFETTO_CMD_INVALID_GUARDRAIL_STATE = 45;
14202        PERFETTO_CMD_HIT_UPLOAD_LIMIT = 46;
14203
14204        // Checkpoints inside traced.
14205        PERFETTO_TRACED_ENABLE_TRACING = 37;
14206        PERFETTO_TRACED_START_TRACING = 38;
14207        PERFETTO_TRACED_DISABLE_TRACING = 39;
14208        PERFETTO_TRACED_NOTIFY_TRACING_DISABLED = 40;
14209
14210        // Trigger checkpoints inside traced.
14211        // These atoms are special because, along with the UUID,
14212        // they log the trigger name.
14213        PERFETTO_TRACED_TRIGGER_START_TRACING = 41;
14214        PERFETTO_TRACED_TRIGGER_STOP_TRACING = 42;
14215
14216        // Guardrails inside traced.
14217        PERFETTO_TRACED_ENABLE_TRACING_EXISTING_TRACE_SESSION = 18;
14218        PERFETTO_TRACED_ENABLE_TRACING_TOO_LONG_TRACE = 19;
14219        PERFETTO_TRACED_ENABLE_TRACING_INVALID_TRIGGER_TIMEOUT = 20;
14220        PERFETTO_TRACED_ENABLE_TRACING_DURATION_WITH_TRIGGER = 21;
14221        PERFETTO_TRACED_ENABLE_TRACING_STOP_TRACING_WRITE_INTO_FILE = 22;
14222        PERFETTO_TRACED_ENABLE_TRACING_DUPLICATE_TRIGGER_NAME = 23;
14223        PERFETTO_TRACED_ENABLE_TRACING_INVALID_DEFERRED_START = 24;
14224        PERFETTO_TRACED_ENABLE_TRACING_INVALID_BUFFER_SIZE = 25;
14225        PERFETTO_TRACED_ENABLE_TRACING_BUFFER_SIZE_TOO_LARGE = 26;
14226        PERFETTO_TRACED_ENABLE_TRACING_TOO_MANY_BUFFERS = 27;
14227        PERFETTO_TRACED_ENABLE_TRACING_DUPLICATE_SESSION_NAME = 28;
14228        PERFETTO_TRACED_ENABLE_TRACING_SESSION_NAME_TOO_RECENT = 29;
14229        PERFETTO_TRACED_ENABLE_TRACING_TOO_MANY_SESSIONS_FOR_UID = 30;
14230        PERFETTO_TRACED_ENABLE_TRACING_TOO_MANY_CONCURRENT_SESSIONS = 31;
14231        PERFETTO_TRACED_ENABLE_TRACING_INVALID_FD_OUTPUT_FILE = 32;
14232        PERFETTO_TRACED_ENABLE_TRACING_FAILED_TO_CREATE_FILE = 33;
14233        PERFETTO_TRACED_ENABLE_TRACING_OOM = 34;
14234        PERFETTO_TRACED_ENABLE_TRACING_UNKNOWN_ERROR = 35;
14235        PERFETTO_TRACED_START_TRACING_INVALID_SESSION_STATE = 36;
14236        PERFETTO_TRACED_ENABLE_TRACING_INVALID_FILTER = 47;
14237        PERFETTO_TRACED_ENABLE_TRACING_OOB_TARGET_BUFFER = 48;
14238        PERFETTO_TRACED_ENABLE_TRACING_INVALID_TRIGGER_MODE = 52;
14239
14240        // Checkpoints inside perfetto_cmd after tracing has finished.
14241        PERFETTO_ON_TRACING_DISABLED = 4;
14242        PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
14243        PERFETTO_CMD_FW_REPORT_BEGIN = 49;
14244        // Will be removed once incidentd is no longer used.
14245        PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
14246
14247        // Guardrails inside perfetto_cmd after tracing has finished.
14248        PERFETTO_CMD_FW_REPORT_EMPTY_TRACE = 50;
14249        // Will be removed once incidentd is no longer used.
14250        PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
14251        PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
14252
14253        // "Successful" terminal states inside perfetto_cmd.
14254        PERFETTO_CMD_FW_REPORT_HANDOFF = 51;
14255
14256        // Deprecated as "success" is misleading; it simply means we were
14257        // able to communicate with incidentd. Will be removed once
14258        // incidentd is no longer used.
14259        PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9 [deprecated = true];
14260
14261        // Contained trigger begin/success/failure. Replaced by
14262        // |PerfettoTriggerAtom| to allow aggregation using a count metric
14263        // and reduce spam.
14264        reserved 12, 13, 14;
14265
14266        // Contained that a guardrail in perfetto_cmd was hit. Replaced with
14267        // kCmd* guardrails.
14268        reserved 15;
14269
14270        // Contained status of Dropbox uploads. Removed as Perfetto no
14271        // longer supports uploading traces using Dropbox.
14272        reserved 5, 6, 7;
14273    }
14274
14275    // Which stage of the pipeline we are reporting from.
14276    optional Event event = 1;
14277
14278    // UUID matching the one set inside the SystemInfo trace packet.
14279    optional int64 trace_uuid_lsb = 2;
14280    optional int64 trace_uuid_msb = 3;
14281
14282    // For trigger checkpoints inside traced, contains the trigger name
14283    // associated with this trace UUID.
14284    optional string trigger_name = 4;
14285}
14286
14287/**
14288 * Logged from
14289 *     external/perfetto/src/tracing/service/tracing_service_impl.cc
14290 */
14291message PerfettoTrigger {
14292    enum Event {
14293        PERFETTO_UNDEFINED = 0;
14294
14295        PERFETTO_CMD_TRIGGER = 1;
14296        PERFETTO_CMD_TRIGGER_FAIL = 2;
14297
14298        PERFETTO_TRIGGER_PERFETTO_TRIGGER = 3;
14299        PERFETTO_TRIGGER_PERFETTO_TRIGGER_FAIL = 4;
14300
14301        PERFETTO_TRACED_LIMIT_PROBABILITY = 5;
14302        PERFETTO_TRACED_LIMIT_MAX_PER_24_H = 6;
14303
14304        PERFETTO_PROBES_PRODUCER_TRIGGER = 7;
14305        PERFETTO_PROBES_PRODUCER_TRIGGER_FAIL = 8;
14306    }
14307
14308    // The event which fired.
14309    optional Event event = 1;
14310
14311    // The name of the trigger which fired.
14312    optional string trigger_name = 2;
14313}
14314
14315/**
14316 * Pulls client metrics on data transferred via Vehicle Maps Service.
14317 * Metrics are keyed by uid + layer.
14318 *
14319 * Pulled from:
14320 *   packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
14321 */
14322message VmsClientStats {
14323    // UID of the VMS client app
14324    optional int32 uid = 1 [(is_uid) = true];
14325
14326    // VMS layer definition
14327    optional int32 layer_type = 2;
14328    optional int32 layer_channel = 3;
14329    optional int32 layer_version = 4;
14330
14331    // Bytes and packets sent by the client for the layer
14332    optional int64 tx_bytes = 5;
14333    optional int64 tx_packets = 6;
14334
14335    // Bytes and packets received by the client for the layer
14336    optional int64 rx_bytes = 7;
14337    optional int64 rx_packets = 8;
14338
14339    // Bytes and packets dropped due to client error
14340    optional int64 dropped_bytes = 9;
14341    optional int64 dropped_packets = 10;
14342}
14343
14344/**
14345 * State of a all permission requested by a package - sampled
14346 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
14347*/
14348message DangerousPermissionStateSampled {
14349    // Name of the permission
14350    optional string permission_name = 1;
14351
14352    // Uid of the package
14353    optional int32 uid = 2 [(is_uid) = true];
14354
14355    // If the permission is granted to the uid
14356    optional bool is_granted = 3;
14357
14358    // Permission flags as per android.content.pm.PermissionFlags
14359    optional int32 permission_flags = 4;
14360
14361    // Permission protection flags as per android.content.pm.PermissionInfo.ProtectionFlags
14362    optional int32 protection_flags = 5;
14363}
14364
14365/**
14366 * HWUI stats for a given app.
14367 */
14368message GraphicsStats {
14369    // The package name of the app
14370    optional string package_name = 1;
14371
14372    // The version code of the app
14373    optional int64 version_code = 2;
14374
14375    // The start & end timestamps in UTC as
14376    // milliseconds since January 1, 1970
14377    // Compatible with java.util.Date#setTime()
14378    optional int64 start_millis = 3;
14379
14380    optional int64 end_millis = 4;
14381
14382    // HWUI renders pipeline type: GL (1) or Vulkan (2).
14383    enum PipelineType {
14384        UNKNOWN = 0;
14385        GL = 1;
14386        VULKAN = 2;
14387    }
14388
14389    // HWUI renders pipeline type: GL or Vulkan.
14390    optional PipelineType pipeline = 5;
14391
14392    // Distinct frame count.
14393    optional int32 total_frames = 6;
14394
14395    // Number of "missed vsync" events.
14396    optional int32 missed_vsync_count = 7;
14397
14398    // Number of frames in triple-buffering scenario (high input latency)
14399    optional int32 high_input_latency_count = 8;
14400
14401    // Number of "slow UI thread" events.
14402    optional int32 slow_ui_thread_count = 9;
14403
14404    // Number of "slow bitmap upload" events.
14405    optional int32 slow_bitmap_upload_count = 10;
14406
14407    // Number of "slow draw" events.
14408    optional int32 slow_draw_count = 11;
14409
14410    // Number of frames that missed their deadline (aka, visibly janked)
14411    optional int32 missed_deadline_count = 12;
14412
14413    // The frame time histogram for the package
14414    optional FrameTimingHistogram cpu_histogram = 13
14415    [(android.os.statsd.log_mode) = MODE_BYTES];
14416
14417    // The gpu frame time histogram for the package
14418    optional FrameTimingHistogram gpu_histogram = 14
14419    [(android.os.statsd.log_mode) = MODE_BYTES];
14420
14421    // UI mainline module version.
14422    optional int64 version_ui_module = 15;
14423
14424    // If true, these are HWUI stats for up to a 24h period for a given app from today.
14425    // If false, these are HWUI stats for a 24h period for a given app from the last complete
14426    // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
14427    // more apps are running / rendering.
14428    optional bool is_today = 16;
14429}
14430
14431/**
14432 * Message related to dangerous (runtime) app ops access
14433 */
14434message RuntimeAppOpAccess {
14435    // Uid of the package accessing app op
14436    optional int32 uid = 1 [(is_uid) = true];
14437
14438    // Name of the package accessing app op
14439    optional string package_name = 2;
14440
14441    // deprecated - set to empty string
14442    optional string op_deprecated = 3 [deprecated = true];
14443
14444    // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
14445    // API. Attributions must be provided through manifest using <attribution> tag available in R
14446    // and above.
14447    optional string attribution_tag = 4;
14448
14449    // message related to app op access, limited to 600 chars by API
14450    optional string message = 5;
14451
14452    enum SamplingStrategy {
14453        DEFAULT = 0;
14454        UNIFORM = 1;
14455        RARELY_USED = 2;
14456        BOOT_TIME_SAMPLING = 3;
14457        UNIFORM_OPS = 4;
14458    }
14459
14460    // sampling strategy used to collect this message
14461    optional SamplingStrategy sampling_strategy = 6;
14462
14463    // operation id
14464    optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
14465}
14466
14467/*
14468 * Logs userspace reboot outcome and duration.
14469 *
14470 * Logged from:
14471 *   frameworks/base/core/java/com/android/server/BootReceiver.java
14472 */
14473message UserspaceRebootReported {
14474    // Possible outcomes of userspace reboot.
14475    enum Outcome {
14476        // Default value in case platform failed to determine the outcome.
14477        OUTCOME_UNKNOWN = 0;
14478        // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
14479        SUCCESS = 1;
14480        // Userspace reboot shutdown sequence was aborted.
14481        FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
14482        // Remounting userdata into checkpointing mode failed.
14483        FAILED_USERDATA_REMOUNT = 3;
14484        // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
14485        // reboot.
14486        FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
14487    }
14488    // Outcome of userspace reboot. Always set.
14489    optional Outcome outcome = 1;
14490    // Duration of userspace reboot in case it has a successful outcome.
14491    // Duration is measured as time between userspace reboot was initiated and until boot completed
14492    // (e.g. sys.boot_completed=1).
14493    optional int64 duration_millis = 2;
14494    // State of primary user's (user0) credential encryption storage.
14495    enum UserEncryptionState {
14496        // Default value.
14497        USER_ENCRYPTION_STATE_UNKNOWN = 0;
14498        // Credential encrypted storage is unlocked.
14499        UNLOCKED = 1;
14500        // Credential encrypted storage is locked.
14501        LOCKED = 2;
14502    }
14503    // State of primary user's encryption storage at the moment boot completed. Always set.
14504    optional UserEncryptionState user_encryption_state = 3;
14505}
14506
14507/*
14508 * Logs integrity check information during each install.
14509 *
14510 * Logged from:
14511 *   frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
14512 */
14513message IntegrityCheckResultReported {
14514    optional string package_name = 1;
14515    optional string app_certificate_hash = 2;
14516    optional int64 version_code = 3;
14517    optional string installer_package_name = 4;
14518    enum Response {
14519        UNKNOWN = 0;
14520        ALLOWED = 1;
14521        REJECTED = 2;
14522        FORCE_ALLOWED = 3;
14523    }
14524    optional Response response = 5;
14525    // An estimate on the cause of the response. This will only be populated for
14526    // REJECTED and FORCE_ALLOWED
14527    optional bool caused_by_app_cert_rule = 6;
14528    optional bool caused_by_installer_rule = 7;
14529}
14530
14531/**
14532 * Logs the information about the rules and the provider whenever rules are
14533 * pushed into AppIntegrityManager.
14534 *
14535 * Logged from:
14536 *   frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
14537 */
14538message IntegrityRulesPushed {
14539    optional bool success = 1;
14540    // Package name of the app that pushed the rules.
14541    optional string rule_provider = 2;
14542    // Version string of arbitrary format provided by the rule provider to
14543    // identify the rules.
14544    optional string rule_version = 3;
14545}
14546
14547/**
14548 * Logs when a cell broadcast message is received on the device.
14549 *
14550 * Logged from Cell Broadcast module and platform:
14551 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
14552 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
14553 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
14554 */
14555message CellBroadcastMessageReported {
14556    // The type of Cell Broadcast message
14557    enum CbType {
14558        UNKNOWN_TYPE = 0;
14559        GSM = 1;
14560        CDMA = 2;
14561        CDMA_SPC = 3;
14562    }
14563
14564    // The parts of the cell broadcast message pipeline
14565    enum ReportSource {
14566        UNKNOWN_SOURCE = 0;
14567        FRAMEWORK = 1;
14568        CB_SERVICE = 2;
14569        CB_RECEIVER_APP = 3;
14570    }
14571
14572    // GSM, CDMA, CDMA-SCP
14573    optional CbType type = 1;
14574    // The source of the report
14575    optional ReportSource source = 2;
14576    // The Message Identifier, as defined in 3GPP 23.041 clause 9.4.1.2.1
14577    optional int32 serial_number = 3;
14578    // The Message Identifier, as defined in 3GPP 23.041 clause 9.4.1.2.2
14579    optional int32 message_id = 4;
14580}
14581
14582/**
14583 * Logs when a cell broadcast message is filtered out,
14584 * or otherwise intentionally not sent to CBR, or not shown to users for reason
14585 *
14586 * Logged from Cell Broadcast module:
14587 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
14588 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
14589 */
14590message CellBroadcastMessageFiltered {
14591    enum FilterReason {
14592        // shown message to the user
14593        NOT_FILTERED = 0;
14594        // filtered message due to duplication (message body, service category, cross sim)
14595        DUPLICATE_MESSAGE = 1;
14596        // filtered message due to outside of coordinate range
14597        GEOFENCED_MESSAGE = 2;
14598        // filtered message due to not using for emergency alert but for update cell information on Setting Menu
14599        AREA_INFO_MESSAGE = 3;
14600        // filtered message due to OEM set config value ‘filtered message for duplication’ as ‘true’
14601        DISABLED_BY_OEM = 4;
14602        // when in ECBM(Emergency CallBack Mode) status
14603        NOTSHOW_ECBM = 5;
14604        // when user turn off preference of channel
14605        NOTSHOW_USER_PREF = 6;
14606        // when Empty content or Unsupported charset
14607        NOTSHOW_EMPTY_BODY = 7;
14608        // when language code in message is not same with preference of second language
14609        NOTSHOW_MISMATCH_PREF_SECOND_LANG = 8;
14610        // when user turn off preference of second language
14611        NOTSHOW_PREF_SECONDLANG_OFF = 9;
14612        // when language code in message is not same with device language setting
14613        NOTSHOW_MISMATCH_DEVICE_LANG_SETTING = 10;
14614        // when channel has feature ‘testing_mode = true’ and device is not in cb test_mode
14615        NOTSHOW_MESSAGE_FOR_TESTMODE = 11;
14616        // when the message contains ‘filter’ string from properties
14617        NOTSHOW_FILTER_STRING = 12;
14618    }
14619
14620    // GSM, CDMA, CDMA-SCP
14621    optional CellBroadcastMessageReported.CbType type = 1;
14622    // The source of the report
14623    optional FilterReason filter = 2;
14624    // The Message Identifier, as defined in 3GPP 23.041 clause 9.4.1.2.1
14625    optional int32 serial_number = 3;
14626    // The Message Identifier, as defined in 3GPP 23.041 clause 9.4.1.2.2
14627    optional int32 message_id = 4;
14628}
14629
14630/**
14631 * Logs when an error occurs while handling a cell broadcast message;
14632 *
14633 * Logged from CellBroadcastService module:
14634 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
14635 */
14636message CellBroadcastMessageError {
14637    // The type of error raised when trying to handle a cell broadcast message
14638    enum ErrorType {
14639        UNKNOWN_TYPE = 0;
14640        CDMA_DECODING_ERROR = 1;
14641        CDMA_SCP_EMPTY = 2;
14642        CDMA_SCP_HANDLING_ERROR = 3;
14643        GSM_INVALID_HEADER_LENGTH = 4;
14644        GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
14645        GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
14646        GSM_INVALID_PDU = 7;
14647        GSM_INVALID_GEO_FENCING_DATA = 8;
14648        GSM_UMTS_INVALID_WAC = 9;
14649        FAILED_TO_INSERT_TO_DB = 10;
14650        UNEXPECTED_GEOMETRY_FROM_FWK = 11;
14651        UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
14652        UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
14653        UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
14654        NO_CONNECTION_TO_CB_SERVICE = 15;
14655    }
14656
14657    // What kind of error occurred
14658    optional ErrorType type = 1;
14659    // Exception message (or log message) associated with the error (max 1000 chars)
14660    optional string exception_message = 2;
14661}
14662
14663/**
14664 * CellBroadcast channel range
14665 * Refer from CellBroadcastConfigUpdated, CellBroadcastReceiverFeature
14666 * Logged from Cell Broadcast module:
14667 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
14668 */
14669message CellBroadcastChannelRange {
14670    optional int32 start = 1;
14671    optional int32 end = 2;
14672}
14673/**
14674 * CellBroadcast channel ranges
14675 * Nested field for repeated
14676 * Logged from Cell Broadcast module:
14677 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
14678 */
14679message CellBroadcastChannelRanges {
14680    repeated CellBroadcastChannelRange channel_ranges = 1;
14681}
14682
14683/**
14684 * Logs when an channel configuration is updated with mcc-mnc
14685 *
14686 * Logged from Cell Broadcast module:
14687 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
14688 */
14689message CellBroadcastConfigUpdated  {
14690    // mcc_mnc value of Network operator for the roaming case
14691    optional string roaming_mcc_mnc = 1;
14692    // The channel ranges to be updated logged as bytes
14693    optional CellBroadcastChannelRanges channel_ranges = 2 [(log_mode) = MODE_BYTES];
14694}
14695
14696/**
14697 * Logs when a cell broadcast message is activated with the feature below
14698 * or when channel configuration is changed with the feature below
14699 *
14700 * Logged from Cell Broadcast module:
14701 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice
14702 */
14703message CellBroadcastServiceFeatureChanged {
14704    // Not for mainline devices, but for android-go devices, OEM can register package names.
14705    // if there is a data then true otherwise false
14706    optional bool overlay_additional_cbr_packages = 1;
14707    // package name which will get area info message
14708    // if there is a data except “com.android.settings” then true, or false
14709    optional bool overlay_area_info_packages = 2;
14710    // Reset Area Info when device goes out of service
14711    optional bool reset_area_info = 3;
14712}
14713
14714/**
14715 * Logs when a cell broadcast message is activated with the feature below
14716 * or when channel configuration is changed with the feature below
14717 *
14718 * Logged from Cell Broadcast module:
14719 *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
14720 */
14721message CellBroadcastReceiverFeatureChanged {
14722    // Whether to enable alert handling during active voice call
14723    optional bool alert_during_call = 1;
14724    // Play alert sound in full volume regardless DND is on
14725    // [none:0][all:Integer.MAX_VALUE][partial:4370 4380 50]
14726    optional CellBroadcastChannelRanges override_dnd = 2 [(log_mode) = MODE_BYTES];
14727    // Whether to Support roaming for attached network operator
14728    optional bool roaming_support = 3;
14729    // Whether to save alerts to sms inbox database
14730    optional bool store_sms = 4;
14731    // whether the device is in test mode through *#*#CMAS#*#*
14732    optional bool testing_mode = 5;
14733    // whether Text To Speech is on/off
14734    optional bool tts_mode = 6;
14735    // whether the device is able to enter test mode even on user build
14736    optional bool testing_mode_on_user_build = 7;
14737}
14738
14739/**
14740 * Logs when exception is occurred in the device
14741 *
14742 * Logged from Cell Broadcast module:
14743 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
14744 *   packages/apps/CellBroadcastReceiver/
14745 */
14746message CellBroadcastModuleErrorReported {
14747    enum ErrorType {
14748        ERROR_UNKNOWN = 0;
14749        ERROR_BAD_CONFIG = 1;
14750        ERROR_DB_MIGRATION = 2;
14751        ERROR_DEFAULT_RES = 3;
14752        ERROR_ENABLE_CHANNEL = 4;
14753        ERROR_GET_LOCATION = 5;
14754        ERROR_MISSING_RES = 6;
14755        ERROR_PLAY_FLASH = 7;
14756        ERROR_PLAY_SOUND = 8;
14757        ERROR_PLAY_TTS = 9;
14758        ERROR_PREF_MIGRATION = 10;
14759        ERROR_PROVIDER_INIT = 11;
14760        ERROR_RESET_CHANNEL_R = 12;
14761        ERROR_STATUS_BAR = 13;
14762        ERROR_REMINDER_INTERVAL = 14;
14763        ERROR_ICON_RESOURCE = 15;
14764        ERROR_CHANNEL_RANGE_PARSE = 16;
14765        ERROR_DB_INIT = 17;
14766        ERROR_NOT_FOUND_DEFAULT_CBR_PKGS = 18;
14767        ERROR_FOUND_MULTIPLE_CBR_PKGS = 19;
14768    }
14769
14770    // The source of the report
14771    optional CellBroadcastMessageReported.ReportSource source = 1;
14772
14773    // The error type
14774    optional ErrorType type = 2;
14775}
14776
14777/**
14778 * Logs when a TV Input Service Session changes tune state
14779 * This is atom ID 327.
14780 *
14781 * Logged from:
14782 *   frameworks/base/services/core/java/com/android/server/tv/TvInputManagerService.java
14783 */
14784message TifTuneStateChanged {
14785
14786    // Tv Input Service uid, TV Player uid
14787    repeated AttributionNode attribution_node = 1 [
14788        (state_field_option).primary_field_first_uid = true
14789    ];
14790    optional android.stats.tv.TifTuneState state = 2 [
14791        (state_field_option).exclusive_state = true,
14792        (state_field_option).default_state_value = 0,
14793        (state_field_option).nested = false
14794    ];
14795    // This a globally unique 128 bit random number created by TvInputManagerService when
14796    // android.media.tv.TvInputManager#createSession is called.
14797    // It is has no device or user association.
14798    // See android.media.tv.TvInputService.onCreateSession(java.lang.String, java.lang.String)
14799    // WARNING: Any changes to this field should be carefully reviewed for privacy.
14800    //          Inspect the code at
14801    //          framework/base/cmds/statsd/src/atoms.proto
14802    //               TifTuneState
14803    //          frameworks/base/services/core/java/com/android/server/tv/TvInputManagerService.java
14804    //              logTuneStateChanged
14805    //              BinderService.createSession
14806    //              SessionState.sessionId
14807    optional string tif_session_id = 3 [(state_field_option).primary_field = true];
14808    optional android.stats.tv.TifInputType type = 4;
14809    // The id of this TV Input, only unique to a given TV Input Service.
14810    // This is specifically NOT android.media.tv.TvInputInfo.getId()
14811    // which is a string that contains the package name of its TvInputService.
14812    optional int32 input_id = 5  [(state_field_option).primary_field = true];
14813    // The HDMI port id
14814    // Only valid when type == HDMI
14815    optional int32 hdmi_port = 6  [(state_field_option).primary_field = true];
14816}
14817
14818/*
14819 * Logs when JSScriptEngine is used to execute JavaScript code on device.
14820 *
14821 * Logged from Cell Broadcast module:
14822 *   packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/js/
14823 */
14824message JSScriptEngineLatencyReported {
14825    enum LatencyStat {
14826      UNKNOWN = 0;
14827      SANDBOX_INIT = 1;
14828      ISOLATE_CREATE = 2;
14829      JAVA_PROCESS_EXECUTION = 3;
14830      WEBVIEW_PROCESS_EXECUTION = 4;
14831    }
14832
14833    optional LatencyStat stat = 1;
14834    optional int64 latency_millis = 2;
14835}
14836
14837/**
14838 * Logs when a tune occurs through device's Frontend.
14839 * This is atom ID 276.
14840 *
14841 * Logged from:
14842 *   frameworks/base/media/java/android/media/tv/tuner/Tuner.java
14843 */
14844message TvTunerStateChanged {
14845    enum State {
14846        UNKNOWN = 0;
14847        TUNING = 1; // Signal is tuned
14848        LOCKED = 2;    // the signal is locked
14849        NOT_LOCKED = 3; // the signal isn’t locked.
14850        SIGNAL_LOST = 4; // the signal was locked, but is lost now.
14851        SCANNING = 5; // the signal is scanned
14852        SCAN_STOPPED = 6; // the scan is stopped.
14853    }
14854    // The uid of the application that sent this custom atom.
14855    optional int32 uid = 1 [(is_uid) = true];
14856    //  new state
14857    optional State state = 2;
14858}
14859
14860/**
14861 * Logs the status of a dvr playback or record.
14862 * This is atom ID 279.
14863 *
14864 * Logged from:
14865 *   frameworks/base/media/java/android/media/tv/tuner/dvr
14866 */
14867message TvTunerDvrStatus {
14868    enum Type {
14869        UNKNOWN_TYPE = 0;
14870        PLAYBACK = 1; // is a playback
14871        RECORD = 2; // is a record
14872    }
14873    enum State {
14874        UNKNOWN_STATE = 0;
14875        STARTED = 1; // DVR is started
14876        STOPPED = 2; // DVR is stopped
14877    }
14878    // The uid of the application that sent this custom atom.
14879    optional int32 uid = 1 [(is_uid) = true];
14880    // DVR type
14881    optional Type type = 2;
14882    //  DVR state
14883    optional State state = 3;
14884    //  Identify the segment of a record or playback
14885    optional int32 segment_id = 4;
14886    // indicate how many overflow or underflow happened between started to stopped
14887    optional int32 overflow_underflow_count = 5;
14888}
14889
14890/**
14891 * Logs when a cas session opened through MediaCas.
14892 * This is atom ID 280.
14893 *
14894 * Logged from:
14895 *   frameworks/base/media/java/android/media/MediaCas.java
14896 */
14897message TvCasSessionOpenStatus {
14898    enum State {
14899        UNKNOWN = 0;
14900        SUCCEEDED = 1; // indicate that the session is opened successfully.
14901        FAILED = 2; // indicate that the session isn’t opened successfully.
14902    }
14903    // The uid of the application that sent this custom atom.
14904    optional int32 uid = 1 [(is_uid) = true];
14905    //  Cas system Id
14906    optional int32 cas_system_id = 2;
14907    // State of the session
14908    optional State state = 3;
14909}
14910
14911/**
14912 * Logs for ContactsProvider general usage.
14913 * This is atom ID 301.
14914 *
14915 * Logged from:
14916 *   packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
14917 */
14918message ContactsProviderStatusReported {
14919    enum ApiType {
14920        UNKNOWN_API = 0;
14921        QUERY = 1;
14922        // INSERT includes insert and bulkInsert, and inserts triggered by applyBatch.
14923        INSERT = 2;
14924        // UPDATE and DELETE includes update/delete and the ones triggered by applyBatch.
14925        UPDATE = 3;
14926        DELETE = 4;
14927        CALL = 5;
14928
14929        // Call from CP2 to a GAL provider.
14930        GAL_CALL = 6;
14931    }
14932
14933    // Method called for ApiType.CALL
14934    enum MethodCall {
14935        UNKNOWN_METHOD = 0;
14936        ADD_SIM_ACCOUNTS = 1;
14937        REMOVE_SIM_ACCOUNTS = 2;
14938        GET_SIM_ACCOUNTS = 3;
14939    }
14940
14941    enum ResultType {
14942        UNKNOWN_RESULT = 0;
14943        SUCCESS = 1;
14944        FAIL = 2;
14945        ILLEGAL_ARGUMENT = 3;
14946        UNSUPPORTED_OPERATION = 4;
14947    }
14948
14949    enum CallerType {
14950        UNSPECIFIED_CALLER_TYPE = 0;
14951        CALLER_IS_SYNC_ADAPTER = 1;
14952        CALLER_IS_NOT_SYNC_ADAPTER = 2;
14953    }
14954
14955    enum TaskType {
14956        UNKNOWN_TASK = 0;
14957        DANGLING_CONTACTS_CLEANUP_TASK = 1;
14958    }
14959
14960    optional ApiType api_type = 1;
14961    // Defined in
14962    // packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
14963    optional int32 uri_type = 2;
14964    optional CallerType caller_type = 3;
14965    optional ResultType result_type = 4;
14966    optional int32 result_count = 5;
14967    optional int64 latency_micros = 6;
14968    optional TaskType task_type = 7;
14969    // Set when api_type == CALL
14970    optional MethodCall method_called = 8;
14971
14972    // Normally, it's the binder calling UID. (this could be CP2, for work profile or cloned
14973    // profile cases.)
14974    // For GAL_CALL, it's the GAL provider UID.
14975    optional int32 uid = 9 [(is_uid) = true];
14976}
14977
14978/**
14979 * Logs when an app is frozen or unfrozen.
14980 *
14981 * Logged from:
14982 *   frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
14983 */
14984message AppFreezeChanged {
14985    // The type of event.
14986    enum Action {
14987        UNKNOWN = 0;
14988        FREEZE_APP = 1;
14989        UNFREEZE_APP = 2;
14990    }
14991    optional Action action = 1;
14992
14993    // Pid of the process being frozen.
14994    optional int32 pid = 2;
14995
14996    // Name of the process being frozen.
14997    optional string process_name = 3;
14998
14999    // Time since last unfrozen.
15000    optional int64 time_unfrozen_millis = 4;
15001
15002    // The list of reason should be kept in sync with @OomAdjReason in OomAdjuster.java.
15003    enum OomAdjReason {
15004        NONE = 0;
15005        ACTIVITY = 1;
15006        FINISH_RECEIVER = 2;
15007        START_RECEIVER = 3;
15008        BIND_SERVICE = 4;
15009        UNBIND_SERVICE = 5;
15010        START_SERVICE = 6;
15011        GET_PROVIDER = 7;
15012        REMOVE_PROVIDER = 8;
15013        UI_VISIBILITY = 9;
15014        ALLOWLIST = 10;
15015        PROCESS_BEGIN = 11;
15016        PROCESS_END = 12;
15017    }
15018
15019    // Deprecated, use unfreeze_reason_v2.
15020    optional OomAdjReason unfreeze_reason = 5 [ deprecated = true ];
15021
15022    // The list of reason should be kept in sync with @UnfreezeReason in CachedAppOptimizer.java.
15023    enum UnfreezeReason {
15024        UFR_NONE = 0;
15025        UFR_ACTIVITY = 1;
15026        UFR_FINISH_RECEIVER = 2;
15027        UFR_START_RECEIVER = 3;
15028        UFR_BIND_SERVICE = 4;
15029        UFR_UNBIND_SERVICE = 5;
15030        UFR_START_SERVICE = 6;
15031        UFR_GET_PROVIDER = 7;
15032        UFR_REMOVE_PROVIDER = 8;
15033        UFR_UI_VISIBILITY = 9;
15034        UFR_ALLOWLIST = 10;
15035        UFR_PROCESS_BEGIN = 11;
15036        UFR_PROCESS_END = 12;
15037        UFR_TRIM_MEMORY = 13;
15038        UFR_PING = 15;
15039        UFR_FILE_LOCKS = 16;
15040        UFR_FILE_LOCK_CHECK_FAILURE = 17;
15041        UFR_BINDER_TXNS = 18;
15042        UFR_FEATURE_FLAGS = 19;
15043        UFR_SHORT_FGS_TIMEOUT = 20;
15044        UFR_SYSTEM_INIT = 21;
15045        UFR_BACKUP = 22;
15046        UFR_SHELL = 23;
15047        UFR_REMOVE_TASK = 24;
15048        UFR_UID_IDLE = 25;
15049        UFR_STOP_SERVICE = 26;
15050        UFR_EXECUTING_SERVICE = 27;
15051        UFR_RESTRICTION_CHANGE = 28;
15052        UFR_COMPONENT_DISABLED = 29;
15053    }
15054
15055    optional UnfreezeReason unfreeze_reason_v2 = 6;
15056}
15057
15058/**
15059 * Pulls information for a single voice call.
15060 *
15061 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
15062 *
15063 * Pulled from:
15064 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15065 */
15066message VoiceCallSession {
15067    // Bearer (IMS or CS) when the call started.
15068    optional android.telephony.CallBearerEnum bearer_at_start = 1;
15069
15070    // Bearer (IMS or CS) when the call ended.
15071    // The bearer may change during the call, e.g. due to SRVCC.
15072    optional android.telephony.CallBearerEnum bearer_at_end = 2;
15073
15074    // Direction of the call (incoming or outgoing).
15075    optional android.telephony.CallDirectionEnum direction = 3;
15076
15077    // Deprecated by setup_duration_millis
15078    optional android.telephony.CallSetupDurationEnum setup_duration = 4 [ deprecated = true ];
15079
15080    // Whether the call ended before the setup was completed.
15081    optional bool setup_failed = 5;
15082
15083    // IMS reason code or CS disconnect cause.
15084    // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
15085    // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
15086    optional int32 disconnect_reason_code = 6;
15087
15088    // IMS extra code or CS precise disconnect cause.
15089    // For IMS, this code is vendor-specific
15090    // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
15091    optional int32 disconnect_extra_code = 7;
15092
15093    // IMS extra message or CS vendor cause.
15094    optional string disconnect_extra_message = 8;
15095
15096    // Radio access technology (RAT) used when call started.
15097    optional android.telephony.NetworkTypeEnum rat_at_start = 9;
15098
15099    // Radio access technology (RAT) used when call terminated.
15100    optional android.telephony.NetworkTypeEnum rat_at_end = 10;
15101
15102    // Number of times RAT changed during the call.
15103    optional int64 rat_switch_count = 11;
15104
15105    // A bitmask of all codecs used during the call.
15106    // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
15107    optional int64 codec_bitmask = 12;
15108
15109    // Number of other calls going on during call setup, for the same SIM slot.
15110    optional int32 concurrent_call_count_at_start = 13;
15111
15112    // Number of other calls going on during call termination, for the same SIM slot.
15113    optional int32 concurrent_call_count_at_end = 14;
15114
15115    // Index of the SIM used, 0 for single-SIM devices.
15116    optional int32 sim_slot_index = 15;
15117
15118    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
15119    optional bool is_multi_sim = 16;
15120
15121    // Whether the call was made with an eSIM profile.
15122    optional bool is_esim = 17;
15123
15124    // Carrier ID of the SIM card.
15125    // See https://source.android.com/devices/tech/config/carrierid.
15126    optional int32 carrier_id = 18;
15127
15128    // Whether an SRVCC has been completed successfully for this call.
15129    optional bool srvcc_completed = 19;
15130
15131    // Number of SRVCC failures.
15132    optional int64 srvcc_failure_count = 20;
15133
15134    // Number of SRVCC cancellations.
15135    optional int64 srvcc_cancellation_count = 21;
15136
15137    // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
15138    // enabled in the dialer's settings).
15139    optional bool rtt_enabled = 22;
15140
15141    // Whether this was an emergency call.
15142    optional bool is_emergency = 23;
15143
15144    // Whether the call was performed while roaming.
15145    optional bool is_roaming = 24;
15146
15147    // A random number used as the dimension field to pull multiple atoms.
15148    optional int32 dimension = 25;
15149
15150    // Signal strength at the end of the call. This value is applicable to both cellular and WiFi.
15151    optional android.telephony.SignalStrengthEnum signal_strength_at_end = 26;
15152
15153    // Band at the end of the call. Value 0 is used if the band is unknown.
15154    // See GeranBands, UtranBands and EutranBands in IRadio interface, depending on the RAT at
15155    // the end of the call.
15156    optional int32 band_at_end = 27;
15157
15158    // Time spent setting up the call in milliseconds.
15159    // The time is measured from dial to ringing for outgoing calls, and from answer to connected
15160    // for incoming calls.
15161    optional int32 setup_duration_millis = 28;
15162
15163    // Main codec quality. The codec quality was equal to or greater than this value for at least
15164    // 70% of the call.
15165    optional android.telephony.CodecQuality main_codec_quality = 29;
15166
15167    // Whether video was enabled at any point during the call.
15168    optional bool video_enabled = 30;
15169
15170    // Radio access technology (RAT) used when call is connected.
15171    optional android.telephony.NetworkTypeEnum rat_at_connected = 31;
15172
15173    // Whether the call was a conference call (applicable only for calls over IMS).
15174    optional bool is_multiparty = 32;
15175
15176    // Duration after the call was connected.
15177    optional android.telephony.CallDuration call_duration = 33;
15178
15179    // Last known Radio access technology (RAT).
15180    optional android.telephony.NetworkTypeEnum last_known_rat = 34;
15181
15182    // Fold state of the device
15183    optional android.telephony.FoldState fold_state = 35;
15184
15185    // Number of times RAT changed after call connection
15186    optional int64 rat_switch_count_after_connected = 36;
15187
15188    // Handover state of the device
15189    optional bool handover_in_progress = 37;
15190}
15191
15192/**
15193 * Pulls voice call radio access technology (RAT) usage.
15194 *
15195 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
15196 * time. The atom will be skipped if not enough data is available.
15197 *
15198 * Pulled from:
15199 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15200 */
15201message VoiceCallRatUsage {
15202    // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
15203    optional int32 carrier_id = 1;
15204
15205    // Radio access technology.
15206    optional android.telephony.NetworkTypeEnum rat = 2;
15207
15208    // Total duration that voice calls spent on this carrier and RAT, rounded to 5 minutes.
15209    optional int64 total_duration_seconds = 3;
15210
15211    // Total number of calls using this carrier and RAT.
15212    // A call is counted once even if it used the RAT multiple times.
15213    optional int64 call_count = 4;
15214}
15215
15216/**
15217 * Pulls amount of time spend in each cellular service state.
15218 *
15219 * Each pull creates multiple atoms, one for each SIM slot/carrier/RAT(including ENDC), the order of
15220 * which is irrelevant to time. If multi SIM settings changes during the period, durations will be
15221 * counted separately before and after the change. Airplane mode does not count towards durations.
15222 *
15223 * Pulled from:
15224 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15225 */
15226message CellularServiceState {
15227    // Radio access technology (RAT) for voice.
15228    // NETWORK_TYPE_UNKNOWN when the device is not in-service.
15229    // NETWORK_TYPE_IWLAN when the device is using VoWiFi.
15230    optional android.telephony.NetworkTypeEnum voice_rat = 1;
15231
15232    // Radio access technology (RAT) for data.
15233    // NETWORK_TYPE_UNKNOWN when the device is not in-service.
15234    // Only cellular RATs are valid and show where the device is camped.
15235    optional android.telephony.NetworkTypeEnum data_rat = 2;
15236
15237    // Whether the device was in roaming (domestic or international) for voice.
15238    optional android.telephony.RoamingTypeEnum voice_roaming_type = 3;
15239
15240    // Whether the device was in roaming (domestic or international) for data.
15241    optional android.telephony.RoamingTypeEnum data_roaming_type = 4;
15242
15243    // Whether the device is on LTE and has access to NR NSA, i.e. cell supports 5G (ENDC) and UE
15244    // registration (attach/TAU) indicates ENDC is not restricted.
15245    optional bool is_endc = 5;
15246
15247    // Index of the SIM used, 0 for single-SIM devices.
15248    optional int32 sim_slot_index = 6;
15249
15250    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
15251    optional bool is_multi_sim = 7;
15252
15253    // Carrier ID of the SIM card.
15254    // See https://source.android.com/devices/tech/config/carrierid.
15255    optional int32 carrier_id = 8;
15256
15257    // Total time spent in this service state, rounded to 5 minutes.
15258    optional int32 total_time_seconds = 9;
15259
15260    // Whether the device is in limited service (only emergency voice
15261    // call available). Voice and data RAT will be recorded as
15262    // NETWORK_TYPE_UNKNOWN in this case.
15263    optional bool is_emergency_only = 10;
15264
15265    // Whether internet pdn is up.
15266    optional bool is_internet_pdn_up = 11;
15267
15268    // Fold state of the device.
15269    optional android.telephony.FoldState fold_state = 12;
15270
15271    // Whether the voice service state is overridden by voice calling capability.
15272    optional bool override_voice_service = 13;
15273
15274    // Whether mobile data is enable.
15275    optional bool isDataEnabled = 14;
15276}
15277
15278/**
15279 * Pulls the number of times cellular data service state switches.
15280 *
15281 * Each pull creates multiple atoms, one for each RAT combination, the order of which is irrelevant
15282 * to time. Switches for different SIM slots, carrier IDs, or multi-SIM settings are counted
15283 * separately.
15284 *
15285 * Pulled from:
15286 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15287 */
15288message CellularDataServiceSwitch {
15289    // Cellular RAT of the DATA domain from where the switch occurred.
15290    optional android.telephony.NetworkTypeEnum rat_from = 1;
15291
15292    // Cellular RAT of the DATA domain to where the switch occurred.
15293    optional android.telephony.NetworkTypeEnum rat_to = 2;
15294
15295    // Index of the SIM used, 0 for single-SIM devices.
15296    optional int32 sim_slot_index = 3;
15297
15298    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
15299    optional bool is_multi_sim = 4;
15300
15301    // Carrier ID of the SIM card.
15302    // See https://source.android.com/devices/tech/config/carrierid.
15303    optional int32 carrier_id = 5;
15304
15305    // Number of switches from rat_from to rat_to.
15306    optional int32 switch_count = 6;
15307}
15308
15309/**
15310 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
15311 *
15312 * Pulled from:
15313 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15314 */
15315message SimSlotState {
15316    // Number of active SIM slots (both physical and eSIM profiles) in the device.
15317    optional int32 active_slot_count = 1;
15318
15319    // Number of SIM cards (both physical and active eSIM profiles).
15320    // This number may be greater than the number of active SIM slots, if multiple profiles are
15321    // enabled on the same eUICC.
15322    optional int32 sim_count = 2;
15323
15324    // Number of active eSIM profiles.
15325    // This number is always equal to or less than the number of SIMs.
15326    optional int32 esim_count = 3;
15327}
15328
15329/**
15330 * Pulls supported cellular radio access technologies.
15331 *
15332 * This atom reports the capabilities of the device, rather than the network it has access to.
15333 *
15334 * Pulled from:
15335 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15336 */
15337message SupportedRadioAccessFamily {
15338    // A bitmask of supported radio technologies.
15339    // See android.telephony.TelephonyManager.NetworkTypeBitMask.
15340    optional int64 network_type_bitmask = 1;
15341}
15342
15343/**
15344 * Pulls the status of device-level telephony properties.
15345 *
15346 * Pulled from:
15347 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15348 */
15349message DeviceTelephonyProperties {
15350    // True if the device adopts the data stack came out in T
15351    // Deprecated since U, where legacy stack has been removed
15352    optional bool using_t_data_stack = 1 [deprecated = true];
15353    // True if auto data switch is enabled on the device
15354    optional bool auto_data_switch_enabled = 2;
15355    // Number of time the user toggled the data switch feature since the last collection
15356    optional int32 auto_data_switch_toggle_count = 3;
15357    // True if work profile is enabled on the device
15358    optional bool has_managed_profile_dedicated_sub = 4;
15359}
15360
15361/**
15362 * This atom is deprecated starting in T, use TelephonyNetworkRequestsV2 instead.
15363 *
15364 * Pulls information about network requests.
15365 *
15366 * Pulled from:
15367 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15368 */
15369message TelephonyNetworkRequests {
15370    // Carrier ID of the SIM card.
15371    // See https://source.android.com/devices/tech/config/carrierid.
15372    optional int32 carrier_id = 1;
15373    // Number of times the enterprise capability was requested.
15374    optional int32 enterprise_request_count = 2;
15375    // Number of times the enterprise capability was released.
15376    optional int32 enterprise_release_count = 3;
15377}
15378
15379/**
15380 * Pulls information about network requests.
15381 *
15382 * Pulled from:
15383 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15384 */
15385message TelephonyNetworkRequestsV2 {
15386    enum NetworkCapability {
15387        // Unknown capability was requested.
15388        UNKNOWN = 0;
15389        // Low latency capability (URLLC) was requested.
15390        PRIORITIZE_LATENCY = 1;
15391        // High bandwidth capability (EMBB) was requested.
15392        PRIORITIZE_BANDWIDTH = 2;
15393        // CBS (Carrier Branded Services) capability was requested.
15394        CBS = 3;
15395        // Enterprise capability was requested.
15396        ENTERPRISE = 4;
15397    }
15398    // Carrier ID of the SIM card.
15399    // See https://source.android.com/devices/tech/config/carrierid.
15400    optional int32 carrier_id = 1;
15401    // The capability that was requested.
15402    optional NetworkCapability capability = 2;
15403    // Number of times the capability was requested.
15404    optional int32 request_count = 3;
15405}
15406
15407/**
15408 * Pulls information for a single incoming SMS.
15409 *
15410 * Each pull creates multiple atoms, one for each SMS. The sequence is randomized when pulled.
15411 *
15412 * Pulled from:
15413 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15414 */
15415message IncomingSms {
15416    // Format of the SMS (3GPP or 3GPP2).
15417    optional android.telephony.SmsFormatEnum sms_format = 1;
15418
15419    // Technology of the SMS (CS or IMS).
15420    optional android.telephony.SmsTechEnum sms_tech = 2;
15421
15422    // Radio access technology (RAT) used for the SMS. It can be IWLAN in case of IMS.
15423    optional android.telephony.NetworkTypeEnum rat = 3;
15424
15425    // Type the SMS.
15426    optional android.telephony.SmsTypeEnum sms_type = 4;
15427
15428    // Number of total parts.
15429    optional int32 total_parts = 5;
15430
15431    // Number of received parts (if smaller than total parts, the SMS was dropped).
15432    optional int32 received_parts = 6;
15433
15434    // Indicates if the incoming SMS was blocked.
15435    optional bool blocked = 7;
15436
15437    // Indicate a specific error handling the SMS
15438    optional android.telephony.SmsIncomingErrorEnum error = 8;
15439
15440    // Whether the SMS was received while roaming.
15441    optional bool is_roaming = 9;
15442
15443    // Index of the SIM used, 0 for single-SIM devices.
15444    optional int32 sim_slot_index = 10;
15445
15446    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
15447    optional bool is_multi_sim = 11;
15448
15449    // Whether the message was received with an eSIM profile.
15450    optional bool is_esim = 12;
15451
15452    // Carrier ID of the SIM card used for the SMS.
15453    // See https://source.android.com/devices/tech/config/carrierid.
15454    optional int32 carrier_id = 13;
15455
15456    // Random message ID.
15457    // If the value of count is greater than 1, the message_id represents only one of the messages.
15458    optional int64 message_id = 14;
15459
15460    // Number of messages with the same properties (see message_id for exception)
15461    optional int32 count = 15;
15462
15463    // Whether the message was received with an enterprise profile.
15464    optional bool is_managed_profile = 16;
15465}
15466
15467/**
15468 * Pulls information for a single outgoing SMS.
15469 *
15470 * Each pull creates multiple atoms, one for each SMS. The sequence is randomized when pulled.
15471 *
15472 * Pulled from:
15473 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15474 */
15475message OutgoingSms {
15476    // Format of the SMS (3GPP or 3GPP2).
15477    optional android.telephony.SmsFormatEnum sms_format = 1;
15478
15479    // Technology of the SMS (CS or IMS).
15480    optional android.telephony.SmsTechEnum sms_tech = 2;
15481
15482    // Radio access technology (RAT) used for the SMS. It can be IWLAN in case of IMS.
15483    optional android.telephony.NetworkTypeEnum rat = 3;
15484
15485    // Result of the SMS sending.
15486    optional android.telephony.SmsSendResultEnum send_result = 4;
15487
15488    // Error code
15489    // For IMS technology, see @SmsManager.Result in
15490    // http://cs/android/frameworks/base/telephony/java/android/telephony/SmsManager.java
15491    // For CS technology:
15492    //  - GSM format: see GsmSmsErrorCode (3GPP 27.005 clause 3.2.5)
15493    //  - CDMA format: see CdmaSmsErrorCode (3GPP2 N.S0005 (IS-41-C) Table 171)
15494    // The field error_code is used for up-to-Android-13 devices. From Android 14,
15495    // network_error_code will be used. The field error_code will be deprecated when most devices
15496    // use Android 14 or higher versions.
15497    optional int32 error_code = 5;
15498
15499    // Whether the SMS was sent while roaming.
15500    optional bool is_roaming = 6;
15501
15502    // Whether the default SMS application generated the SMS (regardless of which application).
15503    optional bool is_from_default_app = 7;
15504
15505    // Index of the SIM used, 0 for single-SIM devices.
15506    optional int32 sim_slot_index = 8;
15507
15508    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
15509    optional bool is_multi_sim = 9;
15510
15511    // Whether the message was sent with an eSIM profile.
15512    optional bool is_esim = 10;
15513
15514    // Carrier ID of the SIM card used for the SMS.
15515    // See https://source.android.com/devices/tech/config/carrierid.
15516    optional int32 carrier_id = 11;
15517
15518    // Random message ID.
15519    // If the value of count is greater than 1, the message_id represents only one of the messages.
15520    optional int64 message_id = 12;
15521
15522    // Retry count: 0 for the first attempt and then increasing for each attempt.
15523    // If the value of count is greater than 1, the retry_id represents the value associated with
15524    // the message defined by message_id.
15525    optional int32 retry_id = 13;
15526
15527    // Time in milliseconds to complete the SMS send to the network.
15528    // If the value of count is greater than 1, this field measures the average time interval.
15529    optional int64 interval_millis = 14;
15530
15531    // Number of messages with the same properties (see message_id, retry_id and latency_millis for
15532    // exceptions)
15533    optional int32 count = 15;
15534
15535    // Internal send error code
15536    optional android.telephony.SmsSendErrorEnum send_error_code = 16;
15537
15538    // Network error code
15539    // - SMS_FORMAT_3GPP format: see GsmSmsErrorCode (3GPP 27.005 clause 3.2.5)
15540    // - SMS_FORMAT_3GPP2 format: see CdmaSmsErrorCode (3GPP2 N.S0005 (IS-41-C) Table 171)
15541    optional int32 network_error_code = 17;
15542
15543    // Whether the message was sent with an enterprise profile.
15544    optional bool is_managed_profile = 18;
15545}
15546
15547/**
15548 * Logs information about usage of airplane mode.
15549 *
15550 * Logged from:
15551 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/AirplaneModeStats.java
15552 */
15553message AirplaneMode {
15554    // Status of airplane mode
15555    optional bool is_enabled = 1;
15556
15557    // When is_enabled is false, indicates if this was a very short airplane mode toggle
15558    // (i.e. airplane mode was disabled after less than 10 seconds from enablement).
15559    optional bool short_toggle = 2;
15560
15561    // Carrier ID of the SIM card.
15562    // See https://source.android.com/devices/tech/config/carrierid.
15563    optional int32 carrier_id = 3;
15564}
15565
15566/**
15567 * Logs information about modem restarts.
15568 *
15569 * Logged from:
15570 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/ModemRestartStats.java
15571 */
15572message ModemRestart {
15573    // Software version of the modem, as provided by android.os.Build.getRadioVersion().
15574    optional string baseband_version = 1;
15575
15576    // Reason of the modem restart, as provided in the modemReset indication of IRadio HAL.
15577    optional string reason = 2;
15578
15579    // Carrier ID of the first SIM card.
15580    // See https://source.android.com/devices/tech/config/carrierid.
15581    optional int32 carrier_id = 3;
15582}
15583
15584/**
15585 * Logs the SIM card details when the carrier ID match is not complete.
15586 *
15587 * The atom is pushed when a SIM card is initialized and the MCC/MNC is not present in the
15588 * carrier ID table, or the SIM card contains a GID1 value that is not present in the carrier ID
15589 * table. This atom is pushed only once for each type of SIM card.
15590 *
15591 * Logged from:
15592 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/CarrierIdMatchStats.java
15593 */
15594message CarrierIdMismatchReported {
15595    // Matched carrier ID. The value -1 is used if no match is found.
15596    optional int32 carrier_id = 1;
15597
15598    // MCC/MNC of the SIM card.
15599    optional string mcc_mnc = 2;
15600
15601    // Group identifier (level 1) of the SIM card.
15602    optional string gid1 = 3;
15603
15604    // SPN value of the SIM card.
15605    optional string spn = 4;
15606
15607    // First record of the PNN in the SIM card. This field is populated only if the SPN is missing
15608    // or empty.
15609    optional string pnn = 5;
15610}
15611
15612/**
15613 * Logs the version of the carrier ID matching table at first power up and when it is updated.
15614 *
15615 * Logged from:
15616 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/CarrierIdMatchStats.java
15617 */
15618message CarrierIdTableUpdated {
15619    // Version of the CarrierId matching table.
15620    optional int32 table_version = 1;
15621}
15622
15623/**
15624 * Pulls the version of the carrier ID matching table.
15625 *
15626 * Logged from:
15627 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15628 */
15629message CarrierIdTableVersion {
15630    // Version of the CarrierId matching table.
15631    optional int32 table_version = 1;
15632}
15633
15634/**
15635 * Pulls information for a single data call session
15636 *
15637 * Each pull creates multiple atoms, one for each data call session.
15638 * The sequence is randomized when pulled.
15639 *
15640 * Pulled from:
15641 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15642 */
15643message DataCallSession {
15644    // A random number to be used as dimension to capture multiple atoms
15645    optional int32 dimension = 1;
15646
15647    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
15648    optional bool is_multi_sim = 2;
15649
15650    // Whether the call was made with an eSIM profile.
15651    optional bool is_esim = 3;
15652
15653    // Data profile of this call (for what purpose this call was made)
15654    optional android.telephony.DataProfileEnum profile = 4 [deprecated = true];
15655
15656    // APN type bitmask of the APN used:
15657    // @ApnType in frameworks/base/telephony/java/android/telephony/Annotation.java.
15658    optional int32 apn_type_bitmask = 5;
15659
15660    // Carrier ID of the SIM
15661    // See https://source.android.com/devices/tech/config/carrierid.
15662    optional int32 carrier_id = 6;
15663
15664    // Whether the subscription is roaming
15665    optional bool is_roaming = 7;
15666
15667    // Data RAT when the call ended, can be IWLAN for IMS/MMS, otherwise should be WWAN PS RAT.
15668    // In the case that the connection hasn't ended yet, this field holds the current RAT.
15669    // In the case the call ended due to Out Of Service (OOS),
15670    // this field should be the last known RAT.
15671    optional android.telephony.NetworkTypeEnum rat_at_end = 8;
15672
15673    // Was the data call ended due to OOS
15674    optional bool oos_at_end = 9;
15675
15676    // Number of RAT switches during the data call
15677    optional int64 rat_switch_count = 10;
15678
15679    // Whether the call is on an opportunistic subscription
15680    optional bool is_opportunistic = 11;
15681
15682    // Packet data protocol used
15683    optional android.telephony.ApnProtocolEnum ip_type = 12;
15684
15685    // Whether the data call terminated before being established
15686    optional bool setup_failed = 13;
15687
15688    // Reason why the data call terminated, as in RIL_DataCallFailCause from ril.h
15689    optional int32 failure_cause = 14;
15690
15691    // Suggested retry back-off timer value from RIL
15692    optional int32 suggested_retry_millis = 15;
15693
15694    // Why the data call was deactivated
15695    // Set by telephony for MO deactivations (unrelated to failure_cause)
15696    optional android.telephony.DataDeactivateReasonEnum deactivate_reason = 16;
15697
15698    // Duration of the data call, rounded into the closest 5 minutes.
15699    optional int64 duration_minutes = 17;
15700
15701    // Whether the data call is still connected when the atom is collected.
15702    optional bool ongoing = 18;
15703
15704    // Band at the end of the data call. Value 0 is used if the band is unknown.
15705    // See GeranBands, UtranBands and EutranBands in IRadio interface, depending
15706    // on the RAT at the end of the data call.
15707    optional int32 band_at_end = 19;
15708
15709    // Reason why the data call handover failed, as in RIL_DataCallFailCause from ril.h
15710    repeated int32 handover_failure_causes = 20;
15711
15712    // For each int32, the lower 16 bits represent the source RAT while the upper 16 bits indicate
15713    // the target RAT of the failed handover.
15714    repeated int32 handover_failure_rat = 21;
15715
15716    // Whether the call is for internet on nonDDS due to auto data switch feature
15717    optional bool is_non_dds = 22;
15718}
15719
15720/**
15721 * Logs data stall recovery event
15722 *
15723 * Logged from:
15724 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/data/
15725 *   DataStallRecoveryManager.java
15726 */
15727message DataStallRecoveryReported {
15728    // Carrier ID of the SIM
15729    // See https://source.android.com/devices/tech/config/carrierid.
15730    optional int32 carrier_id = 1;
15731
15732    // Data RAT when the stall happened
15733    optional android.telephony.NetworkTypeEnum rat = 2;
15734
15735    // Signal strength when stall happened
15736    optional android.telephony.SignalStrengthEnum signal_strength = 3;
15737
15738    // Action taken to recover
15739    optional android.telephony.DataStallRecoveryActionEnum action = 4;
15740
15741    // Whether the subscription is opportunistic
15742    optional bool is_opportunistic = 5;
15743
15744    // Whether the device is in multi-SIM mode
15745    optional bool is_multi_sim = 6;
15746
15747    // Band used when the stall/recovery took place.
15748    // Value 0 is used if the band is unknown.
15749    // See GeranBands, UtranBands and EutranBands in IRadio interface, depending
15750    // on the RAT used at the time.
15751    optional int32 band = 7;
15752
15753    // Whether the data stall is recovered.
15754    optional bool recovered = 8;
15755
15756    // The elapsed time between start of the data stall and result of current action.
15757    optional int32 duration_millis = 9;
15758
15759    // The data stall recovered reason. Available from Android T.
15760    optional android.telephony.DataStallRecoveredReason reason = 10;
15761
15762    // Signal strength of the other phone if DSDS when stall happened.
15763    // SIGNAL_STRENGTH_NONE_OR_UNKNOWN(0) if single SIM.
15764    optional android.telephony.SignalStrengthEnum other_phone_signal_strength = 11;
15765
15766    // PS WWAN Network Registration state of the other phone if DSDS when stall happened.
15767    // REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING(0) if single SIM.
15768    optional android.telephony.NetworkRegistrationState other_phone_reg_state = 12;
15769
15770    // PS WWAN Network Registration state of the default phone when data stall.
15771    optional android.telephony.NetworkRegistrationState phone_reg_state = 13;
15772
15773    // collect the first validation after recovery when data stall occurs.
15774    optional bool is_first_validation_after_recovery = 14;
15775
15776    // The phone id when doing the recovery action.
15777    optional int32 phone_id = 15;
15778
15779    // The elapsed time of current action.
15780    optional int32 duration_millis_of_current_action = 16;
15781
15782    // Link status of the data network.
15783    optional int32 link_status = 17;
15784
15785    // The link up bandwidth of the data network.
15786    optional int32 link_up_bandwidth = 18;
15787
15788    // The link down bandwidth of the data network.
15789    optional int32 link_down_bandwidth = 19;
15790}
15791
15792/**
15793 * Pulls IMS registration terminations.
15794 *
15795 * Each pull generates multiple atoms, one for each termination condition happened during the day.
15796 *
15797 * Pulled from:
15798 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15799 */
15800message ImsRegistrationTermination {
15801    // Carrier ID of the SIM used for IMS registration.
15802    // See https://source.android.com/devices/tech/config/carrierid.
15803    optional int32 carrier_id = 1;
15804
15805    // Whether the device is in multi-SIM mode when the registration terminated.
15806    optional bool is_multi_sim = 2;
15807
15808    // Radio access technology (RAT) used by the registration when it terminated.
15809    // This can be IWLAN if IMS was registered over Wifi.
15810    optional android.telephony.NetworkTypeEnum rat_at_end = 3;
15811
15812    // Whether the IMS registration failed before it was established.
15813    optional bool setup_failed = 4;
15814
15815    // IMS reason code indicating the termination reason.
15816    // See: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
15817    optional int32 reason_code = 5;
15818
15819    // IMS extra code indicating the termination reason.
15820    optional int32 extra_code = 6;
15821
15822    // IMS extra message indicating the termination reason.
15823    // This string is truncated to 128 characters if its length exceeds the limit.
15824    optional string extra_message = 7;
15825
15826    // Total number of instances of registration termination that matches the above conditions.
15827    optional int32 count = 8;
15828}
15829
15830/**
15831 * Pulls IMS registration statistics.
15832 *
15833 * Each pull generates multiple atoms, one for each carrier, SIM slot, and radio access technology
15834 * (RAT) combination. Durations are aggregated from all registrations with matching criteria,
15835 * including ones that are currently active.
15836 *
15837 * Pulled from:
15838 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15839 */
15840message ImsRegistrationStats {
15841    // Carrier ID of the SIM used for IMS registration.
15842    // See https://source.android.com/devices/tech/config/carrierid.
15843    optional int32 carrier_id = 1;
15844
15845    // Index of the SIM used, 0 for single-SIM devices.
15846    optional int32 sim_slot_index = 2;
15847
15848    // Radio access technology (RAT) used by the registration.
15849    // This can be IWLAN if IMS was registered over Wifi.
15850    optional android.telephony.NetworkTypeEnum rat = 3;
15851
15852    // Total time IMS was registered (connected time), rounded to 5 minutes.
15853    optional int32 registered_seconds = 4;
15854
15855    // Durations that each feature (Voice, Video, UT, SMS) is capable (supported/enabled by the
15856    // network/device) and available (registered and ready to use).
15857    // All durations are rounded to 5 minutes and should be equal to or shorter than
15858    // registered_seconds.
15859    optional int32 voice_capable_seconds = 5;
15860    optional int32 voice_available_seconds = 6;
15861    optional int32 sms_capable_seconds = 7;
15862    optional int32 sms_available_seconds = 8;
15863    optional int32 video_capable_seconds = 9;
15864    optional int32 video_available_seconds = 10;
15865    optional int32 ut_capable_seconds = 11;
15866    optional int32 ut_available_seconds = 12;
15867}
15868
15869/*
15870 * Logs information related to PIN storage and automatic PIN operations.
15871 *
15872 * Logged from:
15873 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/uicc/PinStorage.java
15874 */
15875message PinStorageEvent {
15876    // The type of event.
15877    enum Event {
15878        UNKNOWN = 0;
15879        // The PIN was verified automatically successfully.
15880        PIN_VERIFICATION_SUCCESS = 1;
15881        // The PIN was verified automatically unsuccessfully.
15882        PIN_VERIFICATION_FAILURE = 2;
15883        // The PIN(s) was cached, but discarded after reboot (e.g. SIM not present after reboot).
15884        CACHED_PIN_DISCARDED = 3;
15885        // The PIN(s) was stored to be used after unattended reboot.
15886        PIN_STORED_FOR_VERIFICATION = 4;
15887        // The PIN(s) is not available for storage and will be required after unattended reboot.
15888        PIN_REQUIRED_AFTER_REBOOT = 5;
15889        // The PIN was not verified automatically because the SIM card did not match.
15890        PIN_VERIFICATION_SKIPPED_SIM_CARD_MISMATCH = 6;
15891        // The available PINs after reboot does not match the number of stored PINs before reboot.
15892        PIN_COUNT_NOT_MATCHING_AFTER_REBOOT = 7;
15893        // Error while decrypting the PIN
15894        PIN_DECRYPTION_ERROR = 8;
15895        // Error while encrypting the PIN
15896        PIN_ENCRYPTION_ERROR = 9;
15897        // Attempted to decrypt the PIN with a null/missing encryption key.
15898        PIN_ENCRYPTION_KEY_MISSING = 10;
15899    }
15900    optional Event event = 1;
15901
15902    // Number of PINs stored or discarded.
15903    optional int32 number_of_pins = 2;
15904
15905    // The caller package name
15906    optional string package_name = 3;
15907}
15908
15909/**
15910 * Logs flip to screen off events.
15911 *
15912 * Logged from:
15913 *   frameworks/opt/telephony/src/java/com/android/server/power/FaceDownDetector.java
15914 */
15915message FaceDownReported {
15916    enum Response{
15917        UNKNOWN = 1;
15918        // The phone was flipped before the screen turns off.
15919        UNFLIP = 2;
15920        // User interacts with the screen after a face down is detected.
15921        USER_INTERACTION = 3;
15922        // A flip leads to screen turning off. This is the expected outcome.
15923        SCREEN_OFF = 4;
15924    }
15925
15926    // Logs the action that occurs from a flip event, whether by user or system
15927    // action.
15928    optional Response face_down_response = 1;
15929
15930    // After a flip is detected, how long until a system or user action occurs.
15931    optional int64 millis_since_flip = 2;
15932
15933    // Difference between the flip time and when the timeout would otherwise
15934    // occur.
15935    optional int64 millis_until_normal_timeout = 3;
15936
15937    // How quickly the user turns the screen back on after a flip event.
15938    // A low value may indicate a false negative. Logged only when Response is
15939    // SCREEN_OFF.
15940    optional int64 millis_until_next_screen_on = 4;
15941}
15942
15943/**
15944 * Logs timeout extended events which occur from consecutive undims.
15945 *
15946 * Logged from:
15947 *   frameworks/opt/telephony/src/java/com/android/server/power/ScreenUndimDetector.java
15948 */
15949message TimeoutAutoExtendedReported {
15950    enum Outcome {
15951        UNKNOWN = 0;
15952        POWER_BUTTON = 1;
15953        TIMEOUT = 2;
15954    }
15955
15956    // Logs the action that occurs after timeout is extended from undim.
15957    optional Outcome outcome = 1;
15958    // Time from timeout extension to the outcome.
15959    optional int64 time_to_outcome_millis = 2;
15960    // Time of first interaction after undim if an interaction occurs.
15961    // -1 if no interaction occurs before screen turns off.
15962    optional int64 time_to_first_interaction_millis = 3;
15963}
15964
15965/**
15966 * Logs gnss stats from location service provider
15967 *
15968 * Pulled from:
15969 *  frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
15970 */
15971message GnssStats {
15972    // Number of location reports since boot
15973    optional int64 location_reports = 1;
15974
15975    // Total pulled reports of Location failures since boot
15976    optional int64 location_failure_reports = 2;
15977
15978    // Number of time to first fix reports since boot
15979    optional int64 time_to_first_fix_reports = 3;
15980
15981    // Total pulled reported time to first fix (in milli-seconds) since boot
15982    optional int64 time_to_first_fix_millis = 4;
15983
15984    // Number of position accuracy reports since boot
15985    optional int64 position_accuracy_reports = 5;
15986
15987    // Total pulled reported position accuracy (in meters) since boot
15988    optional int64 position_accuracy_meters = 6;
15989
15990    // Number of top 4 average CN0 reports since boot
15991    optional int64 top_four_average_cn0_reports = 7;
15992
15993    // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
15994    optional int64 top_four_average_cn0_db_mhz = 8;
15995
15996    // Number of l5 top 4 average CN0 reports since boot
15997    optional int64 l5_top_four_average_cn0_reports = 9;
15998
15999    // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
16000    optional int64 l5_top_four_average_cn0_db_mhz = 10;
16001
16002    // Total number of sv status messages reports since boot
16003    optional int64 sv_status_reports = 11;
16004
16005    // Total number of sv status messages reports, where sv is used in fix since boot
16006    optional int64 sv_status_reports_used_in_fix = 12;
16007
16008    // Total number of L5 sv status messages reports since boot
16009    optional int64 l5_sv_status_reports = 13;
16010
16011    // Total number of L5 sv status messages reports, where sv is used in fix since boot
16012    optional int64 l5_sv_status_reports_used_in_fix = 14;
16013}
16014
16015/**
16016 * Logs power usage data from GNSS subsystem.
16017 *
16018 * Logged from:
16019 *   /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
16020 */
16021message GnssPowerStats {
16022    // Relative precision of the alignment of the reported power stats measurement.
16023    optional int64 elapsed_realtime_uncertainty_nanos = 1;
16024
16025    // Total GNSS energy consumption in micro-joules (or micro Watt-seconds).
16026    optional int64 total_energy_micro_joule = 2;
16027
16028    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
16029    // tracking signals of a single frequency band.
16030    optional int64 singleband_tracking_mode_energy_micro_joule = 3;
16031
16032    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
16033    // tracking signals of multiple frequency bands.
16034    optional int64 multiband_tracking_mode_energy_micro_joule = 4;
16035
16036    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
16037    // acquiring signals of a single frequency band.
16038    optional int64 singleband_acquisition_mode_energy_micro_joule = 5;
16039
16040    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
16041    // acquiring signals of multiple frequency bands.
16042    optional int64 multiband_acquisition_mode_energy_micro_joule = 6;
16043
16044    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16045    // operating in each of the vendor-specific power modes. (Index 0)
16046    optional int64 vendor_specific_power_modes_energy_micro_joule_0 = 7;
16047
16048    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16049    // operating in each of the vendor-specific power modes. (Index 1)
16050    optional int64 vendor_specific_power_modes_energy_micro_joule_1 = 8;
16051
16052    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16053    // operating in each of the vendor-specific power modes. (Index 2)
16054    optional int64 vendor_specific_power_modes_energy_micro_joule_2 = 9;
16055
16056    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16057    // operating in each of the vendor-specific power modes. (Index 3)
16058    optional int64 vendor_specific_power_modes_energy_micro_joule_3 = 10;
16059
16060    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16061    // operating in each of the vendor-specific power modes. (Index 4)
16062    optional int64 vendor_specific_power_modes_energy_micro_joule_4 = 11;
16063
16064    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16065    // operating in each of the vendor-specific power modes. (Index 5)
16066    optional int64 vendor_specific_power_modes_energy_micro_joule_5 = 12;
16067
16068    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16069    // operating in each of the vendor-specific power modes. (Index 6)
16070    optional int64 vendor_specific_power_modes_energy_micro_joule_6 = 13;
16071
16072    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16073    // operating in each of the vendor-specific power modes. (Index 7)
16074    optional int64 vendor_specific_power_modes_energy_micro_joule_7 = 14;
16075
16076    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16077    // operating in each of the vendor-specific power modes. (Index 8)
16078    optional int64 vendor_specific_power_modes_energy_micro_joule_8 = 15;
16079
16080    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
16081    // operating in each of the vendor-specific power modes. (Index 9)
16082    optional int64 vendor_specific_power_modes_energy_micro_joule_9 = 16;
16083}
16084
16085/**
16086 * Logs when an app is moved to a different standby bucket.
16087 *
16088 * Logged from:
16089 *   frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
16090 */
16091message AppStandbyBucketChanged {
16092    optional string package_name = 1;
16093
16094    // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
16095    optional int32 user_id = 2;
16096
16097    // These enum values match the constants defined in UsageStatsManager.java.
16098    enum Bucket {
16099        BUCKET_UNKNOWN = 0;
16100        BUCKET_EXEMPTED = 5;
16101        BUCKET_ACTIVE = 10;
16102        BUCKET_WORKING_SET = 20;
16103        BUCKET_FREQUENT = 30;
16104        BUCKET_RARE = 40;
16105        BUCKET_RESTRICTED = 45;
16106        BUCKET_NEVER = 50;
16107    }
16108    optional Bucket bucket = 3;
16109
16110    enum MainReason {
16111        MAIN_UNKNOWN = 0;
16112        MAIN_DEFAULT = 0x0100;
16113        MAIN_TIMEOUT = 0x0200;
16114        MAIN_USAGE = 0x0300;
16115        MAIN_FORCED_BY_USER = 0x0400;
16116        MAIN_PREDICTED = 0x0500;
16117        MAIN_FORCED_BY_SYSTEM = 0x0600;
16118    }
16119    optional MainReason main_reason = 4;
16120
16121    // A more detailed reason for the standby bucket change. The sub reason name is dependent on
16122    // the main reason. Values are one of the REASON_SUB_XXX constants defined in
16123    // UsageStatsManager.java.
16124    optional int32 sub_reason = 5;
16125}
16126
16127/**
16128* Reports a started sharesheet transaction.
16129*
16130* Logged from:
16131*   frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
16132*   packages/modules/IntentResolver/java/src/com/android/intentresolver/ChooserActivity.java
16133*/
16134message SharesheetStarted {
16135    // The event_id (as for UiEventReported).
16136    optional int32 event_id = 1;
16137    // The calling app's package name.
16138    optional string package_name = 2;
16139    // An identifier to tie together multiple logs relating to the same share event
16140    optional int32 instance_id = 3;
16141    // The mime type of the share
16142    optional string mime_type = 4;
16143    // The number of direct targets the calling app is providing that will be shown.
16144    optional int32 num_app_provided_direct_targets = 5;
16145    // The number of app targets the calling app is providing that will be shown.
16146    optional int32 num_app_provided_app_targets = 6;
16147    // True if the share originates from the workprofile
16148    optional bool is_workprofile = 7;
16149
16150    enum SharesheetPreviewType {  // Constants from ChooserActivity.java
16151        CONTENT_PREVIEW_TYPE_UNKNOWN = 0;  // Default for proto 2 / 3 compatibility.
16152        CONTENT_PREVIEW_IMAGE = 1;  // The preview shown in the sharesheet is an image.
16153        CONTENT_PREVIEW_FILE = 2;  // The preview shown in the sharesheet is a file.
16154        CONTENT_PREVIEW_TEXT = 3;  // The preview shown in the sharesheet is text.
16155    }
16156    // How the sharesheet preview is presented.
16157    optional SharesheetPreviewType preview_type = 8;
16158
16159    enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
16160        INTENT_DEFAULT = 0;
16161        INTENT_ACTION_VIEW = 1;
16162        INTENT_ACTION_EDIT = 2;
16163        INTENT_ACTION_SEND = 3;
16164        INTENT_ACTION_SENDTO = 4;
16165        INTENT_ACTION_SEND_MULTIPLE = 5;
16166        INTENT_ACTION_IMAGE_CAPTURE = 6;
16167        INTENT_ACTION_MAIN = 7;
16168    }
16169    // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
16170    optional ResolverActivityIntent intent_type = 9;
16171    // The number of custom actions that the calling app has provided.
16172    optional int32 num_provided_custom_actions = 10;
16173    // True if the calling app has provided an action for share modification.
16174    optional bool modify_share_action_provided = 11;
16175}
16176
16177/**
16178 * Reports a ranking selection event.
16179 *
16180 * Logged from:
16181 *   frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
16182 *   packages/modules/IntentResolver/java/src/com/android/intentresolver/ChooserActivity.java
16183 */
16184message RankingSelected {
16185    // The event_id (as for UiEventReported).
16186    optional int32 event_id = 1;
16187    // The relevant app's package name (can be source or picked package).
16188    optional string package_name = 2;
16189    // An identifier to tie together multiple logs relating to the same share event.
16190    optional int32 instance_id = 3;
16191    // Which of the ranked targets got picked, default starting position 0.
16192    optional int32 position_picked = 4;
16193    // Whether the selected target is pinned.
16194    optional bool is_pinned = 5;
16195}
16196
16197/**
16198 * Logs when TvSettings UI is interacted at.
16199 *
16200 * Logged from: packages/apps/TvSettings
16201 */
16202message TvSettingsUIInteracted {
16203
16204    /** The UI action category */
16205    optional android.app.tvsettings.Action action = 1;
16206
16207    /** The ID of the entry that the users actioned on */
16208    optional android.app.tvsettings.ItemId item_id = 2;
16209}
16210
16211/**
16212 * Logs information about a package installation using package installer V2 APIs.
16213 *
16214 * Logged from:
16215 *      frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
16216 */
16217message PackageInstallerV2Reported {
16218    // Whether this installation uses Incremental File System
16219    optional bool is_incremental = 1;
16220    // Name of the package that is intended to be installed
16221    optional string package_name = 2;
16222    // The duration between when the install was requested to when the install has completed
16223    optional int64 duration_millis = 3;
16224    // Installation result in final integer, which are SystemApi's.
16225    // Return_code 1 indicates success.
16226    // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
16227    optional int32 return_code  = 4;
16228    // Total size of the APKs installed for this package
16229    optional int64 apks_size_bytes = 5;
16230    // UID of the package. -1 if the installation failed.
16231    optional int32 uid = 6 [(is_uid) = true];
16232}
16233
16234/**
16235 * Logs settings provider values.
16236 *
16237 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
16238 * then write the value to proto.
16239 *
16240 */
16241message SettingSnapshot {
16242
16243    // Setting key
16244    optional string name = 1;
16245
16246    enum SettingsValueType {
16247        NOTASSIGNED = 0;
16248        ASSIGNED_BOOL_TYPE = 1;
16249        ASSIGNED_INT_TYPE = 2;
16250        ASSIGNED_FLOAT_TYPE = 3;
16251        ASSIGNED_STRING_TYPE = 4;
16252    };
16253    // Setting value type
16254    optional SettingsValueType type = 2;
16255
16256    optional bool bool_value = 3;
16257
16258    optional int32 int_value = 4;
16259
16260    optional float float_value = 5;
16261
16262    optional string str_value = 6;
16263
16264    // Android user index. 0 for primary user, 10, 11 for secondary or profile user
16265    optional int32 user_id = 7;
16266}
16267
16268/**
16269 * An event logged to indicate that a user journey is about to be performed. This atom includes
16270 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
16271 * will immediately follow this atom which will describe the event(s) and its state.
16272 *
16273 * Logged from:
16274 *   frameworks/base/services/core/java/com/android/server/am/UserController.java
16275 *   frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
16276 */
16277message UserLifecycleJourneyReported {
16278    // An identifier to track a chain of user lifecycle events occurring (referenced in the
16279    // UserLifecycleEventOccurred atom)
16280    optional int64 session_id = 1;
16281
16282    // Indicates what type of user journey this session is related to
16283    enum Journey {
16284        UNKNOWN = 0; // Undefined user lifecycle journey
16285        USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
16286        USER_SWITCH_FG = 2; // A user switch journey without a UI shown
16287        USER_START = 3; // A user start journey
16288        USER_CREATE = 4; // A user creation journey
16289        USER_STOP = 5; // A user stop journey
16290        USER_REMOVE = 6; // A user removal journey
16291        GRANT_ADMIN = 7; // An admin grant journey
16292        REVOKE_ADMIN = 8; // An admin revocation journey
16293        USER_LIFECYCLE = 9; // User journey from creation to deletion
16294    }
16295    optional Journey journey = 2;
16296    // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
16297    // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
16298    optional int32 origin_user = 3;
16299    // Which user the journey is targeting
16300    // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
16301    optional int32 target_user = 4;
16302
16303    // What is the user type of the target user
16304    // These should be in sync with USER_TYPE_* flags defined in UserManager.java
16305    enum UserType {
16306        TYPE_UNKNOWN = 0;
16307        FULL_SYSTEM = 1;
16308        FULL_SECONDARY = 2;
16309        FULL_GUEST = 3;
16310        FULL_DEMO = 4;
16311        FULL_RESTRICTED = 5;
16312        PROFILE_MANAGED = 6;
16313        SYSTEM_HEADLESS = 7;
16314        PROFILE_CLONE = 8;
16315    }
16316    optional UserType user_type = 5;
16317    // What are the flags attached to the target user
16318    optional int32 user_flags = 6;
16319    optional int32 error_code = 7;
16320    optional int64 elapsed_time = 8;
16321}
16322
16323/**
16324 * An event logged when a specific user lifecycle event is performed. These events should be
16325 * correlated with a UserLifecycleJourneyReported atom via the session_id.
16326 * Note: journeys can span over multiple events, hence some events may share a single session id.
16327 *
16328 * Logged from:
16329 *   frameworks/base/services/core/java/com/android/server/am/UserController.java
16330 *   frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
16331 */
16332message UserLifecycleEventOccurred {
16333    // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
16334    optional int64 session_id = 1;
16335    // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
16336    // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
16337    optional int32 user_id = 2;
16338
16339    enum Event {
16340        UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
16341        SWITCH_USER = 1; // Indicates that this is a user switch event
16342        START_USER = 2; // Indicates that this is a user start event
16343        CREATE_USER = 3; // Indicates that this is a user create event
16344        USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
16345        UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
16346        UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
16347        STOP_USER = 7; // Indicates that this is a user stop event
16348        REMOVE_USER = 8; // Indicates that this is a user removal event
16349        GRANT_ADMIN = 9; // Indicates that this is an admin privileges grant event
16350        REVOKE_ADMIN = 10; // Indicates that this is an admin privileges revocation event
16351    }
16352    optional Event event = 3;
16353
16354    enum State {
16355        NONE = 0; // Indicates the associated event has no start/end defined
16356        BEGIN = 1;
16357        FINISH = 2;
16358        CANCEL = 3;
16359        ERROR = 4;
16360    }
16361    optional State state = 4; // Represents the state of an event (beginning/ending)
16362    optional int32 error_code = 5;
16363}
16364
16365/**
16366 * The UserInfo information about an Android user (as used in UserManager multiuser).
16367 *
16368 * Currently, we do not include information about user 0, since it is uninteresting.
16369 *
16370 * This will be pulled from
16371 *     frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
16372 */
16373message UserInfo {
16374    // The @UserIdInt userId of the user
16375    optional int32 user_id = 1;
16376
16377    // The type of user, if AOSP-defined, such as {@link UserManager#USER_TYPE_PROFILE_MANAGED}
16378    optional UserLifecycleJourneyReported.UserType user_type = 2;
16379
16380    // The type of user if not AOSP-defined. Will be empty if user_type is not TYPE_UNKNOWN.
16381    optional string user_type_custom = 3;
16382
16383    // The @UserInfoFlag UserInfo flags of user.
16384    optional int32 user_flags = 4;
16385
16386    // Wall-clock time in milliseconds when user was created, according to System.currentTimeMillis
16387    optional int64 creation_time_millis = 5;
16388
16389    // Wall-clock time in milliseconds when user last entered the state of STATE_RUNNING_UNLOCKED,
16390    // according to System.currentTimeMillis
16391    optional int64 last_logged_in_time_millis = 6;
16392
16393    // True if user is currently running and unlocked.
16394    // Note that this is NOT synonymous with being the 'current' user. Multiple users may be
16395    // running unlocked, with one in the foreground and others running in the background.
16396    optional bool is_user_running_unlocked = 7;
16397}
16398
16399
16400/**
16401 * The MultiUserInfo information about maximum supported users on the device.
16402 *
16403 * This will be pulled from
16404 *     frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
16405 */
16406message MultiUserInfo {
16407    // Maximum users supported on the device
16408    optional int32 max_supported_users = 1;
16409    // Whether multi user setting is on.
16410    optional bool multi_user_setting_on = 2;
16411    // Whether device supports multiuser and owner have no restriction in adding users.
16412    optional bool supports_adding_full_users = 3;
16413}
16414
16415/**
16416 * Logs when accessibility shortcut clicked.
16417 *
16418 * Logged from:
16419 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
16420 */
16421message AccessibilityShortcutReported {
16422    // The accessibility feature(including installed a11y service, framework a11y feature,
16423    // and installed a11y activity) package name that is assigned to the accessibility shortcut.
16424    optional string package_name = 1;
16425
16426    // The definition of the accessibility shortcut.
16427    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
16428    optional android.stats.accessibility.ShortcutType shortcut_type = 2;
16429
16430    // The definition of the service status.
16431    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
16432    optional android.stats.accessibility.ServiceStatus service_status = 3;
16433}
16434
16435/**
16436 * Logs when accessibility service status changed.
16437 *
16438 * Logged from:
16439 *   packages/apps/Settings/src/com/android/settings/accessibility
16440 */
16441message AccessibilityServiceReported {
16442    // The accessibility service package name.
16443    optional string package_name = 1;
16444
16445    // The definition of the service status.
16446    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
16447    optional android.stats.accessibility.ServiceStatus service_status = 2;
16448}
16449
16450/**
16451 * Pulls accessibility shortcuts status.
16452 *
16453 * Pulled from:
16454 *   StatsPullAtomService
16455 */
16456message AccessibilityShortcutStats {
16457    // The definition of the accessibility software shortcut.
16458    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
16459    optional android.stats.accessibility.ShortcutType software_shortcut_type = 1;
16460    // Number of accessibility services in accessibility software shortcut.
16461    optional int32 software_shortcut_service_num = 2;
16462
16463    // The definition of the accessibility hardware shortcut.
16464    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
16465    optional android.stats.accessibility.ShortcutType hardware_shortcut_type = 3;
16466    // Number of accessibility services in accessibility hardware shortcut.
16467    optional int32 hardware_shortcut_service_num = 4;
16468
16469    // The definition of the accessibility gesture shortcut.
16470    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
16471    optional android.stats.accessibility.ShortcutType gesture_shortcut_type = 5;
16472    // Number of accessibility services in accessibility gesture shortcut.
16473    optional int32 gesture_shortcut_service_num = 6;
16474}
16475
16476/**
16477 * Pulls accessibility floating menu status.
16478 *
16479 * Pulled from:
16480 *   StatsPullAtomService
16481 */
16482message AccessibilityFloatingMenuStats {
16483    // Size of the accessibility floating menu.
16484    optional int32 size = 1;
16485    // Icon shape of the accessibility floating menu.
16486    optional int32 icon_type = 2;
16487    // Whether the accessibility floating menu is enable auto fade ability.
16488    optional bool fade_enabled = 3;
16489    // Opacity of the accessibility floating menu. The range is between 0 and 1.
16490    optional float opacity = 4;
16491}
16492
16493/**
16494 * Logs when display wake up.
16495 *
16496 * Logged from:
16497 *   services/core/java/com/android/server/power/Notifier.java
16498 */
16499
16500message DisplayWakeReported {
16501    // Wake_up_reason code
16502    // If LOWORD(wake_up_reason) = 0
16503    //     reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
16504    //     else reference wake_up_reason to
16505    //     services/core/java/com/android/server/power/Notifier.java#onWakeUp
16506    optional int32 wake_up_reason = 1;
16507    // UID that caused the display to wake
16508    optional int32 uid = 2 [(is_uid) = true];
16509}
16510
16511/**
16512 * Logs app usage events.
16513 */
16514message AppUsageEventOccurred {
16515    optional int32 uid = 1 [(is_uid) = true];
16516    optional string package_name = 2;
16517    optional string class_name = 3;
16518
16519    enum EventType {
16520        NONE = 0;
16521        MOVE_TO_FOREGROUND = 1;
16522        MOVE_TO_BACKGROUND = 2;
16523    }
16524    optional EventType event_type = 4;
16525}
16526
16527/*
16528 * Quality metrics logged when EVS cameras are active.
16529 *
16530 * Logged from:
16531 *  packages/services/Car/evs/manager/1.1/Enumerator.cpp
16532 */
16533message EvsUsageStatsReported {
16534
16535    // Camera identifier to distinguish the source camera device.  This is not
16536    // globally unique and therefore cannot be used to identify the user and/or
16537    // the device.
16538    optional int32 device_id = 1;
16539
16540    // Peak number of clients during the service
16541    optional int32 peak_num_clients = 2;
16542
16543    // Number of erroneous events during the service
16544    optional int32 num_errors = 3;
16545
16546    // Round trip latency of the very first frame
16547    optional int64 first_latency_millis = 4;
16548
16549    // Average frame round trip latency
16550    optional float avg_latency_millis = 5;
16551
16552    // Peak frame round trip latency
16553    optional int64 peak_latency_millis = 6;
16554
16555    // Total number of frames received
16556    optional int64 total_frames = 7;
16557
16558    // Number of frames ignored
16559    optional int64 ignored_frames = 8;
16560
16561    // Number of dropped frames to synchronize camera devices
16562    optional int64 dropped_frames_to_sync = 9;
16563
16564    // The duration of the service
16565    optional int64 duration_millis = 10;
16566}
16567
16568/**
16569 * Logs audio power usage stats.
16570 *
16571 * Pushed from:
16572 *  frameworks/av/services/mediametrics/AudioPowerUsage.cpp
16573 */
16574message AudioPowerUsageDataReported {
16575    /**
16576     * Device used for input/output
16577     *
16578     * All audio devices please refer to below file:
16579     * system/media/audio/include/system/audio-base.h
16580     *
16581     * Define our own enum values because we don't report all audio devices.
16582     * Currently, we only report built-in audio devices such as handset, speaker,
16583     * built-in mics, common audio devices such as wired headset, usb headset
16584     * and bluetooth devices.
16585     */
16586    enum AudioDevice {
16587        OUTPUT_EARPIECE         = 0x1; // handset
16588        OUTPUT_SPEAKER          = 0x2; // dual speaker
16589        OUTPUT_WIRED_HEADSET    = 0x4; // 3.5mm headset
16590        OUTPUT_USB_HEADSET      = 0x8; // usb headset
16591        OUTPUT_BLUETOOTH_SCO    = 0x10; // bluetooth sco
16592        OUTPUT_BLUETOOTH_A2DP   = 0x20; // a2dp
16593        OUTPUT_SPEAKER_SAFE     = 0x40; // bottom speaker
16594
16595        INPUT_DEVICE_BIT        = 0x40000000; // non-negative positive int32.
16596        INPUT_BUILTIN_MIC       = 0x40000001; // buildin mic
16597        INPUT_BUILTIN_BACK_MIC  = 0x40000002; // buildin back mic
16598        INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
16599        INPUT_USB_HEADSET_MIC   = 0x40000008; // usb headset mic
16600        INPUT_BLUETOOTH_SCO     = 0x40000010; // bluetooth sco mic
16601    }
16602    optional AudioDevice audio_device = 1;
16603
16604    // Duration of the audio in seconds
16605    optional int32 duration_secs = 2;
16606
16607    // Average volume (0 ... 1.0)
16608    optional float average_volume = 3;
16609
16610    enum AudioType {
16611        UNKNOWN_TYPE = 0;
16612        VOICE_CALL_TYPE = 1; // voice call
16613        VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
16614        MEDIA_TYPE = 3; // music and system sound
16615        RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
16616        ALARM_TYPE = 5; // alarm type
16617        // record type
16618        CAMCORDER_TYPE = 6; // camcorder
16619        RECORD_TYPE = 7;  // other recording
16620    }
16621    optional AudioType type = 4;
16622
16623    // Minimum volume duration of the audio in seconds
16624    optional int32 minimum_volume_duration_secs = 5;
16625
16626    // Minimum volume (0 ... 1.0)
16627    optional float minimum_volume = 6;
16628
16629    // Maximum volume duration of the audio in seconds
16630    optional int32 maximum_volume_duration_secs = 7;
16631
16632    // Maximum volume (0 ... 1.0)
16633    optional float maximum_volume = 8;
16634}
16635
16636/**
16637 * Logs the Spatializer capability when the Spatializer is created.
16638 *
16639 * We expect this to occur only once on a healthy system,
16640 * when audioserver is initialized.
16641 *
16642 * On devices that do not support spatialization,
16643 * SpatializerLevel returns SPATIALIZER_LEVEL_NONE only.
16644 *
16645 * Logged from:
16646 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16647 */
16648message MediametricsSpatializerCapabilitiesReported {
16649    // Available head tracking modes
16650    repeated android.media.audio.HeadTrackingMode head_tracking_modes = 1;
16651
16652    // Available spatializer levels
16653    repeated android.media.audio.SpatializerLevel spatializer_levels = 2;
16654
16655    // Available spatializer modes
16656    repeated android.media.audio.SpatializerMode spatializer_modes = 3;
16657
16658    // Available channel masks, with each channel position bitwise ORed.
16659    // One or more bits from
16660    // system/media/audio/include/system/audio-hal-enums.h
16661    // audio_channel_mask_t, representing the channel configuration
16662    // of AudioTrack data.
16663    //
16664    // Generally the most populated channel_mask is selected for use.
16665    repeated int64 channel_masks = 4;
16666}
16667
16668/**
16669 * Logs when Spatializer is enabled or disabled for a device.
16670 *
16671 * The event field indicates the reason for enabling or disabling:
16672 * through the Settings UI, startup/boot, or new device detection.
16673 *
16674 * The presence of this message indicates that the audio device type
16675 * supports Spatialization; this is generally a fixed
16676 * property of the platform and depends if the device type is considered
16677 * BINAURAL or TRANSAURAL, and the Spatializer support for it.
16678 *
16679 * This logs existing saved state on BOOT and changes afterwards.
16680 * Due to rpc to the MediaMetrics service which generates the atom,
16681 * the timestamp of the atom may have a slight delay.
16682 *
16683 * Logged from:
16684 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16685 */
16686message MediametricsSpatializerDeviceEnabledReported {
16687    // Device type enumeration, e.g. BUILTIN_SPEAKER, BT_A2DP, etc.
16688    optional android.media.audio.AudioDeviceInfoType type = 1;
16689
16690    // The event field indicates the reason for enabling or disabling:
16691    // NORMAL: from Settings UI.
16692    // BOOT: on startup/boot.
16693    // FIRST: on new device detection.
16694    optional android.media.audio.SpatializerSettingEvent event = 2;
16695
16696    // Whether the spatializer is enabled on that device.
16697    // This triggers only on a change of state.
16698    // If multiple devices share the same type (e.g. bluetooth headsets),
16699    // they will register separate messages.
16700    optional bool enabled = 3;
16701}
16702
16703/**
16704 * Logs whether the HeadTracker is enabled for a device.
16705 *
16706 * This only changes if there is a HeadTracker associated with the device.
16707 *
16708 * This logs existing saved state on BOOT and changes afterwards.
16709 * Due to rpc to the MediaMetrics service which generates the atom,
16710 * the timestamp of the atom may have a slight delay.
16711 *
16712 * Logged from:
16713 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16714 */
16715message MediametricsHeadTrackerDeviceEnabledReported {
16716    // Device type enumeration, e.g. BUILTIN_SPEAKER, BT_A2DP, etc.
16717    optional android.media.audio.AudioDeviceInfoType type = 1;
16718
16719    // The event field indicates the reason for enabling or disabling:
16720    // NORMAL: from Settings UI.
16721    // BOOT: on startup/boot.
16722    // FIRST: on new device detection.
16723    optional android.media.audio.SpatializerSettingEvent event = 2;
16724
16725    // Whether the head tracker was enabled or disabled on that device.
16726    // This triggers only on a change of state.
16727    // If multiple devices share the same type (e.g. bluetooth headsets),
16728    // they will register separate messages.
16729    optional bool enabled = 3;
16730}
16731
16732/**
16733 * Logs whether the HeadTracker is supported for a device.
16734 *
16735 * Generally a fixed property of the device, but it is possible
16736 * that the HeadTracker sensor might be turned off
16737 * or be temporarily unavailable.
16738 *
16739 * This logs existing saved state on BOOT and changes afterwards.
16740 * Due to rpc to the MediaMetrics service which generates the atom,
16741 * the timestamp of the atom may have a slight delay.
16742 *
16743 * Logged from:
16744 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16745 */
16746message MediametricsHeadTrackerDeviceSupportedReported {
16747    // Device type enumeration, e.g. BUILTIN_SPEAKER, BT_A2DP, etc.
16748    optional android.media.audio.AudioDeviceInfoType type = 1;
16749
16750    // The event field indicates the reason for enabling or disabling:
16751    // NORMAL: on sensor change.
16752    // BOOT: on startup/boot.
16753    // FIRST: on new device detection.
16754    optional android.media.audio.SpatializerSettingEvent event = 2;
16755
16756    // Whether the head tracker is supported on that device.
16757    // This triggers only on a change of state.
16758    // If multiple devices share the same type (e.g. bluetooth headsets),
16759    // they will register separate messages.
16760    optional bool supported = 3;
16761}
16762
16763/**
16764  * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
16765  *
16766  * Pulled from:
16767  *   StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
16768  */
16769message BytesTransferByTagAndMetered {
16770    optional int32 uid = 1 [(is_uid) = true];
16771
16772    optional bool is_metered = 2;
16773
16774    optional int32 tag = 3;
16775
16776    optional int64 rx_bytes = 4;
16777
16778    optional int64 rx_packets = 5;
16779
16780    optional int64 tx_bytes = 6;
16781
16782    optional int64 tx_packets = 7;
16783}
16784
16785/**
16786 * Logs when the Assistant is invoked.
16787 *
16788 * Logged from:
16789 *   frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
16790 */
16791message AssistantInvocationReported {
16792
16793    // The event_id (as for UiEventReported).
16794    optional int32 event_id = 1;
16795
16796    // The registered Assistant's uid and package (as for UiEventReported).
16797    optional int32 uid = 2 [(is_uid) = true];
16798    optional string package_name = 3;
16799
16800    // An identifier used to disambiguate which logs refer to a particular invocation of the
16801    // Assistant  (as for UiEventReported).
16802    optional int32 instance_id = 4;
16803
16804    // The state of the device at the time of invocation.
16805    enum DeviceState {
16806        UNKNOWN_DEVICE_STATE = 0;
16807        AOD1 = 1;
16808        AOD2 = 2;
16809        BOUNCER = 3;
16810        UNLOCKED_LOCKSCREEN = 4;
16811        LAUNCHER_HOME = 5;
16812        LAUNCHER_OVERVIEW = 6;
16813        LAUNCHER_ALL_APPS = 7;
16814        APP_DEFAULT = 8;
16815        APP_IMMERSIVE = 9;
16816        APP_FULLSCREEN = 10;
16817    }
16818    optional DeviceState device_state = 5;
16819
16820    // Whether the Assistant handles were showing at the time of invocation.
16821    optional bool assistant_handles_showing = 6;
16822}
16823
16824/**
16825 * Logs when an AudioRecord finishes running on an audio device
16826 *
16827 * Logged from:
16828 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16829 */
16830message MediametricsAudioRecordDeviceUsageReported {
16831    // The devices connected to this AudioRecord.
16832    // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
16833    // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
16834    // See audio_device_t in system/media/audio/include/system/audio-base.h
16835    optional string devices = 1;
16836
16837    // The name of the remote device attached to the device, typically available for USB or BT.
16838    // This may be empty for a fixed device, or separated by "|" if more than one.
16839    optional string device_names = 2;
16840
16841    // The amount of time spent in the device as measured by the active track in AudioFlinger.
16842    optional int64 device_time_nanos = 3;
16843
16844    // The audio data format used for encoding.
16845    // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
16846    optional string encoding = 4;
16847
16848    // The client-server buffer framecount.
16849    // The framecount is generally between 960 - 48000 for PCM encoding.
16850    // The framecount represents raw buffer size in bytes for non-PCM encoding.
16851    optional int32 frame_count = 5;
16852
16853    // The number of audio intervals (contiguous, continuous playbacks).
16854    optional int32 interval_count = 6;
16855
16856    // The sample rate of the AudioRecord.
16857    // A number generally between 8000-96000 (frames per second).
16858    optional int32 sample_rate = 7;
16859
16860    // The audio input flags used to construct the AudioRecord.
16861    // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
16862    optional string flags = 8;
16863
16864    // The santized package name of the audio client associated with the AudioRecord.
16865    // See getSanitizedPackageNameAndVersionCode() in
16866    // frameworks/av/services/mediametrics/MediaMetricsService.cpp
16867    optional string package_name = 9;
16868
16869    // The selected device id (nonzero if a non-default device is selected)
16870    optional int32 selected_device_id = 10;
16871
16872    // The caller of the AudioRecord.
16873    // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
16874    optional string caller = 11;
16875
16876    // The audio source for AudioRecord.
16877    // An enumeration from system/media/audio/include/system/audio-base.h audio_source_t
16878    optional string source = 12;
16879
16880    // Android S
16881    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
16882    // An empty string means no session id is set.
16883    optional string log_session_id = 13;
16884}
16885
16886/**
16887 * Logs when an AudioThread finishes running on an audio device
16888 *
16889 * Logged from:
16890 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16891 */
16892message MediametricsAudioThreadDeviceUsageReported {
16893    // The devices connected to this audio thread.
16894    // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
16895    // (for record threads):
16896    // See lookup<INPUT_DEVICE> in frameworks/av/services/mediametrics/AudioTypes.cpp
16897    // (for playback threads):
16898    // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
16899    // See audio_device_t in system/media/audio/include/system/audio-base.h
16900    optional string devices = 1;
16901
16902    // The name of the remote device attached to the device, typically available for USB or BT.
16903    // This may be empty for a fixed device, or separated by "|" if more than one.
16904    optional string device_names = 2;
16905
16906    // The amount of time spent in the device as measured by the active track in AudioFlinger.
16907    optional int64 device_time_nanos = 3;
16908
16909    // The audio data format used for encoding.
16910    // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
16911    optional string encoding = 4;
16912
16913    // The framecount of the buffer delivered to (or from) the HAL.
16914    // The framecount is generally ~960 for PCM encoding.
16915    // The framecount represents raw buffer size in bytes for non-PCM encoding.
16916    optional int32 frame_count = 5;
16917
16918    // The number of audio intervals (contiguous, continuous playbacks).
16919    optional int32 interval_count = 6;
16920
16921    // The sample rate of the audio thread.
16922    // A number generally between 8000-96000 (frames per second).
16923    optional int32 sample_rate = 7;
16924
16925    // The audio flags used to construct the thread
16926    // (for record threads):
16927    // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
16928    // (for playback threads):
16929    // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
16930    optional string flags = 8;
16931
16932    // The number of underruns encountered for a playback thread or the
16933    // number of overruns encountered for a capture thread.
16934    optional int32 xruns = 9;
16935
16936    // The type of thread
16937    // A thread type enumeration from
16938    // frameworks/av/mediametrics/services/Translate.h
16939    optional string type = 10;
16940}
16941
16942/**
16943 * Logs when an AudioTrack finishes running on an audio device
16944 *
16945 * Logged from:
16946 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16947 */
16948message MediametricsAudioTrackDeviceUsageReported {
16949    // The output devices connected to this AudioTrack.
16950    // A string OR of various output device categories, e.g. "DEVICE1|DEVICE2".
16951    // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
16952    // See audio_device_t in system/media/audio/include/system/audio-base.h
16953    optional string devices = 1;
16954
16955    // The name of the remote device attached to the device, typically available for USB or BT.
16956    // This may be empty for a fixed device, or separated by "|" if more than one.
16957    optional string device_names = 2;
16958
16959    // The amount of time spent in the device as measured by the active track in AudioFlinger.
16960    optional int64 device_time_nanos = 3;
16961
16962    // The audio data format used for encoding.
16963    // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
16964    optional string encoding = 4;
16965
16966    // The client-server buffer framecount.
16967    // The framecount is generally between 960 - 48000 for PCM encoding.
16968    // The framecount represents raw buffer size in bytes for non-PCM encoding.
16969    // A static track (see traits) may have a very large framecount.
16970    optional int32 frame_count = 5;
16971
16972    // The number of audio intervals (contiguous, continuous playbacks).
16973    optional int32 interval_count = 6;
16974
16975    // The sample rate of the AudioTrack.
16976    // A number generally between 8000-96000 (frames per second).
16977    optional int32 sample_rate = 7;
16978
16979    // The audio flags used to construct the AudioTrack.
16980    // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
16981    optional string flags = 8;
16982
16983    // The number of underruns encountered.
16984    optional int32 xruns = 9;
16985
16986    // The santized package name of the audio client associated with the AudioTrack.
16987    // See getSanitizedPackageNameAndVersionCode() in
16988    // frameworks/av/services/mediametrics/MediaMetricsService.cpp
16989    optional string package_name = 10;
16990
16991    // The latency of the last sample in the buffer in milliseconds.
16992    optional float device_latency_millis = 11;
16993
16994    // The startup time in milliseconds from start() to sample played.
16995    optional float device_startup_millis = 12;
16996
16997    // The average volume of the track on the device [ 0.f - 1.f ]
16998    optional float device_volume = 13;
16999
17000    // The selected device id (nonzero if a non-default device is selected)
17001    optional int32 selected_device_id = 14;
17002
17003    // The stream_type category for the AudioTrack.
17004    // An enumeration from system/media/audio/include/system/audio-base.h audio_stream_type_t
17005    optional string stream_type = 15;
17006
17007    // The usage for the AudioTrack.
17008    // An enumeration from system/media/audio/include/system/audio-base.h audio_usage_t
17009    optional string usage = 16;
17010
17011    // The content type of the AudioTrack.
17012    // An enumeration from system/media/audio/include/system/audio-base.h audio_content_type_t
17013    optional string content_type = 17;
17014
17015    // The caller of the AudioTrack.
17016    // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
17017    optional string caller = 18;
17018
17019    // The traits of the AudioTrack.
17020    // A string OR of different traits, may be empty string.
17021    // Only "static" is supported for R.
17022    // See lookup<TRACK_TRAITS>() in frameworks/av/services/mediametrics/AudioTypes.cpp
17023    optional string traits = 19;
17024
17025    // Android S
17026    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
17027    // An empty string means no session id is set.
17028    optional string log_session_id = 20;
17029}
17030
17031/**
17032 * Logs the status of an audio device connection attempt.
17033 *
17034 * Logged from:
17035 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17036 */
17037message MediametricsAudioDeviceConnectionReported {
17038    // The input devices represented by this report.
17039    // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
17040    // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
17041    // See audio_device_t in system/media/audio/include/system/audio-base.h
17042    optional string input_devices = 1;
17043
17044    // The output devices represented by this report.
17045    // A string OR of various output device categories.
17046    // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
17047    // See audio_device_t in system/media/audio/include/system/audio-base.h
17048    optional string output_devices = 2;
17049
17050    // The name of the remote device attached to the device, typically available for USB or BT.
17051    // This may be empty for a fixed device, or separated by "|" if more than one.
17052    optional string device_names = 3;
17053
17054    // The result of the audio device connection.
17055    // 0 indicates success: connection verified.
17056    // 1 indicates unknown: connection not verified or not known if diverted properly.
17057    // Other values indicate specific status.
17058    // See DeviceConnectionResult in frameworks/av/services/mediametrics/AudioTypes.h
17059    optional int32 result = 4;
17060
17061    // Average milliseconds of time to connect
17062    optional float time_to_connect_millis = 5;
17063
17064    // Number of connections if aggregated statistics, otherwise 1.
17065    optional int32 connection_count = 6;
17066}
17067
17068/**
17069 * Logs the status of an AudioRecord operation.
17070 *
17071 * Logged from:
17072 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17073 */
17074message MediametricsAudioRecordStatusReported {
17075    // General status code for categorization of status.
17076    optional android.media.Status status = 1;
17077
17078    // Status or error message, e.g. logcat.
17079    optional string debug_message = 2;
17080
17081    // Supplemental status subcode for AudioRecord.
17082    optional int32 status_subcode = 3;
17083
17084    // Uid associated with the AudioRecord.
17085    optional int32 uid = 4 [(is_uid) = true];
17086
17087    // The AudioRecord event.
17088    optional android.media.audio.AudioRecordEvent event = 5;
17089
17090    // Requested AudioRecord flags, with each flag bitwise ORed.
17091    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
17092    // audio_input_flags_t
17093    optional int32 input_flags = 6;
17094
17095    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
17096    // audio_source_t, representing the input source for the AudioRecord.
17097    optional android.media.audio.Source source = 7;
17098
17099    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
17100    // audio_format_t, representing the encoding of the AudioRecord data.
17101    optional android.media.audio.Encoding encoding = 8;
17102
17103    // Channel mask, with each channel position bitwise ORed.
17104    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
17105    // audio_channel_mask_t, representing the input channel configuration
17106    // of AudioRecord data.
17107    optional int64 channel_mask = 9;
17108
17109    // The size of the AudioRecord buffer in frames.
17110    // If an error occurs during creation, this may be a small integer requested size
17111    // as AudioFlinger is entitled to increase this as required.
17112    optional int32 buffer_frame_count = 10;
17113
17114    // Sample rate in Hz.
17115    optional int32 sample_rate = 11;
17116}
17117
17118/**
17119 * Logs the status of an AudioTrack operation.
17120 *
17121 * Logged from:
17122 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
17123 */
17124message MediametricsAudioTrackStatusReported {
17125    // General status code for categorization of status.
17126    optional android.media.Status status = 1;
17127
17128    // Status or error message, e.g. logcat.
17129    optional string debug_message = 2;
17130
17131    // Supplemental status subcode for AudioTrack.
17132    optional int32 status_subcode = 3;
17133
17134    // Uid associated with track
17135    optional int32 uid = 4 [(is_uid) = true];
17136
17137    // The AudioTrack event.
17138    optional android.media.audio.AudioTrackEvent event = 5;
17139
17140    // Requested AudioTrack flags, with each flag bitwise ORed.
17141    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
17142    // audio_output_flags_t
17143    optional int32 output_flags = 6;
17144
17145    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
17146    // audio_content_type_t, representing the content type of the AudioTrack.
17147    optional android.media.audio.ContentType content_type = 7;
17148
17149    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
17150    // audio_usage_t, representing the use case for the AudioTrack.
17151    optional android.media.audio.Usage usage = 8;
17152
17153    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
17154    // audio_format_t, representing the encoding of the AudioTrack data.
17155    optional android.media.audio.Encoding encoding = 9;
17156
17157    // Channel mask, with each channel position bitwise ORed.
17158    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
17159    // audio_channel_mask_t, representing the channel configuration of AudioTrack data.
17160    optional int64 channel_mask = 10;
17161
17162    // The size of the AudioTrack buffer in frames.
17163    // If an error occurs during creation, this may be a small integer requested size
17164    // as AudioFlinger is entitled to increase this as required.
17165    optional int32 buffer_frame_count = 11;
17166
17167    // Sample rate in Hz.
17168    optional int32 sample_rate = 12;
17169
17170    // Playback speed, nominal 1.f representing 1x.
17171    optional float speed = 13;
17172
17173    // Playback pitch, nominal 1.f representing 1x.
17174    optional float pitch = 14;
17175}
17176
17177/**
17178 * Logs: i) creation of different types of cryptographic keys in the keystore,
17179 * ii) operations performed using the keys,
17180 * iii) attestation of the keys
17181 * Logged from: system/security/keystore/key_event_log_handler.cpp
17182 */
17183message KeystoreKeyEventReported {
17184
17185    enum Algorithm {
17186        /** Asymmetric algorithms. */
17187        RSA = 1;
17188        // 2 removed, do not reuse.
17189        EC = 3;
17190        /** Block cipher algorithms */
17191        AES = 32;
17192        TRIPLE_DES = 33;
17193        /** MAC algorithms */
17194        HMAC = 128;
17195    };
17196    /** Algorithm associated with the key */
17197    optional Algorithm algorithm = 1;
17198
17199    /** Size of the key */
17200    optional int32 key_size = 2;
17201
17202    enum KeyOrigin {
17203        /** Generated in keymaster.  Should not exist outside the TEE. */
17204        GENERATED = 0;
17205        /** Derived inside keymaster.  Likely exists off-device. */
17206        DERIVED = 1;
17207        /** Imported into keymaster.  Existed as cleartext in Android. */
17208        IMPORTED = 2;
17209        /** Keymaster did not record origin. */
17210        UNKNOWN = 3;
17211        /** Securely imported into Keymaster. */
17212        SECURELY_IMPORTED = 4;
17213    };
17214    /* Logs whether the key was generated, imported, securely imported, or derived.*/
17215    optional KeyOrigin key_origin = 3;
17216
17217    enum HardwareAuthenticatorType {
17218        NONE = 0;
17219        PASSWORD = 1;
17220        FINGERPRINT = 2;
17221        // Additional entries must be powers of 2.
17222    };
17223    /**
17224     * What auth types does this key require? If none,
17225     * then no auth required.
17226     */
17227    optional HardwareAuthenticatorType user_auth_type = 4;
17228
17229    /**
17230     * If user authentication is required, is the requirement time based? If it
17231     * is not time based then this field will not be used and the key is per
17232     * operation. Per operation keys must be user authenticated on each usage.
17233     */
17234    optional int32 user_auth_key_timeout_secs = 5;
17235
17236    /**
17237     * padding mode, digest, block_mode and purpose should ideally be repeated
17238     * fields. However, since statsd does not support repeated fields in
17239     * pushed atoms, they are represented using bitmaps.
17240     */
17241
17242    /** Track which padding mode is being used.*/
17243    optional int32 padding_mode_bitmap = 6;
17244
17245    /** Track which digest is being used. */
17246    optional int32 digest_bitmap = 7;
17247
17248    /** Track what block mode is being used (for encryption). */
17249    optional int32 block_mode_bitmap = 8;
17250
17251    /** Track what purpose is this key serving. */
17252    optional int32 purpose_bitmap = 9;
17253
17254    enum EcCurve {
17255        P_224 = 0;
17256        P_256 = 1;
17257        P_384 = 2;
17258        P_521 = 3;
17259    };
17260    /** Which ec curve was selected if elliptic curve cryptography is in use **/
17261    optional EcCurve ec_curve = 10;
17262
17263    enum KeyBlobUsageRequirements {
17264        STANDALONE = 0;
17265        REQUIRES_FILE_SYSTEM = 1;
17266    };
17267    /** Standalone or is a file system required */
17268    optional KeyBlobUsageRequirements key_blob_usage_reqs = 11;
17269
17270    enum Type {
17271        key_operation = 0;
17272        key_creation = 1;
17273        key_attestation = 2;
17274    }
17275    /** Key creation event, operation event or attestation event? */
17276    optional Type type = 12;
17277
17278    /** Was the key creation, operation, or attestation successful? */
17279    optional bool was_successful = 13;
17280
17281    /** Response code or error code */
17282    optional int32 error_code = 14;
17283}
17284
17285/**
17286 * Logs: key creation events with Algorithm, Origin, Error and Attestation info.
17287 * Logged from: system/security/keystore2/metrics.rs
17288 */
17289message Keystore2KeyCreationWithGeneralInfo {
17290
17291    // Algorithm associated with the key
17292    optional android.system.security.keystore2.Algorithm algorithm = 1;
17293
17294    // Size of the key, based on the algorithm used.
17295    optional int32 key_size = 2;
17296
17297    enum EcCurve {
17298        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
17299        EC_CURVE_UNSPECIFIED = 0;
17300        P_224 = 1;
17301        P_256 = 2;
17302        P_384 = 3;
17303        P_521 = 4;
17304        CURVE_25519 = 5;
17305    };
17306    // Which ec curve was selected if elliptic curve cryptography is in use
17307    optional EcCurve ec_curve = 3;
17308
17309    enum KeyOrigin {
17310        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
17311        ORIGIN_UNSPECIFIED = 0;
17312        // Generated in keymaster.  Should not exist outside the TEE.
17313        GENERATED = 1;
17314        // Derived inside keymaster.  Likely exists off-device.
17315        DERIVED = 2;
17316        // Imported into keymaster.  Existed as cleartext in Android.
17317        IMPORTED = 3;
17318        // Previously used for another purpose that is now obsolete.
17319        RESERVED = 4;
17320        // Securely imported into Keymaster.
17321        SECURELY_IMPORTED = 5;
17322    };
17323    // Logs whether the key was generated, imported, securely imported, or derived.
17324    optional KeyOrigin key_origin = 4;
17325
17326    /**
17327     * Response code (system/hardware/interfaces/keystore2/aidl/../ResponseCode.aidl)
17328     * or
17329     * error code (hardware/interfaces/security/keymint/aidl/../ErrorCode.aidl)
17330     */
17331    optional int32 error_code = 5;
17332
17333    // Indicates whether key attestation is requested in creation
17334    optional bool attestation_requested = 6;
17335
17336    // Count of a particular combination of field values of this atom
17337    optional int32 count = 7;
17338}
17339
17340/**
17341 * Logs: key creation events with authentication info.
17342 * Logged from: system/security/keystore2/metrics.rs
17343 */
17344message Keystore2KeyCreationWithAuthInfo {
17345
17346    enum HardwareAuthenticatorType {
17347        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
17348        AUTH_TYPE_UNSPECIFIED = 0;
17349        NONE = 1;
17350        PASSWORD = 2;
17351        FINGERPRINT = 3;
17352        ANY = 5;
17353    };
17354    /**
17355     * What auth types does this key require? If none,
17356     * then no auth required.
17357     */
17358    optional HardwareAuthenticatorType user_auth_type = 1;
17359
17360    /**
17361     * If user authentication is required, is the requirement time based? If it
17362     * is time based then this field indicates the base 10 logarithm of time out in seconds.
17363     * Logarithm is taken in order to reduce the cardinaltiy.
17364     */
17365    optional int32 log_auth_timeout_seconds = 2;
17366
17367    // Security level of the Keymint instance which creates the key.
17368    optional android.system.security.keystore2.SecurityLevelEnum security_level = 3;
17369
17370    // Count of a particular combination of field values of this atom
17371    optional int32 count = 4;
17372}
17373
17374/**
17375 * Logs: key creation events with purpose and modes info.
17376 * Logged from: system/security/keystore2/metrics.rs
17377 */
17378message Keystore2KeyCreationWithPurposeAndModesInfo {
17379    // Algorithm associated with the key
17380    optional android.system.security.keystore2.Algorithm algorithm = 1;
17381
17382	/**
17383     * Track which purpose is being used.
17384     * Bitmap composition is given by KeyPurposeBitPosition enum
17385     * defined in system/security/keystore2/metrics.rs.
17386     */
17387    optional int32 purpose_bitmap = 2;
17388
17389    /**
17390     * Track which padding mode is being used.
17391     * Bitmap composition is given by PaddingModeBitPosition enum
17392     * defined in system/security/keystore2/metrics.rs.
17393     */
17394    optional int32 padding_mode_bitmap = 3;
17395
17396    /**
17397     * Track which digest is being used.
17398     * Bitmap composition is given by DigestBitPosition enum
17399     * defined in system/security/keystore2/metrics.rs.
17400     */
17401    optional int32 digest_bitmap = 4;
17402
17403    /**
17404     * Track which block mode is being used.
17405     * Bitmap composition is given by BlockModeBitPosition enum
17406     * defined in system/security/keystore2/metrics.rs.
17407     */
17408    optional int32 block_mode_bitmap = 5;
17409
17410    // Count of a particular combination of field values of this atom
17411    optional int32 count = 6;
17412}
17413
17414/**
17415 * Logs the atom id of the atoms associated with key creation/operation events, that have reached
17416 * the maximum storage limit allocated for different atom objects of that atom,
17417 * in keystore in-memory store.
17418 *
17419 * Size of the storage bucket for each atom is limited considering their expected cardinaltity.
17420 * This limit may exceed if the dimensions of the atoms take a large number of unexpected
17421 * combinations. This atom is used to track such cases.
17422 */
17423message Keystore2AtomWithOverflow {
17424
17425    // Atom id as defined in atoms.proto
17426    optional int32 atom_id = 1;
17427
17428    // Count of the objects of this atom type that have overflowed.
17429    optional int32 count = 2;
17430}
17431
17432/**
17433 * Logs: key operations events with purpose and modes info.
17434 * Logged from: system/security/keystore2/metrics.rs
17435 */
17436message Keystore2KeyOperationWithPurposeAndModesInfo {
17437
17438    enum KeyPurpose {
17439        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
17440        KEY_PURPOSE_UNSPECIFIED = 0;
17441
17442        // Usable with RSA, 3DES and AES keys.
17443        ENCRYPT = 1;
17444
17445        // Usable with RSA, 3DES and AES keys.
17446        DECRYPT = 2;
17447
17448        // Usable with RSA, EC and HMAC keys.
17449        SIGN = 3;
17450
17451        // Usable with RSA, EC and HMAC keys.
17452        VERIFY = 4;
17453
17454        // 5 is reserved
17455        // Usable with RSA keys.
17456        WRAP_KEY = 6;
17457
17458        // Key Agreement, usable with EC keys.
17459        AGREE_KEY = 7;
17460
17461        // Usable as an attestation signing key.
17462        ATTEST_KEY = 8;
17463    }
17464    // Purpose of the key operation
17465    optional KeyPurpose purpose = 1;
17466
17467    /**
17468     * Track which padding mode is being used.
17469     * Bitmap composition is given by PaddingModeBitPosition enum
17470     * defined in system/security/keystore2/metrics.rs.
17471     */
17472    optional int32 padding_mode_bitmap = 2;
17473
17474    /**
17475     * Track which digest is being used.
17476     * Bitmap composition is given by DigestBitPosition enum
17477     * defined in system/security/keystore2/metrics.rs.
17478     */
17479    optional int32 digest_bitmap = 3;
17480
17481    /**
17482     * Track which block mode is being used.
17483     * Bitmap composition is given by BlockModeBitPosition enum
17484     * defined in system/security/keystore2/metrics.rs.
17485     */
17486    optional int32 block_mode_bitmap = 4;
17487
17488    // Count of a particular combination of field values of this atom
17489    optional int32 count = 5;
17490}
17491
17492/**
17493 * Logs key operations events with outcome, error_code, security level and whether the key is
17494 * upgraded during the operation.
17495 * Logged from: system/security/keystore2/metrics.rs
17496 */
17497message Keystore2KeyOperationWithGeneralInfo {
17498
17499    enum Outcome {
17500        OUTCOME_UNSPECIFIED = 0;
17501        DROPPED = 1;
17502        SUCCESS = 2;
17503        ABORT = 3;
17504        PRUNED = 4;
17505        ERROR = 5;
17506    }
17507    // Outcome of the operation
17508    optional Outcome outcome = 1;
17509
17510    // Response code or error code in case of error outcome
17511    optional int32 error_code = 2;
17512
17513    // Indicates whether the key was upgraded during the operation
17514    optional bool key_upgraded = 3;
17515
17516    // Security level of the Keymint instance which performs the operation.
17517    optional android.system.security.keystore2.SecurityLevelEnum security_level = 4;
17518
17519    // Count of a particular combination of field values of this atom
17520    optional int32 count = 5;
17521}
17522
17523/**
17524 * Logs: Keystore 2 storage statistics.
17525 * Logged from: system/security/keystore2
17526 */
17527message Keystore2StorageStats {
17528    enum Storage {
17529       STORAGE_UNSPECIFIED = 0;
17530       KEY_ENTRY = 1;
17531       KEY_ENTRY_ID_INDEX = 2;
17532       KEY_ENTRY_DOMAIN_NAMESPACE_INDEX = 3;
17533       BLOB_ENTRY = 4;
17534       BLOB_ENTRY_KEY_ENTRY_ID_INDEX = 5;
17535       KEY_PARAMETER = 6;
17536       KEY_PARAMETER_KEY_ENTRY_ID_INDEX = 7;
17537       KEY_METADATA = 8;
17538       KEY_METADATA_KEY_ENTRY_ID_INDEX = 9;
17539       GRANT = 10;
17540       AUTH_TOKEN = 11;
17541       BLOB_METADATA = 12;
17542       BLOB_METADATA_BLOB_ENTRY_ID_INDEX =13;
17543       METADATA = 14;
17544       DATABASE = 15;
17545       LEGACY_STORAGE = 16;
17546    }
17547    // Type of the storage (database table or legacy storage) of which the size is reported.
17548    optional Storage storage_type = 1;
17549    // Storage size in bytes
17550    optional int64 size = 2;
17551    // Unused space, in bytes. The total storage size may be larger, indicating
17552    // inefficiencies in the packing of data in the database.
17553    optional int64 unused_size = 3;
17554}
17555
17556/**
17557 * Logs Remote Key Provisioning (RKP) related error events.
17558 * Logged from: system/security/keystore2
17559 */
17560message RkpErrorStats {
17561
17562    enum RkpError {
17563        RKP_ERROR_UNSPECIFIED = 0;
17564        // The key pool is out of keys.
17565        OUT_OF_KEYS = 1;
17566        // Falling back to factory provisioned keys during hybrid mode.
17567        FALL_BACK_DURING_HYBRID = 2;
17568    }
17569    // Type of the error event
17570    optional RkpError rkp_error = 1;
17571
17572    // Count of a particular error occurred.
17573    optional int32 count = 2;
17574
17575    /**
17576     * Security level of the IRemotelyProvisionedComponent.
17577     */
17578    optional android.system.security.keystore2.SecurityLevelEnum security_level = 3;
17579}
17580
17581
17582/**
17583 * Deprecated in U. Use RkpdPoolStats instead.
17584 *
17585 * Logs: Status of the attestation key pool related to
17586 * Remote Key Provisioning (RKP).
17587 * Logged from: system/security/keystore2
17588 */
17589message RkpPoolStats {
17590    /**
17591     * Security level of the Keymint instance associated with the
17592     * attestation pool status.
17593     */
17594    optional android.system.security.keystore2.SecurityLevelEnum security_level = 1;
17595
17596    /**
17597     * The number of signed attestation certificate chains which are
17598     * expired.
17599     */
17600    optional int32 expiring = 2;
17601
17602    /**
17603     * The number of signed attestation certificate chains which have
17604     * not yet been assigned to an app.
17605     */
17606    optional int32 unassigned = 3;
17607
17608    /**
17609     * The number of signed attestation keys.
17610     */
17611    optional int32 attested = 4;
17612
17613    /**
17614     * The total number of attestation keys.
17615     */
17616    optional int32 total = 5;
17617}
17618
17619/**
17620 * Logs: Number of keystore2 crashes per-boot cycle.
17621 * Logged from: system/security/keystore2
17622 */
17623message Keystore2CrashStats {
17624    optional int32 count_of_crash_events = 1;
17625}
17626
17627// Blob Committer stats
17628// Keep in sync between:
17629//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
17630//     frameworks/base/cmds/statsd/src/atoms.proto
17631message BlobCommitterProto {
17632    // Committer app's uid
17633    optional int32 uid = 1 [(is_uid) = true];
17634
17635    // Unix epoch timestamp of the commit in milliseconds
17636    optional int64 commit_timestamp_millis = 2;
17637
17638    // Flags of what access types the committer has set for the Blob
17639    optional int32 access_mode = 3;
17640
17641    // Number of packages that have been whitelisted for ACCESS_TYPE_WHITELIST
17642    optional int32 num_whitelisted_package = 4;
17643}
17644
17645// Blob Leasee stats
17646// Keep in sync between:
17647//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
17648//     frameworks/base/cmds/statsd/src/atoms.proto
17649message BlobLeaseeProto {
17650    // Leasee app's uid
17651    optional int32 uid = 1 [(is_uid) = true];
17652
17653    // Unix epoch timestamp for lease expiration in milliseconds
17654    optional int64 lease_expiry_timestamp_millis = 2;
17655}
17656
17657// List of Blob Committers
17658// Keep in sync between:
17659//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
17660//     frameworks/base/cmds/statsd/src/atoms.proto
17661message BlobCommitterListProto {
17662    repeated BlobCommitterProto committer = 1;
17663}
17664
17665// List of Blob Leasees
17666// Keep in sync between:
17667//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
17668//     frameworks/base/cmds/statsd/src/atoms.proto
17669message BlobLeaseeListProto {
17670    repeated BlobLeaseeProto leasee = 1;
17671}
17672
17673/**
17674 * Logs the current state of a Blob committed with BlobStoreManager
17675 *
17676 * Pulled from:
17677 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
17678 */
17679message BlobInfo {
17680    // Id of the Blob
17681    optional int64 blob_id = 1;
17682
17683    // Size of the Blob data
17684    optional int64 size = 2;
17685
17686    // Unix epoch timestamp of the Blob's expiration in milliseconds
17687    optional int64 expiry_timestamp_millis = 3;
17688
17689    // List of committers of this Blob
17690    optional BlobCommitterListProto committers = 4 [(log_mode) = MODE_BYTES];
17691
17692    // List of leasees of this Blob
17693    optional BlobLeaseeListProto leasees = 5 [(log_mode) = MODE_BYTES];
17694}
17695
17696/**
17697 * Logs when the HDMI CEC active source changes.
17698 *
17699 * Logged from:
17700 *   frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecAtomWriter.java
17701 */
17702message HdmiCecActiveSourceChanged {
17703    // The logical address of the active source.
17704    optional android.stats.hdmi.LogicalAddress active_source_logical_address = 1;
17705
17706    // The physical address of the active source. Consists of four hexadecimal nibbles.
17707    // Examples: 0x1234, 0x0000 (root device). 0xFFFF represents an unknown or invalid address.
17708    // See section 8.7 in the HDMI 1.4b spec for details.
17709    optional int32 active_source_physical_address = 2;
17710
17711    // The relationship between this device and the active source.
17712    optional android.stats.hdmi.PathRelationship local_relationship = 3;
17713}
17714
17715/**
17716 * Logs when an HDMI CEC message is sent or received.
17717 *
17718 * Logged from:
17719 *   frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecAtomWriter.java
17720 */
17721message HdmiCecMessageReported {
17722    // The calling uid of the application that caused this atom to be written.
17723    optional int32 uid = 1 [(is_uid) = true];
17724
17725    // Whether a HDMI CEC message is sent from this device, to this device, or neither.
17726    optional android.stats.hdmi.MessageDirection direction = 2;
17727
17728    // The HDMI CEC logical address of the initiator.
17729    optional android.stats.hdmi.LogicalAddress initiator_logical_address = 3;
17730
17731    // The HDMI CEC logical address of the destination.
17732    optional android.stats.hdmi.LogicalAddress destination_logical_address = 4;
17733
17734    // The opcode of the message. Ranges from 0x00 to 0xFF.
17735    // For all values, see section "CEC 15 Message Descriptions" in the HDMI CEC 1.4b spec.
17736    optional int32 opcode = 5;
17737
17738    // The result of attempting to send the message on its final retransmission attempt.
17739    // Only applicable to outgoing messages; set to SEND_MESSAGE_RESULT_UNKNOWN otherwise.
17740    optional android.stats.hdmi.SendMessageResult send_message_result = 6;
17741
17742    // Fields specific to <User Control Pressed> messages
17743
17744    // The user control command that was received.
17745    optional android.stats.hdmi.UserControlPressedCommand user_control_pressed_command = 7;
17746
17747    // Fields specific to <Feature Abort> messages
17748
17749    // The opcode of the message that was feature aborted.
17750    // Set to 0x100 when unknown or not applicable.
17751    optional int32 feature_abort_opcode = 8;
17752
17753    // The reason for the feature abort.
17754    optional android.stats.hdmi.FeatureAbortReason feature_abort_reason = 9;
17755}
17756
17757/**
17758 * Logs when an auto rotate event occurs while smart auto rotate is enabled.
17759 */
17760message AutoRotateReported {
17761    enum Orientation {
17762        UNKNOWN = 0;
17763        DEPRECATED = 1;
17764        ROTATION_0 = 2;
17765        ROTATION_90 = 3;
17766        ROTATION_180 = 4;
17767        ROTATION_270 = 5;
17768        DISABLED = 6;
17769        UNAVAILABLE = 7;
17770        FAILURE = 8;
17771    }
17772
17773    // Orientation of the device when a rotation was detected.
17774    optional Orientation current_orientation = 1;
17775    // The orientation of the phone after rotation before going through the recommendation service.
17776    optional Orientation proposed_orientation = 2;
17777    // Orientation recommended by the smart autorotate service component outside of the platform. It
17778    // may or may not match the proposed_orientation. Can be disabled or unavailable if the
17779    // recommendation service is disabled or unavailable. Will be unknown if the service failed.
17780    optional Orientation recommended_orientation = 3;
17781    // Time taken to calculate the rotation recommendation.
17782    optional int64 recommendation_process_duration_millis = 4;
17783}
17784
17785/**
17786 * Logs when sensors only autorotate is triggered. Associated event can be a rotation preindication,
17787 * actual event or a "data ready to be pulled" indication. More info: go/autorotate-logging.
17788 *
17789 * Logged from:
17790 *    platform/vendor/unbundled_google/packages/SystemUIGoogle/src/com/google/android/systemui/autorotate/DataLogger.java
17791 */
17792
17793message DeviceRotated {
17794  // Timestamp of the event in millis. We log the timestamp explicitly since
17795  // data logging will follow the event logging and all these
17796  // will be joined with other logs such as rotation button clicked.
17797  optional int64 timestamp_millis = 1;
17798  // Device orientation
17799  optional android.stats.wm.Orientation proposed_orientation = 2;
17800
17801  enum RotationEventType{
17802    UNKNOWN = 0;
17803    // An early indication of device might be rotated.
17804    PREINDICATION = 1;
17805    // Device rotation is detected.
17806    ACTUAL_EVENT = 2;
17807    // Device rotated and the data associated with it is ready to be pulled.
17808    // This happens after the ACTUAL_EVENT since some data after the event is
17809    // also useful.
17810    DATA_READY = 3;
17811  }
17812  optional RotationEventType rotation_event_type = 3;
17813}
17814
17815/**
17816 * Records the raw sensor data published by the device orientation debug sensor. The pull will be
17817 * configured to be conditioned on the {@code DeviceRotated} atom.
17818 *
17819 * Logged from:
17820 *     platform/vendor/unbundled_google/packages/SystemUIGoogle/src/com/google/android/systemui/autorotate/DataLogger.java
17821 */
17822message DeviceRotatedData {
17823  // All the sensor data and timestamps used to calculate the orientation
17824  optional DeviceRotatedSensorData snapshot = 1 [(log_mode) = MODE_BYTES];
17825  // Resulting orientation
17826  optional android.stats.wm.Orientation proposed_orientation = 2;
17827}
17828
17829message DeviceRotatedSensorData {
17830  optional DeviceRotatedSensorHeader header = 1 [(log_mode) = MODE_BYTES];
17831  repeated DeviceRotatedSensorSample sample = 2 [(log_mode) = MODE_BYTES];
17832}
17833
17834message DeviceRotatedSensorHeader {
17835  optional int64 timestamp_base_millis = 1;
17836}
17837
17838message DeviceRotatedSensorSample{
17839  optional int32 timestamp_offset_millis = 1;
17840  enum SensorType {
17841    UNKNOWN = 0;
17842    ACCEL = 1;
17843    GYRO = 2;
17844  }
17845  optional SensorType sensor_type = 2;
17846  optional float x_value = 3;
17847  optional float y_value = 4;
17848  optional float z_value = 5;
17849}
17850
17851/**
17852  * Pushes TLS handshake counters from Conscrypt.
17853  * Pulled from:
17854  *   external/conscrypt/common/src/main/java/org/conscrypt/ConscryptEngineSocket.java
17855  *   external/conscrypt/common/src/main/java/org/conscrypt/ConscryptFileDescriptorSocket.java
17856  */
17857message TlsHandshakeReported {
17858    optional bool success = 1;
17859
17860    optional android.stats.tls.Protocol protocol = 2;
17861
17862    optional android.stats.tls.CipherSuite cipher_suite = 3;
17863
17864    optional int32 handshake_duration_millis = 4;
17865
17866    optional android.stats.tls.Source source = 5;
17867}
17868
17869/**
17870 * Logs when a TextClassifier API is invoked.
17871 *
17872 * See frameworks/base/core/java/android/view/textclassifier/TextClassifier.java
17873 * Logged from: external/libtextclassifier/java/
17874 */
17875message TextClassifierApiUsageReported {
17876    enum ApiType {
17877        UNKNOWN_API = 0;
17878        SUGGEST_SELECTION = 1;
17879        CLASSIFY_TEXT = 2;
17880        GENERATE_LINKS = 3;
17881        DETECT_LANGUAGES = 4;
17882        SUGGEST_CONVERSATION_ACTIONS = 5;
17883    }
17884    optional ApiType api_type = 1;
17885
17886    enum ResultType {
17887        UNKNOWN_RESULT = 0;
17888        SUCCESS = 1;
17889        FAIL = 2;
17890    }
17891    optional ResultType result_type = 2;
17892    optional int64 latency_millis = 3;
17893    optional string session_id = 4;
17894}
17895
17896/**
17897 * Logs when TextClassifier Model Downloader finishes a download task.
17898 *
17899 * Currently we create a downlaod task for each new manifest to download.
17900 *
17901 * Logged from: external/libtextclassifier/java/
17902 */
17903message TextClassifierDownloadReported {
17904    // The model type to download
17905    enum ModelType {
17906        UNKNOWN_MODEL_TYPE = 0;
17907        ANNOTATOR = 1;
17908        LANG_ID = 2;
17909        ACTIONS_SUGGESTIONS = 3;
17910    }
17911    optional ModelType model_type = 1;
17912    // The file type to download
17913    enum FileType {
17914        UNKNOWN_FILE_TYPE = 0;
17915        MANIFEST = 1;
17916        MODEL = 2;
17917    }
17918    // Deprecated: now manifest and model files are downloaded together.
17919    optional FileType file_type = 2;
17920    // The status of the download
17921    enum DownloadStatus {
17922        UNKNOWN_STATUS = 0;
17923        SCHEDULED = 1;
17924        SUCCEEDED = 2;
17925        FAILED_AND_RETRY = 3;
17926        FAILED_AND_ABORT = 4;
17927    }
17928    optional DownloadStatus download_status = 3;
17929    // The public GStatic url we used to download the model. Contains locale info.
17930    optional string url_suffix = 4;
17931    // Failure reason, only set if this is for a failure status
17932    enum FailureReason {
17933        reserved 1, 8, 9;
17934
17935        UNKNOWN_FAILURE_REASON = 0;
17936        FAILED_TO_DOWNLOAD_SERVICE_CONN_BROKEN = 2;
17937        FAILED_TO_DOWNLOAD_404_ERROR = 3;
17938        FAILED_TO_DOWNLOAD_OTHER = 4;
17939        DOWNLOADED_FILE_MISSING = 5;
17940        FAILED_TO_PARSE_MANIFEST = 6;
17941        FAILED_TO_VALIDATE_MODEL = 7;
17942    }
17943    optional FailureReason failure_reason = 5;
17944    // How many attempts we have tried for the same task at a terminal status (i.e. SUCCEEDED or
17945    // FAILED_AND_ABORT).
17946    optional int32 run_attempt_count = 6;
17947
17948    // Custom failure code for downloader lib internal failures (E.g. 404 error).
17949    optional int32 downloader_lib_failure_code = 7;
17950
17951    // Time elapsed for the whole download task
17952    optional int64 download_duration_millis = 8;
17953
17954    // The id of the WorkManager work that launched this download.
17955    optional int64 work_id = 9;
17956}
17957
17958/**
17959 * Logs when TextClassifier Model Downloader schedules a WorkManager work.
17960 *
17961 * Logged from: external/libtextclassifier/java/
17962 */
17963message TextClassifierDownloadWorkScheduled {
17964    optional int64 work_id = 1;
17965
17966    enum ReasonToSchedule {
17967        UNKNOWN_REASON_TO_SCHEDULE = 0;
17968        TCS_STARTED = 1;
17969        LOCALE_SETTINGS_CHANGED = 2;
17970        DEVICE_CONFIG_UPDATED = 3;
17971    }
17972    optional ReasonToSchedule reason_to_schedule = 2;
17973
17974    optional bool failed_to_schedule = 3;
17975}
17976
17977/**
17978 * Logs when TextClassifier Model Downloader finishes a WorkManager work.
17979 *
17980 * A WorkManager work includes one or more downlad tasks. We log this atom when
17981 * all tasks finished. The work_id can be used to join work log and task logs.
17982 *
17983 * Logged from: external/libtextclassifier/java/
17984 */
17985message TextClassifierDownloadWorkCompleted {
17986    optional int64 work_id = 1;
17987
17988    enum WorkResult {
17989        UNKNOWN_WORK_RESULT = 0;
17990        SUCCESS_MODEL_DOWNLOADED = 1;
17991        SUCCESS_NO_UPDATE_AVAILABLE = 2;
17992        FAILURE_MODEL_DOWNLOADER_DISABLED = 3;
17993        FAILURE_MAX_RUN_ATTEMPT_REACHED = 4;
17994        RETRY_MODEL_DOWNLOAD_FAILED = 5;
17995        RETRY_RUNTIME_EXCEPTION = 6;
17996        RETRY_STOPPED_BY_OS = 7;
17997    }
17998    optional WorkResult work_result = 2;
17999
18000    // How many attempts we have tried for this work.
18001    optional int32 run_attempt_count = 3;
18002
18003    optional int64 work_scheduled_to_started_duration_millis = 4;
18004    optional int64 work_started_to_ended_duration_millis = 5;
18005}
18006
18007/**
18008 * Logs telemetry for Android Virtualization framework
18009 *
18010 * On CreateVM requests, an atom is pushed that records what hypervisor is being used.
18011 * the protected status of the new VM, and if the VM creation succeeded
18012 * Logged from: packages/modules/Virtualization/
18013 */
18014message VmCreationRequested {
18015    enum Hypervisor {
18016        UNKNOWN = 0;
18017        PKVM = 1;
18018        OTHER = 2;
18019    }
18020
18021    enum ConfigType {
18022        UNKNOWN_CONFIG = 0;
18023        VIRTUAL_MACHINE_APP_CONFIG = 1;
18024        VIRTUAL_MACHINE_RAW_CONFIG = 2;
18025    }
18026
18027    optional Hypervisor hypervisor = 1;
18028    // Is the VM started in protected mode?
18029    optional bool is_protected = 2;
18030    // Did the VM creation succeed
18031    optional bool creation_succeeded = 3;
18032    // Binder exception Code thrown by createVm request
18033    optional int32 binder_exception_code = 4;
18034
18035    optional int32 uid = 5 [(is_uid) = true];
18036    optional string vm_identifier = 6;
18037
18038    optional ConfigType config_type = 7;
18039    optional int32 num_cpus = 8;
18040    optional string cpu_affinity = 9 [deprecated = true];
18041    optional int32 memory_mib = 10;
18042    optional string apexes = 11;
18043
18044    // TODO(seungjaeyoo) Fill information about task_profile
18045    // TODO(seungjaeyoo) Fill information about disk_image for raw config
18046
18047}
18048
18049/**
18050 * Logs telemetry for Android Virtualization framework
18051 *
18052 * When VM is booted successfully, an atom is pushed that records information about VM.
18053 * Logged from: packages/modules/Virtualization/
18054 */
18055message VmBooted {
18056    optional int32 uid = 1 [(is_uid) = true];
18057    optional string vm_identifier = 2;
18058    // Elapsed time between start and boot completion of a VM
18059    optional int64 elapsed_time_millis = 3;
18060}
18061
18062/**
18063 * Logs telemetry for Android Virtualization framework
18064 *
18065 * When VM is exited, an atom is pushed that records information about VM.
18066 * Logged from: packages/modules/Virtualization/
18067 */
18068message VmExited {
18069    enum DeathReason {
18070        UNKNOWN = 0;
18071        INFRASTRUCTURE_ERROR = 1;
18072        KILLED = 2;
18073        SHUTDOWN = 3;
18074        ERROR = 4;
18075        REBOOT = 5;
18076        CRASH = 6;
18077        PVM_FIRMWARE_PUBLIC_KEY_MISMATCH = 7;
18078        PVM_FIRMWARE_INSTANCE_IMAGE_CHANGED = 8;
18079        BOOTLOADER_PUBLIC_KEY_MISMATCH = 9;
18080        BOOTLOADER_INSTANCE_IMAGE_CHANGED = 10;
18081        MICRODROID_FAILED_TO_CONNECT_TO_VIRTUALIZATION_SERVICE = 11;
18082        MICRODROID_PAYLOAD_HAS_CHANGED = 12;
18083        MICRODROID_PAYLOAD_VERIFICATION_FAILED = 13;
18084        MICRODROID_INVALID_PAYLOAD_CONFIG = 14;
18085        MICRODROID_UNKNOWN_RUNTIME_ERROR = 15;
18086        HANGUP = 16;
18087    }
18088    optional int32 uid = 1 [(is_uid) = true];
18089    optional string vm_identifier = 2;
18090
18091    optional DeathReason death_reason = 3;
18092    // Exit signal when VM was KILLED
18093    optional int32 exit_signal = 8;
18094
18095    // Elapsed time between start and termination of a VM
18096    optional int64 elapsed_time_millis = 4;
18097
18098    // Guest time for CPU usage
18099    optional int64 guest_time_millis = 5;
18100
18101    // RSS for memory usage
18102    optional int64 rss_vm_kb = 6;
18103    optional int64 rss_crosvm_kb = 7;
18104}
18105
18106/**
18107 * (Deprecated)
18108 * Logs telemetry for Android Virtualization framework
18109 *
18110 * For every second while VM is running, an atom is pushed that records CPU time information of VM.
18111 * Logged from: packages/modules/Virtualization/
18112 */
18113message VmCpuStatusReported {
18114    option deprecated = true;
18115
18116    optional int32 uid = 1 [(is_uid) = true];
18117    optional string vm_identifier = 2;
18118
18119    optional int64 cpu_time_user_millis = 3;
18120    optional int64 cpu_time_nice_millis = 4;
18121    optional int64 cpu_time_sys_millis = 5;
18122    optional int64 cpu_time_idle_millis = 6;
18123}
18124
18125/**
18126 * (Deprecated)
18127 * Logs telemetry for Android Virtualization framework
18128 *
18129 * For every second while VM is running, an atom is pushed that records memory information of VM.
18130 * Logged from: packages/modules/Virtualization/
18131 */
18132message VmMemStatusReported {
18133    option deprecated = true;
18134
18135    optional int32 uid = 1 [(is_uid) = true];
18136    optional string vm_identifier = 2;
18137
18138    optional int64 mem_total_kb = 3;
18139    optional int64 mem_free_kb = 4;
18140    optional int64 mem_available_kb = 5;
18141    optional int64 mem_buffer_kb = 6;
18142    optional int64 mem_cached_kb = 7;
18143}
18144
18145/**
18146 * Logs telemetry for Early boot CompOsArtifacts checks (done by odsign)
18147 *
18148 * odsign is a binary that runs during early boot. One of its responsibility is
18149 * to check if the device can use compOS and check if so, validate the compos
18150 * generated artifacts. An atom is pushed on each such check. Note: We only
18151 * push an atom from devices/configurations that can use compOs.
18152 */
18153message EarlyBootCompOsArtifactsCheckReported {
18154  // Are the current Artifacts okay (This check is done by odrefresh).
18155  // (current_artifacts_ok == true) => compilationRequired is false
18156  optional bool current_artifacts_ok = 1;
18157  // Has CompOs generated any Artifacts
18158  optional bool comp_os_pending_artifacts_exists = 2;
18159  // The device will be using CompOs generated artifacts. Note: the value of
18160  // this is meaningless if current_artifacts_ok = true
18161  optional bool use_comp_os_generated_artifacts = 3;
18162}
18163
18164/**
18165 * Logs telemetry when Isolation compilation job is scheduled.
18166 *
18167 * The atoms are sent by IsolatedCompilationService (fragment of system_server)
18168 * when apex are staged and need compilation.
18169 */
18170message IsolatedCompilationScheduled {
18171    enum Result {
18172        SCHEDULING_RESULT_UNKNOWN = 0;
18173        SCHEDULING_FAILURE = 1;
18174        SCHEDULING_SUCCESS = 2;
18175    }
18176    optional Result scheduling_result = 1;
18177}
18178
18179/**
18180 * Logs telemetry Isolation compilation completion.
18181 *
18182 * The atoms is sent by IsolatedCompilationService by compilation ends
18183 * and contain results/timings of compilation
18184 */
18185message IsolatedCompilationEnded {
18186    enum Result {
18187        RESULT_UNKNOWN = 0;
18188        RESULT_SUCCESS = 1;
18189        RESULT_UNKNOWN_FAILURE = 2;
18190        RESULT_FAILED_TO_START = 3;
18191        RESULT_JOB_CANCELED = 4;
18192        RESULT_COMPILATION_FAILED = 5;
18193        RESULT_UNEXPECTED_COMPILATION_RESULT = 6;
18194        RESULT_COMPOSD_DIED = 7;
18195        RESULT_FAILED_TO_ENABLE_FSVERITY = 8;
18196    }
18197    // Time between compilation job starts to when it ends.
18198    // Note: this does not include the time between compilation job being scheduled (or when apex is staged)
18199    // and it actually starting
18200    optional int64 compilation_time_millis = 1;
18201    // Result of compilation
18202    optional Result compilation_result = 2;
18203    // In case the job scheduler cancels the job, this will be the reason code
18204    // Codes are used from https://source.corp.google.com/android/frameworks/base/apex/jobscheduler/framework/java/android/app/job/JobParameters.java
18205    // Note: this field only makes sense when compilation_result = RESULT_JOB_CANCELED
18206    optional int32 compilation_job_stop_reason = 3;
18207}
18208
18209/**
18210 * Logs the current state of an application/process before it is killed.
18211 *
18212 * Keep in sync with proto file at
18213 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18214 *
18215 * Pushed from:
18216 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18217 */
18218message CarWatchdogKillStatsReported {
18219    // Linux process uid for the package.
18220    optional int32 uid = 1 [(is_uid) = true];
18221
18222    // State of the uid when it was killed.
18223    enum UidState {
18224        UNKNOWN_UID_STATE = 0;
18225        BACKGROUND_MODE = 1;
18226        FOREGROUND_MODE = 2;
18227    }
18228    optional UidState uid_state = 2;
18229
18230    // System state indicating whether the system was in normal mode or garage mode.
18231    enum SystemState {
18232        UNKNOWN_SYSTEM_STATE = 0;
18233        USER_INTERACTION_MODE = 1;
18234        USER_NO_INTERACTION_MODE = 2;
18235        GARAGE_MODE = 3;
18236    }
18237    optional SystemState system_state = 3;
18238
18239    // Reason for killing the application.
18240    // Keep in sync with proto file at packages/services/Car/cpp/watchdog/proto
18241    enum KillReason {
18242        UNKNOWN_KILL_REASON = 0;
18243        KILLED_ON_ANR = 1;
18244        KILLED_ON_IO_OVERUSE = 2;
18245        KILLED_ON_MEMORY_OVERUSE = 3;
18246    }
18247    optional KillReason kill_reason = 4;
18248
18249    // Stats of the processes owned by the application when the application was killed.
18250    // The process stack traces are not collected when the application was killed due to IO_OVERUSE.
18251    optional CarWatchdogProcessStats process_stats = 5 [(log_mode) = MODE_BYTES];
18252
18253    // The application's I/O overuse stats logged only when the kill reason is KILLED_ON_IO_OVERUSE.
18254    optional CarWatchdogIoOveruseStats io_overuse_stats = 6 [(log_mode) = MODE_BYTES];
18255}
18256
18257/**
18258 * Logs the I/O overuse stats for an application on detecting I/O overuse.
18259 *
18260 * Keep in sync with proto file at
18261 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18262 *
18263 * Pushed from:
18264 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18265 */
18266message CarWatchdogIoOveruseStatsReported {
18267    // Linux process uid for the package.
18268    optional int32 uid = 1 [(is_uid) = true];
18269
18270    // The application's I/O overuse stats.
18271    optional CarWatchdogIoOveruseStats io_overuse_stats = 2 [(log_mode) = MODE_BYTES];
18272}
18273
18274/**
18275 * Logs I/O overuse stats for a package.
18276 *
18277 * Keep in sync with proto file at
18278 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18279 *
18280 * Logged from:
18281 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18282 */
18283message CarWatchdogIoOveruseStats {
18284    enum Period {
18285        UNKNOWN_PERIOD = 0;
18286        DAILY = 1;
18287        WEEKLY = 2;
18288    }
18289
18290    // Threshold and usage stats period.
18291    optional Period period = 1;
18292
18293    // Threshold in-terms of write bytes defined for the package.
18294    optional CarWatchdogPerStateBytes threshold = 2;
18295
18296    // Number of write bytes in each state for the specified period.
18297    optional CarWatchdogPerStateBytes written_bytes = 3;
18298
18299    // Application or service uptime during the aforementioned period.
18300    optional uint64 uptime_millis = 4;
18301};
18302
18303/**
18304 * Logs bytes attributed to each application and system states.
18305 *
18306 * Keep in sync with proto file at
18307 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18308 *
18309 * Logged from:
18310 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18311 */
18312message CarWatchdogPerStateBytes {
18313    // Number of bytes attributed to the application foreground.
18314    optional int64 foreground_bytes = 1;
18315
18316    // Number of bytes attributed to the application background.
18317    optional int64 background_bytes = 2;
18318
18319    // Number of bytes attributed to the garage mode.
18320    optional int64 garage_mode_bytes = 3;
18321}
18322
18323/**
18324 * Logs each CarWatchdogProcessStat in CarWatchdogProcessStats.
18325 *
18326 * Keep in sync with proto file at
18327 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18328 *
18329 * Logged from:
18330 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18331 */
18332message CarWatchdogProcessStats {
18333    // Records the stats of the processes owned by an application.
18334    repeated CarWatchdogProcessStat process_stat = 1;
18335}
18336
18337/**
18338 * Logs a process's stats.
18339 *
18340 * Keep in sync with proto file at
18341 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18342 *
18343 * Logged from:
18344 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18345 */
18346message CarWatchdogProcessStat {
18347    // Command name of the process.
18348    optional string process_name = 1;
18349
18350    // Process uptime.
18351    optional uint64 uptime_millis = 2;
18352
18353    // Number of major page faults caused by the process and its children.
18354    optional uint64 major_page_faults = 3;
18355
18356    // Peak virtual memory size in kb.
18357    optional uint64 vm_peak_kb = 4;
18358
18359    // Virtual memory size in kb.
18360    optional uint64 vm_size_kb = 5;
18361
18362    // Peak resident set size (high water mark) in kb.
18363    optional uint64 vm_hwm_kb = 6;
18364
18365    // Resident set size in kb.
18366    optional uint64 vm_rss_kb = 7;
18367}
18368
18369/**
18370 * Logs total I/O usage summary for all applications and services running in the system.
18371 *
18372 * Keep in sync with proto file at
18373 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18374 *
18375 * Pulled from:
18376 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18377 */
18378message CarWatchdogSystemIoUsageSummary {
18379    // I/O usage summary for the system.
18380    optional CarWatchdogIoUsageSummary io_usage_summary = 1 [(log_mode) = MODE_BYTES];
18381
18382    // Start time of the event in milliseconds since epoch.
18383    // Note: This field must be a top-level field as it is used to slice the metrics.
18384    optional int64 start_time_millis = 2;
18385}
18386
18387/**
18388 * Logs I/O usage summary for an UID.
18389 *
18390 * Keep in sync with proto file at
18391 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18392 *
18393 * Pulled from:
18394 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18395 */
18396message CarWatchdogUidIoUsageSummary {
18397    // UID of the application/service whose usage summary are recorded.
18398    optional int32 uid = 1 [(is_uid) = true];
18399
18400    // I/O usage summary for the UID.
18401    optional CarWatchdogIoUsageSummary io_usage_summary = 2 [(log_mode) = MODE_BYTES];
18402
18403    // Start time of the event in milliseconds since epoch.
18404    // Note: This field must be a top-level field as it is used to slice the metrics.
18405    optional int64 start_time_millis = 3;
18406}
18407
18408/**
18409 * Logs I/O usage summary for a time period.
18410 *
18411 * Keep in sync with proto file at
18412 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18413 *
18414 * Pulled from:
18415 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18416 */
18417message CarWatchdogIoUsageSummary {
18418    // Summary event time period.
18419    optional CarWatchdogEventTimePeriod event_time_period = 1;
18420
18421    // Daily I/O usage summary for the period. Logs summary entries only for days with I/O usage.
18422    // The entries are ordered beginning from the event_time_period.start_time_millis.
18423    repeated CarWatchdogDailyIoUsageSummary daily_io_usage_summary = 2;
18424}
18425
18426/**
18427 * Logs a car watchdog event's time period.
18428 *
18429 * Keep in sync with proto file at
18430 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18431 *
18432 * Pulled from:
18433 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18434 */
18435message CarWatchdogEventTimePeriod {
18436    enum Period {
18437        UNKNOWN_PERIOD = 0;
18438        WEEKLY = 1;
18439        BIWEEKLY = 2;
18440        MONTHLY = 3;
18441    }
18442
18443    // Deprecated field - Start time of the event in milliseconds since epoch.
18444    optional uint64 start_time_millis = 1 [deprecated = true];
18445
18446    // Period for the event.
18447    optional Period period = 2;
18448}
18449
18450/**
18451 * Logs daily I/O usage summary.
18452 *
18453 * Keep in sync with proto file at
18454 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
18455 *
18456 * Pulled from:
18457 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
18458 */
18459message CarWatchdogDailyIoUsageSummary {
18460    // Total bytes written to disk during a day.
18461    optional CarWatchdogPerStateBytes written_bytes = 1;
18462
18463    // Total uptime for the system or service or application during a day.
18464    optional uint64 uptime_millis = 2;
18465
18466    // Total disk I/O overuses during a day.
18467    optional int32 overuse_count = 3;
18468}
18469
18470/*
18471 * pushes Media playback information.
18472 * Logged from
18473 *  frameworks/base/services/core/java/com/android/server/media/metrics/
18474 *      MediaMetricsManagerService.java
18475 */
18476message MediametricsPlaybackReported {
18477    optional int32 uid = 1 [(is_uid) = true];
18478
18479    // Randomly generated log session ID. A Base64 encoded hex string representing a
18480    // 128-bit integer.
18481    optional string log_session_id = 2;
18482    // The total length of the media in milliseconds. 0 for live contents.
18483    optional int64 media_duration_millis = 3;
18484    // Network, device, or mixed.
18485    optional android.stats.mediametrics.StreamSourceType stream_source = 4;
18486    // Stream type. DASH, HLS, etc
18487    optional android.stats.mediametrics.StreamType stream_type = 5;
18488    // Live, VOD, others
18489    optional android.stats.mediametrics.PlaybackType playback_type = 6;
18490    // DRM type
18491    optional android.stats.mediametrics.DrmType drm_type = 7;
18492    // Main, AD, others
18493    optional android.stats.mediametrics.ContentType content_type = 8;
18494    // Player name. E.g. ExoPlayer
18495    optional string player_name = 9;
18496    // Player version. E.g. 1.10.3e
18497    optional string player_version = 10;
18498    // Player related experiment IDs
18499    optional Experiments experiment_ids = 11 [(log_mode) = MODE_BYTES];
18500    // Number of frames played. Dropped frames included. -1 means unknown.
18501    optional int32 video_frames_played = 12;
18502    // Number of frames dropped. -1 means unknown.
18503    optional int32 video_frames_dropped = 13;
18504    // Number of audio underruns. -1 means unknown.
18505    optional int32 audio_underrun_count = 14;
18506    // Total number of bytes read from the network
18507    optional int64 network_bytes_read = 15;
18508    // Total number of bytes read from on-device sources
18509    optional int64 local_bytes_read = 16;
18510    // Total transfer spent reading from the network in ms.
18511    // For parallel requests, the overlapping time intervals are counted only once.
18512    optional int64 network_transfer_duration_millis = 17;
18513    // A session ID generated from DRM to distinguish different DRM sessions.
18514    optional string drm_session_id = 18;
18515}
18516
18517message MediaNetworkInfoChanged {
18518    // Randomly generated log session ID. A Base64 encoded hex string representing a
18519    // 128-bit integer.
18520    optional string log_session_id = 1;
18521    //  New network type
18522    optional android.stats.mediametrics.NetworkType type = 2;
18523    // When the network info change occurred relative to playback creation
18524    // time in milliseconds.
18525    // It is in absolute time (e.g. always ticks even if the playback is paused).
18526    optional int64 time_since_playback_created_millis = 3;
18527}
18528
18529message MediaPlaybackStateChanged {
18530    // Randomly generated log session ID. A Base64 encoded hex string representing a
18531    // 128-bit integer.
18532    optional string log_session_id = 1;
18533    //  New playback state
18534    optional android.stats.mediametrics.PlaybackState playback_state = 2;
18535    // When the state change occurred relative to playback creation time in
18536    // milliseconds.
18537    // It is in absolute time (e.g. always ticks even if the playback is paused).
18538    optional int64 time_since_playback_created_millis = 3;
18539}
18540
18541message MediaPlaybackErrorReported {
18542    // Randomly generated log session ID. A Base64 encoded hex string representing a
18543    // 128-bit integer.
18544    optional string log_session_id = 1;
18545    //  A shortened call stack of the error
18546    optional string exception_stack = 2;
18547    //  Error code
18548    optional android.stats.mediametrics.PlaybackErrorCode error_code = 3;
18549    //  Sub-code of error type specified by the error code.
18550    optional int32 sub_error_code = 4;
18551    // When the error occurred relative to playback creation time in millisecond.
18552    // It is in absolute time (e.g. always ticks even if the playback is paused).
18553    optional int64 time_since_playback_created_millis = 5;
18554}
18555
18556message MediaPlaybackTrackChanged {
18557    // Randomly generated log session ID. A Base64 encoded hex string representing a
18558    // 128-bit integer.
18559    optional string log_session_id = 1;
18560    //  The track is on or off after the change
18561    optional android.stats.mediametrics.TrackState state = 2;
18562    //  The reason of the track change
18563    optional android.stats.mediametrics.TrackChangeReason reason = 3;
18564    //  The MIME type of the container. E.g. video/mp4
18565    optional string container_mime_type = 4;
18566    //  The sample MIME type of the track. E.g. video/avc
18567    optional string sample_mime_type = 5;
18568
18569    //  Codec name
18570    optional string codec_name = 6;
18571    //  Bits per second. 0 means unknown.
18572    optional int32 bitrate = 7;
18573
18574   // When the track change occurred, relative to playback creation time in
18575   // millisecond.
18576   // It is in absolute time (e.g. always ticks even if the playback is paused).
18577   optional int64 time_since_playback_created_millis = 8;
18578
18579    //  Track type. Audio, Video, Text
18580    optional android.stats.mediametrics.TrackType type = 9;
18581    //  2-letter ISO 639-1 language code.
18582    optional string language = 10;
18583    //  IETF BCP 47 optional language region subtag based on a two-letter country code
18584    optional string language_region = 11;
18585    //  Number of channels
18586    optional int32 channel_count = 12;
18587    //  Samples per second
18588    optional int32 sample_rate = 13;
18589    //  The width of the video in pixels.
18590    optional int32 width = 14;
18591    //  The height of the video in pixels.
18592    optional int32 height = 15;
18593    //  Video frame rate in frames per second.
18594    optional float video_frame_rate = 16;
18595}
18596
18597message Experiments {
18598    // Experiment IDs sent by the player.
18599    repeated int64 experiments = 1;
18600}
18601
18602/**
18603 * Logs when a Wifi network scan happens.
18604 *
18605 * Logged from:
18606 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
18607 */
18608message WifiScanReported {
18609    enum Type {
18610        TYPE_UNKNOWN = 0;
18611
18612        // Single scan.
18613        TYPE_SINGLE = 1;
18614
18615        // Background scan (deprecated, should not happen).
18616        TYPE_BACKGROUND = 2;
18617    }
18618
18619    enum Result {
18620        RESULT_UNKNOWN = 0;
18621
18622        // Failed to start scan.
18623        RESULT_FAILED_TO_START = 1;
18624
18625        // The HAL reported a scan failure after the scan was started.
18626        RESULT_FAILED_TO_SCAN = 2;
18627
18628        // Scan succeeded.
18629        RESULT_SUCCESS = 3;
18630    }
18631
18632    enum Source {
18633        SOURCE_UNKNOWN = 0;
18634
18635        // No work source set - not possible to determine the origin.
18636        SOURCE_NO_WORK_SOURCE = 1;
18637
18638        // The Wifi stack.
18639        SOURCE_WIFI_STACK = 2;
18640
18641        // GMS on behalf of some other app.
18642        SOURCE_GMS = 3;
18643
18644        // Settings app.
18645        SOURCE_SETTINGS_APP = 4;
18646
18647        // Other app directly.
18648        SOURCE_OTHER_APP = 5;
18649    }
18650
18651    enum Importance {
18652        IMPORTANCE_UNKNOWN = 0;
18653
18654        // Foreground app. Corresponds to the value of
18655        // ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND or less.
18656        IMPORTANCE_FOREGROUND = 1;
18657
18658        // Foreground service. Corresponds to the value of
18659        // ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE
18660        IMPORTANCE_FOREGROUND_SERVICE = 2;
18661
18662        // Everything else.
18663        IMPORTANCE_BACKGROUND = 3;
18664    }
18665
18666    // Scan type
18667    optional Type type = 1;
18668
18669    // Outcome: success/failure
18670    optional Result result = 2;
18671
18672    // What initiated a scan.
18673    optional Source source = 3;
18674
18675    // Process importance of the initiator.
18676    // This is only available for non-system calls.
18677    optional Importance importance = 4;
18678
18679    // Time taken for the scan.
18680    optional int32 scan_duration_millis = 5;
18681
18682    // Count of found networks.
18683    optional int32 count_networks_found = 6;
18684}
18685
18686/**
18687 * Logs when a Wifi PNO (Preferred Network Offload) scan happens.
18688 *
18689 * Logged from:
18690 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
18691 */
18692message WifiPnoScanReported {
18693    enum State {
18694        UNKNOWN = 0;
18695
18696        // Scan started.
18697        STARTED = 1;
18698
18699        // Scan failed to start (e.g. bad request, unsupported by hardware, etc).
18700        FAILED_TO_START = 2;
18701
18702        // Scan completed and a network was found.
18703        // Note - due to implementation constraints, nothing is reported when a scan completes but
18704        // doesn't find any networks.
18705        FINISHED_NETWORKS_FOUND = 3;
18706
18707        // Scan failed.
18708        FAILED = 4;
18709    }
18710
18711    optional State state = 1;
18712}
18713
18714/**
18715 * Logs when an airplane mode session happens.
18716 *
18717 * Logged from:
18718 *   packages/modules/Wifi/service/java/com/android/server/wifi/WifiMetrics.java
18719 *   packages/modules/Bluetooth/service/java/com/android/server/bluetooth/BluetoothAirplaneModeListener.java
18720 */
18721message AirplaneModeSessionReported {
18722    enum PackageName {
18723        WIFI = 0;
18724        BLUETOOTH = 1;
18725    }
18726    // Module recording the airplane mode session
18727    optional PackageName package_name = 1;
18728    // State of the module before entering airplane mode
18729    // False - module off
18730    // True - module on
18731    optional bool previous_state = 2;
18732    // State of the module at the beginning of airplane mode
18733    optional bool entering_state = 3;
18734    // State of the module at the end of airplane mode
18735    optional bool exiting_state = 4;
18736    // Whether the user has activated the feature by
18737    // toggling the module in airplane mode
18738    optional bool feature_active = 5;
18739    // Whether the user toggled the module during current airplane mode
18740    optional bool user_toggled = 6;
18741    // Whether the user toggled the module within one minute
18742    optional bool user_toggled_within_minute = 7;
18743    // Whether media profile was connected before entering airplane mode
18744    // Only applicable to the Bluetooth module
18745    optional bool media_profile_connected = 8;
18746}
18747
18748/**
18749 * Logs when a package installation session happens.
18750 *
18751 * Logged from:
18752 *   frameworks/base/services/core/java/com/android/server/pm/InstallPackageHelper.java
18753 */
18754message PackageInstallationSessionReported {
18755    // Used to correlate with Play logging metrics
18756    optional int32 session_id = 1;
18757    // Only logged for failed installations
18758    optional string package_name = 2;
18759
18760    // UID of the app that is successfully installed
18761    optional int32 uid = 3 [(is_uid) = true];
18762    // Users that will have this package installed
18763    repeated int32 user_ids = 4;
18764    // User types for the users listed above
18765    repeated int32 user_types = 5;
18766    // Users that originally had this package installed if it already exists
18767    repeated int32 original_user_ids = 6;
18768    // User types for original users
18769    repeated int32 original_user_types = 7;
18770    // PackageManager.INSTALL_FAILED_* error codes
18771    optional int32 public_return_code = 8;
18772    // Internal error codes that indicate detailed installation failures
18773    optional int32 internal_error_code = 9;
18774    // Total size of the new APKs in the current session
18775    optional int64 apks_size_bytes = 10;
18776    // Version code of the app
18777    optional int64 version_code = 11;
18778
18779    // List of install steps defined in
18780    // frameworks/base/services/core/java/com/android/server/pm/PackageMetrics.java
18781    repeated int32 install_steps = 12;
18782    // Duration of each step in the installation; order must match install_steps
18783    repeated int64 step_duration_millis = 13;
18784    // Total duration can be greater than zero even if install failed
18785    optional int64 total_duration_millis = 14;
18786    // Installation flags including DONT_KILL
18787    optional int32 install_flags = 15;
18788    // UID of the package that initiates the installation
18789    optional int32 installer_package_uid = 16 [(is_uid) = true];
18790    // UID of the package that previously installed the app
18791    optional int32 original_installer_package_uid = 17 [(is_uid) = true];
18792    // {@see android.content.pm.DataLoaderType}
18793    optional int32 data_loader_type = 18;
18794    // {@see android.content.pm.UserActionRequirement}
18795    optional int32 user_action_required_type = 19;
18796
18797    // Install types might overlap, therefore using booleans for each type
18798    // A regular new app install has every field as false.
18799    optional bool is_instant = 20;
18800    optional bool is_replace = 21;
18801    optional bool is_system = 22;
18802    optional bool is_inherit = 23;
18803    optional bool is_installing_existing_as_user = 24;
18804    optional bool is_move_install = 25;
18805    // Whether this is a staged installation
18806    optional bool is_staged = 26;
18807}
18808
18809message PackageUninstallationReported {
18810    // UID of the package being uninstalled
18811    optional int32 uid = 1 [(is_uid) = true];
18812    // Users on which the package (or system app update) is uninstalled from
18813    // If uninstall for all users, list all the user ids
18814    repeated int32 user_ids = 2;
18815    // Types of the users listed above. Order must match above.
18816    repeated int32 user_types = 3;
18817    // Users that originally had this package (or system app update) installed
18818    repeated int32 original_user_ids = 4;
18819    repeated int32 original_user_types = 5;
18820    // Flags of uninstallation, including KEEP_DATA
18821    optional int32 uninstall_flags = 6;
18822    // PackageManager.DELETE_SUCCEEDED or PackageManager.DELETE_FAILED_*
18823    optional int32 return_code = 7;
18824    // Special uninstall types might overlap, therefore booleans
18825    // An uninstall of a non-system app on all users should have all fields false
18826    optional bool is_system = 8;
18827    // When this is true, user_ids != original_user_ids
18828    optional bool is_uninstall_for_users = 9;
18829}
18830
18831/**
18832 * Logs when the entitlement configuration of an IMS service is queried/updated.
18833 *
18834 * Logged from: ImsServiceEntitlement app
18835 */
18836message ImsServiceEntitlementUpdated {
18837    // The purpose of entitlement query/update
18838    enum Purpose {
18839        UNKNOWN_PURPOSE = 0;
18840
18841        // Initial service activation in foreground
18842        ACTIVATION = 1;
18843
18844        // Updating service configuration in foreground
18845        UPDATE = 2;
18846
18847        // Background polling for querying service entitlement
18848        POLLING = 3;
18849    }
18850
18851    // The IMS services
18852    enum ServiceType {
18853        UNKNOWN_SERVICE = 0;
18854        VOWIFI = 1;
18855        VOLTE = 2;
18856        SMSOIP = 3;
18857    }
18858
18859    // The result of activation
18860    enum AppResult {
18861        UNKNOWN_RESULT = 0;
18862        ENABLED = 1;
18863        DISABLED = 2;
18864        INCOMPATIBLE = 3;
18865        PROVISIONING = 4;
18866        SUCCESSFUL = 5;
18867        FAILED = 6;
18868        CANCELED = 7;
18869        TIMEOUT = 8;
18870        UNEXPECTED_RESULT = 9;
18871    }
18872
18873    // The Android carrier ID for the carrier providing the IMS service.
18874    // This may not be the actual carrier of the device, e.g. a MVNO
18875    // may use the IMS service of its MNO.
18876    optional int64 carrier_id = 1;
18877
18878    // The Android carrier ID of the actual carrier.
18879    // E.g. a MVNO may use its MNO's IMS service. In this case,
18880    // actual_carrier_id is the MVNO and carrier_id is the MNO.
18881    optional int64 actual_carrier_id = 2;
18882
18883    // The purpose of this query/update.
18884    optional Purpose purpose = 3;
18885
18886    // Which IMS service's entitlement status were queried/updated.
18887    optional ServiceType service_type = 4;
18888
18889    // Result of this query/update.
18890    optional AppResult app_result = 5;
18891
18892    // How long (in milliseconds) this query/update took.
18893    optional int64 duration_millis = 6;
18894}
18895
18896/**
18897 * Logged when a SIM-specific settings restore was attempted.
18898 *
18899 * Logged from:
18900 *    packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyProvider.java
18901 */
18902message SimSpecificSettingsRestored {
18903    optional android.telephony.SimSpecfifcSettingsRestoreResult result = 1;
18904
18905    // Indicates which restore flow was followed.
18906    optional android.telephony.SimSpecificSettingsRestoreCase restored_from_suw = 2;
18907
18908    // Indicates which criteria was used to match the inserted SIM to backed up
18909    // SIM. Only relevant when result is SUCCESS
18910    optional android.telephony.SimSpecificSettingsRestoreMatchingCriteria matching_criteria = 3;
18911}
18912
18913/**
18914 * The latency of Binder calls broken down by calling API and method name.
18915 * This is different from BinderCalls as it collects a histogram of the
18916 * latencies (to get more detailed data) not just the count, sum, and maximum.
18917 *
18918 * Logged from:
18919 * frameworks/base/core/java/com/android/internal/os/BinderLatencyObserver.java
18920 */
18921message BinderLatencyReported {
18922    message Dims {
18923        enum ProcessSource {
18924            UNKNOWN_PROCESS_SOURCE = 0;
18925            SYSTEM_SERVER = 1;
18926            TELEPHONY = 2;
18927            BLUETOOTH = 3;
18928            WIFI = 4;
18929        }
18930        enum ServiceClassName {
18931            UNKNOWN_CLASS = 0;
18932        }
18933        enum ServiceMethodName {
18934            UNKNOWN_METHOD = 0;
18935        }
18936
18937        // Required.
18938        optional ProcessSource process_source = 1;
18939
18940        // The class name of the API making the call to Binder. Enum value
18941        // is preferred as uses much less data to store.
18942        // This field does not contain PII.
18943        oneof service_class {
18944            ServiceClassName service_class_name_as_enum = 2;
18945            string service_class_name = 3;
18946        }
18947
18948        // Method name of the API call. It can also be a transaction code if we
18949        // cannot resolve it to a name. See Binder#getTransactionName. Enum value
18950        // is preferred as uses much less data to store.
18951        // This field does not contain PII.
18952        oneof service_method {
18953            ServiceMethodName service_method_name_as_enum = 4;
18954            string service_method_name = 5;
18955        }
18956    }
18957
18958    message ApiStats {
18959        // required.
18960        optional Dims dims = 1;
18961
18962        // Indicates the first bucket that had any data. Allows omitting any empty
18963        // buckets at the start of the bucket list and thus save on data size.
18964        optional int32 first_bucket_index = 2;
18965        // Stores the count of samples for each bucket. The number of buckets and
18966        // their sizes are controlled server side with a flag.
18967        repeated int32 buckets = 3;
18968    }
18969
18970    message RepeatedApiStats {
18971        repeated ApiStats api_stats = 1;
18972    }
18973
18974    // The binder latency data broken down by the dimensions specified above.
18975    // The message wrapper is used for the repeated field as top level repeated
18976    // fields are not allowed.
18977    // MODE_BYTES is used as nested messages are not allowed otherwise.
18978    // Required.
18979    optional RepeatedApiStats repeated_api_stats = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
18980
18981    // The fraction of samples that are recorded in the histogram.
18982    // Required.
18983    optional float sampling_rate = 2;
18984
18985    // Indicates how many shards the APIs are divided in - e.g. for 3 every
18986    // 3rd API will be included in the data for this shard.
18987    // Required.
18988    optional int32 sharding_modulo = 3;
18989
18990    // Params for histogram buckets.
18991    // The number of buckets the histogram should have.
18992    optional int32 bucket_count = 4;
18993
18994    // The size (upper bound) of the first bucket (used to avoid creating an
18995    // excessive amount of small buckets). E.g. for first_bucket_size of 5, the
18996    // first bucket will be [0, 5) and the second will be [5, 5 * scaleFactor).
18997    optional int32 first_bucket_size = 5;
18998
18999    // The rate in which each consecutive bucket increases (before rounding).
19000    // Implemented in: com.android.internal.os.BinderLatencyBuckets.
19001    optional float scale_factor = 6;
19002}
19003
19004/**
19005 * Log audio device types that are used for input/output.
19006 * Next Tag: 2
19007 */
19008message AudioDevice {
19009    // See audio_devices_t in system/media/audio/include/system/audio-hal-enums.h
19010    repeated int32 type = 1;
19011}
19012
19013/**
19014 * Track information about AAudio Stream
19015 * Logged from
19016 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
19017 */
19018message MediametricsAAudioStreamReported {
19019    // The implementation of aaudio.
19020    optional android.media.audio.CallerPath path = 1;
19021
19022    // The direction of the stream.
19023    optional android.media.audio.Direction direction = 2;
19024
19025    // The amount read or written in one shot by the Mixer or DSP.
19026    optional int32 frames_per_burst = 3;
19027    // The number of frames that the buffer is used.
19028    optional int32 buffer_size = 4;
19029    // The allocated number of frames for the buffer.
19030    optional int32 buffer_capacity = 5;
19031    // The channel count of the aaudio stream.
19032    optional int32 channel_count = 6;
19033    // Total frames transferred (written or read)
19034    optional int64 total_frames_transferred = 7;
19035
19036    // The performance mode requested by the applications.
19037    optional android.media.audio.PerformanceMode perf_mode_requested = 8;
19038    // The actual performance mode used by aaudio.
19039    optional android.media.audio.PerformanceMode perf_mode_actual = 9;
19040
19041    // The mode requested for sharing the device
19042    optional android.media.audio.SharingMode sharing = 10;
19043
19044    // Approximate number of glitches.
19045    // Underrun on output stream. Overrun on input stream.
19046    optional int32 xrun_count = 11;
19047    // Devices that are used by the aaudio stream.
19048    optional AudioDevice types = 12 [(log_mode) = MODE_BYTES];
19049
19050    // Format request by the applications
19051    optional int32 format_app = 13;
19052    // Format processed by the framework
19053    optional int32 format_device = 14;
19054
19055    // Android S metric log session id, a Base64Url encoded string representing a 128-bit integer.
19056    optional string log_session_id = 15;
19057
19058    // The sample rate of the aaudio stream.
19059    optional int32 sample_rate = 16;
19060
19061    // The content type of the aaudio stream.
19062    optional android.media.audio.ContentType content_type = 17;
19063
19064    // The mode of sharing the device requested by the client.
19065    optional android.media.audio.SharingMode sharing_requested = 18;
19066
19067    // Android U
19068    // The format used by the audio hardware.
19069    optional int32 format_hardware = 19;
19070
19071    // Android U
19072    // The channel count used by the audio hardware.
19073    optional int32 channel_count_hardware = 20;
19074
19075    // Android U
19076    // The sample rate used by the audio hardware.
19077    optional int32 sample_rate_hardware = 21;
19078
19079    // Android U
19080    // The UID of the client.
19081    optional int32 uid = 22 [(is_uid) = true];
19082}
19083
19084/**
19085 * Logs media transcoding session ended events.
19086 *
19087 * Logged from:
19088 *   frameworks/av/media/libmediatranscoding/TranscoderWrapper.cpp
19089 */
19090message MediaTranscodingSessionEnded {
19091
19092    enum Reason {
19093        UNKNOWN = 0;       // Unused.
19094        FINISHED = 1;      // Transcoding session finished successfully.
19095        ERROR = 2;         // Transcoding session returned error while running.
19096        PAUSED = 3;        // Transcoding session was paused, potentially failed.
19097        CANCELLED = 4;     // Transcoding session was cancelled.
19098        START_FAILED = 5;  // Transcoding session failed to start.
19099        RESUME_FAILED = 6; // Transcoding session failed to resume.
19100        CREATE_FAILED = 7; // Transcoder instance failed to crate.
19101        CONFIG_SRC_FAILED = 8;    // Configure source failed.
19102        CONFIG_DST_FAILED = 9;    // Configure destination failed.
19103        CONFIG_TRACK_FAILED = 10; // Configure track failed.
19104        OPEN_SRC_FD_FAILED = 11;  // Open source fd failed.
19105        OPEN_DST_FD_FAILED = 12;  // Open destination fd failed.
19106        NO_TRACKS = 13;  // No tracks in source file.
19107    }
19108
19109    // Reason for logging the atom.
19110    optional Reason reason = 1;
19111
19112    // UID of client connecting to media transcoding service.
19113    optional int32 calling_uid = 2 [(is_uid) = true];
19114
19115    // Transcode session status flag (media_status_t).
19116    optional int32 transcode_status = 3;
19117
19118    // Transcode speed as framerate, if status is success.
19119    optional int32 transcode_fps = 4;
19120
19121    // Source video dimensions.
19122    optional int32 src_width = 5;
19123    optional int32 src_height = 6;
19124
19125    // Source video codec information.
19126    optional string src_codec_type = 7;
19127    optional int32 src_profile = 8;
19128    optional int32 src_level = 9;
19129
19130    // Source video framerate.
19131    optional int32 src_fps = 10;
19132
19133    // Source video duration.
19134    optional int32 src_duration_millis = 11;
19135
19136    // Whether source video is HDR.
19137    optional bool src_is_hdr = 12;
19138
19139    // Destination video dimensions.
19140    optional int32 dst_width = 13;
19141    optional int32 dst_height = 14;
19142
19143    // Destination video codec information.
19144    optional string dst_codec_type = 15;
19145
19146    // Whether destination video is HDR.
19147    optional bool dst_is_hdr = 16;
19148}
19149
19150/** Logs information about an unattended reboot that took place. This is logged
19151 *  after the next boot, when the device is first unlocked.
19152 *
19153 * Logged from:
19154 *   packages/modules/Scheduling/service/java/com/android/server/RebootReadinessLogger.java
19155 */
19156message UnattendedRebootOccurred {
19157
19158    // Time between the reboot readiness state checks starting, and the device
19159    // becoming reboot-ready.
19160    optional int64 time_until_reboot_ready_millis= 1;
19161
19162    // Time taken for the device to be unlocked (i.e. for the keyguard to be
19163    // gone) after an unattended reboot took place.
19164    optional int64 time_until_first_unlock_millis = 2;
19165
19166    // Number of times the reboot was blocked by the device being interactive.
19167    optional int32 times_blocked_by_interactivity = 3;
19168
19169    // Number of times the reboot was blocked by a callback registered by a
19170    // subsystem or a privileged app.
19171    optional int32 times_blocked_by_subsystems = 4;
19172
19173    // Number of times the reboot was blocked by background app activity.
19174    optional int32 times_blocked_by_app_activity = 5;
19175
19176    // Time until next user interaction with the device.
19177    optional int64 time_until_next_interaction_ms = 6;
19178}
19179
19180
19181/**
19182 * Logs information about an app uid or registered system component that has
19183 * been blocking the device from being reboot-ready for a long time.
19184 *
19185 * Logged from:
19186 *   packages/modules/Scheduling/service/java/com/android/server/RebootReadinessLogger.java
19187 */
19188message LongRebootBlockingReported {
19189
19190    enum RebootBlockReason {
19191        SYSTEM_COMPONENT = 1;
19192        APP_UID = 2;
19193    }
19194
19195    // The reason why the reboot has been blocked. This is either a system
19196    // component that has registered a callback, or an app UID running in the
19197    // background.
19198    optional RebootBlockReason reboot_block_reason = 1;
19199
19200    // Only one of the following two fields should be set, depending on the
19201    // RebootBlockReason.
19202
19203    // The name supplied by a system component when it registered a callback
19204    // to block the reboot.
19205    optional string component_name = 2;
19206
19207    // The uid of an app that is running in the background.
19208    optional int32 uid = 3;
19209}
19210
19211/**
19212 * Logs the magnification activated mode and its duration of the usage
19213 * when the magnification is disabled.
19214 *
19215 * Logged from:
19216 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
19217 */
19218message MagnificationUsageReported {
19219    // The definition of the magnification mode.
19220    // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
19221    optional android.stats.accessibility.MagnificationMode activated_mode = 1;
19222
19223    // The duration of this magnification mode activation in milliseconds
19224    optional int64 duration_millis = 2;
19225
19226    // The last magnification scale for the activation in percentage
19227    optional int64 scale_percentage = 3;
19228}
19229
19230/**
19231 * Logs the magnification activated mode when IME dialog shows on the screen.
19232 *
19233 * Logged from:
19234 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
19235 */
19236message MagnificationModeWithImeOnReported {
19237    // The definition of the magnification mode.
19238    // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
19239    optional android.stats.accessibility.MagnificationMode activated_mode = 1;
19240}
19241
19242/**
19243 * Logs the duration for the magnification session which is activated by the triple tap and
19244 * hold gesture.
19245 *
19246 * Logged from:
19247 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
19248 */
19249message MagnificationTripleTapAndHoldActivatedSessionReported {
19250    // The duration of the triple tap and hold activated session in milliseconds
19251    optional int64 duration_millis = 1;
19252}
19253
19254/**
19255 * Logs the duration for the following typing focus activated session.
19256 *
19257 * Logged from:
19258 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
19259 */
19260message MagnificationFollowTypingFocusActivatedSessionReported {
19261    // The duration of the following typing focus activated session in milliseconds
19262    optional int64 duration_millis = 1;
19263}
19264
19265/*
19266 * Logged when hardware based user-configurable device state changes.
19267 *
19268 * Logged from:
19269 *     frameworks/base/services/core/java/com/android/server/devicestate/DeviceStateManagerService.java
19270 */
19271message DeviceStateChanged {
19272    optional int32 new_device_state = 1
19273            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
19274    optional bool boot_state = 2;
19275}
19276
19277/*
19278 * Logged when device folded state changes.
19279 *
19280 * Logged from:
19281 *     frameworks/base/packages/SystemUI/src/com/android/systemui/unfold/FoldStateLogger.kt
19282 */
19283message FoldStateDurationReported {
19284    enum State {
19285      UNKNOWN = 0;
19286      OPEN = 1;
19287      CLOSED = 2;
19288      HALF_OPEN = 3;
19289    }
19290
19291    optional State start_state = 1;
19292    optional State end_state = 2;
19293    optional int64 duration_millis = 3;
19294}
19295
19296/**
19297 * This metric is collected at the end of playback
19298 * as a pulled atom.
19299 *
19300 *   DrmHal::cleanup() {
19301 *     // ...
19302 *     reportFrameworkMetrics(reportPluginMetrics());
19303 *     // ...
19304 *   }
19305 * This proto should be kept in-sync with
19306 * frameworks/av/drm/libmediadrm/protos/metrics.proto.
19307 */
19308message DrmFrameworkMetrics {
19309
19310    // Attributes are associated with a recorded value. E.g. A counter may
19311    // represent a count of an operation returning a specific error code. The
19312    // error code will be an attribute.
19313    message Attributes {
19314        // Reserved for compatibility with logging proto.
19315        reserved 2 to 13;
19316
19317        // A general purpose error code where 0 means OK.
19318        optional int32 error_code = 1;
19319
19320        // Defined at ::android::hardware::drm::V1_0::KeyStatusType;
19321        optional uint32 key_status_type = 14;
19322
19323        // Defined at ::android::hardware::drm::V1_0::EventType;
19324        optional uint32 event_type = 15;
19325    }
19326
19327    // The Counter message is used to store a count value with an associated
19328    // Attribute.
19329    message Counter {
19330        optional uint64 count = 1;
19331        // Represents the attributes associated with this counter instance.
19332        optional Attributes attributes = 2;
19333    }
19334
19335    // The DistributionMetric is meant to capture the moments of a normally
19336    // distributed (or approximately normal) value.
19337    message DistributionMetric {
19338        optional float min = 1;
19339        optional float max = 2;
19340        optional float mean = 3;
19341        optional double variance = 4;
19342        optional uint64 operation_count = 5;
19343
19344        // Represents the attributes associated with this distribution metric
19345        // instance.
19346        optional Attributes attributes = 6;
19347    }
19348
19349    message SessionLifetime {
19350        // Start time of the session in milliseconds since epoch.
19351        optional uint64 start_time_millis = 1;
19352        // End time of the session in milliseconds since epoch.
19353        optional uint64 end_time_millis = 2;
19354    }
19355
19356    // The count of open session operations. Each instance has a specific error
19357    // code associated with it.
19358    repeated Counter open_session_counter = 1;
19359
19360    // The count of close session operations. Each instance has a specific error
19361    // code associated with it.
19362    repeated Counter close_session_counter = 2;
19363
19364    // Count and execution time of getKeyRequest calls.
19365    repeated DistributionMetric get_key_request_time_us = 3;
19366
19367    // Count and execution time of provideKeyResponse calls.
19368    repeated DistributionMetric provide_key_response_time_us = 4;
19369
19370    // Count of getProvisionRequest calls.
19371    repeated Counter get_provisioning_request_counter = 5;
19372
19373    // Count of provideProvisionResponse calls.
19374    repeated Counter provide_provisioning_response_counter = 6;
19375
19376    // Count of key status events broken out by status type.
19377    repeated Counter key_status_change_counter = 7;
19378
19379    // Count of events broken out by event type
19380    repeated Counter event_callback_counter = 8;
19381
19382    // Count getPropertyByteArray calls to retrieve the device unique id.
19383    repeated Counter get_device_unique_id_counter = 9;
19384
19385    message SessionLifetimeEntry {
19386        optional string session_id = 1;
19387        optional SessionLifetime session_lifetime = 2;
19388    }
19389    // Session ids to lifetime (start and end time) map.
19390    // Session ids are strings of hex-encoded byte arrays.
19391    // This field is equivalent to the map<string, SessionLifetime>
19392    // field in frameworks/av/drm/libmediadrm/protos/metrics.proto.
19393    repeated SessionLifetimeEntry session_lifetimes = 10;
19394}
19395
19396/**
19397 * The metric is collected at the end of playback
19398 * as a pulled atom MediaDrmActivityInfo.
19399 *
19400 * The framework_metrics is defined in
19401 * frameworks/av/drm/libmediadrm/protos/metrics.proto.
19402 *
19403 * The format of vendor_metrics is  MediaDrm plugin dependent.
19404 *
19405 *   DrmHal::cleanup() {
19406 *     // ...
19407 *     reportFrameworkMetrics(reportPluginMetrics());
19408 *     // ...
19409 *   }
19410 *
19411 * This pulled atom is then collected in
19412 * frameworks/av/services/mediametrics/MediaMetricsService.cpp.
19413 */
19414message MediaDrmActivityInfo {
19415    optional string package_name = 1;
19416    optional int64 package_version_code = 2;
19417
19418    // vendor+description tell about which DRM plugin is in use on this device
19419    optional string vendor = 3;
19420    optional string description = 4;
19421
19422    optional DrmFrameworkMetrics framework_metrics = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
19423    optional bytes vendor_metrics = 6 [(android.os.statsd.log_mode) = MODE_BYTES];
19424}
19425
19426/*
19427 * A canonical form time zone suggestion for metrics use.
19428 */
19429message MetricsTimeZoneSuggestion {
19430    enum Type {
19431        UNKNOWN = 0;
19432        CERTAIN = 1;
19433        UNCERTAIN = 2;
19434    }
19435    optional Type type = 1;
19436
19437    // The ordinals for time zone(s) in the suggestion. Always empty for
19438    // UNCERTAIN, and can be empty for CERTAIN, for example when the device is in
19439    // a disputed area / on an ocean.
19440    //
19441    // The suggestion's time zone IDs (which relate to location) are obfuscated by
19442    // mapping them to an ordinal. When the ordinal is assigned consistently across
19443    // several objects (i.e. so the same time zone ID is always mapped to the same
19444    // ordinal), this allows comparisons between those objects. For example, we can
19445    // answer "did these two suggestions agree?", "does the suggestion match the
19446    // device's current time zone?", without leaking knowledge of location. Ordinals
19447    // are also significantly more compact than full IANA TZDB IDs, albeit unstable
19448    // and of limited use.
19449    repeated int32 time_zone_ordinals = 2;
19450
19451    // The actual time zone ID(s) in the suggestion. Similar to time_zone_ordinals
19452    // but contains the actual string IDs.
19453    //
19454    // This information is only captured / reported for some devices based on the
19455    // value of a server side flag, i.e. it could be enabled for internal testers.
19456    // Therefore the list can be empty even when time_zone_ordinals is populated.
19457    //
19458    // When enabled, see time_zone_ordinals for the expected number of values.
19459    repeated string time_zone_ids = 3;
19460}
19461
19462/*
19463 * Logs a snapshot of time zone detector state.
19464 *
19465 * Logged from:
19466 * frameworks/base/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
19467 */
19468message TimeZoneDetectorState {
19469
19470    // True if telephony-based time zone detection is supported on the device.
19471    optional bool telephony_supported = 1;
19472
19473    // True if geo-based time zone detection is supported on the device.
19474    optional bool geo_supported = 2;
19475
19476    // The current user's master location setting value.
19477    optional bool location_enabled = 3;
19478
19479    // The current user's auto time zone detection enabled setting value.
19480    optional bool auto_detection_setting = 4;
19481
19482    // The current user's geo detection enabled setting.
19483    optional bool geo_detection_setting = 5;
19484
19485    enum DetectionMode {
19486        UNKNOWN = 0;
19487        MANUAL = 1;
19488        TELEPHONY = 2;
19489        GEO = 3;
19490    }
19491
19492    // The functional / behavioral state for how time zones are currently determined on the device.
19493    // Avoids needing to duplicate the logic used.
19494    optional DetectionMode detection_mode = 6;
19495
19496    // The device's current time zone ordinal (see MetricsTimeZoneSuggestion).
19497    optional int32 device_time_zone_ordinal = 7;
19498
19499    // The latest suggestion received from the user, e.g. via SettingsUI (non-persistent).
19500    optional MetricsTimeZoneSuggestion latest_manual_suggestion = 8
19501            [(log_mode) = MODE_BYTES];
19502
19503    // The latest telephony-derived suggestion (non-persistent).
19504    optional MetricsTimeZoneSuggestion latest_telephony_suggestion = 9
19505            [(log_mode) = MODE_BYTES];
19506
19507    // The latest geo-derived suggestion (non-persistent).
19508    optional MetricsTimeZoneSuggestion latest_geo_suggestion = 10
19509            [(log_mode) = MODE_BYTES];
19510
19511    // True if fallback to telephony time zone detection is supported on the device.
19512    optional bool telephony_time_zone_fallback_supported = 11;
19513
19514    // The device's current time zone ID (see MetricsTimeZoneSuggestion).
19515    optional string device_time_zone_id = 12;
19516
19517    // True if enhanced metrics collection is enabled.
19518    optional bool enhanced_metrics_collection_enabled = 13;
19519
19520    // True if the device may run geolocation time zone detection in the
19521    // background. This is the raw server flag value, not the value after
19522    // considering other state like the user's "use location" setting that also
19523    // affects runtime behavior. See LocationTimeZoneProviderController for
19524    // details.
19525    optional bool geo_detection_run_in_background_enabled = 14;
19526}
19527
19528/*
19529 * Logs information about an individual location time zone provider's state.
19530 *
19531 * Logged from:
19532 * frameworks/base/services/core/java/com/android/server/timezonedetector/location/RealProviderMetricsLogger.java
19533 */
19534message LocationTimeZoneProviderStateChanged {
19535    // The index of the provider (primary = 0, secondary = 1)
19536    optional int32 provider_index = 1 [(state_field_option).primary_field = true];
19537
19538    enum State {
19539        // A placeholder for unknown values.
19540        UNKNOWN = 0;
19541
19542        // The provider is initializing.
19543        INITIALIZING = 1;
19544
19545        // The provider is certain of the time zone.
19546        CERTAIN = 2;
19547
19548        // The provider is uncertain of the time zone.
19549        UNCERTAIN = 3;
19550
19551        // The provider has been stopped.
19552        STOPPED = 4;
19553
19554        // The provider has failed.
19555        PERM_FAILED = 5;
19556
19557        // The provider has been destroyed.
19558        DESTROYED = 6;
19559    }
19560
19561    // The state of the provider.
19562    optional State state = 2 [(state_field_option).exclusive_state = true];
19563}
19564
19565/*
19566 * Logs information about the location time zone provider controller's state.
19567 *
19568 * Logged from:
19569 * frameworks/base/services/core/java/com/android/server/timezonedetector/location/RealControllerMetricsLogger.java
19570 */
19571message LocationTimeZoneProviderControllerStateChanged {
19572
19573    enum State {
19574        // A placeholder for unknown values.
19575        UNKNOWN = 0;
19576
19577        // The providers are initializing.
19578        PROVIDERS_INITIALIZING = 1;
19579
19580        // The controller is / has been stopped.
19581        STOPPED = 2;
19582
19583        // The controller is started and is initializing.
19584        INITIALIZING = 3;
19585
19586        // The controller is started and is certain of the time zone.
19587        CERTAIN = 4;
19588
19589        // The controller is started and is uncertain of the time zone.
19590        UNCERTAIN = 5;
19591
19592        // The controller has been destroyed.
19593        DESTROYED = 6;
19594
19595        // The controller has failed.
19596        FAILED = 7;
19597    }
19598
19599    // The state of the provider.
19600    optional State state = 1;
19601}
19602
19603/*
19604 * Reports fdtrack state change.
19605 *
19606 * Logged from:
19607 *   frameworks/base/services/java/com/android/server/SystemServer.java
19608 */
19609message FdtrackEventOccurred {
19610    enum FdtrackEventType {
19611      DISABLED = 1;
19612      ENABLED = 2;
19613
19614      // Aborting because we're above the abort threshold.
19615      ABORTING = 3;
19616    }
19617
19618    optional FdtrackEventType event = 1;
19619    optional int32 fd_count = 2;
19620}
19621
19622/**
19623 * Pushed when delivering a batch of alarms.
19624 *
19625 * Logged from:
19626 * frameworks/base/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
19627 */
19628message AlarmBatchDelivered {
19629    // The total number of alarms delivered in the batch.
19630    optional int32 num_alarms = 1;
19631
19632    // The number of wakeup alarms delivered in the batch.
19633    optional int32 wakeups = 2;
19634
19635    // A list of uids receiving the alarm delivery.
19636    repeated int32 uids = 3 [(is_uid) = true];
19637
19638    // The number of alarms delivered to each of the {@link uids} above.
19639    repeated int32 num_alarms_per_uid = 4;
19640
19641    // The number of wakeup alarms delivered to each of the {@link uids} above.
19642    repeated int32 num_wakeups_per_uid = 5;
19643}
19644
19645/**
19646 * Pushed when an app schedules an alarm.
19647 *
19648 * Logged from:
19649 * frameworks/base/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
19650 */
19651message AlarmScheduled {
19652    optional int32 calling_uid = 1 [(is_uid) = true];
19653
19654    optional bool is_exact = 2;
19655    optional bool is_wakeup = 3;
19656    optional bool is_allow_while_idle = 4;
19657    optional bool is_alarm_clock = 5;
19658    optional bool is_repeating = 6;
19659
19660    enum ReasonCode {
19661        NOT_APPLICABLE = 0;
19662        PERMISSION = 1;
19663        ALLOW_LIST = 2;
19664        CHANGE_DISABLED = 3;
19665        POLICY_PERMISSION = 4;
19666        LISTENER = 5;
19667        PRIORITIZED = 6;
19668    }
19669    optional ReasonCode exact_alarm_allowed_reason = 7;
19670    optional bool is_rtc = 8;
19671    // The state of the callingUid, from frameworks/proto_logging/stats/enums/app/enums.proto.
19672    optional android.app.ProcessStateEnum calling_process_state = 9;
19673}
19674
19675/**
19676 * Logs statistics about pending alarms.
19677 *
19678 * Pulled from:
19679 * frameworks/base/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
19680 */
19681message PendingAlarmInfo {
19682    optional int32 num_total = 1;
19683    optional int32 num_exact = 2;
19684    optional int32 num_wakeup = 3;
19685    optional int32 num_allow_while_idle = 4;
19686    optional int32 num_prioritized = 5;
19687    optional int32 num_foreground_service = 6;
19688    optional int32 num_activity = 7;
19689    optional int32 num_service = 8;
19690    optional int32 num_listener = 9;
19691    optional int32 num_indefinite_future = 10;
19692    optional int32 num_repeating = 11;
19693    optional int32 num_alarm_clock = 12;
19694    optional int32 num_rtc = 13;
19695}
19696
19697/*
19698 * Logged when a package's user-level hibernation state changes.
19699 * Logged from:
19700 *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
19701 */
19702 message UserLevelHibernationStateChanged {
19703    // Name of the package that had its hibernation state change.
19704    optional string package_name = 1;
19705
19706    // Android user id to which this event belongs. This can only be 0, 10, 11 and so on.
19707    optional int32 user_id = 2;
19708
19709    // New hibernation state. True if hibernating, false otherwise
19710    optional bool is_hibernating = 3;
19711}
19712
19713/*
19714 * Pull atom for the number of hibernated packages on the device for the given user.
19715 * Logged from:
19716 *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
19717 */
19718message UserLevelHibernatedApps {
19719    // Total number of apps hibernated for the user
19720    optional int32 hibernated_app_count = 1;
19721
19722    // Android user id of the queried user which can only be 0, 10, 11 and so on.
19723    optional int32 user_id = 2;
19724}
19725
19726/**
19727 * Pull atom for total number of globally hibernated packages on the device and the storage savings
19728 * from these apps being hibernated.
19729 * Logged from:
19730 *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
19731 */
19732message GlobalHibernatedApps {
19733    // Total number of apps in global hibernation
19734    optional int32 hibernated_app_count = 1;
19735
19736    // Cumulative storage savings from apps being hibernated
19737    optional int64 storage_saved_mb = 2;
19738}
19739
19740/*
19741 * Report the event of app process kills.
19742 * Logged from:
19743 *   frameworks/base/services/core/java/com/android/server/am/AppExitInfoTracker.java
19744 */
19745message AppProcessDied {
19746    // Uid of the package of the dying process
19747    optional int32 uid = 1 [(is_uid) = true];
19748
19749    // Name of the dying process, it'll be omitted if the process name and package name are the same
19750    optional string process_name = 2;
19751
19752    // The reason code of why the process dies
19753    optional android.app.AppExitReasonCode reason = 3;
19754
19755    // The supplemental reason code of why the process dies
19756    optional android.app.AppExitSubReasonCode sub_reason = 4;
19757
19758    // The importance of the process when it dies
19759    optional android.app.Importance importance = 5;
19760
19761    // The last known PSS (in kB) of the process before it dies, could be 0.
19762    optional int32 pss = 6;
19763
19764    // The last known RSS (in kB) of the process before it dies, could be 0.
19765    optional int32 rss = 7;
19766
19767    // Whether or not this process is hosting one or more foregound services.
19768    optional bool has_foreground_services = 8;
19769}
19770
19771// Each pull creates multiple atoms. One for each incremental package.
19772message InstalledIncrementalPackage {
19773    optional int32 uid = 1 [(is_uid) = true];
19774    optional bool is_loading = 2;
19775    optional int64 loading_completed_timestamp = 3;
19776}
19777
19778/**
19779 * Memory management statistics pulled atom based on /proc/vmstat.
19780 * Logged from StatsPullAtomService.
19781 */
19782message VmStat {
19783    optional int32 oom_kill_count = 1;
19784}
19785
19786/**
19787* Log that the user has interacted with an app on the permission usage
19788* fragment.
19789* Logged from permission/debug/PermissionUsageV2Frament.kt
19790*/
19791message PermissionUsageFragmentInteraction {
19792    // id which identifies single session of user interacting with permission hub
19793    optional int64 session_id = 1;
19794
19795    enum Action {
19796        UNDEFINED = 0;
19797        OPEN = 1;
19798        LOCATION_ACCESS_TIMELINE_VIEWED = 2;
19799        CAMERA_ACCESS_TIMELINE_VIEWED = 3;
19800        MICROPHONE_ACCESS_TIMELINE_VIEWED = 4;
19801        SHOW_SYSTEM_CLICKED = 5;
19802        SEE_OTHER_PERMISSIONS_CLICKED = 6;
19803    }
19804
19805    // The action the user took to interact with the fragment
19806    optional Action action = 2;
19807}
19808
19809/**
19810* Log that the user has clicked on .
19811* Logged from permission/debug/PermissionDetailsFragment.kt
19812*/
19813message PermissionDetailsInteraction {
19814    // id which identifies single session of user interacting with permission details fragment.
19815    optional int64 session_id = 1;
19816
19817    // The name of a permission group whose details are viewed.
19818    optional string permission_group_name = 2;
19819
19820    enum Action {
19821        UNDEFINED = 0;
19822        SHOW_SYSTEM_CLICKED = 1;
19823        INFO_ICON_CLICKED = 2;
19824    }
19825
19826    // Package name for which the info icon was clicked.
19827    optional string package_name = 3;
19828
19829    // The action the user took to interact with the fragment
19830    optional Action action = 4;
19831}
19832
19833/**
19834* Log that the user has toggled the sensor privacy.
19835*/
19836message PrivacySensorToggleInteraction {
19837
19838    enum Sensor {
19839        SENSOR_UNKNOWN = 0;
19840        MICROPHONE = 1;
19841        CAMERA = 2;
19842    }
19843
19844    // Sensor for which sensor privacy was toggled.
19845    optional Sensor sensor = 1;
19846
19847    enum Action {
19848        ACTION_UNKNOWN = 0;
19849        TOGGLE_ON = 1;
19850        TOGGLE_OFF = 2;
19851    }
19852
19853    // Action taken on sensor.
19854    optional Action action = 2;
19855
19856    enum Source {
19857        SOURCE_UNKNOWN = 0;
19858        DIALOG = 1;
19859        SETTINGS = 2;
19860        QS_TILE = 3;
19861    }
19862
19863    // Source for the toggling.
19864    optional Source source = 3;
19865
19866    // Amount of time a user spent in the previous sensor privacy state in minutes.
19867    optional int64 time_in_previous_state_in_mins = 4;
19868}
19869
19870message PrivacyToggleDialogInteraction {
19871
19872    enum Action {
19873        ACTION_UNKNOWN = 0;
19874        ENABLE = 1;
19875        CANCEL = 2;
19876    }
19877
19878    // Action taken on the toggle dialog.
19879    optional Action action = 1;
19880
19881    // Name of the package for which the dialog was shown.
19882    optional string package_name = 2;
19883}
19884
19885message VendorApexInfo {
19886  optional string package_name = 1;
19887  optional string version_code = 2;
19888  optional string version_name = 3;
19889  optional string source_dir = 4;
19890  optional string signing_certs_hash = 5;
19891  optional string file_hash = 6;
19892}
19893
19894/**
19895 * Logs the non-a11yTool service warning status and its duration of the usage.
19896 *
19897 * Logged from:
19898 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
19899 *   packages/apps/Settings
19900 */
19901message NonA11yToolServiceWarningReported {
19902    // Package name of the non-a11yTool service.
19903    optional string package_name = 1;
19904
19905    // Warning status of the non-a11yTool service.
19906    optional android.stats.accessibility.WarningStatus status = 2;
19907
19908    // Duration between status in milliseconds.
19909    optional int64 duration_millis = 3;
19910}
19911
19912message MediaCapabilities {
19913    message AudioEncodings {
19914        repeated android.stats.mediametrics.AudioEncoding audio_encodings = 1;
19915    }
19916
19917    message HdrFormats {
19918        repeated android.stats.mediametrics.HdrFormat hdr_formats = 1;
19919    }
19920
19921
19922    message DisplayMode {
19923        optional int32 height = 1;
19924        optional int32 width = 2;
19925        optional float refresh_rate = 3;
19926        optional int32 seamless_refresh_rates_group_id = 4;
19927    }
19928
19929    message DisplayModes {
19930        repeated DisplayMode display_modes = 1;
19931    }
19932
19933    // Surround sound capabilities
19934
19935    // List of surround sound encodings supported by this device
19936    optional AudioEncodings surround_encodings = 1 [(log_mode) = MODE_BYTES];
19937    // List of surround sound encodings supported by the sink device
19938    optional AudioEncodings sink_surround_encodings = 2 [(log_mode) = MODE_BYTES];
19939    // List of supported surround sound encodings disabled by user
19940    optional AudioEncodings user_disabled_surround_encodings = 3 [(log_mode) = MODE_BYTES];
19941    // List of unsupported surround sound encodings enabled by user
19942    optional AudioEncodings user_enabled_surround_encodings = 4 [(log_mode) = MODE_BYTES];
19943     // The surround sound output mode chosen by user
19944    optional android.stats.mediametrics.EncodedSurroundOutputMode surround_output_mode = 5;
19945
19946
19947    // Display capabilities
19948
19949    // List of HDR display formats supported by the sink device
19950    optional HdrFormats sink_hdr_formats = 6 [(log_mode) = MODE_BYTES];
19951    // List of modes supported by the sink device. Each mode has height, width, refresh rate and a list
19952    // of refresh-rates between which a seamless switch is possible.
19953    optional DisplayModes sink_display_modes = 7 [(log_mode) = MODE_BYTES];
19954    // The HDCP level with which the display is connected
19955    optional int32 hdcp_level = 8;
19956
19957    // Display settings
19958
19959    // The Match content refresh rate user preference
19960    optional android.stats.mediametrics.MatchContentFrameRatePreference
19961                match_content_refresh_rate_preference = 9;
19962    // List of HDR formats disabled by the user
19963    optional HdrFormats user_disabled_hdr_formats = 10 [(log_mode) = MODE_BYTES];
19964    // The resolution height selected by the user
19965    optional int32 user_preferred_resolution_height = 11;
19966    // The resolution width selected by the user
19967    optional int32 user_preferred_resolution_width = 12;
19968    // The refresh rate selected by the user
19969    optional float user_preferred_refresh_rate = 13;
19970    // Whether the user has disabled auto low latency mode
19971    optional bool has_user_disabled_allm = 14;
19972}
19973
19974/**
19975 * Logs when NNAPI model is compiled successfully
19976 * Logged from
19977 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
19978 */
19979message NeuralNetworksCompilationCompleted {
19980    // Linux process uid for the package.
19981    optional int32 uid = 1 [(is_uid) = true];
19982
19983    // id which identifies single session of client interacting with NNAPI runtime
19984    optional int32 session_id = 2;
19985
19986    // NNAPI mainline module version.
19987    optional int64 version_nnapi_module = 3;
19988
19989    // An identifier that can be used to match events for ML model architecture.
19990    // Hash is generated from model operations and operands definition, but not weights.
19991    // Hash algorithm: HMAC-SHA256
19992    // Size: 32 byte
19993    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];
19994
19995    // Device driver identifier used by this compilation.
19996    // NeuralNetworks models are compiled/prepared for one or more device drivers (e.g., DSP, GPU,
19997    // TPU, CPU). The device driver identifier is a concatenation of [device driver name, =, and
19998    // device driver version]. If multiple device drivers are used, all device driver identifiers
19999    // are sorted and concatenated with comma as a separator.
20000    optional string device_id = 5;
20001
20002    // Type of tensors used for inputs
20003    optional android.neuralnetworks.DataClass input_data_class = 6;
20004
20005    // Type of tensors used for outputs
20006    optional android.neuralnetworks.DataClass output_data_class = 7;
20007
20008    // Did the compilation had to fallback to cpu due to an error?
20009    optional bool fallback_to_cpu_from_error = 8;
20010
20011    // Did client name target devices explicitly?
20012    optional bool introspection_enabled = 9;
20013
20014    // Was cache enabled?
20015    optional bool cache_enabled = 10;
20016
20017    // Was control flow used in the model?
20018    optional bool has_control_flow = 11;
20019
20020    // Whether there exists a partition boundary in the compilation that has dynamic size
20021    optional bool has_dynamic_temporaries = 12;
20022
20023    // Time taken to compile a model
20024    optional int64 compilation_time_sum_millis = 13;
20025    optional int64 compilation_time_min_millis = 14;
20026    optional int64 compilation_time_max_millis = 15;
20027    optional int64 compilation_time_sum_squared_millis = 16;
20028    optional int32 compilation_time_count = 17;
20029
20030    // How many times this atom occurred locally before being pushed.
20031    optional int32 count = 18;
20032
20033    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
20034    optional int64 model_arch_hash_64 = 19;
20035}
20036
20037/**
20038 * Logs when NNAPI model fails compilation
20039 * Logged from
20040 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
20041 */
20042message NeuralNetworksCompilationFailed {
20043    // Linux process uid for the package.
20044    optional int32 uid = 1 [(is_uid) = true];
20045
20046    // id which identifies single session of client interacting with NNAPI runtime
20047    optional int32 session_id = 2;
20048
20049    // NNAPI mainline module version.
20050    optional int64 version_nnapi_module = 3;
20051
20052    // An identifier that can be used to match events for ML model architecture.
20053    // Hash is generated from model operations and operands definition, but not weights.
20054    // Hash algorithm: HMAC-SHA256
20055    // Size: 32 byte
20056    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];
20057
20058    // Device driver identifier used by this compilation.
20059    // NeuralNetworks models are compiled/prepared for one or more device drivers (e.g., DSP, GPU,
20060    // TPU, CPU). The device driver identifier is a concatenation of [device driver name, =, and
20061    // device driver version]. If multiple device drivers are used, all device driver identifiers
20062    // are sorted and concatenated with comma as a separator.
20063    optional string device_id = 5;
20064
20065    // Type of tensors used for inputs
20066    optional android.neuralnetworks.DataClass input_data_class = 6;
20067
20068    // Type of tensors used for outputs
20069    optional android.neuralnetworks.DataClass output_data_class = 7;
20070
20071    // Error code returned by compilation call
20072    optional android.neuralnetworks.ResultCode error_code = 8;
20073
20074    // Did client name target devices explicitly?
20075    optional bool introspection_enabled = 9;
20076
20077    // Was cache enabled?
20078    optional bool cache_enabled = 10;
20079
20080    // Was control flow used in the model?
20081    optional bool has_control_flow = 11;
20082
20083    // Whether there exists a partition boundary in the compilation that has dynamic size
20084    optional bool has_dynamic_temporaries = 12;
20085
20086    // How many times this atom occurred locally before being pushed.
20087    optional int32 count = 13;
20088
20089    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
20090    optional int64 model_arch_hash_64 = 14;
20091}
20092
20093/**
20094 * Logs when NNAPI model is executed successfully
20095 *
20096 * Logged from
20097 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
20098 */
20099message NeuralNetworksExecutionCompleted {
20100    // Linux process uid for the package.
20101    optional int32 uid = 1 [(is_uid) = true];
20102
20103    // id which identifies single session of client interacting with NNAPI runtime
20104    optional int32 session_id = 2;
20105
20106    // NNAPI mainline module version.
20107    optional int64 version_nnapi_module = 3;
20108
20109    // An identifier that can be used to match events for ML model architecture.
20110    // Hash is generated from model operations and operands definition, but not weights.
20111    // Hash algorithm: HMAC-SHA256
20112    // Size: 32 byte
20113    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];
20114
20115    // Device driver identifier used by this execution.
20116    // NeuralNetworks models are executed on one or more device drivers (e.g., DSP, GPU, TPU, CPU).
20117    // The device driver identifier is a concatenation of [device driver name, =, and device driver
20118    // version]. If multiple device drivers are used, all device driver identifiers are sorted and
20119    // concatenated with comma as a separator.
20120    optional string device_id = 5;
20121
20122    // Execution mode
20123    optional android.neuralnetworks.Mode mode = 6;
20124
20125    // Type of tensors used for inputs
20126    optional android.neuralnetworks.DataClass input_data_class = 7;
20127
20128    // Type of tensors used for outputs
20129    optional android.neuralnetworks.DataClass output_data_class = 8;
20130
20131    // Did client name target devices explicitly?
20132    optional bool introspection_enabled = 9;
20133
20134    // Was cache enabled?
20135    optional bool cache_enabled = 10;
20136
20137    // Was control flow used in the model?
20138    optional bool has_control_flow = 11;
20139
20140    // Whether there exists a partition boundary in the compilation that has dynamic size
20141    optional bool has_dynamic_temporaries = 12;
20142
20143    // Time taken to execute from runtime, including runtime/ipc overhead
20144    optional int64 duration_runtime_sum_micros = 13;
20145    optional int64 duration_runtime_min_micros = 14;
20146    optional int64 duration_runtime_max_micros = 15;
20147    optional int64 duration_runtime_sum_squared_micros = 16;
20148    optional int32 duration_runtime_count = 17;
20149
20150    // Time taken to execute in the driver, excluding runtime/ipc overhead
20151    optional int64 duration_driver_sum_micros = 18;
20152    optional int64 duration_driver_min_micros = 19;
20153    optional int64 duration_driver_max_micros = 20;
20154    optional int64 duration_driver_sum_squared_micros = 21;
20155    optional int32 duration_driver_count = 22;
20156
20157    // Time taken to execute on the hardware, excluding driver overhead
20158    optional int64 duration_hardware_sum_micros = 23;
20159    optional int64 duration_hardware_min_micros = 24;
20160    optional int64 duration_hardware_max_micros = 25;
20161    optional int64 duration_hardware_sum_squared_micros = 26;
20162    optional int32 duration_hardware_count = 27;
20163
20164    // How many times this atom occurred locally before being pushed.
20165    optional int32 count = 28;
20166
20167    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
20168    optional int64 model_arch_hash_64 = 29;
20169}
20170
20171/**
20172 * Logs when NNAPI model fails execution
20173 * Logged from
20174 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
20175 */
20176message NeuralNetworksExecutionFailed {
20177    // Linux process uid for the package.
20178    optional int32 uid = 1 [(is_uid) = true];
20179
20180    // id which identifies single session of client interacting with NNAPI runtime
20181    optional int32 session_id = 2;
20182
20183    // NNAPI mainline module version.
20184    optional int64 version_nnapi_module = 3;
20185
20186    // An identifier that can be used to match events for ML model architecture.
20187    // Hash is generated from model operations and operands definition, but not weights.
20188    // Hash algorithm: HMAC-SHA256
20189    // Size: 32 byte
20190    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];
20191
20192    // Device driver identifier used by this execution.
20193    // NeuralNetworks models are executed on one or more device drivers (e.g., DSP, GPU, TPU, CPU).
20194    // The device driver identifier is a concatenation of [device driver name, =, and device driver
20195    // version]. If multiple device drivers are used, all device driver identifiers are sorted and
20196    // concatenated with comma as a separator.
20197    optional string device_id = 5;
20198
20199    // Execution mode
20200    optional android.neuralnetworks.Mode mode = 6;
20201
20202    // Type of tensors used for inputs
20203    optional android.neuralnetworks.DataClass input_data_class = 7;
20204
20205    // Type of tensors used for outputs
20206    optional android.neuralnetworks.DataClass output_data_class = 8;
20207
20208    // Error code returned by execution call
20209    optional android.neuralnetworks.ResultCode error_code = 9;
20210
20211    // Did client name target devices explicitly?
20212    optional bool introspection_enabled = 10;
20213
20214    // Was cache enabled?
20215    optional bool cache_enabled = 11;
20216
20217    // Was control flow used in the model?
20218    optional bool has_control_flow = 12;
20219
20220    // Whether there exists a partition boundary in the compilation that has dynamic size
20221    optional bool has_dynamic_temporaries = 13;
20222
20223    // How many times this atom occurred locally before being pushed.
20224    optional int32 count = 14;
20225
20226    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
20227    optional int64 model_arch_hash_64 = 15;
20228}
20229
20230/**
20231 * Logs boot-time info for a Context Hub.
20232 */
20233message ContextHubBooted {
20234  // The amount of time it took the framework to connect to CHRE/Context Hub HAL
20235  // since the framework has booted.
20236  optional int64 boot_time_nanos = 1;
20237
20238  // The number of Context Hub instances found on this system.
20239  optional int32 num_context_hubs = 2;
20240}
20241
20242/**
20243 * Logs Context Hub restart events (e.g. crashes).
20244 */
20245message ContextHubRestarted {
20246  // The duration of time between the last time Context Hub restart and this event.
20247  // This should use the SystemClock.elapsedRealTime() API.
20248  optional int64 elapsed_time_millis_since_boot = 1;
20249
20250  // The ID of the Context Hub that has restarted (zero-indexed).
20251  optional int32 context_hub_id = 2;
20252}
20253
20254/**
20255 * Logs a snapshot of all the nanoapps loaded on this Context Hub.
20256 */
20257message ContextHubLoadedNanoappSnapshotReported {
20258  // The ID of the Context Hub the snapshot is for (zero-indexed).
20259  optional int32 context_hub_id = 1;
20260
20261  // The nanoapp this snapshot is for. The nanoapp ID is the 64-bit unique identifier
20262  // for the application, and the version is the semantic versioning (https://semver.org)
20263  // used to determine the software version.
20264  optional int64 nanoapp_id = 2;
20265  optional int32 nanoapp_version = 3;
20266}
20267
20268/**
20269 * Logs details of a dynamic CHRE nanoapp code download transaction.
20270 */
20271message ChreCodeDownloadTransacted {
20272  enum Type {
20273    TYPE_UNKNOWN = 0;
20274    TYPE_LOAD = 1;
20275    TYPE_UNLOAD = 2;
20276  }
20277  // The ID/version of the nanoapp this code download was for.
20278  optional int64 nanoapp_id = 1;
20279  optional int32 nanoapp_version = 2;
20280
20281  // The type of code download transaction.
20282  optional Type transaction_type = 3;
20283
20284  // The result of this transaction.
20285  optional android.contexthub.ContextHubTransactionResult transaction_result = 4;
20286}
20287
20288/**
20289 * Stats about each feature tag that was included in the registration.
20290 *
20291 * Logged from:
20292 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20293 */
20294message ImsRegistrationFeatureTagStats {
20295    // the carrier id associated with this SIP delegate
20296    // Used as a dimension
20297    optional int32 carrier_id = 1;
20298
20299    // The slot id associated with this SIP delegate
20300    // Used as a dimension
20301    optional int32 slot_id = 2;
20302
20303    // The name of the feature tag
20304    // used as a dimension
20305    optional android.telephony.ImsFeatureTag feature_tag_name = 3;
20306
20307    // The underlying radio technology type associated with the feature tag
20308    // used as a dimension
20309    // See the ImsRegistrationImplBase#REGISTRATION_TECH*
20310    optional int32 registration_tech = 4;
20311
20312    // The time this feature tag was registered, rounded to 5 minutes
20313    optional int32 registered_seconds = 5;
20314}
20315
20316/**
20317 * Stats about the messaging client interacting with telephony
20318 *
20319 * Logged from:
20320 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20321 */
20322message RcsClientProvisioningStats {
20323    enum EventType {
20324        EVENT_TYPE_UNSPECIFIED = 0;
20325        // The client sent its client params to the ACS service.
20326        CLIENT_PARAMS_SENT = 1;
20327        // The client has manually triggered reconfiguration
20328        TRIGGER_RCS_RECONFIGURATION = 2;
20329        // Default messaging application changed.
20330        DMA_CHANGED = 3;
20331    }
20332    // Carrier ID of the SIM used for IMS registration.
20333    // See https://source.android.com/devices/tech/config/carrierid.
20334    // Used as a dimension
20335    optional int32 carrier_id = 1;
20336
20337    // Index of the SIM used, 0 for single-SIM devices.
20338    // Used as a dimension
20339    optional int32 slot_id = 2;
20340
20341    // Used as a dimension
20342    optional EventType event = 3;
20343
20344    // The number of times this event has occurred.
20345    optional int32 count = 4;
20346}
20347
20348/**
20349 * Stats about the RCS provisioning via ACS
20350 *
20351 * Logged from:
20352 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20353 */
20354message RcsAcsProvisioningStats {
20355    enum ResponseType {
20356        RESPONSE_TYPE_UNSPECIFIED = 0;
20357        // a provisioning request resulted in an error.
20358        ERROR = 1;
20359        // a provisioning request succeeded and provided an xml
20360        PROVISIONING_XML = 2;
20361        // a provisioning request has resulted in a "pre-provisioning" xml, which
20362        // means RCS is not provisioned and requires the user to intervene.
20363        PRE_PROVISIONING_XML = 3;
20364    }
20365
20366    // Carrier ID of the SIM used for IMS registration.
20367    // See https://source.android.com/devices/tech/config/carrierid.
20368    // Used as a dimension
20369    optional int32 carrier_id = 1;
20370
20371    // Index of the SIM used, 0 for single-SIM devices.
20372    // Used as a dimension
20373    optional int32 slot_id = 2;
20374
20375    // The response code of provisioning if the provisioning resulted in
20376    // ResponseType.ERROR
20377    // Used as a dimension
20378    optional int32 response_code = 3;
20379
20380    // used as a dimension.
20381    optional ResponseType response_type = 4;
20382
20383    // Does the provisioning XML have single registration provisioned.
20384    // Populated if response_type is ResponseType.PROVISIONING_XML
20385    // used as a dimension
20386    optional bool is_single_registration_enabled = 5;
20387
20388    // The number of times this event has occurred.
20389    optional int32 count = 6;
20390
20391    // The amount of time in seconds that the device was in this state in total, rounded 5 minutes
20392    optional int32 state_timer_sec = 7;
20393}
20394
20395/**
20396 * Metrics surrounding the lifetime of a SIP delegate created by applications.
20397 *
20398 * Logged from:
20399 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20400 */
20401message SipDelegateStats {
20402    // The random number identifier with this SIP delegate
20403    optional int32 dimension = 1;
20404
20405    // The carrier id associated with this SIP delegate
20406    optional int32 carrier_id = 2;
20407
20408    // The slot id associated with this SIP delegate
20409    optional int32 slot_id = 3;
20410
20411    // The total uptime of this delegate, rounded 5 minutes
20412    optional int32 uptime_seconds = 4;
20413
20414    // The reason why this SIP delegate was destroyed.
20415    // See the SipDelegateManager#SIP_DELEGATE_DESTROY_REASON*
20416    optional int32 destroy_reason = 5;
20417}
20418
20419/**
20420 * Tracks each feature tag associated with the SipDelegates that are currently active.
20421 *
20422 * Logged from:
20423 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20424 */
20425message SipTransportFeatureTagStats {
20426    // the carrier id associated with this SIP delegate
20427    // Used as a dimension
20428    optional int32 carrier_id = 1;
20429
20430    // The slot id associated with this SIP delegate
20431    // Used as a dimension
20432    optional int32 slot_id = 2;
20433
20434    // The name of the feature tag
20435    // used as a dimension
20436    optional android.telephony.ImsFeatureTag feature_tag_name = 3;
20437
20438    // The reason why this feature tag was denied on the SIP Transport
20439    // used as a dimension
20440    // Use SIP transport denied reason.
20441    // See the SipDelegateManager#DENIED_REASON*
20442    optional int32 sip_transport_denied_reason = 4;
20443
20444    // The reason why this feature tag was associated with the SIP Transport but not
20445    // marked as deregistered.
20446    // used as a dimension
20447    // Use SIP transport deregistered reason.
20448    // See the DelegateRegistrationState#DEREGISTERING_REASON*
20449    optional int32 sip_transport_deregistered_reason = 5;
20450
20451    // the time this feature tag was in this state, rounded 5 minutes
20452    optional int32 associated_seconds = 6;
20453}
20454
20455/**
20456 * Tracks each SIP message and the response from either the app or network.
20457 *
20458 * Logged from:
20459 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20460 */
20461message SipMessageResponse {
20462    enum Direction {
20463        UNKNOWN = 0;
20464        INCOMING = 1;
20465        OUTGOING = 2;
20466    }
20467    // the carrier id associated with this SIP delegate
20468    // Used as a dimension
20469    optional int32 carrier_id = 1;
20470
20471    // The slot id associated with this SIP delegate
20472    // Used as a dimension
20473    optional int32 slot_id = 2;
20474
20475    // The SIP message method type (INVITE, MESSAGE, etc...)
20476    // used as a dimension
20477    optional android.telephony.SipRequestMethodType sip_message_method = 3;
20478
20479    // The SIP message response code, used if this is a response to a request.
20480    // used as a dimension.
20481    optional int32 sip_message_response = 4;
20482
20483    // The SIP message direction
20484    // used as a dimension
20485    optional Direction sip_message_direction = 5;
20486
20487    // The response from the SIP stack to sending/receiving the message
20488    // used as a dimension
20489    // See the SipDelegateManager#MESSAGE_FAILURE_REASON*
20490    optional int32 message_error = 6;
20491
20492    // The number of messages that fit this criteria.
20493    optional int32 count = 7;
20494}
20495
20496/**
20497 * Tracks SIP sessions managed by the SIP transport.
20498 *
20499 * Logged from:
20500 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20501 */
20502message SipTransportSession {
20503    enum Direction {
20504        UNKNOWN = 0;
20505        INCOMING = 1;
20506        OUTGOING = 2;
20507    }
20508    // the carrier id associated with this SIP delegate
20509    // Used as a dimension
20510    optional int32 carrier_id = 1;
20511
20512    // The slot id associated with this SIP delegate
20513    // Used as a dimension
20514    optional int32 slot_id = 2;
20515
20516    // The SIP message method that started the session (INVITE, SUBSCRIBE, etc...)
20517    // used as a dimension
20518    optional android.telephony.SipRequestMethodType session_method = 3;
20519
20520    // The SIP message direction
20521    // used as a dimension
20522    optional Direction sip_message_direction = 4;
20523
20524    // The response from the SIP stack or network.
20525    // used as a dimension.
20526    optional int32 sip_response = 5;
20527
20528    // The number of these sessions counted
20529    optional int32 session_count = 6;
20530
20531    // The number of sessions that were started properly and did not require
20532    // the SIP transport to forcefully close them.
20533    optional int32 ended_gracefully_count = 7;
20534}
20535
20536/**
20537 * Used to determine if there were dedicated bearers set up for a specific listener.
20538 * If not, this indicates that there may have been a network issue in the dedicated bearer setup.
20539 *
20540 * Logged from:
20541 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20542 */
20543message ImsDedicatedBearerListenerEvent {
20544    // Carrier ID of the SIM used for IMS registration.
20545    // See https://source.android.com/devices/tech/config/carrierid.
20546    // Used as a dimension
20547    optional int32 carrier_id = 1;
20548
20549    // Index of the SIM used, 0 for single-SIM devices.
20550    // Used as a dimension
20551    optional int32 slot_id = 2;
20552
20553    // Radio access technology (RAT) used by the registration when it terminated.
20554    // The value is either 4G or 5G.
20555    // Used as a dimension
20556    optional android.telephony.NetworkTypeEnum rat_at_end = 3;
20557
20558    // QoS class identifier.
20559    // dimension
20560    optional int32 qci = 4;
20561
20562    // True if there was a dedicated bearer established for this listener.
20563    // dimension
20564    optional bool dedicated_bearer_established = 5;
20565
20566    // The count of listeners with this result.
20567    optional int32 event_count = 6;
20568}
20569
20570/**
20571 * Logs information related to ims dedicated bearer which fulfills required qos and provides guaranteed service.
20572 *
20573 * Logged from:
20574 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20575 */
20576message ImsDedicatedBearerEvent {
20577    enum State {
20578        STATE_UNSPECIFIED = 0;
20579        STATE_ADDED = 1;
20580        STATE_MODIFIED = 2;
20581        STATE_DELETED = 3;
20582    }
20583    // Carrier ID of the SIM used for IMS registration.
20584    // See https://source.android.com/devices/tech/config/carrierid.
20585    // Used as a dimension
20586    optional int32 carrier_id = 1;
20587
20588    // Index of the SIM used, 0 for single-SIM devices.
20589    // Used as a dimension
20590    optional int32 slot_id = 2;
20591
20592    // Radio access technology (RAT) used by the registration when it terminated.
20593    // The value is either 4G or 5G.
20594    // Used as a dimension
20595    optional android.telephony.NetworkTypeEnum rat_at_end = 3;
20596
20597    // Qos class identifier.
20598    // Used as a dimension
20599    optional int32 qci = 4;
20600
20601    // Dedicated bearer state from the network.
20602    // Used as a dimension
20603    optional State bearer_state = 5;
20604
20605    // Whether location connection information is received.
20606    // Used as a dimension
20607    optional bool local_connection_info_received = 6;
20608
20609    // Whether remote connection information is received.
20610    // Used as a dimension
20611    optional bool remote_connection_info_received = 7;
20612
20613    // Whether or not the QoS indication had listeners.
20614    // Used as a dimension
20615    optional bool has_listeners = 8;
20616
20617    // The count that matches the above conditions.
20618    optional int32 count = 9;
20619}
20620
20621/**
20622 * Stats about each ServiceDescription that was included in the PIDF XML sent to the network during publish.
20623 *
20624 * Logged from:
20625 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20626 */
20627message ImsRegistrationServiceDescStats {
20628    // Describe Service IDs will be included PUBLISH
20629    // See RcsContactPresenceTuple.java
20630    enum ServiceId {
20631        SERVICE_ID_UNSPECIFIED = 0;
20632        SERVICE_ID_CUSTOM = 1;
20633        SERVICE_ID_MMTEL = 2;
20634        SERVICE_ID_CHAT_V1 = 3;
20635        SERVICE_ID_CHAT_V2 = 4;
20636        SERVICE_ID_FT = 5;
20637        SERVICE_ID_FT_OVER_SMS = 6;
20638        SERVICE_ID_GEO_PUSH = 7;
20639        SERVICE_ID_GEO_PUSH_VIA_SMS = 8;
20640        SERVICE_ID_CALL_COMPOSER = 9;
20641        SERVICE_ID_POST_CALL = 10;
20642        SERVICE_ID_SHARED_MAP = 11;
20643        SERVICE_ID_SHARED_SKETCH = 12;
20644        SERVICE_ID_CHATBOT = 13;
20645        SERVICE_ID_CHATBOT_STANDALONE = 14;
20646        SERVICE_ID_CHATBOT_ROLE = 15;
20647    }
20648
20649    // the carrier id associated with this SIP delegate
20650    // Used as a dimension
20651    optional int32 carrier_id = 1;
20652
20653    // The slot id associated with this SIP delegate
20654    // Used as a dimension
20655    optional int32 slot_id = 2;
20656
20657    // The service id portion of the ServiceDescription
20658    // used as a dimension
20659    optional ServiceId service_id_name = 3;
20660
20661    // The version portion of the ServiceDescription
20662    // used as a dimension
20663    optional float service_id_version = 4;
20664
20665    // The underlying radio technology type associated with the feature tag
20666    // used as a dimension
20667    // See the ImsRegistrationImplBase#REGISTRATION_TECH*
20668    optional int32 registration_tech = 5;
20669
20670    // the time this feature tag was registered, rounded 5 minutes
20671    optional int32 published_seconds = 6;
20672}
20673
20674/**
20675 * Stats related to UCE queries to the network
20676 *
20677 * Logged from:
20678 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20679 */
20680message UceEventStats {
20681    enum MessageType {
20682        MESSAGE_TYPE_UNSPECIFIED = 0;
20683        PUBLISH = 1;
20684        SUBSCRIBE = 2;
20685        INCOMING_OPTION = 3;
20686        OUTGOING_OPTION = 4;
20687    }
20688    enum CommandCode {
20689        SERVICE_UNKNOWN = 0;
20690        GENERIC_FAILURE = 1;
20691        INVALID_PARAM = 2;
20692        FETCH_ERROR = 3;
20693        REQUEST_TIMEOUT = 4;
20694        INSUFFICIENT_MEMORY = 5;
20695        LOST_NETWORK_CONNECTION = 6;
20696        NOT_SUPPORTED = 7;
20697        NOT_FOUND = 8;
20698        SERVICE_UNAVAILABLE = 9;
20699        NO_CHANGE = 10;
20700    }
20701    // Carrier ID of the SIM used for IMS registration.
20702    // See https://source.android.com/devices/tech/config/carrierid.
20703    // Used as a dimension
20704    optional int32 carrier_id = 1;
20705
20706    // Index of the SIM used, 0 for single-SIM devices.
20707    // Used as a dimension
20708    optional int32 slot_id = 2;
20709
20710    // Used to identify the message type.
20711    // Used as a dimension
20712    optional MessageType type = 3;
20713
20714    // Whether the UCE event is successfully finished. If false, the request to the
20715    // modem timed out and we sent a timeout error back to the requesting app.
20716    // Used as a dimension
20717    optional bool successful = 4;
20718
20719    // The command error code for the Uce event. Not populated if the modem
20720    // accepted the request and delivered a network_response.
20721    // Used as a dimension
20722    optional CommandCode command_code = 5;
20723
20724    // The network response code for the Uce event. Will not be populated if
20725    // command_code is present.
20726    // Used as a dimension
20727    optional int32 network_response = 6;
20728
20729    // The count that matches the above conditions;
20730    optional int32 count = 7;
20731}
20732
20733/**
20734 * Information related to a SIP NOTIFY event from modem.
20735 *
20736 * Logged from:
20737 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20738 */
20739message PresenceNotifyEvent {
20740    // See RFC3265 Section 3.2.4 for more information about these subscription states.
20741    enum TerminatedReason {
20742        REASON_UNSPECIFIED = 0;
20743        // Not spec defined, the network returned a custom code that is not spec defined.
20744        REASON_CUSTOM = 1;
20745        REASON_DEACTIVATED = 2;
20746        REASON_PROBATION = 3;
20747        REASON_REJECTED = 4;
20748        REASON_TIMEOUT = 5;
20749        REASON_GIVEUP = 6;
20750        REASON_NORESOURCE = 7;
20751    }
20752
20753    // Carrier ID of the SIM used for IMS registration.
20754    // See https://source.android.com/devices/tech/config/carrierid.
20755    // Used as a dimension
20756    optional int32 carrier_id = 1;
20757
20758    // Index of the SIM used, 0 for single-SIM devices.
20759    // Used as a dimension
20760    optional int32 slot_id = 2;
20761
20762    // The terminated reason associated with the subscription state.
20763    // Used as a dimension
20764    optional TerminatedReason reason = 3;
20765
20766    // Whether or not the NOTIFY received contained at least one body with PIDF
20767    // content before moving to the terminated state.
20768    // Used as a dimension
20769    optional bool content_body_received = 4;
20770
20771    // The count of PIDF info received that contained RCS caps.
20772    optional int32 rcs_caps_count = 5;
20773
20774    // The count of PIDF info received that contained MMTEL caps.
20775    optional int32 mmtel_caps_count = 6;
20776
20777    // The count of PIDF info received that contained no mmtel or RCS caps.
20778    optional int32 no_caps_count = 7;
20779
20780    // The count that matches the above conditions;
20781    optional int32 count = 8;
20782}
20783
20784/**
20785 * Tracks GBA requests from applications
20786 *
20787 * Logged from:
20788 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20789 */
20790message GbaEvent {
20791    enum FailedReason {
20792        UNKNOWN = 0;
20793        FEATURE_NOT_SUPPORTED = 1;
20794        FEATURE_NOT_READY = 2;
20795        NETWORK_FAILURE = 3;
20796        INCORRECT_NAF_ID = 4;
20797        SECURITY_PROTOCOL_NOT_SUPPORTED = 5;
20798    }
20799    // Carrier ID of the SIM used for IMS registration.
20800    // See https://source.android.com/devices/tech/config/carrierid.
20801    // Used as a dimension
20802    optional int32 carrier_id = 1;
20803
20804    // Index of the SIM used, 0 for single-SIM devices.
20805    // Used as a dimension
20806    optional int32 slot_id = 2;
20807
20808    // Whether the GBA event is successful.
20809    // Used as a dimension
20810    optional bool successful = 3;
20811
20812    // Gba authentication failed reason.
20813    // Used as a dimension
20814    optional FailedReason failed_reason = 4;
20815
20816    // The count that matches the above conditions.
20817    optional int32 count = 5;
20818}
20819
20820/*
20821 * Logs details of initiated UWB ranging session
20822 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
20823 */
20824message UwbSessionInitiated {
20825    // UWB profiles
20826    optional android.uwb.Profile profile = 1;
20827    // Scrambled timestamp sequence (STS) Type
20828    optional android.uwb.Sts sts = 2;
20829    // Was it an initiator as opposed to responder?
20830    optional bool is_initiator = 3;
20831    // Was it a controller as opposed to controlee?
20832    optional bool is_controller = 4;
20833    // Was the discovery done by the framework?
20834    optional bool is_discovered_by_framework = 5;
20835    // Was it out-of-band connection as opposed to in-band connection?
20836    // Note that this field is ignored if is_discovered_by_framework is false.
20837    optional bool is_out_of_band = 6;
20838    // UWB channel 5, 6, 9, etc.
20839    optional int32 channel = 7;
20840    // The status code of session initialization.
20841    optional android.uwb.Status status = 8;
20842    // Initialization latency in ms if is_discovered_by_framework is true.
20843    optional int32 latency_ms = 9;
20844    // Initialization latency in step size of 200 ms if is_discovered_by_framework is true.
20845    optional int32 latency_200ms = 10;
20846    // The uid of the app that initiates the connection.
20847    optional int32 uid = 11 [(is_uid) = true];
20848    // Ranging interval of the session in ms.
20849    optional int32 ranging_interval_ms = 12;
20850    // How many ongoing session when current session is initiated?
20851    optional int32 parallel_session_count = 13;
20852    // Composed value for UWB filter configurations.
20853    // This value combines the boolean value of multiple feature flags for
20854    // UWB filter configuration into one integer, where the bits of its binary value
20855    // are for the flags
20856    // Below are the flags from LSB to MSB, 1 for enabled and 0 for disabled
20857    // bit 0: filter_enabled
20858    // bit 1: enable_azimuth_mirroring
20859    // bit 2: enable_primer_aoa
20860    // bit 3: enable_primer_est_elevation
20861    // bit 4: enable_primer_fov
20862    // bit 5: predict_rear_azimuths
20863    // For example, when all flags are enabled this value is 63 (0b111111)
20864    // Refer to packages/modules/Uwb/service/ServiceUwbResources/res/values/config.xml
20865    // for more information about the flags
20866    optional int32 filter_config_value = 14;
20867}
20868
20869/*
20870 * Logs details of closed UWB ranging session
20871 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
20872 */
20873message UwbSessionClosed {
20874    // UWB profiles
20875    optional android.uwb.Profile profile = 1;
20876    // Scrambled timestamp sequence (STS) Type
20877    optional android.uwb.Sts sts = 2;
20878    // Was it an initiator as opposed to responder?
20879    optional bool is_initiator = 3;
20880    // Was it a controller as opposed to controlee?
20881    optional bool is_controller = 4;
20882    // Was the connection done by the app as opposed to by the framework?
20883    optional bool is_framework_initiated = 5;
20884    // Was it out-of-band connection as opposed to in-band connection?
20885    // Note that this field is ignored if is_framework_initiated is false.
20886    optional bool is_out_of_band = 6;
20887    // Session active duration in seconds
20888    optional int32 duration_sec = 7;
20889    // Session active duration bucket
20890    optional android.uwb.DurationBucket duration_bucket = 8;
20891    // Total ranging measurement count
20892    optional int32 ranging_count = 9;
20893    // Valid ranging measurement count
20894    optional int32 valid_ranging_count = 10;
20895    // Ranging measurement count bucket.
20896    optional android.uwb.CountBucket ranging_count_bucket = 11;
20897    // Valid ranging measurement count bucket.
20898    optional android.uwb.CountBucket valid_ranging_count_bucket = 12;
20899    // Ranging start count
20900    optional int32 start_count = 13;
20901    // Ranging start failure count
20902    optional int32 start_failure_count = 14;
20903    // Ranging start without valid ranging result count
20904    optional int32 start_no_valid_report_count = 15;
20905    // Total Rx data packet count
20906    optional int32 rx_packet_count = 16;
20907    // Total Tx data packet count
20908    optional int32 tx_packet_count = 17;
20909    // Count of Rx data packet with error
20910    optional int32 rx_error_count = 18;
20911    // Count of Tx data packet with error
20912    optional int32 tx_error_count = 19;
20913    // Count of Rx data packets sent to upper layer
20914    optional int32 rx_to_upper_layer_count = 20;
20915    // Ranging Measurement Type
20916    optional android.uwb.RangingType ranging_type = 21;
20917}
20918
20919/*
20920 * Logs details of start UWB ranging
20921 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
20922 */
20923message UwbStartRanging {
20924    // UWB profiles
20925    optional android.uwb.Profile profile = 1;
20926    // Scrambled timestamp sequence (STS) Type
20927    optional android.uwb.Sts sts = 2;
20928    // Was it an initiator as opposed to responder?
20929    optional bool is_initiator = 3;
20930    // Was it a controller as opposed to controlee?
20931    optional bool is_controller = 4;
20932    // Was the connection done by the app as opposed to by the framework?
20933    optional bool is_framework_initiated = 5;
20934    // Was it out-of-band connection as opposed to in-band connection?
20935    // Note that this field is ignored if is_framework_initiated is false.
20936    optional bool is_out_of_band = 6;
20937    // The status code of ranging start.
20938    optional android.uwb.RangingStatus status = 7;
20939}
20940
20941/*
20942 * Log that the ranging measurement is received
20943 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
20944 */
20945message UwbRangingMeasurementReceived {
20946    // UWB profiles
20947    optional android.uwb.Profile profile = 1;
20948    // None-Line-of-sight (LOS) indication
20949    optional android.uwb.Nlos nlos = 2;
20950    // Was the distance valid?
20951    optional bool is_distance_valid = 3;
20952    // The distance measurement in centimeters.
20953    optional int32 distance_cm = 4;
20954    // The distance measurement in step size of 50 cm
20955    optional int32 distance_50cm = 5;
20956    // RSSI of ranging report, in dBm
20957    optional int32 rssi = 6;
20958    // Was azimuth angle valid?
20959    optional bool is_azimuth_valid = 7;
20960    // The azimuth angle measurement in degrees.
20961    optional int32 azimuth_degree = 8;
20962    // The azimuth angle measurement in step size of 10 degree.
20963    optional int32 azimuth_10degree = 9;
20964    // The figure of merit of azimuth angle measurement.
20965    optional int32 azimuth_fom = 10;
20966    // Was elevation angle valid?
20967    optional bool is_elevation_valid = 11;
20968    // The elevation angle measurement in degrees.
20969    optional int32 elevation_degree = 12;
20970    // The elevation angle measurement in step size of 10 degree.
20971    optional int32 elevation_10degree = 13;
20972    // The figure of merit of elevation angle measurement.
20973    optional int32 elevation_fom = 14;
20974    // Ranging Measurement Type
20975    optional android.uwb.RangingType ranging_type = 15;
20976    // The filtered distance measurement in centimeters.
20977    optional int32 filtered_distance_cm = 16;
20978    // The filtered azimuth angle measurement in degrees.
20979    optional int32 filtered_azimuth_degree = 17;
20980    // The filtered figure of merit of azimuth angle measurement.
20981    optional int32 filtered_azimuth_fom = 18;
20982    // The filtered elevation angle measurement in degrees.
20983    optional int32 filtered_elevation_degree = 19;
20984    // The filtered figure of merit of elevation angle measurement.
20985    optional int32 filtered_elevation_fom = 20;
20986}
20987
20988/*
20989 * Log that the first ranging measurement is received
20990 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
20991 */
20992message UwbFirstRangingReceived {
20993    // UWB profiles
20994    optional android.uwb.Profile profile = 1;
20995    // The latency between the ranging start/resume and 1st ranging measurement, in ms.
20996    optional int32 latency_ms = 2;
20997    // The ranging latency in 200ms.
20998    optional int32 latency_200ms = 3;
20999}
21000
21001/*
21002 * Log that UWB device error is detected
21003 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
21004 */
21005message UwbDeviceErrorReported {
21006    enum Type {
21007        UNKNOWN = 0;
21008        // Initialization error
21009        INIT_ERROR = 1;
21010        // Device status error
21011        DEVICE_STATUS_ERROR = 2;
21012        // UCI generic error
21013        UCI_GENERIC_ERROR = 3;
21014    }
21015    // Error type
21016    optional Type type= 1;
21017}
21018
21019/**
21020 * Log that the clipboard has been cleared
21021 * Logged from frameworks/base/services/core/java/android/content/ClipboardAutoWipeService.java
21022 */
21023message ClipboardCleared {
21024    enum Source {
21025        SOURCE_UNKNOWN = 0;
21026        AUTO_CLEAR = 1;
21027    }
21028
21029    // Source of the wipe
21030    optional Source source = 1;
21031}
21032
21033/**
21034 * Pulls status for a SIM.
21035 *
21036 * Each pull creates multiple atoms, one for each SIM. The atom holds the status for a SIM that's
21037 * sensitive per carrier. The atom would be aggregated per carrier for analysis.
21038 *
21039 * Pulled from:
21040 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
21041 */
21042message PerSimStatus {
21043    enum WfcMode {
21044        UNKNOWN = 0;
21045        WIFI_ONLY = 1;
21046        CELLULAR_PREFERRED = 2;
21047        WIFI_PREFERRED = 3;
21048    }
21049    enum SimVoltageClass {
21050        VOLTAGE_CLASS_UNKNOWN = 0;
21051        VOLTAGE_CLASS_A = 1;
21052        VOLTAGE_CLASS_B = 2;
21053        VOLTAGE_CLASS_C = 3;
21054    }
21055
21056    // Index of the SIM, 0 for single-SIM devices.
21057    optional int32 sim_slot_index = 1;
21058
21059    // Carrier ID of the SIM.
21060    // See https://source.android.com/devices/tech/config/carrierid.
21061    optional int32 carrier_id = 2;
21062
21063    // Indicates whether phone number source UICC provides a phone number
21064    // and whether it agrees with other sources:
21065    //  - 0: no number provided
21066    //  - a positive integer (> 0): sources providing the same phone number
21067    //    shall use the same integer. The integer shall start from 1, and
21068    //    for each new unique source the next integer (2, 3, …) is used.
21069    // This way, the raw phone number cannot be derived from the value of
21070    // this field.
21071    // This also allows a quick check of conflicts: any field > 1 means conflict,
21072    // and the max means the count of unique phone numbers.
21073    optional int32 phone_number_source_uicc = 3;
21074
21075    // Indicates whether phone number source CARRIER provides a phone number
21076    // and whether it agrees with other sources.
21077    // See field phone_number_source_uicc.
21078    optional int32 phone_number_source_carrier = 4;
21079
21080    // Indicates whether phone number source IMS provides a phone number
21081    // and whether it agrees with other sources.
21082    // See field phone_number_source_uicc.
21083    optional int32 phone_number_source_ims = 5;
21084
21085    // Indicates whether VoLTE is enabled
21086    optional bool volte_enabled = 6;
21087
21088    // Indicates whether WFC is enabled
21089    optional bool wfc_enabled = 7;
21090
21091    // Indicates the user's WFC mode
21092    optional WfcMode wfc_mode = 8;
21093
21094    // Indicates the user's WFC mode when roaming
21095    optional WfcMode wfc_roaming_mode = 9;
21096
21097    // Indicates the user's setting for video calling.
21098    optional bool video_calling_enabled = 10;
21099
21100    // Indicates if data roaming is enabled
21101    optional bool data_roaming_enabled = 11;
21102
21103    // Indicates the list of networks allowed by the user. Bitmask is encoded as
21104    // TelephonyManager#NetworkTypeBitMask.
21105    optional int64 allowed_networks_by_user = 12;
21106
21107    // Indicates if 2G is disabled by the user using the "Allow 2G" toggle
21108    optional bool is_2g_disabled = 13;
21109
21110    // Indicates if PIN1 of the SIM card is enabled
21111    optional bool is_pin1_enabled = 14;
21112
21113    // Indicates the lowest voltage class supported by the SIM
21114    optional SimVoltageClass sim_voltage_class = 15;
21115
21116    // APN type bitmask of the APNs added or modified by user:
21117    // @ApnType in frameworks/base/telephony/java/android/telephony/Annotation.java.
21118    optional int32 user_modified_apn_type_bitmask = 16;
21119
21120    // Indicates the unmetered networks
21121    // Bitmask is encoded as TelephonyManager#NetworkTypeBitMask.
21122    optional int64 unmetered_networks = 17;
21123
21124    // Indicates whether VoNR is enabled
21125    optional bool vonr_enabled = 18;
21126}
21127
21128/*
21129 * Logs Device Scan State events generated by Nearby Scan API.
21130 */
21131message NearbyDeviceScanStateChanged {
21132  // Uid of the client that triggers the Nearby scan.
21133  optional int32 uid = 1 [(is_uid) = true];
21134
21135  // Scan start timestamp as session id.
21136  optional int64 scan_session_id = 2;
21137
21138  // Scan state.
21139  optional android.nearby.NearbyScanState scan_state = 3;
21140
21141  // Scan type.
21142  optional android.nearby.NearbyScanType scan_type = 4;
21143
21144  // Medium that this device was discovered/lost.
21145  optional android.nearby.NearbyNetworkMedium network_medium = 5;
21146
21147  // Received Signal Strength Indication (RSSI) value of the device discovered/lost.
21148  optional int32 rssi = 6;
21149
21150  // Model of the device discovered/lost.
21151  optional string scanned_device_model = 7;
21152
21153  // Manufacturer of the device discovered/lost.
21154  optional string scanned_device_manufacturer = 8;
21155}
21156
21157/**
21158 * Logs when locales of an application are changed.
21159 * Logged from
21160 *   frameworks/base/services/core/java/com/android/server/locales/LocaleManagerService.java
21161 */
21162message ApplicationLocalesChanged {
21163    // The uid which invoked this update. The locales for an application
21164    // could be changed from the in-app picker OR from the settings UI.
21165    optional int32 calling_uid = 1 [(is_uid) = true];
21166
21167    // The uid for which the locale change is being done.
21168    optional int32 target_uid = 2 [(is_uid) = true];
21169
21170    // The new locales for the target package. A comma separated list of BCP 47
21171    // locale identifiers, compatible with LocaleList#forLanguageTags.
21172    optional string new_locales = 3;
21173
21174    // The previous locales for the target package. A comma separated list of
21175    // BCP 47 locale identifiers, compatible with LocaleList#forLanguageTags.
21176    optional string prev_locales = 4;
21177
21178    // Application locales changed status.
21179    enum Status {
21180        // A placeholder for unspecified values.
21181        STATUS_UNSPECIFIED = 0;
21182
21183        // New locales were committed.
21184        CONFIG_COMMITTED = 1;
21185
21186        // Likely because no change is required.
21187        CONFIG_UNCOMMITTED = 2;
21188
21189        // Failed because the target package is invalid.
21190        FAILURE_INVALID_TARGET_PACKAGE = 3;
21191
21192        // Failed because the calling package does not have the required permission.
21193        FAILURE_PERMISSION_ABSENT = 4;
21194    }
21195
21196    optional Status status = 5;
21197
21198    // The caller where changes application locales.
21199    enum Caller {
21200        // A placeholder for unknown value.
21201        CALLER_UNKNOWN = 0;
21202
21203        // The change was called from the delegate.
21204        CALLER_DELEGATE = 1;
21205
21206        // The change was called from Apps.
21207        CALLER_APPS = 2;
21208
21209        // The change was called from the system due to backup and restore.
21210        CALLER_BACKUP_RESTORE = 3;
21211
21212        // The change was called from the system when the app languages
21213        // feature or the set per-app locales was changed from opt-in to
21214        // opt-out.
21215        CALLER_APP_UPDATE_LOCALES_CHANGE = 4;
21216
21217        // The change was called from the system due to the dynamic locales
21218        // change.
21219        CALLER_DYNAMIC_LOCALES_CHANGE = 5;
21220    }
21221
21222    optional Caller caller = 6;
21223}
21224
21225/* Logs when the display HBM state changes.
21226 *
21227 * Logged from:
21228 *   frameworks/base/services/core/java/com/android/server/display/HighBrightnessModeController.java
21229 */
21230message DisplayHbmStateChanged {
21231    optional int32 display_id = 1;
21232
21233    // New HBM state
21234    optional android.server.display.HbmState state = 2;
21235
21236    // The reason the state changes.
21237    optional android.server.display.HbmStateTransitionReason reason = 3;
21238}
21239
21240/*
21241 * Logs when the display HBM brightness changes.
21242 * Logged from:
21243 *   frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessControllerjava
21244 */
21245message DisplayHbmBrightnessChanged {
21246    optional int32 display_id = 1;
21247
21248    // display brightness
21249    optional float brightness = 2;
21250}
21251
21252/**
21253 * Per-UID time spent running work on the GPU.
21254 *
21255 * Each pull creates multiple atoms, one per (GPU ID, UID) pair, for at most 10
21256 * randomly selected UIDs.
21257 *
21258 * Pulled from:
21259 *    frameworks/native/services/gpuservice/gpuwork/GpuWork.cpp
21260 */
21261message GpuWorkPerUid {
21262  // The UID (i.e. app id) that scheduled work on the GPU.
21263  optional int32 uid = 1 [(is_uid) = true];
21264
21265  // The GPU ID for which we have work information.
21266  optional int32 gpu_id = 2;
21267
21268  // The time duration (in seconds) over which this data was collected (most
21269  // likely 24 hours).
21270  optional int32 time_duration_seconds = 3;
21271
21272  // The total amount of time (in milliseconds) the GPU spent running work for
21273  // |uid|.
21274  optional int32 total_active_duration_millis = 4;
21275
21276  // The total amount of time (in milliseconds) the GPU was inactive while
21277  // running "continuous" work for |uid|. This is estimated by adding up the
21278  // duration of the small gaps between GPU work for |uid|.
21279  optional int32 total_inactive_duration_millis = 5;
21280}
21281
21282/**
21283 * Logs when entries are dropped in DropBox and the reason for the drop.
21284 *
21285 * Logged from: frameworks/base/services/
21286 */
21287message DropboxEntryDropped {
21288    // Explains at which stage of the DropBox workflow the entry was dropped.
21289    enum DropReason {
21290        UNKNOWN = 0;
21291        CLEARING_DATA = 3;
21292        AGED = 4;
21293        WRITE_FAILURE = 5;
21294        ENTRY_TOO_LARGE = 6;
21295
21296        reserved 1, 2;
21297    }
21298
21299    optional DropReason drop_reason = 1;
21300
21301    // Tag describing the type of dropbox entry.
21302    optional string tag = 2;
21303
21304    // The age (millis) of the dropped dropbox entry.
21305    optional int64 age_millis = 3;
21306}
21307
21308message PersistentUriPermissionsFlushed {
21309    // Current amount of persistent uri permissions overall
21310    optional int32 permissions_flushed_amount = 1;
21311}
21312
21313message PersistentUriPermissionsAmountPerPackage {
21314    // The uid persistent uri permissions amount reported for
21315    optional int32 uid = 1 [(is_uid) = true];
21316    // Current amount of persistent uri permissions for this package
21317    optional int32 amount = 2;
21318}
21319
21320/**
21321 * VBMeta Digest cryptographically encapsulates the composition of signed images or partitions of
21322 * a particular build.
21323 *
21324 * Logs when boot is complete.
21325 * Pushed from:
21326 *    frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
21327 */
21328message VBMetaDigestReported {
21329    // the hex encoded string of VBMeta Digest value
21330    optional string vbmeta_digest = 1;
21331}
21332
21333/**
21334 * APEXs can either be signed by Google or OEMs. This atom captures basic metadata of APEXs
21335 * pre-installed on a build or a device.
21336 *
21337 * Logs when boot is complete.
21338 * Pushed from:
21339 *    frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
21340 */
21341message ApexInfoGathered {
21342    // APEX package names are determined by OEMs
21343    optional string package_name = 1;
21344    // the version code of the APEX
21345    optional int64 version_code = 2;
21346
21347    // the hex encoded value of digest of the content of this APEX
21348    // we are deprecating the use of this going forward
21349    optional string content_digest = 3;
21350
21351    enum DigestAlgorithmType {
21352        UNKNOWN = 0;
21353        CHUNKED_SHA256 = 1;
21354        CHUNKED_SHA512 = 2;
21355        VERITY_CHUNKED_SHA256 = 3;
21356        SHA256 = 4;
21357    }
21358
21359    // the algorithm that the content digest is computed
21360    optional DigestAlgorithmType algo_type = 4;
21361
21362    // the SHA256 digest(s) of the APEX's signer certificate(s)
21363    repeated string signer_sha256_digest = 5;
21364}
21365
21366/**
21367 * MobileBundledApps (MBAs) include preloaded apps and apps that are installed in the background
21368 * without user knowledge/consent.
21369 *
21370 * However, note that we will only be recording *updated* preloaded apps + dynamic MBAs.
21371 *
21372 * Pushed from:
21373 *    frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
21374 *
21375 * Next ID: 12
21376 */
21377message MobileBundledAppInfoGathered {
21378    // MBA package names are determined by developers (which can include OEMs)
21379    optional string package_name = 1;
21380    // the package version code of the MBA
21381    optional int64 version_code = 2;
21382    // the split name (empty if it's the base)
21383    optional string split_name = 11;
21384
21385    enum DigestAlgorithmType {
21386        UNKNOWN = 0;
21387        CHUNKED_SHA256 = 1;
21388        CHUNKED_SHA512 = 2;
21389        VERITY_CHUNKED_SHA256 = 3;
21390        SHA256 = 4;
21391    }
21392    // the hex encoded value of digest of the content of the MBA
21393    optional string content_digest = 3;
21394    // the algorithm that the content_digest is computed
21395    optional DigestAlgorithmType algo_type = 4;
21396    // the SHA256 digest(s) of the APEX's signer certificate(s)
21397    repeated string signer_sha256_digest = 5;
21398
21399    enum MBAStatus {
21400        ERROR = 0;
21401        PRELOADED = 1;
21402        UPDATED_PRELOAD = 2;
21403        NEW_MBA = 3;
21404        UPDATED_NEW_MBA = 4;
21405    }
21406    // whether or not the MBA is preloaded or dynamically installed
21407    optional MBAStatus mba_status = 6;
21408    // the package that initiated the installation of this MBA
21409    optional string initiator = 7;
21410    // the SHA256 digest(s) of the initiator's signer certificate(s)
21411    repeated string initiator_signer_sha256_digest = 8;
21412    // the package that installs this MBA
21413    optional string installer = 9;
21414    // the package on behalf of which initiator requested the installation of this MBA
21415    optional string originator = 10;
21416}
21417
21418/**
21419 * PVM is protected virtual machine. This atom captures the notion of a container
21420 * that describes a virtual machine.
21421 *
21422 * Will be pushed from:
21423 *      frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
21424 */
21425message PvmInfoGathered {
21426    // PVM names are determined by OEMs
21427    optional string name = 1;
21428    // an int describing the version of the VM
21429    optional int64 version = 2;
21430    // the hex encoded SHA256 digest of the pvm descriptor file
21431    optional string sha256_digest = 3;
21432}
21433
21434/**
21435 * This will be pulled from
21436 *     frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
21437 */
21438message SignedPartitionInfo {
21439    // partition name (e.g. vendor, product) is determined by OEM
21440    optional string partition_name = 1;
21441    // the hex encoded SHA256 digest of the partition image file
21442    optional string sha256_digest = 2;
21443}
21444
21445/**
21446 * Logs when Wear Settings UI is interacted with
21447 */
21448message WearSettingsUIInteracted {
21449    /** The UI action category */
21450    optional android.app.wearsettings.Action action = 1;
21451
21452    /** The ID of the entry that the users actioned on. */
21453    optional android.app.wearsettings.ItemId item_id = 2;
21454}
21455
21456message TracingServiceReportEvent {
21457    enum Event {
21458      TRACING_SERVICE_REPORT_UNDEFINED = 0;
21459
21460      // Checkpoints inside TracingServiceProxy.
21461      TRACING_SERVICE_REPORT_BEGIN = 1;
21462      TRACING_SERVICE_REPORT_SVC_HANDOFF = 2;
21463
21464      // Guardrails inside TracingServiceProxy.
21465      TRACING_SERVICE_REPORT_BIND_PERM_INCORRECT = 3;
21466      TRACING_SERVICE_REPORT_SVC_PERM_MISSING = 4;
21467      TRACING_SERVICE_REPORT_SVC_COMM_ERROR = 5;
21468  }
21469
21470  // Which stage of the pipeline we are reporting from.
21471  optional Event event = 1;
21472
21473  // UUID of the trace.
21474  optional int64 trace_uuid_lsb = 2;
21475  optional int64 trace_uuid_msb = 3;
21476}
21477
21478/** Pulled from PinnerService. */
21479message PinnedFileSizesPerPackage {
21480    // If the file is pinned but not as part of a specific pinned app,
21481    // this will be set to 1000 - the value of system_server.
21482    optional int32 uid = 1 [(is_uid) = true];
21483
21484    // Consists of only the pinned file's filename, not its full path; for example
21485    // Given a pinned file at ‘/vendor/lib64/libCB.so’, then this field will be
21486    // Determined to have have the value ‘libCB.so’.
21487    optional string filename = 2;
21488
21489    // The size of the pinned file, in kilobytes.
21490    optional int32 size_kb = 3;
21491}
21492
21493/** Pulled from PendingIntentController. */
21494message PendingIntentsPerPackage {
21495    // The UID of the app that sent the PendingIntent.
21496    optional int32 uid = 1 [(is_uid) = true];
21497    // The total number of currently active PendingIntents belonging to this uid.
21498    optional int32 pending_intent_count = 2;
21499    // The total size of all currently active PendingIntents belonging to this uid, in kilobytes.
21500    optional int32 pending_intent_total_bundle_size_kb = 3;
21501}
21502
21503/*
21504 * Logs changes to game state set by game applications via GameService.
21505 */
21506message GameStateChanged {
21507    enum State {
21508        // Game mode is unknown.
21509        MODE_UNKNOWN = 0;
21510
21511        // The game is not in active play, e.g.e the user is using a game menu.
21512        MODE_NONE = 1;
21513
21514        // The game is in active, but interruptible, game play.
21515        MODE_GAMEPLAY_INTERRUPTIBLE = 2;
21516
21517        // The game is in active user play mode, which cannot be interrupted.
21518        MODE_GAMEPLAY_UNINTERRUPTIBLE = 3;
21519
21520        // The current content shown is not gameplay related (e.g. an ad).
21521        MODE_CONTENT = 4;
21522    }
21523
21524    // Provided to ensure package is available even with UID sharing.
21525    optional string package_name = 1;
21526
21527    // The UID (i.e. app id).
21528    optional int32 uid = 2 [(is_uid) = true];
21529
21530    // Whether the device enabled performance boost when the state was changed.
21531    optional bool boost_enabled = 3;
21532
21533    // This includes a top-level state for the game.
21534    optional State state = 4;
21535
21536    // Indicates if the game is loading assets/resources/compiling/etc.
21537    optional bool is_loading = 5;
21538
21539    // A developer-selected enum, for example to indicate level or scene.
21540    optional int32 label = 6;
21541
21542    // A developer-supplied enum, e.g. to indicate the current quality level.
21543    optional int32 quality = 7;
21544}
21545
21546/**
21547 *  Logs for a background fetch process when the runBackgroundFetch() is called.
21548 */
21549message BackgroundFetchProcessReported {
21550    optional int32 latency_in_millis = 1;
21551    optional int32 num_of_eligible_to_update_cas = 2;
21552    optional int32 result_code = 3;
21553}
21554
21555/**
21556 *  Logs for an updating a single custom audience process when the updateCustomAudience() is called.
21557 */
21558message UpdateCustomAudienceProcessReported {
21559    optional int32 latency_in_millis = 1;
21560    optional int32 result_code = 2;
21561    optional int32 data_size_of_ads_in_bytes = 3;
21562    optional int32 num_of_ads = 4;
21563}
21564
21565/**
21566 * Logs for the bidding stage of an ad selection process when the getBuyersCustomAudience() or
21567 * the runAdBidding() is called.
21568 */
21569message RunAdBiddingProcessReported {
21570    /* Logs when the getBuyersCustomAudience() is called. */
21571    optional int32 get_buyers_custom_audience_latency_in_millis = 1;
21572    optional int32 get_buyers_custom_audience_result_code = 2;
21573    optional int32 num_buyers_requested = 3;
21574    optional int32 num_buyers_fetched = 4;
21575
21576    /* Logs when the runAdBidding() is called. */
21577    optional int32 num_of_ads_entering_bidding = 5;
21578    optional int32 num_of_cas_entering_bidding = 6;
21579    optional int32 num_of_cas_post_bidding = 7;
21580    optional float ratio_of_cas_selecting_rmkt_ads = 8;
21581    optional int32 run_ad_bidding_latency_in_millis = 9;
21582    optional int32 run_ad_bidding_result_code = 10;
21583
21584    /* Time from the start of the getBuyersCustomAudience() to the end of the runAdBidding(). */
21585    optional int32 total_ad_bidding_stage_latency_in_millis = 11;
21586}
21587
21588/**
21589 * Logs for the scoring stage of an ad selection process when the runAdScoring() is called.
21590 */
21591message RunAdScoringProcessReported {
21592    /* Logs when the getAdSelectionLogic() is called. */
21593    optional int32 get_ad_selection_logic_latency_in_millis = 1;
21594    optional int32 get_ad_selection_logic_result_code = 2;
21595    optional android.adservices.service.ScriptType get_ad_selection_logic_script_type = 3;
21596    optional int32 fetched_ad_selection_logic_script_size_in_bytes = 4;
21597
21598    /* Logs when the getTrustedScoringSignals() is called. */
21599    optional int32 get_trusted_scoring_signals_latency_in_millis = 5;
21600    optional int32 get_trusted_scoring_signals_result_code = 6;
21601    optional int32 fetched_trusted_scoring_signals_data_size_in_bytes = 7;
21602
21603    /* Logs when the getAdScores() is called. */
21604    // the total scoreAds script execution time when getAdScores() is called.
21605    optional int32 score_ads_latency_in_millis = 8;
21606    // the overall latency of the getAdScores().
21607    optional int32 get_ad_scores_latency_in_millis = 9;
21608    optional int32 get_ad_scores_result_code = 10;
21609
21610    optional int32 num_of_cas_entering_scoring = 11;
21611    optional int32 num_of_remarketing_ads_entering_scoring = 12;
21612    optional int32 num_of_contextual_ads_entering_scoring = 13;
21613    // the overall latency of the runAdScoring process.
21614    optional int32 run_ad_scoring_latency_in_millis = 14;
21615    optional int32 run_ad_scoring_result_code = 15;
21616}
21617
21618/* Logs for the ad selection process when the runAdSelection() is called.*/
21619message RunAdSelectionProcessReported {
21620    /* Logs for the persisting ad selection process. */
21621    optional bool is_remarketing_ads_won = 1;
21622    optional int32 db_ad_selection_size_in_bytes = 2;
21623    optional int32 persist_ad_selection_latency_in_millis = 3;
21624    optional int32 persist_ad_selection_result_code = 4;
21625
21626    /* Logs for the overall runAdSelection process. */
21627    optional int32 run_ad_selection_latency_in_millis = 5;
21628    optional int32 run_ad_selection_result_code = 6;
21629}
21630
21631/**
21632 *  Logs for the bidding process on a single custom audience when the runAdBiddingPerCA() is called.
21633 */
21634message RunAdBiddingPerCAProcessReported {
21635    optional int32 num_of_ads_for_bidding = 1;
21636    optional int32 run_ad_bidding_per_ca_latency_in_millis = 2;
21637    optional int32 run_ad_bidding_per_ca_result_code = 3;
21638
21639    /* Logs for the getting buyer's decision logic script process. */
21640    optional int32 get_buyer_decision_logic_latency_in_millis = 4;
21641    optional int32 get_buyer_decision_logic_result_code = 5;
21642    optional android.adservices.service.ScriptType buyer_decision_logic_script_type = 6;
21643    optional int32 fetched_buyer_decision_logic_script_size_in_bytes = 7;
21644
21645    /* Logs for the getting trusted bidding signals process. */
21646    optional int32 num_of_keys_of_trusted_bidding_signals = 8;
21647    optional int32 fetched_trusted_bidding_signals_data_size_in_bytes = 9;
21648    optional int32 get_trusted_bidding_signals_latency_in_millis = 10;
21649    optional int32 get_trusted_bidding_signals_result_code = 11;
21650
21651    /* Logs when runBidding() is called. */
21652    // the total generateBids script execution time when runBidding() is called..
21653    optional int32 generate_bids_latency_in_millis = 12;
21654    // the overall latency of runBidding().
21655    optional int32 run_bidding_latency_in_millis = 13;
21656    optional int32 run_bidding_result_code = 14;
21657}
21658
21659/**
21660 * Logs for AdServices GetTopics API call on T+ only due to repeated fields.
21661 * Keep in sync with AdServicesBackCompatGetTopicsReported for R+ logging.
21662 */
21663message AdServicesGetTopicsReported {
21664    // List of topic ids returned.
21665    repeated int32 topic_ids = 1;
21666
21667    // Number of filtered duplicate topics.
21668    optional int32 duplicate_topic_count = 2;
21669
21670    // Number of filtered blocked topics.
21671    optional int32 filtered_blocked_topic_count = 3;
21672
21673    // Number of topic ids returned.
21674    optional int32 count_of_topic_ids = 4;
21675}
21676
21677/**
21678 * Logs for AdServices Epoch computation GetTopTopics.
21679 */
21680message AdServicesEpochComputationGetTopTopicsReported {
21681    // Number of top topics generated.
21682    optional int32 top_topics_count = 1;
21683
21684    // Number of padded random topics generated.
21685    optional int32 padded_random_topics_count = 2;
21686
21687    // Number of apps considered for calculating top topics.
21688    optional int32 apps_considered_count = 3;
21689
21690    // Number of sdks that called Topics API in the epoch.
21691    optional int32 sdks_considered_count = 4;
21692}
21693
21694/**
21695 * Logs for AdServices Epoch Computation Classifier on T+ only due to repeated fields.
21696 * Keep in sync with AdServicesBackCompatEpochComputationClassifierReported for R+ logging.
21697 * One atom should be logged for each app classification.
21698 */
21699message AdServicesEpochComputationClassifierReported {
21700
21701    // List of topics returned by the classifier for each app. The classification
21702    // does not depend on the user's usage of the app.
21703    repeated int32 topic_ids = 1;
21704
21705    // Build id of the assets.
21706    optional int32 build_id = 2;
21707
21708    // Version of the assets used.
21709    optional string asset_version = 3;
21710
21711    // Type of the classifier used for classifying apps.
21712    enum ClassifierType {
21713       /** Unknown classifier option. */
21714       UNKNOWN_CLASSIFIER = 0;
21715       /** Only on-device classification. */
21716       ON_DEVICE_CLASSIFIER = 1;
21717       /** Only Precomputed classification. */
21718       PRECOMPUTED_CLASSIFIER = 2;
21719       /** Precomputed classification values are preferred over on-device classification values. */
21720       PRECOMPUTED_THEN_ON_DEVICE_CLASSIFIER = 3;
21721    }
21722    optional ClassifierType classifier_type = 4;
21723
21724    // On Device classifier status.
21725    enum OnDeviceClassifierStatus {
21726       ON_DEVICE_CLASSIFIER_STATUS_UNSPECIFIED = 0;
21727       ON_DEVICE_CLASSIFIER_STATUS_NOT_INVOKED = 1;
21728       ON_DEVICE_CLASSIFIER_STATUS_SUCCESS = 2;
21729       ON_DEVICE_CLASSIFIER_STATUS_FAILURE = 3;
21730    }
21731    optional OnDeviceClassifierStatus on_device_classifier_status = 5;
21732
21733    // Precomputed classifier status.
21734    enum PrecomputedClassifierStatus {
21735       PRECOMPUTED_CLASSIFIER_STATUS_UNSPECIFIED = 0;
21736       PRECOMPUTED_CLASSIFIER_STATUS_NOT_INVOKED = 1;
21737       PRECOMPUTED_CLASSIFIER_STATUS_SUCCESS = 2;
21738       PRECOMPUTED_CLASSIFIER_STATUS_FAILURE = 3;
21739    }
21740    optional PrecomputedClassifierStatus precomputed_classifier_status = 6;
21741}
21742
21743/**
21744 * Logs when an AdServices api is called.
21745 */
21746message AdServicesApiCalled {
21747    // The name of the api that was called.
21748    // Can be classified as one of the three:
21749    //
21750    // Targeting
21751    //  * GetTopics()
21752    //
21753    // FLEDGE
21754    //  * joinCustomAudience()
21755    //  * leaveCustomAudience()
21756    //  * overrideCustomAudienceRemoteInfo()
21757    //  * removeCustomAudienceRemoteInfoOverride()
21758    //  * resetAllCustomAudienceOverrides()
21759    //  * selectAds()
21760    //  * reportImpression()
21761    //  * overrideAdSelectionConfigRemoteInfo()
21762    //  * removeAdSelectionConfigRemoteInfoOverride()
21763    //  * resetAllAdSelectionConfigRemoteOverrides()
21764    //  * setAppInstallAdvertisers()
21765    //  * reportInteraction()
21766    //  * updateAdCounterHistogram()
21767    //
21768    // Measurement - client side
21769    //   * register() : SOURCE
21770    //   * register() : TRIGGER
21771    //   * deleteRegistrations()
21772    //   * registerWebSource()
21773    //   * registerWebTrigger()
21774    //   * getMeasurementApiStatus()
21775    //
21776    // AdId
21777    //   * GetAdId()
21778    //
21779    // AppsetId
21780    //   * GetAppsetId()
21781
21782
21783    enum AdServicesApiClassType {
21784        UNKNOWN = 0;
21785        TARGETING = 1;
21786        FLEDGE = 2;
21787        MEASUREMENT = 3;
21788        ADID = 4;
21789        APPSETID = 5;
21790    }
21791
21792    enum AdServicesApiName {
21793        API_NAME_UNKNOWN = 0;
21794        GET_TOPICS = 1;
21795        JOIN_CUSTOM_AUDIENCE = 2;
21796        LEAVE_CUSTOM_AUDIENCE = 3;
21797        SELECT_ADS = 4;
21798        REGISTER_SOURCE = 5;
21799        DELETE_REGISTRATIONS = 6;
21800        REPORT_IMPRESSION = 7;
21801        OVERRIDE_CUSTOM_AUDIENCE_REMOTE_INFO = 8;
21802        REMOVE_CUSTOM_AUDIENCE_REMOTE_INFO_OVERRIDE = 9;
21803        RESET_ALL_CUSTOM_AUDIENCE_OVERRIDES = 10;
21804        OVERRIDE_AD_SELECTION_CONFIG_REMOTE_INFO = 11;
21805        REMOVE_AD_SELECTION_CONFIG_REMOTE_INFO_OVERRIDE = 12;
21806        RESET_ALL_AD_SELECTION_CONFIG_REMOTE_OVERRIDES = 13;
21807        GET_ADID = 14;
21808        GET_APPSETID = 15;
21809        REGISTER_TRIGGER = 16;
21810        REGISTER_WEB_SOURCE = 17;
21811        REGISTER_WEB_TRIGGER = 18;
21812        GET_MEASUREMENT_API_STATUS = 19;
21813        GET_TOPICS_PREVIEW_API = 20;
21814        SELECT_ADS_FROM_OUTCOMES = 21;
21815        SET_APP_INSTALL_ADVERTISERS = 22;
21816        REPORT_INTERACTION = 23;
21817        UPDATE_AD_COUNTER_HISTOGRAM = 24;
21818    }
21819
21820    optional AdServicesApiClassType api_class = 1 [deprecated = true];
21821
21822    // The actual name of the api within the 3 classes described above.
21823    optional AdServicesApiName  api_name = 2;
21824
21825    optional string app_package_name = 3;
21826    optional string sdk_package_name = 4;
21827
21828    optional int32 latency_millis = 5;
21829
21830    // response_code is the error/failure code for the given api.
21831    optional int32 response_code = 6;
21832}
21833
21834/**
21835 * Logs when an AdServices measurement reports are being uploaded.
21836 */
21837message AdServicesMeasurementReportsUploaded {
21838    enum ReportType {
21839        UNKNOWN_REPORT = 0;
21840        EVENT = 1;
21841        AGGREGATE = 2;
21842    }
21843
21844    optional ReportType type = 1;
21845
21846    enum ReportUploadStatus {
21847        UNKNOWN_STATUS = 0;
21848        SUCCESS = 1;
21849        FAILURE = 2;
21850    }
21851
21852    optional ReportUploadStatus response_code = 2;
21853    optional android.adservices.service.measurement.ReportUploadFailureType failure_type = 3;
21854    optional android.adservices.service.measurement.ReportUploadMethod upload_method = 4;
21855    // delay (in milliseconds) between scheduled delivery time and actual delivery time.
21856    optional int64 reporting_delay_millis = 5;
21857}
21858
21859/**
21860 * Logs registration response size when registration URI is pinged.
21861 */
21862message AdServicesMeasurementRegistrations {
21863    enum RegistrationType {
21864        UNKNOWN_REGISTRATION = 0;
21865        SOURCE = 1;
21866        TRIGGER = 2;
21867    }
21868
21869    optional RegistrationType type = 1;
21870    optional int64 response_size_in_bytes = 2;
21871    optional string adtech_url_domain_if_size_above_threshold = 3;
21872    optional android.adservices.service.measurement.SourceType source_type = 4;
21873    optional android.adservices.service.measurement.RegistrationSurfaceType surface_type = 5;
21874    optional android.adservices.service.measurement.Status status = 6;
21875    optional android.adservices.service.measurement.RegistrationFailureType failure_type = 7;
21876    // delay (in milliseconds) between registration queue request and the time it gets processed
21877    optional int64 registration_delay_millis = 8;
21878}
21879
21880/**
21881 * Log the duration of executing all receivers of LOCKED_BOOT_COMPLETED or BOOT_COMPLETED broadcast.
21882 * The dispatch latency is the dispatchTime - enqueueTime.
21883 * The completion latency is the completeTime - enqueueTime.
21884 * Logged from:
21885 *   frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
21886 */
21887message BootCompletedBroadcastCompletionLatencyReported {
21888    enum Event {
21889        UNKNOWN = 0;
21890        LOCKED_BOOT_COMPLETED = 1;
21891        BOOT_COMPLETED = 2;
21892    }
21893
21894    optional Event event = 1;
21895    // from enqueueTime to dispatchTime.
21896    optional int32 dispatch_latency_uptime_millis = 2;
21897    // from enqueueTime to completeTime.
21898    optional int32 complete_latency_uptime_millis = 3;
21899    // from enqueueRealTime to dispatchRealTime.
21900    optional int32 dispatch_latency_realtime_millis = 4;
21901    // from enqueueRealTime to completeRealTime.
21902    optional int32 complete_latency_realtime_millis = 5;
21903
21904    optional int32 user_id = 6;
21905    optional UserLifecycleJourneyReported.UserType user_type = 7;
21906}
21907
21908/**
21909 * Log that the permission reminder notification has been displayed or clicked.
21910 */
21911message PermissionReminderNotificationInteracted {
21912    // id which identifies single session of user interacting with permission
21913    // controller
21914    optional int64 session_id = 1;
21915
21916    enum Result {
21917        UNDEFINED = 0;
21918        // notification was presented to the user
21919        NOTIFICATION_PRESENTED = 1;
21920        // notification was clicked by the user
21921        NOTIFICATION_CLICKED = 2;
21922    }
21923
21924    // View / interaction recorded
21925    optional Result result = 2;
21926}
21927
21928/**
21929 * Log that the user has interacted with the permission decision screen.
21930 */
21931message RecentPermissionDecisionsInteracted {
21932    // id which identifies single session of user interacting with permission
21933    // controller
21934    optional int64 session_id = 1;
21935
21936    enum Action {
21937        ACTION_UNKNOWN = 0;
21938        SCREEN_VIEWED = 1;
21939        REVIEW_DECISION = 2;
21940        VIEW_ALL_CLICKED = 3;
21941    }
21942
21943    // Action taken on the recent permission decisions page.
21944    optional Action action = 2;
21945
21946    // Uid of the package for the permission decision being reviewed
21947    optional int32 uid = 3 [(is_uid) = true];
21948
21949    // Name of the permission for the permission decision being reviewed.
21950    optional string permission_group_name = 4;
21951}
21952
21953/**
21954 * Logs information about app background restrictions.
21955 *
21956 * Logged from:
21957 *      frameworks/base/services/core/java/com/android/server/am/AppRestrictionController.java
21958 */
21959message AppBackgroundRestrictionsInfo {
21960    // the uid of the app.
21961    optional int32 uid = 1 [(is_uid) = true];
21962
21963    enum RestrictionLevel {
21964        LEVEL_UNKNOWN = 0;
21965        LEVEL_UNRESTRICTED = 1;
21966        LEVEL_EXEMPTED = 2;
21967        LEVEL_ADAPTIVE_BUCKET = 3;
21968        LEVEL_RESTRICTED_BUCKET = 4;
21969        LEVEL_BACKGROUND_RESTRICTED = 5;
21970        LEVEL_HIBERNATION = 6;
21971    }
21972    // indicates the app background restriction level.
21973    optional RestrictionLevel restriction_level = 2;
21974
21975    enum Threshold {
21976        THRESHOLD_UNKNOWN = 0;
21977        THRESHOLD_RESTRICTED = 1; // app was background restricted by the system.
21978        THRESHOLD_USER = 2; // app was background restricted by user action.
21979    }
21980    // indicates which threshold caused the app to be put into bg restriction.
21981    optional Threshold threshold = 3;
21982
21983    enum StateTracker {
21984        UNKNOWN_TRACKER = 0;
21985        BATTERY_TRACKER = 1;
21986        BATTERY_EXEMPTION_TRACKER = 2;
21987        FGS_TRACKER = 3;
21988        MEDIA_SESSION_TRACKER = 4;
21989        PERMISSION_TRACKER = 5;
21990        BROADCAST_EVENTS_TRACKER = 6;
21991        BIND_SERVICE_EVENTS_TRACKER = 7;
21992    }
21993    // indicates the reason/tracker which caused the app to hit the threshold.
21994    optional StateTracker tracker = 4;
21995
21996    message FgsTrackerInfo {
21997        // indicates whether an fgs notification was visible for this app or not.
21998        optional bool fgs_notification_visible = 1;
21999        // total FGS duration for this app.
22000        optional int64 fgs_duration = 2;
22001    }
22002    optional FgsTrackerInfo fgs_tracker_info = 5 [(log_mode) = MODE_BYTES];
22003
22004    message BatteryTrackerInfo {
22005        // total battery usage within last 24h (1/10000th)
22006        optional int32 battery_24h = 1;
22007        // background battery usage (1/10000th)
22008        optional int32 battery_usage_background = 2;
22009        // FGS battery usage (1/10000th)
22010        optional int32 battery_usage_fgs = 3;
22011        // Foreground battery usage (1/10000th)
22012        optional int32 battery_usage_foreground = 4;
22013        // Cached battery usage (1/10000th)
22014        optional int32 battery_usage_cached = 5;
22015    }
22016    optional BatteryTrackerInfo battery_tracker_info = 6 [(log_mode) = MODE_BYTES];
22017
22018    message BroadcastEventsTrackerInfo {
22019        // the number of broadcasts sent by this app.
22020        optional int32 broadcasts_sent = 1;
22021    }
22022    optional BroadcastEventsTrackerInfo broadcast_events_tracker_info = 7 [(log_mode) = MODE_BYTES];
22023
22024    message BindServiceEventsTrackerInfo {
22025        // the number of bind service requests by this app.
22026        optional int32 bind_service_requests = 1;
22027    }
22028    optional BindServiceEventsTrackerInfo bind_service_events_tracker_info =
22029        8 [(log_mode) = MODE_BYTES];
22030
22031    // The reasons listed below are defined in PowerExemptionManager.java
22032    enum ExemptionReason {
22033        // range 0-9 is reserved for default reasons
22034        REASON_UNKNOWN = 0;
22035        REASON_DENIED = 1;
22036        REASON_OTHER = 2;
22037        // range 10-49 is reserved for BG-FGS-launch allowed proc states
22038        REASON_PROC_STATE_PERSISTENT = 10;
22039        REASON_PROC_STATE_PERSISTENT_UI = 11;
22040        REASON_PROC_STATE_TOP = 12;
22041        REASON_PROC_STATE_BTOP = 13;
22042        REASON_PROC_STATE_FGS = 14;
22043        REASON_PROC_STATE_BFGS = 15;
22044        // range 50-99 is reserved for BG-FGS-launch allowed reasons
22045        REASON_UID_VISIBLE = 50;
22046        REASON_SYSTEM_UID = 51;
22047        REASON_ACTIVITY_STARTER = 52;
22048        REASON_START_ACTIVITY_FLAG = 53;
22049        REASON_FGS_BINDING = 54;
22050        REASON_DEVICE_OWNER = 55;
22051        REASON_PROFILE_OWNER = 56;
22052        REASON_COMPANION_DEVICE_MANAGER = 57;
22053        REASON_BACKGROUND_ACTIVITY_PERMISSION = 58;
22054        REASON_BACKGROUND_FGS_PERMISSION = 59;
22055        REASON_INSTR_BACKGROUND_ACTIVITY_PERMISSION = 60;
22056        REASON_INSTR_BACKGROUND_FGS_PERMISSION = 61;
22057        REASON_SYSTEM_ALERT_WINDOW_PERMISSION = 62;
22058        REASON_DEVICE_DEMO_MODE = 63;
22059        REASON_ALLOWLISTED_PACKAGE = 65;
22060        REASON_APPOP = 66;
22061        REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD = 67;
22062        REASON_OP_ACTIVATE_VPN = 68;
22063        REASON_OP_ACTIVATE_PLATFORM_VPN = 69;
22064        REASON_TEMP_ALLOWED_WHILE_IN_USE = 70;
22065        REASON_CURRENT_INPUT_METHOD = 71;
22066        // range 100-199 is reserved for public reasons
22067        REASON_GEOFENCING = 100;
22068        REASON_PUSH_MESSAGING = 101;
22069        REASON_PUSH_MESSAGING_OVER_QUOTA = 102;
22070        REASON_ACTIVITY_RECOGNITION = 103;
22071        REASON_ACCOUNT_TRANSFER = 104;
22072        // range 200-299 is reserved for broadcast actions
22073        REASON_BOOT_COMPLETED = 200;
22074        REASON_PRE_BOOT_COMPLETED = 201;
22075        REASON_LOCKED_BOOT_COMPLETED = 202;
22076        REASON_BLUETOOTH_BROADCAST = 203;
22077        REASON_TIMEZONE_CHANGED = 204;
22078        REASON_TIME_CHANGED = 205;
22079        REASON_LOCALE_CHANGED = 206;
22080        REASON_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED = 207;
22081        REASON_REFRESH_SAFETY_SOURCES = 208;
22082        // range 300-399 is reserved for other internal reasons
22083        REASON_SYSTEM_ALLOW_LISTED = 300;
22084        REASON_ALARM_MANAGER_ALARM_CLOCK = 301;
22085        REASON_ALARM_MANAGER_WHILE_IDLE = 302;
22086        REASON_SERVICE_LAUNCH = 303;
22087        REASON_KEY_CHAIN = 304;
22088        REASON_PACKAGE_VERIFIER = 305;
22089        REASON_SYNC_MANAGER = 306;
22090        REASON_DOMAIN_VERIFICATION_V1 = 307;
22091        REASON_DOMAIN_VERIFICATION_V2 = 308;
22092        REASON_VPN = 309;
22093        REASON_NOTIFICATION_SERVICE = 310;
22094        REASON_PACKAGE_REPLACED = 311;
22095        REASON_LOCATION_PROVIDER = 312;
22096        REASON_MEDIA_BUTTON = 313;
22097        REASON_EVENT_SMS = 314;
22098        REASON_EVENT_MMS = 315;
22099        REASON_SHELL = 316;
22100        REASON_MEDIA_SESSION_CALLBACK = 317;
22101        REASON_ROLE_DIALER = 318;
22102        REASON_ROLE_EMERGENCY = 319;
22103        REASON_SYSTEM_MODULE = 320;
22104        REASON_CARRIER_PRIVILEGED_APP = 321;
22105        REASON_DPO_PROTECTED_APP = 322;
22106        REASON_DISALLOW_APPS_CONTROL = 323;
22107        REASON_ACTIVE_DEVICE_ADMIN = 324;
22108        // app requested to be exempt
22109        REASON_OPT_OUT_REQUESTED = 1000;
22110    }
22111    // indicates if the app is exempt from background restrictions and the reason if applicable.
22112    optional ExemptionReason exemption_reason = 9;
22113
22114    enum OptimizationLevel {
22115        UNKNOWN = 0;
22116        OPTIMIZED = 1;
22117        BACKGROUND_RESTRICTED = 2;
22118        NOT_OPTIMIZED = 3;
22119    }
22120    // the user choice for the optimization level of the app.
22121    optional OptimizationLevel opt_level = 10;
22122
22123    enum TargetSdk {
22124        SDK_UNKNOWN = 0;
22125        SDK_PRE_S = 1;
22126        SDK_S = 2;
22127        SDK_T = 3;
22128    }
22129    // indicates the target sdk level for this app.
22130    optional TargetSdk target_sdk = 11;
22131
22132    // indicates if the current device is a low ram device.
22133    optional bool low_mem_device = 12;
22134
22135    // indicates previous background restriction level.
22136    optional RestrictionLevel previous_restriction_level = 13;
22137}
22138
22139/**
22140 * Logs failure reason when MmsSmsProvider#getThreadId fails to return a threadId
22141 */
22142message MmsSmsProviderGetThreadIdFailed {
22143    enum FailureCode {
22144        FAILURE_UNKNOWN = 0;
22145        // Did not return a threadId due to recipients being passed in
22146        FAILURE_NO_RECIPIENTS = 1;
22147        FAILURE_FIND_OR_CREATE_THREAD_ID_SQL = 2;
22148        // Found more than one threadId for the given of recipients
22149        FAILURE_MULTIPLE_THREAD_IDS_FOUND = 3;
22150    }
22151
22152    optional FailureCode failure_code = 1;
22153}
22154
22155/**
22156 * Logs failure reason when MmsSmsDatabaseHelperOnUpgradeFailed fails on an upgrade step
22157 */
22158message MmsSmsDatabaseHelperOnUpgradeFailed {
22159    enum FailureCode {
22160        FAILURE_UNKNOWN = 0;
22161        FAILURE_IO_EXCEPTION = 1;
22162        FAILURE_SECURITY_EXCEPTION = 2;
22163        FAILURE_SQL_EXCEPTION = 3;
22164    }
22165
22166    // Database version being upgraded from
22167    optional int32 old_version = 1;
22168    // Database version being upgraded to
22169    optional int32 current_version = 2;
22170    // Version number of the database upgrade step that failed
22171    optional int32 upgrade_failed_to_version = 3;
22172    optional FailureCode failure_code = 4;
22173}
22174
22175/** Log for autofill events. This captures events till the view goes out of
22176 * focus. For each auttofilled view going out of focus, and coming back, a
22177 * separate event would be generated.
22178 *
22179 * Logged from:
22180 * frameworks/base/services/autofill/java/com/android/server/autofill/
22181 */
22182message AutofillPresentationEventReported {
22183  enum PresentationEventResult {
22184    NONE_SHOWN_UNKNOWN_REASON =
22185        0;  // Includes reasons where losses can be partial: eg: IME not showing
22186            // certain datasets, while others are filtered out because user
22187            // started typing. So, it can either refer to a set of mixed of
22188            // known or unknown reasons.
22189    ANY_SHOWN =
22190        1;  // This is counter to the event name, but we need it in order to get
22191            // overall success rate.
22192    // Below ones corresponds to no presentation getting shown
22193    NONE_SHOWN_VIEW_FOCUS_CHANGED =
22194        2;  // User action leads to focus getting shifted to another field
22195    NONE_SHOWN_VIEW_CHANGED =
22196        3;  // This would also include if view becomes invisible.
22197    NONE_SHOWN_ACTIVITY_FINISHED = 4;  // Eg: User pressed back
22198    NONE_SHOWN_REQUEST_TIMEOUT =
22199        5;  // Autofill provider didn't respond in the given time.
22200    NONE_SHOWN_SESSION_COMMITTED_PREMATURELY =
22201        6;  // Session was prematurely committed. This can happen due to various
22202            // reasons, eg: app developers calling commit() earlier than when
22203            // they should.
22204    NONE_SHOWN_FILL_REQUEST_FAILED =
22205        7; // Autofill provider request failed. Different from timeout.
22206    NONE_SHOWN_NO_FOCUS =
22207        8; // Autofill provider request was triggered pre-focus. User never
22208           // focussed on autofillable fields. This can happen for FillDialog
22209           // where we trigger fill request at layout time.
22210    NONE_SHOWN_VIEW_FOCUSED_BEFORE_FILL_DIALOG_RESPONSE =
22211        9; // Users focus a field before the fill dialogs response is returned.
22212  }
22213
22214  // Id number which increases for each subsequent request.
22215  optional int32 request_id = 1;
22216
22217  // SessionId to aggregate requests within a session, and see overall
22218  // performance.
22219  optional int32 session_id = 2;
22220
22221  // Result of autofill event.
22222  optional PresentationEventResult presentation_event_result = 3;
22223
22224  // Count of datasets that should've been available for display. If the request
22225  // times out, this won't be populated.
22226  optional int32 available_count = 4;
22227
22228  // Count of datasets that are shown to the user.
22229  optional int32 count_shown = 5;
22230
22231  // Count of datasets that are eligible to be shown to the user, but aren't
22232  // shown because user started typing already, and the results were filtered.
22233  // If the user starts typing, dataset isn't shown at the moment, but then the
22234  // user deletes text, and the dataset becomes visible, it would count as
22235  // shown, and not as filtered out.
22236  optional int32 count_filtered_user_typing = 6;
22237
22238  // Count of datasets that aren't shown because IME didn't use datasets at all.
22239  optional int32 count_not_shown_unused_by_ime = 7;
22240
22241  // Count of datasets that are eligible to be shown to the user, but aren't
22242  // shown because display didn't show them (probably user didn't scroll to see
22243  // the view). The dataset was requested by display, but not shown.
22244  optional int32 count_not_shown_never_visible = 8;
22245
22246  // How the dataset is supposed to be shown to the user
22247  optional AutofillDisplayPresentationType display_presentation_type = 9;
22248
22249  // Autofill Service Provider's uid
22250  optional int32 autofill_service_uid = 10 [(is_uid) = true];
22251
22252  // Inline suggestion host's uid. Populated only when
22253  // AutofillDisplayPresentationType = INLINE
22254  optional int32 inline_suggestion_host_uid = 11 [(is_uid) = true];
22255
22256  // Whether a new request was triggered or alternatively served from cached
22257  // response.
22258  optional bool is_request_triggered = 12;
22259
22260  // Timestamps are in milliseconds, relative to when the Session was created
22261  // For example, if timestamp has a value = 100, the event was triggered
22262  // 100ms after the session was created.
22263  // Since these are relative to Session creation, you can subtract events to
22264  // get the latency duration between events.
22265  // t1 = 100
22266  // t2 = 300
22267  // duration = t2 - t1 = 200ms
22268  // ------------------------------------------------------------------------
22269  // Timestamp of when FillRequest is sent to Autofill provider
22270  // This is also the latency of when a field is focused to Framework sending a FillRequest
22271  optional int32 fill_request_sent_timestamp_ms = 13;
22272
22273  // Timestamp of when Autofill provider returns a FillResponse
22274  // The latency of the Autofill provider IPC can be calculated
22275  // by fillResponseReceivedTimestampMs - fillRequestSentTimestampMs
22276  optional int32 fill_response_received_timestamp_ms = 14;
22277
22278  // Timestamp of when FillResponse is sent to the IME/Dropdown handler/Fill Dialog UI
22279  // The latency of processing provider FillResponse to when suggestions are sent to be rendered
22280  // can be calculated by suggestionSentTimestampMs - fillResponseReceivedTimestampMs
22281  optional int32 suggestion_sent_timestamp_ms = 15;
22282
22283  // Timestamp of when the suggestion is shown
22284  // The latency of showing suggestions can be calculated by
22285  // suggestionPresentedTimestampMs - suggestionSentTimestampMs
22286  optional int32 suggestion_presented_timestamp_ms = 16;
22287
22288  // The index of the dataset that a user selected. -1 if not selected.
22289  optional int32 selected_dataset_id = 17;
22290
22291  // True if the user dismissed the fill UI.
22292  optional bool dialog_dismissed = 18;
22293
22294  // True if the user clicked the negative CTA button.
22295  optional bool negative_cta_button_clicked = 19;
22296
22297  // True if the user clicked the positive CTA button.
22298  optional bool positive_cta_button_clicked = 20;
22299
22300  optional autofill.AuthenticationType authentication_type = 21;
22301
22302  optional autofill.AuthenticationResult authentication_result = 22;
22303
22304  // From response received to authentication UI displayed to the user.
22305  optional int64 latency_authentication_ui_display_millis = 23;
22306
22307  // From the user finishing authentication to the dataset is displayed to the user.
22308  optional int64 latency_dataset_display_millis = 24;
22309
22310  // Count of datasets that are available due to PCC Detection. These can include datasets
22311  // available via provider response, and would be eligible because of pcc too.
22312  // If PCC detection is preferred over Autofill provider, and Autofill provider had same detection
22313  // as PCC did, the following invariants would hold.
22314  // available_pcc_count = available_count
22315  // available_pcc_only_count = 0
22316  optional int32 available_pcc_count = 25;
22317
22318  // Count of datasets that are available only due to PCC Detection.
22319  optional int32 available_pcc_only_count = 26;
22320
22321  // The selection process of this dataset.
22322  optional autofill.DatasetPickedReason selected_dataset_picked_reason = 27;
22323
22324  // Which detection was preferred
22325  optional autofill.DetectionPreference detection_preference = 28;
22326
22327  // field_classification request id that was used for this event.
22328  optional int32 field_classification_request_id = 29;
22329
22330  // App package Uid
22331  optional int32 app_package_uid = 30 [(is_uid) = true];
22332}
22333
22334// Tells how Autofill dataset was/will-be displayed.
22335enum AutofillDisplayPresentationType {
22336  UNKNOWN_AUTOFILL_DISPLAY_PRESENTATION_TYPE = 0;
22337  MENU = 1;    // aka drop-down
22338  INLINE = 2;  // shown via IME
22339  DIALOG = 3;  // aka Bottom-sheet dialog
22340}
22341
22342/**
22343 * Log the CompanionDeviceManager associations are created by various device
22344 * profiles
22345 *
22346 * Logged from:
22347 * frameworks/base/services/companion/java/com/android/server/companion/
22348 * CompanionDeviceManagerService.java
22349 */
22350message CdmAssociationAction {
22351    enum Action {
22352        UNKNOWN = 0;
22353        CREATED = 1;
22354        REMOVED = 2;
22355    }
22356
22357    enum DeviceProfile{
22358        DEVICE_PROFILE_NULL = 0;
22359        DEVICE_PROFILE_WATCH = 1;
22360        DEVICE_PROFILE_APP_STREAMING = 2;
22361        DEVICE_PROFILE_AUTO_PROJECTION = 3;
22362        DEVICE_PROFILE_COMPUTER = 4;
22363        DEVICE_PROFILE_GLASSES = 5;
22364        DEVICE_PROFILE_NEARBY_DEVICE_STREAMING = 6;
22365    }
22366
22367    // Action taken on the CDM association been created by companion apps.
22368    optional Action action = 1;
22369
22370    // Name of the CDM Association Request profiles.
22371    optional DeviceProfile device_profile = 2;
22372}
22373
22374/**
22375 * Logs when text and reading options changed.
22376 *
22377 * Logged from:
22378 *   packages/apps/Settings/src/com/android/settings/accessibility
22379 */
22380message AccessibilityTextReadingOptionsChanged {
22381    // The item name of the accessibility feature "Text and Reading Options".
22382    optional android.stats.accessibility.TextReadingOption name = 1;
22383
22384    // The status value of the item of the accessibility feature "Text and Reading Options".
22385    optional int32 value = 2;
22386
22387    // The entry point from which page.
22388    optional android.stats.accessibility.TextReadingEntry entry_point = 3;
22389}
22390
22391/*
22392 * Pushed atom logged by ONS service.
22393 */
22394message OnsOpportunisticEsimProvisioningComplete {
22395    enum ResultCode {
22396      // Unknown
22397      RESULT_UNKNOWN = 0;
22398
22399      // Operation was successful.
22400      RESULT_SUCCESS = 1;
22401
22402      // Device capabilities not met such as eSIM and MultiSIM not supported.
22403      RESULT_DEVICE_NOT_CAPABLE = 2;
22404
22405      // Internet connection is not available while trying to download opportunistic eSIM.
22406      RESULT_INTERNET_NOT_AVAILABLE = 3;
22407
22408      // Error occurred while switching device from Single to MultiSIM mode.
22409      RESULT_SWITCH_TO_MULTISIM_FAILED = 4;
22410
22411      // Connection error occurred while downloading opportunistic eSIM from SMDP server.
22412      RESULT_CONNECTION_ERROR = 5;
22413
22414      // Download failed because there is no sufficient storage available in eUICC memory.
22415      RESULT_MEMORY_FULL = 6;
22416
22417      // Installation of downloaded eSIM failed.
22418      RESULT_INSTALL_ESIM_PROFILE_FAILED = 7;
22419
22420      // Unresolvable errors such as Invalid SMDP address or activation code.
22421      RESULT_UNRESOLVABLE_ERROR = 8;
22422
22423      // Auto provisioning disabled
22424      RESULT_AUTO_PROVISIONING_DISABLED = 9;
22425
22426      // eSIM provisioning failed
22427      RESULT_ESIM_PROVISIONING_FAILED = 10;
22428    }
22429
22430    // CBRS carrier id. Filled only while reporting failure cases.
22431    optional int32 carrier_id = 1;
22432
22433    // carrier id of the opportunistic eSIM downloaded from the SMDP server.
22434    //Filled only while reporting failure cases.
22435    optional int32 opportunistic_esim_carrier_id = 2;
22436
22437    // Flag to indicate that the data connection was used for downloading.
22438    optional bool is_mobile_data_used = 3;
22439
22440    // Error code occurred during the above operation.
22441    optional ResultCode error_code = 4;
22442
22443    // Retry count of the above operation.
22444    optional int32 retry_count = 5;
22445
22446    // Detailed error code.
22447    optional int32 detailed_error_code = 6;
22448}
22449
22450/**
22451 * Logs when a telephony anomaly is reported.
22452 *
22453 * Logged from:
22454 *   frameworks/base/telephony/java/android/telephony/AnomalyReporter.java
22455 */
22456message TelephonyAnomalyDetected {
22457    // Carrier ID of the SIM card.
22458    // See https://source.android.com/devices/tech/config/carrierid.
22459    optional int32 carrier_id = 1;
22460    // UUID of the anomaly, as generated by android.telephony.AnomalyReporter
22461    optional int64 event_id_lsb = 2;
22462    optional int64 event_id_msb = 3;
22463}
22464
22465// Logs when the remote key provisioner application is invoked, either
22466// due to a periodically scheduled job, due to an attestation key being
22467// consumed from the pool, or when the system has detected that it's
22468// completely out of attestation keys.
22469//
22470// Logged from:
22471//   packages/modules/RemoteKeyProvisioning
22472message RemoteKeyProvisioningAttempt {
22473    // The reason for the provisioning attempt.
22474    enum Cause {
22475        CAUSE_UNKNOWN = 0;
22476        SCHEDULED = 1;          // A scheduled job issued the request
22477        KEY_CONSUMED = 2;       // A provisioned key was consumed from the pool
22478        OUT_OF_KEYS = 3;        // The system is out of keys
22479    }
22480    optional Cause cause = 1;
22481
22482    // The name of the remotely provisioned component for whom keys are being
22483    // generated and certified. The string value is determined by the vendor,
22484    // and is fixed for the lifetime of the device. The number of unique string
22485    // values on a given device is determined by how many remotely provisioned
22486    // component HALs are on a given device. Typically, this is 2-3 HALs.
22487    optional string remotely_provisioned_component = 2;
22488
22489    // The uptime of the device, organized into time ranges of interest.
22490    enum UpTime {
22491        UPTIME_UNKNOWN = 0;
22492        LESS_THAN_5_MINUTES = 1;
22493        BETWEEN_5_AND_60_MINUTES = 2;
22494        MORE_THAN_60_MINUTES = 3;
22495    }
22496    optional UpTime uptime = 3;
22497
22498    // The state of remote provisioning enablement
22499    enum Enablement {
22500        ENABLEMENT_UNKNOWN = 0;
22501        ENABLED_WITH_FALLBACK = 1;
22502        ENABLED_RKP_ONLY = 2;
22503        DISABLED = 3;
22504    }
22505    optional Enablement enablement = 4;
22506
22507    // If the key pool is completely exhausted, this is set to true. Typically,
22508    // we do not expect to see a pool with no spare keys available.
22509    optional bool is_key_pool_empty = 5;
22510
22511    // Indicates success or failure of the provisioning attempt.
22512    optional com.android.remoteprovisioner.RemoteKeyProvisioningStatus status = 6;
22513
22514    // A digest of the root key that certified the provisioned certificates
22515    optional string root_cert_fingerprint = 7;
22516
22517    // The depth of the cert chains issued to the device
22518    optional int32 cert_chain_length = 8;
22519}
22520
22521// Logs that correlate remote key provisioning status with the active
22522// network for the given provisioning attempt.
22523//
22524// Logged from:
22525//   packages/modules/RemoteKeyProvisioning
22526message RemoteKeyProvisioningNetworkInfo {
22527    // The network transport, according ConnectivityManager::getActiveNetwork().
22528    optional android.stats.connectivity.TransportType transport_type = 1;
22529
22530    // Indicates success or failure of the provisioning attempt.
22531    optional com.android.remoteprovisioner.RemoteKeyProvisioningStatus status = 2;
22532
22533    // If an HTTP error was received, this contains the code. Else, contains 200.
22534    optional int32 http_status_error = 3;
22535}
22536
22537// Logs indicating timing data to understand how long the remote provisioner is
22538// taking to perform various sub-tasks. This is intended to be used with KLL metrics.
22539//
22540// Logged from:
22541//   packages/modules/RemoteKeyProvisioning
22542message RemoteKeyProvisioningTiming {
22543    // Time spent waiting on the RKP service to reply.
22544    optional int32 server_wait_millis = 1;
22545
22546    // Time spent waiting on internal binder calls to the provisioning service.
22547    optional int32 binder_wait_millis = 2;
22548
22549    // Time spent waiting on the serialization lock.
22550    optional int32 lock_wait_millis = 3;
22551
22552    // Total time spent processing the attempt.
22553    optional int32 total_processing_time = 4;
22554
22555    // The network transport, according ConnectivityManager::getActiveNetwork().
22556    optional android.stats.connectivity.TransportType transport_type = 5;
22557
22558    // The name of the remotely provisioned component for whom keys are being
22559    // generated and certified. The string value is determined by the vendor,
22560    // and is fixed for the lifetime of the device. The number of unique string
22561    // values on a given device is determined by how many remotely provisioned
22562    // component HALs are on a given device. Typically, this is 2-3 HALs.
22563    optional string remotely_provisioned_component = 6;
22564}
22565
22566// Deprecated in U.
22567//
22568// Counters that track how many errors we're seeing on the device for the
22569// given boot.
22570//
22571// Logged from:
22572//   packages/modules/RemoteKeyProvisioning
22573message RemoteKeyProvisioningErrorCounts {
22574    // The total number of RKP attempts there have been this boot.
22575    optional int32 total_count = 1;
22576
22577    // How many errors this device has encountered this boot.
22578    optional int32 error_count = 2;
22579
22580    // How many bytes of data have been sent that resulted in errors. These
22581    // bytes count against an error budget, so it's important to track.
22582    optional int32 error_bytes = 3;
22583}
22584
22585/**
22586 * Logs information about sync exemptions when they occur.
22587 *
22588 * Logged from:
22589 *      frameworks/base/services/core/java/com/android/server/content/ContentService.java
22590 */
22591message SyncExemptionOccurred {
22592    optional int32 uid = 1 [(is_uid) = true]; // the uid of the app.
22593
22594    enum ProcState {
22595        UNKNOWN = 0;
22596        PERSISTENT = 1;
22597        PERSISTENT_UI = 2;
22598        TOP = 3;
22599        BOUND_TOP = 4;
22600        FOREGROUND_SERVICE = 5;
22601        BOUND_FOREGROUND_SERVICE = 6;
22602        IMPORTANT_FOREGROUND = 7;
22603        IMPORTANT_BACKGROUND = 8;
22604        TRANSIENT_BACKGROUND = 9;
22605        BACKUP = 10;
22606        SERVICE = 11;
22607        RECEIVER = 12;
22608        TOP_SLEEPING = 13;
22609        HEAVY_WEIGHT = 14;
22610        HOME = 15;
22611        LAST_ACTIVITY = 16;
22612        CACHED_ACTIVITY = 17;
22613        CACHED_ACTIVITY_CLIENT = 18;
22614        CACHED_RECENT = 19;
22615        CACHED_EMPTY = 20;
22616    }
22617    optional ProcState proc_state = 2; // the proc state of the app when the exemption occurred.
22618
22619    optional bool is_uid_active = 3; // was the uid active when the exemption occurred.
22620
22621    optional AppBackgroundRestrictionsInfo.RestrictionLevel restriction_level = 4;
22622}
22623
22624// Logs the overall Safety State of the device (as cached by the Safety Center)
22625message SafetyState {
22626    // The overall severity level of the Safety Center.
22627    optional android.stats.safetycenter.SafetySeverityLevel overall_severity_level = 1;
22628
22629    // The number of open issues in the Safety Center.
22630    optional int64 open_issues_count = 2;
22631
22632    // The number of dismissed issues in the Safety Center.
22633    optional int64 dismissed_issues_count = 3;
22634}
22635
22636// Logs the state of an individual Safety Source when overall SafetyState is
22637// collected.
22638message SafetySourceStateCollected {
22639    optional int64 encoded_safety_source_id = 1;
22640
22641    optional android.stats.safetycenter.SafetySourceProfileType safety_source_profile_type = 2;
22642
22643    // The severity level of this source.
22644    optional android.stats.safetycenter.SafetySeverityLevel severity_level = 3;
22645
22646    // The number of open issues belonging to this Safety Source.
22647    optional int64 open_issues_count = 4;
22648
22649    // The number of dismissed issues belonging to this Safety Source.
22650    optional int64 dismissed_issues_count = 5;
22651
22652    optional int64 duplicate_filtered_out_issues_count = 6;
22653
22654    enum SourceState {
22655        SOURCE_STATE_UNKNOWN = 0;
22656        DATA_PROVIDED = 1;
22657        NO_DATA_PROVIDED = 2;
22658        REFRESH_TIMEOUT = 3;
22659        REFRESH_ERROR = 4;
22660        SOURCE_ERROR = 5;
22661        SOURCE_CLEARED = 6;
22662    }
22663    optional SourceState source_state = 7;
22664
22665    // Indicates the reason for which this event was collected.
22666    enum CollectionType {
22667        COLLECTION_TYPE_UNKNOWN = 0;
22668        AUTOMATIC = 1;
22669        SOURCE_UPDATED = 2;
22670    }
22671    optional CollectionType collection_type = 8;
22672
22673    enum UpdateType {
22674        UPDATE_TYPE_UNKNOWN = 0;
22675        SELF_INITIATED = 1;
22676        REFRESH_RESPONSE = 2;
22677    }
22678    optional UpdateType update_type = 9;
22679
22680    optional int64 refresh_reason = 10;
22681
22682    optional bool data_changed = 11;
22683
22684    optional int64 last_updated_elapsed_time_millis = 12;
22685}
22686
22687// Logs system-health and performance related events from the Safety Center
22688message SafetyCenterSystemEventReported {
22689    enum EventType {
22690        EVENT_TYPE_UNKNOWN = 0;
22691        SINGLE_SOURCE_GET_NEW_DATA = 1;
22692        SINGLE_SOURCE_RESCAN = 2;
22693        COMPLETE_GET_NEW_DATA = 3;
22694        COMPLETE_RESCAN = 4;
22695        INLINE_ACTION = 5;
22696    }
22697    optional EventType event_type = 1;
22698
22699    // Unset if this event isn't source-specific.
22700    optional int64 encoded_safety_source_id = 2;
22701
22702    // Unset if this event isn't source-specific.
22703    optional android.stats.safetycenter.SafetySourceProfileType safety_source_profile_type = 3;
22704
22705    // Unset if this event isn't specific to an issue.
22706    optional int64 encoded_issue_type_id = 4;
22707
22708    optional int64 duration_millis = 5;
22709
22710    enum Result {
22711        RESULT_UNKNOWN = 0;
22712        SUCCESS = 1;
22713        TIMEOUT = 2;
22714        ERROR = 3;
22715    }
22716    optional Result result = 6;
22717
22718    optional int64 refresh_reason = 7;
22719
22720    optional bool data_changed = 8;
22721}
22722
22723// Logs a user interaction with the Safety Center. Various fields may or may not be
22724// set depending on the Action reported.
22725message SafetyCenterInteractionReported {
22726    // ID which identifies single session of user interacting with Safety Center.
22727    optional int64 session_id = 1;
22728
22729    enum Action {
22730        ACTION_UNKNOWN = 0;
22731
22732        SAFETY_CENTER_VIEWED = 1;
22733        SAFETY_ISSUE_VIEWED = 2;
22734
22735        SCAN_INITIATED = 3;
22736
22737        ISSUE_PRIMARY_ACTION_CLICKED = 4;
22738        ISSUE_SECONDARY_ACTION_CLICKED = 5;
22739        ISSUE_DISMISS_CLICKED = 6;
22740
22741        MORE_ISSUES_CLICKED = 7;
22742        ENTRY_CLICKED = 8;
22743        ENTRY_ICON_ACTION_CLICKED = 9;
22744        STATIC_ENTRY_CLICKED = 10;
22745
22746        PRIVACY_CONTROL_TOGGLE_CLICKED = 11;
22747        SENSOR_PERMISSION_REVOKE_CLICKED = 12;
22748        SENSOR_PERMISSION_SEE_USAGES_CLICKED = 13;
22749        REVIEW_SETTINGS_CLICKED = 14;
22750
22751        NOTIFICATION_POSTED = 15;
22752        NOTIFICATION_DISMISSED = 16;
22753
22754        STATUS_VIEWED = 17;
22755        ENTRY_VIEWED = 18;
22756
22757        ISSUE_RESOLVED = 19;
22758    }
22759
22760    // Action taken in the Safety Center.
22761    optional Action action = 2;
22762
22763    enum ViewType {
22764        VIEW_TYPE_UNKNOWN = 0;
22765        FULL = 1;
22766        QUICK_SETTINGS = 2;
22767        SUBPAGE = 3;
22768
22769        // Prefix required to distinguish from NavigationSource.NOTIFICATION (since
22770        // proto enums use C++ scoping rules, enum value names must be unique within
22771        // the enum's enclosing type, not just the enum itself).
22772        VIEW_TYPE_NOTIFICATION = 4;
22773    }
22774
22775    // Which view of the Safety Center this interaction occurred in.
22776    optional ViewType view_type = 3;
22777
22778    enum NavigationSource {
22779        SOURCE_UNKNOWN = 0;
22780        NOTIFICATION = 1;
22781        QUICK_SETTINGS_TILE = 2;
22782        SETTINGS = 3;
22783        SENSOR_INDICATOR = 4;
22784
22785        // Set for navigations that start from within Safety Center. e.g. when a subpage
22786        // is opened from the main Safety Center page instead of from a notification.
22787        SAFETY_CENTER = 5;
22788    }
22789
22790    // Where the session was initiated from.
22791    optional NavigationSource navigation_source = 4;
22792
22793    // Severity level of the particular issue or entry, or the overall Safety
22794    // Center this interaction is associated with.
22795    optional android.stats.safetycenter.SafetySeverityLevel severity_level = 5;
22796
22797    // The hashed ID of the Safety Source that this interaction was with performed with,
22798    // or nothing if this event isn't source-specific.
22799    optional int64 encoded_safety_source_id = 6;
22800
22801    // The kind of profile that this safety source originated from (sources from
22802    // personal and work profiles may have the same source ID)
22803    optional android.stats.safetycenter.SafetySourceProfileType safety_source_profile_type = 7;
22804
22805    // A hash of the loggable issue type ID that this interaction was performed with.
22806    optional int64 encoded_issue_type_id = 8;
22807
22808    enum Sensor {
22809        SENSOR_UNKNOWN = 0;
22810        MICROPHONE = 1;
22811        CAMERA = 2;
22812        LOCATION = 3;
22813    }
22814
22815    // Which sensor was associated with this interaction (if any).
22816    optional Sensor sensor = 9;
22817
22818    optional int64 encoded_safety_sources_group_id = 10;
22819
22820    enum IssueState {
22821        ISSUE_STATE_UNKNOWN = 0;
22822        ACTIVE = 1;
22823        DISMISSED = 2;
22824    }
22825    optional IssueState issue_state = 11;
22826}
22827
22828/**
22829 * Logs information about SettingsProvider setting changes when they occur.
22830 *
22831 * Logged from:
22832 *      frameworks/base/packages/src/com/android/providers/settings/SettingsProvider.java
22833 */
22834message SettingsProviderSettingChanged {
22835    optional int32 user_id = 1; // user for whom the setting has changed
22836    optional string name = 2; // name of the setting
22837    optional int32 type = 3; // the setting type, e.g., global, system or secure
22838    optional int32 change_type = 4; // the change type, e.g., insert, delete or update
22839}
22840
22841/**
22842 * Pulls information for a single incoming MMS.
22843 *
22844 * Each pull creates multiple atoms, one for each MMS.
22845 * The sequence is randomized when pulled.
22846 *
22847 * Pulled from:
22848 *   packages/services/Mms/src/com/android/mms/service/metrics/MmsMetricsCollector.java
22849 */
22850message IncomingMms {
22851    // Radio access technology (RAT) used for downloading the MMS.
22852    // It can be IWLAN in case of IMS.
22853    // RAT is logged at the end of the download.
22854    optional android.telephony.NetworkTypeEnum rat = 1;
22855
22856    // Indicate a specific result handling the MMS.
22857    optional android.mms.MmsResultEnum result = 2;
22858
22859    // Roaming type when MMS was received.
22860    optional android.telephony.RoamingTypeEnum roaming = 3;
22861
22862    // Index of the SIM used, 0 for single-SIM devices.
22863    optional int32 sim_slot_index = 4;
22864
22865    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
22866    optional bool is_multi_sim = 5;
22867
22868    // Whether the MMS was received with an eSIM profile.
22869    optional bool is_esim = 6;
22870
22871    // Carrier ID of the SIM card used for the MMS.
22872    // See https://source.android.com/devices/tech/config/carrierid.
22873    optional int32 carrier_id = 7;
22874
22875    // Average time in milliseconds to download MMS from the network.
22876    optional int64 avg_interval_millis = 8;
22877
22878    // Total number of MMS having same configuration.
22879    optional int64 mms_count = 9;
22880
22881    // Retry count: 0 for the first attempt and then increasing for each attempt.
22882    optional int32 retry_id = 10;
22883
22884    // Whether MmsService or carrier app downloaded the MMS from the network.
22885    optional bool handled_by_carrier_app = 11;
22886
22887    // Whether the MMS was received with an enterprise profile.
22888    optional bool is_managed_profile = 12;
22889}
22890
22891/**
22892 * Pulls information for a single outgoing MMS.
22893 *
22894 * Each pull creates multiple atoms, one for each MMS.
22895 * The sequence is randomized when pulled.
22896 *
22897 * Pulled from:
22898 *   packages/services/Mms/src/com/android/mms/service/metrics/MmsMetricsCollector.java
22899 */
22900message OutgoingMms {
22901    // Radio access technology (RAT) used for uploading the MMS.
22902    // It can be IWLAN in case of IMS.
22903    // RAT is logged at the end of the upload.
22904    optional android.telephony.NetworkTypeEnum rat = 1;
22905
22906    // Indicate a specific result handling the MMS.
22907    optional android.mms.MmsResultEnum result = 2;
22908
22909    // Roaming type when MMS was received.
22910    optional android.telephony.RoamingTypeEnum roaming = 3;
22911
22912    // Index of the SIM used, 0 for single-SIM devices.
22913    optional int32 sim_slot_index = 4;
22914
22915    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
22916    optional bool is_multi_sim = 5;
22917
22918    // Whether the MMS was sent with an eSIM profile.
22919    optional bool is_esim = 6;
22920
22921    // Carrier ID of the SIM card used for the MMS.
22922    // See https://source.android.com/devices/tech/config/carrierid.
22923    optional int32 carrier_id = 7;
22924
22925    // Average time in milliseconds to download MMS from the network.
22926    optional int64 avg_interval_millis = 8;
22927
22928    // Total number of MMS having same configuration.
22929    optional int64 mms_count = 9;
22930
22931    // Whether the default MMS application sent the MMS (regardless of which application).
22932    optional bool is_from_default_app = 10;
22933
22934    // Retry count: 0 for the first attempt and then increasing for each attempt.
22935    optional int32 retry_id = 11;
22936
22937    // Whether MmsService or carrier app uploaded the MMS to the network.
22938    optional bool handled_by_carrier_app = 12;
22939
22940    // Whether the MMS was sent with an enterprise profile.
22941    optional bool is_managed_profile = 13;
22942}
22943
22944message PrivacySignalNotificationInteraction {
22945
22946    enum Action {
22947        UNKNOWN = 0;
22948        NOTIFICATION_SHOWN = 1;
22949        NOTIFICATION_CLICKED = 2;
22950        DISMISSED = 3;
22951    }
22952
22953    // Privacy source that triggered the notification
22954    optional android.stats.privacysignals.PrivacySource privacy_source = 1;
22955
22956    // Optional Uid of the package for which the notification was sent.
22957    optional int32 uid = 2 [(is_uid) = true];
22958
22959    // Action taken on the notification.
22960    optional Action action = 3;
22961
22962    // Session Id to link the notification with the issue card.
22963    optional int64 session_id = 4; // to map the notification and issue card interaction
22964}
22965
22966message PrivacySignalIssueCardInteraction {
22967
22968    enum Action {
22969        ACTION_UNKNOWN = 0;
22970        CARD_SHOWN = 1;
22971        CARD_CLICKED = 2;
22972        CARD_DISMISSED = 3;
22973        CLICKED_CTA1 = 4;
22974        CLICKED_CTA2 = 5;
22975    }
22976
22977    // Privacy source  that pushed the issue card.
22978    optional android.stats.privacysignals.PrivacySource privacy_source = 1;
22979
22980    // Optional Uid of the package for which the issue card was sent.
22981    optional int32 uid = 2 [(is_uid) = true];
22982
22983    // Action taken on the issue card.
22984    optional Action action = 3;
22985
22986    // Session Id to link the notification with the issue card.
22987    optional int64 session_id = 4;
22988}
22989
22990message PrivacySignalsJobFailure {
22991
22992    // Which privacy source for which the daily job failed.
22993    optional android.stats.privacysignals.PrivacySource privacy_source = 1;
22994
22995    enum JobFailureReason {
22996        REASON_UNKNOWN = 0;
22997        TIMEOUT = 1;
22998        COROUTINE_CANCELLED = 2;
22999    }
23000    optional JobFailureReason reason =2;
23001}
23002
23003// Logs when an API call from app to sandbox process is made
23004// Next ID: 6
23005message SandboxApiCalled {
23006    // Next ID: 14
23007    enum Method {
23008        METHOD_UNSPECIFIED = 0;
23009        LOAD_SDK = 1;
23010        REQUEST_SURFACE_PACKAGE = 3;
23011        // Api used by Apps via SdkSandboxManager
23012        GET_SANDBOXED_SDKS = 5;
23013        SYNC_DATA_FROM_CLIENT = 6;
23014        UNLOAD_SDK = 7;
23015        ADD_SDK_SANDBOX_LIFECYCLE_CALLBACK = 8;
23016        REMOVE_SDK_SANDBOX_LIFECYCLE_CALLBACK = 9;
23017        REGISTER_APP_OWNED_SDK_SANDBOX_INTERFACE = 11;
23018        UNREGISTER_APP_OWNED_SDK_SANDBOX_INTERFACE = 12;
23019        GET_APP_OWNED_SDK_SANDBOX_INTERFACES = 13;
23020        // Api used by SDKs in the sandbox via SdkSandboxController
23021        GET_SANDBOXED_SDKS_VIA_CONTROLLER = 10;
23022
23023        LOAD_SANDBOX_AND_SDK = 2 [deprecated = true];
23024        SEND_DATA = 4 [deprecated = true];
23025    }
23026    // The method which was called.
23027    optional Method method = 1;
23028
23029    enum Stage {
23030        STAGE_UNSPECIFIED = 0;
23031        APP_TO_SYSTEM_SERVER = 1;
23032        SYSTEM_SERVER_APP_TO_SANDBOX = 2;
23033        LOAD_SANDBOX = 3;
23034        SYSTEM_SERVER_TO_SANDBOX = 4;
23035        SANDBOX = 5;
23036        SDK = 6;
23037        SANDBOX_TO_SYSTEM_SERVER = 7;
23038        SYSTEM_SERVER_SANDBOX_TO_APP = 8;
23039        SYSTEM_SERVER_TO_APP = 9;
23040    }
23041    // The stage at which latency is being measured.
23042    optional Stage stage = 4;
23043
23044    // The success status of the callback
23045    optional bool success = 3;
23046
23047    //Time taken from the initiation of the API till the callback was received
23048    optional int32 latency_millis = 2;
23049
23050    // Uid of the app that made a call to sandbox
23051    optional int32 uid = 5 [(is_uid) = true];
23052}
23053
23054//Logs periodically the storage of SDKs used by the app
23055message SandboxSdkStorage {
23056
23057    // Boolean value to specify if the storage belongs to SDK or is shared
23058    optional bool shared = 1;
23059
23060    // Storage
23061    optional int32 storage_kb = 2;
23062
23063    // Uid of the app that made a call to sandbox
23064    optional int32 uid = 3 [(is_uid) = true];
23065}
23066
23067/**
23068 * Logs stats on the download status of file groups. Provides information on
23069 * download latency and download penetration.
23070 */
23071message MobileDataDownloadFileGroupDownloadStatusReported {
23072  // The status of the file group on device: PENDING, DOWNLOADED, FAILED
23073  optional android.stats.mobiledatadownload.DownloadStatus
23074      file_group_download_status = 1;
23075  // Timestamp of when this file group was added to the device.
23076  optional int64 group_added_timestamp = 2;
23077  // Timestamp of when MDD completed downloading the file group.
23078  optional int64 group_downloaded_timestamp = 3;
23079  // Stats specific to the file group
23080  optional MobileDataDownloadFileGroupStats file_group_stats = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
23081  // Number of days since the last time the device attempted to log file group download status for any file group.
23082  optional int32 days_since_last_log = 5;
23083}
23084
23085/**
23086 * Contains information about different method and code contention durations in
23087 * the ANR code path
23088 */
23089message ANRLatencyReported {
23090    /* Important durations */
23091    // Total duration of the ANR (in ms)
23092    optional int64 total_duration = 1;
23093    // The duration between when the ANR is triggered and when the stacks are dumped
23094    // (in ms)
23095    optional int64 triggering_to_stack_dump_duration = 2;
23096
23097    /* Disjoint durations, each duration representing the time spent in the
23098    method before calling the next one on the ANR chain */
23099    // The duration between when the ANR is triggered and when appNotResponding starts.
23100    optional int64 triggering_to_app_not_responding_duration = 3;
23101    // The time taken by appNotResponding before the record is placed on the
23102    // queue.
23103    optional int64 app_not_responding_duration = 4;
23104    // The time spent by the ANR record on the ANR queue.
23105    optional int64 anr_record_placed_on_queue_duration = 5;
23106    // The time from the start of the ANR processing by the ANR thread until the
23107    // stacks are dumped.
23108    optional int64 anr_processing_duration = 6;
23109    // The time taken to dump the stacks.
23110    optional int64 dump_stack_traces_duration = 7;
23111
23112    /* Helper methods */
23113    // The time spent waiting on updateCpuStatsNow to return.
23114    optional int64 update_cpu_stats_now_total_duration = 8;
23115    // The time spent waiting on currentPsiStateReturned to return.
23116    optional int64 current_psi_state_total_duration = 9;
23117    // The time spent waiting on ProcessCpuTracker methods to return
23118    optional int64 process_cpu_tracker_methods_total_duration = 10;
23119    // The time spent waiting on CriticalEventLog#logLinesForTraceFile to return.
23120    optional int64 critical_event_log_duration = 11;
23121
23122    /* Lock contention */
23123    // The time spent waiting on the Global Lock.
23124    optional int64 global_lock_total_contention = 12;
23125    // The time spent waiting on the PID lock.
23126    optional int64 pid_lock_total_contention = 13;
23127    // The time spent waiting on the AMS lock.
23128    optional int64 ams_lock_total_contention = 14;
23129    // The time spent waiting on proc lock.
23130    optional int64 proc_lock_total_contention = 15;
23131    // The time spent waiting on the ANR record queue lock.
23132    optional int64 anr_record_lock_total_contention = 16;
23133
23134    /* Misc */
23135    // The size of the ANR queue before pushing the ANR.
23136    optional int32 anr_queue_size_when_pushed = 17;
23137    // The type of the ANR.
23138    optional android.anr.AnrType anr_type = 18;
23139    // The number of dumped processes.
23140    optional int32 dumped_processes_count = 19;
23141    // Next ID: 20
23142}
23143
23144/** Shared data among MobileDataDownload statistics. Not meant to be a top level atom proto.*/
23145message MobileDataDownloadFileGroupStats {
23146  // The name of the file group. This a string set server side used to retrieve
23147  // the files. Does not contain PII.
23148  optional string file_group_name = 1;
23149  // Allows the clients to identify a file group based on a given set of
23150  // properties. This string is set server side and does not contain PII.
23151  optional string variant_id = 2;
23152  // Identifier for the data file group created to identify the version of the
23153  // file group.
23154  optional int64 build_id = 3;
23155  // The number of files in the file group.
23156  optional int32 file_count = 4;
23157  // Whether the file group has an account associated with it.
23158  optional bool has_account = 5;
23159  // Inverse of the sampling rate used to sample this event.
23160  optional int32 sampling_interval = 6;
23161  // Note: we do not have owner_package since that's already transmitted.
23162}
23163
23164/**
23165* Logs stats on the result of download attempts of file groups. Provides info on individual download attempts.
23166*/
23167message MobileDataDownloadDownloadResultReported {
23168  // The result of the download attempt
23169  optional android.stats.mobiledatadownload.DownloadResult download_result = 1;
23170
23171  // Specifies which file group the download attempt was for
23172  optional MobileDataDownloadFileGroupStats file_group_stats = 2 [(log_mode) = MODE_BYTES];
23173}
23174
23175/**
23176* Logs stats on the amount of storage being used by file groups.
23177*/
23178message MobileDataDownloadFileGroupStorageStatsReported {
23179  // Storage stats for all file groups in the MDD Instance
23180  optional MobileDataDownloadStorageStats storage_stats = 1  [(log_mode) = MODE_BYTES];
23181  // All the bytes used by mdd file groups
23182  optional int64 total_mdd_bytes_used = 2;
23183  // All the bytes used in the entire mdd directory
23184  optional int64 total_mdd_directory_bytes_used = 3;
23185}
23186
23187/**
23188* Container for MobileDataDownloadFileGroupStorageStats
23189*/
23190message MobileDataDownloadStorageStats {
23191    repeated MobileDataDownloadFileGroupStorageStats mobile_data_download_file_group_storage_stats = 1;
23192}
23193
23194/**
23195* Storage stats for a single file group. This is logged as a nested field and is not meant to be logged as a top level proto.
23196*/
23197message MobileDataDownloadFileGroupStorageStats {
23198  // The total number of bytes used by this file group
23199  optional int64 total_bytes_used = 1;
23200  // The total number of inline file bytes used by this file group
23201  optional int64 total_inline_bytes_used = 2;
23202  // The number of bytes used for the downloaded version of the file group
23203  optional int64 downloaded_group_bytes_used = 3;
23204  // Specifies which file group this storage is associated with
23205  optional MobileDataDownloadFileGroupStats file_group_stats = 4 [(log_mode) = MODE_BYTES];
23206}
23207
23208// Logs Display Brightness change events.
23209message DisplayBrightnessChanged {
23210
23211    enum Reason {
23212        REASON_UNKNOWN = 0;
23213        REASON_MANUAL = 1;
23214    }
23215
23216    // Display brightness before the brightness event, in nits.
23217    optional float initial_nits = 1;
23218
23219    // Display brightness after the brightness event, in nits.
23220    optional float end_nits = 2;
23221
23222    // Estimated ambient light, in lux.
23223    optional float lux = 3;
23224
23225    // Physical display id, with format $ADAPTER_PREFIX:$ID, in this case
23226    // "local:$PHYSICAL_ID".
23227    optional string physical_display_id = 4;
23228
23229    // Whether the short term model was active at the time of the event.
23230    optional bool short_term_model_active = 5;
23231
23232    // The factor to adjust the screen brightness in low power mode in the range
23233    // 0 (screen off) to 1 (no change).
23234    // If not applied, this is set to -1.
23235    optional float power_brightness_factor = 6;
23236
23237    // The level of Reduce Bright Colors (RBC) intensity, the range is [0, 100].
23238    // If RBC is not enabled, this is set to -1;
23239    optional int32 reduce_bright_colors_strength = 7;
23240
23241    // Max nits value when High Brightness Mode (HBM) is enabled.
23242    // If HBM is not enabled, this is set to -1;
23243    optional float hbm_current_max = 8;
23244
23245    // Thermal throttling cap.
23246    // If thermal throttling not enabled, this is -1.
23247    optional float thermal_throttling_cap = 9;
23248
23249    // Whether adaptive brightness is enabled.
23250    optional bool adaptive_brightness_enabled = 10;
23251
23252    // Historical: replaced by entire_reason after 2023-04-10
23253    optional Reason reason = 11 [deprecated = true];
23254
23255    // Reason that triggered the brightness event to occur.
23256    optional android.display.DisplayBrightnessChangeReasonEnum entire_reason = 12;
23257
23258    // New brightness bucket index, from frameworks/proto_logging/stats/enums/display/enums.proto.
23259    optional android.display.DisplayBrightnessRangeEnum bucket_index = 13;
23260
23261    // Brightness is at maximum allowable value regarding the current context.
23262    optional bool brightness_at_max = 14;
23263
23264    // Whether HBM mode is enabled due to sunlight
23265    optional bool hbm_mode_sunlight = 15;
23266
23267    // Whether HBM mode is enabled due to HDR
23268    optional bool hbm_mode_hdr = 16;
23269
23270    // Whether modified by low power mode.
23271    optional bool modified_by_low_power_mode = 17;
23272
23273    // Value defined in frameworks/base/core/java/android/hardware/display/BrightnessInfo.java
23274    // BRIGHTNESS_MAX_REASON_NONE = 0
23275    // BRIGHTNESS_MAX_REASON_THERMAL = 1
23276    // BRIGHTNESS_MAX_REASON_* defined in the future
23277    optional int32 throttling_reason = 18;
23278
23279    // Whether modified by dimming.
23280    optional bool modified_by_dimming = 19;
23281
23282    // Whether Reduce Bright Colors (RBC) is enabled.
23283    optional bool rbc_enabled = 20;
23284
23285    // Whether ambient lux is invalid.
23286    optional bool ambient_lux_invalid = 21;
23287
23288    // Whether doze scale applied for auto brightness.
23289    optional bool doze_scale_applied = 22;
23290
23291    // Whether the value is set by the user.
23292    optional bool set_by_user = 23;
23293
23294    // Whether idle mode is active.
23295    optional bool idle_mode_active= 24;
23296
23297    // Whether low power mode is enabled.
23298    optional bool low_power_mode_enabled= 25;
23299}
23300
23301
23302/**
23303 * Logs when various Privacy Sandbox settings are used.
23304 */
23305message AdServicesSettingsUsageReported {
23306    // Region of the user who interacted with AdServicesSettings UI.
23307    enum AdServiceSettingRegion {
23308        // fallback when getDeviceRegion call failed.
23309        REGION_UNSPECIFIED = 0;
23310        // European Union user (based on isoCountryInfo).
23311        EU = 1;
23312        // Non-European Union user (based on isoCountryInfo).
23313        ROW = 2;
23314    }
23315    // Region where the device was used.
23316    optional AdServiceSettingRegion region = 1;
23317
23318    // UI settings page action performed by the user.
23319    enum AdServiceSettingsName {
23320        // fallback when getAction call failed.
23321        ACTION_UNSPECIFIED = 0;
23322        // notification was requested to be sent to the user.
23323        REQUESTED_NOTIFICATION = 1;
23324        // the notification landing page was displayed.
23325        LANDING_PAGE_DISPLAYED = 2;
23326        // user opt-in for PP API.
23327        OPT_IN_SELECTED = 3;
23328        // user opt-out of PP API.
23329        OPT_OUT_SELECTED = 4;
23330        // the topics page was displayed.
23331        MANAGE_TOPICS_SELECTED = 5;
23332        // the fledge page was displayed.
23333        MANAGE_APPS_SELECTED = 6;
23334        // user reset topics.
23335        RESET_TOPIC_SELECTED = 7;
23336        /// user reset fledge apps.
23337        RESET_APP_SELECTED = 8;
23338        // user blocked topics.
23339        BLOCK_TOPIC_SELECTED = 9;
23340        // user unblocked topics.
23341        UNBLOCK_TOPIC_SELECTED = 10;
23342        // user blocked fledge apps.
23343        BLOCK_APP_SELECTED = 11;
23344        // user unblocked fledge apps.
23345        UNBLOCK_APP_SELECTED = 12;
23346        // Measurement page and data reset.
23347        MANAGE_MEASUREMENT_SELECTED = 13;
23348        RESET_MEASUREMENT_SELECTED = 14;
23349        // user opt-in to topics.
23350        TOPICS_OPT_IN_SELECTED = 15;
23351        // user opt-out of topics.
23352        TOPICS_OPT_OUT_SELECTED = 16;
23353        // user opt-in to fledge.
23354        FLEDGE_OPT_IN_SELECTED = 17;
23355        // user opt-out of fledge.
23356        FLEDGE_OPT_OUT_SELECTED = 18;
23357        // user opt-in to measurement.
23358        MEASUREMENT_OPT_IN_SELECTED = 19;
23359        // user opt-out of measurement.
23360        MEASUREMENT_OPT_OUT_SELECTED = 20;
23361        // Notification and landing page for kids policy
23362        // notification was requested for GA  user.
23363        GA_UX_NOTIFICATION_REQUESTED = 21;
23364        // GA landing page was displayed.
23365        GA_UX_NOTIFICATION_LANDING_PAGE_DISPLAYED = 22;
23366        // GA confirmation page was displayed.
23367        GA_UX_NOTIFICATION_CONFIRMATION_PAGE_DISPLAYED = 23;
23368        // GA version of opt_in/out selected.
23369        // opt-in for GA user.
23370        NOTIFICATION_OPT_IN_SELECTED = 24;
23371        // opt-out for GA user.
23372        NOTIFICATION_OPT_OUT_SELECTED = 25;
23373        // user selected manage settings in consent notification.
23374        NOTIFICATION_MANAGE_SETTINGS_SELECTED = 26;
23375        // the privacy sandbox settings page was displayed.
23376        PRIVACY_SANDBOX_SETTINGS_PAGE_DISPLAYED = 27;
23377        // the confirmation page was displayed for a user.
23378        CONFIRMATION_PAGE_DISPLAYED = 28;
23379        // notification was blocked by a user.
23380        NOTIFICATION_DISABLED = 29;
23381        // notification was blocked by a GA user.
23382        GA_UX_NOTIFICATION_DISABLED = 30;
23383        // notification was displayed to a user.
23384        NOTIFICATION_DISPLAYED = 31;
23385        // notification was displayed to a GA user.
23386        GA_UX_NOTIFICATION_DISPLAYED = 32;
23387        // user clicked on the more button on the landing page.
23388        LANDING_PAGE_MORE_BUTTON_CLICKED = 33;
23389        // GA user clicked on the more button on the landing page.
23390        GA_UX_LANDING_PAGE_MORE_BUTTON_CLICKED = 34;
23391        // user clicked the additional info button on the landing page.
23392        LANDING_PAGE_ADDITIONAL_INFO_CLICKED = 35;
23393        // GA user clicked the additional info button on the landing page.
23394        GA_UX_LANDING_PAGE_ADDITIONAL_INFO_CLICKED = 36;
23395        // user scrolled the landing page.
23396        LANDING_PAGE_SCROLLED = 37;
23397        // GA user scrolled the landing page.
23398        GA_UX_LANDING_PAGE_SCROLLED = 38;
23399        // user scrolled to the bottom of the landing page.
23400        LANDING_PAGE_SCROLLED_TO_BOTTOM = 39;
23401        // GA user scrolled to the bottom of the landing page.
23402        GA_UX_LANDING_PAGE_SCROLLED_TO_BOTTOM = 40;
23403        // user clicked the settings button on the landing page.
23404        LANDING_PAGE_SETTINGS_BUTTON_CLICKED = 41;
23405        // GA user clicked the settings button on the landing page.
23406        GA_UX_LANDING_PAGE_SETTINGS_BUTTON_CLICKED = 42;
23407        // user clicked the got it button on the landing page.
23408        LANDING_PAGE_GOT_IT_BUTTON_CLICKED = 43;
23409        // GA user clicked the got it button on the landing page.
23410        GA_UX_LANDING_PAGE_GOT_IT_BUTTON_CLICKED = 44;
23411        // user clicked opt-out on the landing page.
23412        LANDING_PAGE_OPT_OUT_CLICKED = 45;
23413        // GA user clicked opt-out on the landing page.
23414        GA_UX_LANDING_PAGE_OPT_OUT_CLICKED = 46;
23415        // user dismissed the landing page.
23416        LANDING_PAGE_DISMISSED = 47;
23417        // GA user dismissed the landing page.
23418        GA_UX_LANDING_PAGE_DISMISSED = 48;
23419        // user opt-in from the landing page.
23420        LANDING_PAGE_OPT_IN = 49;
23421        // GA user opt-in from the landing page.
23422        GA_UX_LANDING_PAGE_OPT_IN = 50;
23423        // user clicked settings on the opt-in confirmation page.
23424        OPT_IN_CONFIRMATION_PAGE_SETTINGS_CLICKED = 51;
23425        // GA user clicked settings on the opt-in confirmation page.
23426        GA_UX_OPT_IN_CONFIRMATION_PAGE_SETTINGS_CLICKED = 52;
23427        // user clicked settings on the opt-out confirmation page.
23428        OPT_OUT_CONFIRMATION_PAGE_SETTINGS_CLICKED = 53;
23429        // GA user clicked settings on the opt-out confirmation page.
23430        GA_UX_OPT_OUT_CONFIRMATION_PAGE_SETTINGS_CLICKED = 54;
23431        // user clicked got it on the opt-in confirmation page.
23432        OPT_IN_CONFIRMATION_PAGE_GOT_IT_CLICKED = 55;
23433        // GA user clicked got it on the opt-in confirmation page.
23434        GA_UX_OPT_IN_CONFIRMATION_PAGE_GOT_IT_CLICKED = 56;
23435        // user clicked got it on the opt-out confirmation page.
23436        OPT_OUT_CONFIRMATION_PAGE_GOT_IT_CLICKED = 57;
23437        // GA user clicked got it on the opt-out confirmation page.
23438        GA_UX_OPT_OUT_CONFIRMATION_PAGE_GOT_IT_CLICKED = 58;
23439        // user dismissed confirmation page.
23440        CONFIRMATION_PAGE_DISMISSED = 59;
23441        // GA user dismissed confirmation page.
23442        GA_UX_CONFIRMATION_PAGE_DISMISSED = 60;
23443        // user clicked more info on the opt in confirmation page.
23444        OPT_IN_CONFIRMATION_PAGE_MORE_INFO_CLICKED = 61;
23445        // user clicked more info on the opt out confirmation page.
23446        OPT_OUT_CONFIRMATION_PAGE_MORE_INFO_CLICKED = 62;
23447        // GA user clicked more info on the opt in confirmation page.
23448        GA_UX_OPT_IN_CONFIRMATION_PAGE_MORE_INFO_CLICKED = 63;
23449        // GA user clicked more info on the opt out confirmation page.
23450        GA_UX_OPT_OUT_CONFIRMATION_PAGE_MORE_INFO_CLICKED = 64;
23451        // GA user clicked opt out on the landing page.
23452        GA_UX_LANDING_PAGE_OPT_OUT = 65;
23453        // user clicked opt out on the landing page.
23454        LANDING_PAGE_OPT_OUT = 66;
23455    }
23456    // UI action performed by user.
23457    optional AdServiceSettingsName action = 2;
23458
23459    enum AdServicesSettingsDefaultConsent {
23460        // fallback when getDefaultConsent failed.
23461        CONSENT_UNSPECIFIED = 0;
23462        // user was opted-in to PP API by default.
23463        PP_API_DEFAULT_OPT_IN = 1;
23464        // user was opted-out of PP API by default.
23465        PP_API_DEFAULT_OPT_OUT = 2;
23466        // user was opted-in to topics by default.
23467        TOPICS_DEFAULT_OPT_IN = 3;
23468        // user was opted-in to topics by default.
23469        TOPICS_DEFAULT_OPT_OUT = 4;
23470        // user was opted-in to fledge by default.
23471        FLEDGE_DEFAULT_OPT_IN = 5;
23472        // user was opted-in to fledge by default.
23473        FLEDGE_DEFAULT_OPT_OUT = 6;
23474        // user was opted-in to measurement by default.
23475        MEASUREMENT_DEFAULT_OPT_IN = 7;
23476        // user was opted-in to measurement by default.
23477        MEASUREMENT_DEFAULT_OPT_OUT = 8;
23478    }
23479    // AdServices consents of a user when consent notification was first sent.
23480    optional AdServicesSettingsDefaultConsent default_consent = 3;
23481
23482    // AdId state of a user when consent notification was first sent.
23483    enum AdServicesSettingsDefaultAdIdState {
23484        // fallback when getDefaultAdId failed.
23485        STATE_UNSPECIFIED = 0;
23486        // AdId was not zeroed-out when user first received consent notification.
23487        AD_ID_ENABLED = 1;
23488        // AdId was zeroed-out when user first received consent notification.
23489        AD_ID_DISABLED = 2;
23490    }
23491
23492    // Default ad id state when consent notification was first sent.
23493    optional AdServicesSettingsDefaultAdIdState default_ad_id_state = 4;
23494
23495    // Type of AdService feature running on device.
23496    enum PrivacySandboxFeatureType {
23497        // fallback when getFeature failed.
23498        FEATURE_UNSPECIFIED = 0;
23499        // the first consent feature is enabled.
23500        PRIVACY_SANDBOX_FIRST_CONSENT = 1;
23501        // the reconsent feature is enabled.
23502        PRIVACY_SANDBOX_RECONSENT = 2;
23503        // privacy sandbox is not yet supported on the device.
23504        PRIVACY_SANDBOX_UNSUPPORTED = 3;
23505        // privacy sandbox is already running on the device.
23506        PRIVACY_SANDBOX_ALREADY_RUNNING = 4;
23507        // the first consent feature with flipped flow is enabled.
23508        PRIVACY_SANDBOX_FIRST_CONSENT_FF = 5;
23509        // the reconsent feature with flipped flow is enabled.
23510        PRIVACY_SANDBOX_RECONSENT_FF = 6;
23511    }
23512
23513    // Privacy sandbox feature currently running on the device.
23514    optional PrivacySandboxFeatureType feature_type = 5;
23515}
23516
23517// Logs daily ambient brightness stats.
23518message AmbientBrightnessStatsReported {
23519
23520    // How much time was spent in each of the buckets, in seconds.
23521    repeated float bucket_size_seconds = 1;
23522
23523    // Ambient brightness values for creating bucket boundaries from.
23524    repeated float bucket_boundary_lux = 2;
23525}
23526
23527// Logs information about bpf maps in BpfNetMaps.
23528//
23529// Logged from:
23530//   packages/modules/Connectivity/service/src/com/android/server/BpfNetMaps.java
23531message NetworkBpfMapInfo {
23532    // The size of cookie tag bpf map.
23533    optional int32 cookie_tag_map_size = 1;
23534
23535    // The size of uid owner bpf map.
23536    optional int32 uid_owner_map_size = 2;
23537
23538    // The size of uid permission bpf map.
23539    optional int32 uid_permission_map_size = 3;
23540}
23541
23542/**
23543 * Pulls information for a single outgoing short code sms.
23544 *
23545 * Each pull generates multiple atoms, one for each category and xml_version combination.
23546 *
23547 * Pulled from:
23548 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
23549 */
23550message OutgoingShortCodeSms {
23551    /* Short code sms category. */
23552    optional android.telephony.ShortCodeSmsEnum category = 1;
23553
23554    /* sms_short_codes.xml file version used by the device. */
23555    optional int32 xml_version = 2;
23556
23557    /* Number of short code sms with the same configuration. */
23558    optional int32 short_code_sms_count = 3;
23559}
23560
23561/**
23562 * Logs information when a hearing aid is bonded
23563 *
23564 * Logged from:
23565 *   frameworks/base/packages/SettingsLib/src/com/android/settingslib/bluetooth/
23566 *   LocalBluetoothProfileManager.java
23567 */
23568message HearingAidInfoReported {
23569    // The device mode of the bonded hearing aid
23570    // Mode definition for hearing aids. See {@link HearingAidInfo}
23571    enum DeviceMode {
23572        MODE_UNKNOWN = -1;
23573        MONAURAL = 0;
23574        BINAURAL = 1;
23575        BANDED = 2;
23576    }
23577    optional DeviceMode device_mode = 1;
23578
23579    // The device side of the bonded hearing aid
23580    // Side definition for hearing aids. See {@link HearingAidInfo}.
23581    enum DeviceSide {
23582        SIDE_UNKNOWN = -1;
23583        LEFT = 0;
23584        RIGHT = 1;
23585        LEFT_AND_RIGHT = 2;
23586    }
23587    optional DeviceSide device_side = 2;
23588
23589    // The entry page id where the bonding process starts
23590    enum BondEntry {
23591        PAGE_UNKNOWN = -1;
23592        CONNECTED_DEVICES = 0;
23593        ACCESSIBILITY_HEARING_AIDS = 1;
23594        ACCESSIBILITY_HEARING_AID_PAIR_ANOTHER = 2;
23595        BLUETOOTH = 3;
23596        ACCESSIBILITY_HEARING_AID_SETTINGS = 4;
23597    }
23598    optional BondEntry bond_entry = 3;
23599}
23600
23601/**
23602 * Logs when Ambient/OFFLOAD Mode is entered or exited.
23603 *
23604 * Logged from:
23605 *  1. vendor/google_clockwork/packages/Ambient/src/com/google/
23606 *     android/wearable/ambient/AmbientService.java
23607 *  2. vendor/google_clockwork/packages/Ambient/src/com/google/android/
23608 *     wearable/ambient/autoresume/AmbientLiteFlowController.java
23609 *  3. frameworks/opt/wear/src/com/google/android/clockwork/
23610 *     displayoffload/DisplayOffloadService.java
23611 */
23612message AmbientModeChanged {
23613    enum AmbientStateEnum {
23614        AMBIENT_ENTER = 1;
23615        AMBIENT_EXIT = 2;
23616        AMBIENT_LITE_ENTER = 3;
23617        AMBIENT_LITE_EXIT = 4;
23618        OFFLOAD_ENTER = 5;
23619        OFFLOAD_EXIT = 6;
23620    }
23621
23622    optional AmbientStateEnum state = 1;
23623}
23624
23625
23626/**
23627 * Contains statistics about time spent fetching resource information from an APK.
23628 * Logged from:
23629 *   frameworks/base/core/java/android/content/res/ResourceTimer.java
23630 */
23631message ResourceValueApiStatisticsReported {
23632
23633  // The api that is being reported.
23634  optional android.app.ResourceApiEnum api = 1;
23635
23636  // The total number of events recorded.
23637  optional int32 event_count = 2;
23638
23639  // The total time spent in thie API.  The units are ns.
23640  optional int64 cumulative_event_time_ns = 3;
23641
23642  // Four percentile values.  Units are in ns.  A value of zero means the percentile could not be
23643  // computed.
23644  optional int32 p50_ns = 4;
23645  optional int32 p90_ns = 5;
23646  optional int32 p95_ns = 6;
23647  optional int32 p99_ns = 7;
23648
23649  // The five largest values recorded.  Units are in ns.  A value of zero means the value is
23650  // missing (which means fewer than 5 events were recorded).  Values that exceed INT_MAX are
23651  // capped at INT_MAX.
23652  optional int32 l0_ns = 8;
23653  optional int32 l1_ns = 9;
23654  optional int32 l2_ns = 10;
23655  optional int32 l3_ns = 11;
23656  optional int32 l4_ns = 12;
23657}
23658
23659/**
23660 * Logs when Iwlan responds the setup data call request.
23661 *
23662 * Logged from:
23663 *   packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
23664 */
23665message IwlanSetupDataCallResultReported {
23666  enum IwlanError {
23667    NO_ERROR = 0;
23668    IKE_PROTOCOL_EXCEPTION = 1;
23669    IKE_INTERNAL_IO_EXCEPTION = 2;
23670    IKE_GENERIC_EXCEPTION = 3;
23671    EPDG_SELECTOR_SERVER_SELECTION_FAILED = 4;
23672    TUNNEL_TRANSFORM_FAILED = 5;
23673    SIM_NOT_READY_EXCEPTION = 6;
23674    NETWORK_FAILURE = 7;
23675    UNKNOWN_EXCEPTION = 8;
23676  }
23677
23678  // Setup data call apn type
23679  // See go/apntypedefinition
23680  optional int32 apn_type = 1;
23681  // Is the request for handover
23682  optional bool is_handover = 2;
23683  // ePDG server address
23684  optional string epdg_server_address = 3;
23685  // If the request type is handover, record the source network type
23686  // See
23687  // frameworks/base/telephony/java/android/telephony/TelephonyManager.java
23688  optional int32 source_rat = 4;
23689  // If the request type is handover, record the source network roaming status
23690  optional bool is_cellular_roaming = 5;
23691  // Is network connected
23692  optional bool is_network_connected = 6;
23693  // Default network transport type
23694  // See
23695  // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
23696  optional int32 transport_type = 7;
23697  // Setup result
23698  optional int32 setup_request_result = 8;
23699  // Iwlan error code if setup failed
23700  optional IwlanError iwlan_error = 9;
23701  // Data call fail cause
23702  // See
23703  // frameworks/base/telephony/java/android/telephony/DataFailCause.java
23704  optional int32 data_call_fail_cause = 10;
23705  // Setup request processing duration
23706  optional int32 processing_duration_millis = 11;
23707  // Time for doing ePDG server selection through DNS query of FQDNs
23708  optional int32 epdg_server_selection_duration_millis = 12;
23709  // Time for establishing IKE tunnel
23710  optional int32 ike_tunnel_establishment_duration_millis = 13;
23711  // Tunnel State
23712  // See
23713  // packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
23714  optional int32 tunnel_state = 14;
23715  // Handover failure mode
23716  // See
23717  // frameworks/base/telephony/java/android/telephony/data/DataCallResponse.java
23718  optional int32 handover_failure_mode = 15;
23719  // Retry duration
23720  optional int32 retry_duration_millis = 16;
23721  // Iwlan error wrapped exception classname
23722  optional string iwlan_error_wrapped_classname = 17;
23723  // Iwlan error wrapped exception 1st line of stack trace
23724  optional string iwlan_error_wrapped_stack_first_frame = 18;
23725}
23726
23727/**
23728 * Logs when Iwlan reports IWLAN PDN disconnected without deactivation request.
23729 *
23730 * Logged from:
23731 *   packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
23732 */
23733message IwlanPdnDisconnectedReasonReported {
23734  // Disconnection cause
23735  // See
23736  // frameworks/base/telephony/java/android/telephony/DataFailCause.java
23737  optional int32 cause = 1;
23738  // Is network connected
23739  optional bool is_network_connected = 2;
23740  // default network transport type
23741  // See
23742  // packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
23743  optional int32 transport_type = 3;
23744  // Wifi signal level
23745  optional int32 wifi_signal_level = 4;
23746}
23747
23748/**
23749 * Logs the number of network count on each list of transports
23750 *
23751 * Logs from:
23752 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23753 */
23754message NetworkCountPerTransports {
23755    // the number of network count on each list of transports
23756    repeated NetworkCountForTransports network_count_for_transports = 1;
23757}
23758
23759/**
23760 * Logs the number of network count and transport type
23761 *
23762 * Logs from:
23763 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23764 */
23765message NetworkCountForTransports {
23766    // Transport types of the network
23767    optional int32 transport_types = 1;
23768
23769    // Number of networks for one list of transport types
23770    optional int32 network_count = 2;
23771}
23772
23773/**
23774 * Logs a list of networks
23775 *
23776 * Logs from:
23777 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23778 */
23779message NetworkList {
23780    repeated NetworkDescription network_description = 1;
23781}
23782
23783/**
23784 * Logs connection duration in seconds and list of transports
23785 *
23786 * Logs from:
23787 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23788 */
23789message ConnectionDurationForTransports {
23790    // Transport types of the network
23791    optional int32 transport_types = 1;
23792
23793    // Time duration that the device stays connected to the network
23794    optional int32 duration_sec = 2;
23795}
23796
23797/**
23798 * Logs connection duration on each list of transports, in seconds
23799 *
23800 * Logs from:
23801 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23802 */
23803message ConnectionDurationPerTransports {
23804    repeated ConnectionDurationForTransports connection_duration_for_transports = 1;
23805}
23806
23807/**
23808 * Logs network request count & request type
23809 *
23810 * Logs from:
23811 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23812 */
23813message RequestCountForType {
23814    // The type of network request
23815    optional android.stats.connectivity.RequestType request_type = 1;
23816
23817    // Number of network requests
23818    optional int32 request_count = 2;
23819}
23820
23821/**
23822 * Logs network request count
23823 *
23824 * Logs from:
23825 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23826 */
23827message NetworkRequestCount {
23828    // Network request count for request type
23829    repeated RequestCountForType request_count_for_type = 1;
23830}
23831
23832/**
23833 * Logs information about a network
23834 *
23835 * Logs from:
23836 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23837 */
23838message NetworkDescription {
23839    // The transport types of the network. A network may include multiple transport types.
23840    // Each transfer type is represented by a different bit, defined in
23841    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
23842    optional int32 transport_types = 1;
23843
23844    // Indicates the network is metered, non-metered or temporarily-unmetered
23845    optional android.stats.connectivity.MeteredState metered_state = 2;
23846
23847    // Indicates the network is validated, non-validated, partial or portal
23848    optional android.stats.connectivity.ValidatedState validated_state = 3;
23849
23850    // Record the bitmask of all the policies applied to this score of network.
23851    // Each policy is represented by a different bit, defined in
23852    // packages/modules/Connectivity/service/src/com/android/server/connectivity/FullScore.java
23853    optional int64 score_policies = 4;
23854
23855    // The capabilities of the network. A network may include multiple network capabilities.
23856    // Each capability is represented by a different bit, defined in
23857    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
23858    optional int64 capabilities = 5;
23859
23860    // Bitfield representing the network's enterprise capability identifier, defined in
23861    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
23862    optional int32 enterprise_id = 6;
23863}
23864
23865/**
23866 * Pulls a list of NumberOfRematchesPerReason.
23867 *
23868 * Pulled from:
23869 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23870 */
23871message NumberOfRematchesPerReason {
23872    // Number of network rematches for each rematch reason
23873    repeated NumberOfRematchesForReason number_of_rematches_per_reason= 1;
23874}
23875
23876/**
23877 * Logs number of network rematches for rematch reason
23878 *
23879 * Logs from:
23880 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23881 */
23882message NumberOfRematchesForReason {
23883    // The reason of network rematch
23884    optional android.stats.connectivity.RematchReason rematch_reason = 1;
23885
23886    // Number of network rematches
23887    optional int32 rematch_count = 2;
23888};
23889
23890/**
23891 * Pulls information for connectivity stats.
23892 *
23893 * Pulled from:
23894 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23895 */
23896message ConnectivityStateSample {
23897    // Number of networks per list of transports
23898    optional NetworkCountPerTransports network_count_per_transports = 1
23899    [(android.os.statsd.log_mode) = MODE_BYTES];
23900
23901    // This is a list of networks with their transports and the duration
23902    optional ConnectionDurationPerTransports connection_duration_per_transports = 2
23903    [(android.os.statsd.log_mode) = MODE_BYTES];
23904
23905    // Number of requests per category
23906    optional NetworkRequestCount network_request_count  = 3
23907    [(android.os.statsd.log_mode) = MODE_BYTES];
23908
23909    // Full list of network details (slice by transport / meteredness / internet+validated)
23910    optional NetworkList networks = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
23911}
23912
23913
23914/**
23915 * Pulls information for network selection rematch info.
23916 *
23917 * Pulled from:
23918 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23919 */
23920message NetworkSelectionRematchReasonsInfo {
23921    // Number of rematch per rematch reason
23922    optional NumberOfRematchesPerReason number_of_rematches_per_reason = 1
23923    [(android.os.statsd.log_mode) = MODE_BYTES];
23924}
23925
23926/**
23927 * Logs rematch information for the default network
23928 *
23929 * Logs from:
23930 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23931 */
23932message DefaultNetworkRematchInfo {
23933    // The session id comes from each reboot, this is used to correlate the statistics of the
23934    // networkselect on the same boot
23935    optional int64 session_id = 1;
23936
23937    // The information of old device default network
23938    optional NetworkDescription old_network = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
23939
23940    // The information of new device default network
23941    optional NetworkDescription new_network = 3 [(android.os.statsd.log_mode) = MODE_BYTES];
23942
23943    // The reason of network rematch
23944    optional android.stats.connectivity.RematchReason rematch_reason = 4;
23945
23946    // The time duration the device kept the old network as the default in seconds
23947    optional int32 time_duration_on_old_network_sec = 5;
23948}
23949
23950/**
23951 * Logs network selection performance
23952 *
23953 * Logs from:
23954 *   packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
23955 */
23956message NetworkSelectionPerformance {
23957    // Number of network requests
23958    optional int32 number_of_network_requests = 1;
23959
23960    // List of networks right now
23961    // (slice by transport / meteredness / internet+validated)
23962    optional NetworkList networks = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
23963
23964    // The latency of selection computed in milli-second
23965    optional int32 selection_computed_latency_milli = 3;
23966
23967    // The latency of selection applied in milli-second
23968    optional int32 selection_applied_latency_milli = 4;
23969
23970    // The latency of selection issued in milli-second
23971    optional int32 selection_issued_latency_milli = 5;
23972}
23973
23974message NetworkSliceRequestCountSample {
23975    // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY),
23976    // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
23977    optional int64 slice_id = 1;
23978
23979    // Bitfield representing the network's enterprise capability identifier
23980    // (e.g. NET_ENTERPRISE_ID_1), defined in
23981    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
23982    optional int32 enterprise_id = 2;
23983
23984    // number of request for this slice
23985    optional int32 request_count = 3;
23986
23987    // number of apps with outstanding request(s) for this slice
23988    optional int32 distinct_app_count = 4;
23989}
23990
23991message NetworkSliceSessionEnded {
23992    // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY),
23993    // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
23994    optional int64 slice_id = 1;
23995
23996    // Bitfield representing the network's enterprise capability identifier
23997    // (e.g. NET_ENTERPRISE_ID_1), defined in
23998    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
23999    optional int32 enterprise_id = 2;
24000
24001    // Number of bytes received at the device on this slice id
24002    optional int64 rx_bytes = 3;
24003
24004    // Number of bytes transmitted by the device on this slice id
24005    optional int64 tx_bytes = 4;
24006
24007    // Number of apps that have used this slice
24008    optional int32 number_of_apps = 5;
24009
24010    // How long(in seconds) this slice has been connected
24011    optional int32 slice_connection_duration_sec = 6;
24012}
24013
24014message NetworkSliceDailyDataUsageReported {
24015    // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY),
24016    // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
24017    optional int64 slice_id = 1;
24018
24019    // Bitfield representing the network's enterprise capability identifier
24020    // (e.g. NET_ENTERPRISE_ID_1), defined in
24021    // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
24022    optional int32 enterprise_id = 2;
24023
24024    // Number of bytes received at the device on this slice id
24025    optional int64 rx_bytes = 3;
24026
24027    // Number of bytes transmitted by the device on this slice id
24028    optional int64 tx_bytes = 4;
24029
24030    // Number of apps that have used this slice
24031    optional int32 number_of_apps = 5;
24032
24033    // How long(in seconds) this slice has been connected
24034    optional int32 slice_connection_duration_sec = 6;
24035}
24036
24037/**
24038 * Logs the Brightness Configuration pushed by the long term model. The Brightness Configuration is
24039 * expressed as a curve where each point is a pair of ambient light (lux) and the corresponding
24040 * screen brightness (nits).
24041 *
24042 * Logged from:
24043 *    frameworks/base/services/core/java/com/android/server/display/DisplayManagerService.java
24044 */
24045message BrightnessConfigurationUpdated {
24046    // Array of ambient light values (in lux) to define the configuration.
24047    repeated float lux = 1;
24048    // Array of screen brightness values (in nits) corresponding to the lux
24049    // values above.
24050    repeated float nits = 2;
24051    // Physical display id, with format $ADAPTER_PREFIX:$ID, in this case
24052    // "local:$PHYSICAL_ID".
24053    optional string physical_display_id = 3;
24054}
24055
24056/**
24057 * Logs data when wear media output switcher is launched.
24058 *
24059 * Logged from:
24060 * package: vendor/google_clockwork/packages/Media
24061 */
24062message WearMediaOutputSwitcherLaunched {
24063    // Name of the media app package from where Output Switcher got triggered.
24064    optional string triggering_package_name = 1;
24065
24066    // The operation type for invoking the OutputSwitcher
24067    optional com.google.android.wearable.media.routing.OpType op_type = 2;
24068
24069    // The result of OutputSwticher launch.
24070    optional com.google.android.wearable.media.routing.LaunchResult result = 3;
24071}
24072
24073/**
24074 * Logs data when wear media output switcher is finished.
24075 *
24076 * Logged from:
24077 * package: vendor/google_clockwork/packages/Media
24078 */
24079message WearMediaOutputSwitcherFinished {
24080    optional bool user_did_some_activity = 1;
24081    optional bool is_device_connected = 2;
24082}
24083
24084/**
24085 * Logs data when wear media output switcher operation is INITIATED
24086 * or COMPLETED.
24087 *
24088 * Logged from:
24089 * package: vendor/google_clockwork/packages/Media
24090 */
24091message WearMediaOutputSwitcherConnectionReported {
24092    // Type of the medium through which media is played
24093    optional com.google.android.wearable.media.routing.MediumType source = 1;
24094    optional com.google.android.wearable.media.routing.MediumType target  = 2;
24095
24096    // Reason for the connection reported
24097    optional com.google.android.wearable.media.routing.ConnectionReportReason reason = 3;
24098
24099    // Current status of switching the media.
24100    optional com.google.android.wearable.media.routing.ConnectionState state =4;
24101
24102    // Type of target device.
24103    optional com.google.android.wearable.media.routing.MediaDeviceType target_device_type = 5;
24104
24105    // The operation type for invoking the OutputSwitcher
24106    optional com.google.android.wearable.media.routing.OpType op_type = 6;
24107
24108    optional bool is_retry = 7;
24109
24110    // For differentiating if the bluetooth device is connected from already
24111    // paired device list or from the bluetooth settings flow.
24112    optional bool is_already_paired = 8;
24113}
24114
24115/**
24116 * Logs data when wear media output switcher starts scanning
24117 * for already paired devices.
24118 *
24119 * Logged from:
24120 * package: vendor/google_clockwork/packages/Media
24121 */
24122message WearMediaOutputSwitcherDeviceScanTriggered {
24123    // The current status of the scanned device.
24124    optional com.google.android.wearable.media.routing.ScanState scan_state = 1;
24125
24126    // Name of the media app package from where Output Switcher got triggered.
24127    optional string triggering_package_name = 2;
24128
24129    optional com.google.android.wearable.media.routing.OpType op_type = 3;
24130}
24131
24132/**
24133 * Logs the latency for scanning the first device.
24134 *
24135 * Logged from:
24136 * package: vendor/google_clockwork/packages/Media
24137 */
24138message WearMediaOutputSwitcherFirstDeviceScanLatency {
24139    // The latency of scanning the first device
24140    optional int32 latency_in_millis = 1;
24141}
24142
24143/**
24144 * Logs the latency for scanning all devices.
24145 *
24146 * Logged from:
24147 * package: vendor/google_clockwork/packages/Media
24148 */
24149message WearMediaOutputSwitcherAllDevicesScanLatency {
24150    // The latency of scanning all available devices in milli-second
24151    optional int32 latency_in_millis = 1;
24152
24153    // Type of target device.
24154    optional com.google.android.wearable.media.routing.MediaDeviceType target_device_type = 2;
24155}
24156
24157/**
24158 * Logs the latency in connecting to an already paired device.
24159 *
24160 * Logged from:
24161 * package: vendor/google_clockwork/packages/Media
24162 */
24163message WearMediaOutputSwitcherConnectDeviceLatency {
24164    // The latency of connecting to an already paired device in milli-second.
24165    optional int32 latency_in_millis = 1;
24166
24167    // Type of target medium.
24168    optional com.google.android.wearable.media.routing.MediumType target_device_medium_type = 2;
24169
24170    // Type of target device.
24171    optional com.google.android.wearable.media.routing.MediaDeviceType target_device_type = 3;
24172}
24173
24174/**
24175 * Logs package manager snapshot performance.
24176 *
24177 * Logs from:
24178 *   frameworks/base/services/core/java/com/android/server/pm/SnapshotStatistics.java
24179 */
24180message PackageManagerSnapshotReported {
24181    // The histogram of snapshot rebuild latency in a period. Each bucket
24182    // represents a range of rebuild latency such as less than 1 ms, and the
24183    // value of the bucket is the number of snapshots in this range.
24184    repeated int32 rebuild_latency_buckets= 1;
24185
24186    // The histogram of the snapshot usage in a period. Each bucket
24187    // represents a range of snapshot uses such as less than 1, and the
24188    // value is the number of snapshots in this range.
24189    repeated int32 reuse_count_buckets = 2;
24190
24191    // The maximum rebuild latency in a period.
24192    optional int64 max_rebuild_latency_us = 3;
24193
24194    // The maximum number of snapshot usage in a period.
24195    optional int32 max_reuse_count = 4;
24196
24197    // The average rebuild latency for each snapshot in a period.
24198    optional int64 rebuild_latency_us_avg = 5;
24199
24200    // The average snapshot usage for each snapshot in a period.
24201    optional int32 reuse_count_avg = 6;
24202
24203    // The number of packages on the device.
24204    optional int32 packages_count = 7;
24205}
24206
24207/**
24208 * Logs package manager apps filter cache built performance.
24209 *
24210 * Logs from:
24211 *   frameworks/base/services/core/java/com/android/server/pm/AppsFilterImpl.java
24212 */
24213message PackageManagerAppsFilterCacheBuildReported {
24214    // An event id to indicate the type of the cache building.
24215    enum Event {
24216        UNSPECIFIED = 0;
24217        BOOT = 1;
24218        USER_CREATED = 2;
24219        USER_DELETED = 3;
24220    }
24221    optional Event event_type = 1;
24222
24223    // The time to build the cache in microseconds.
24224    optional int64 build_cache_latency_us = 2;
24225
24226    // The number of users on the device.
24227    optional int32 user_count = 3;
24228
24229    // The number of packages on the device.
24230    optional int32 packages_count = 4;
24231
24232    // The size of the cache.
24233    optional int32 cache_size_bytes = 5;
24234}
24235
24236/**
24237 * Logs package manager apps filter cache updated performance.
24238 *
24239 * Logs from:
24240 *   frameworks/base/services/core/java/com/android/server/pm/AppsFilterImpl.java
24241 */
24242message PackageManagerAppsFilterCacheUpdateReported {
24243    // An event id to indicate the type of cache updating.
24244    enum Event {
24245        UNSPECIFIED = 0;
24246        PACKAGE_ADDED = 1;
24247        PACKAGE_DELETED = 2;
24248        PACKAGE_REPLACED = 3;
24249        COMPAT_CHANGED = 4;
24250    }
24251    optional Event event_type = 1;
24252
24253    // The package's uid.
24254    optional int32 uid = 2 [(is_uid) = true];
24255
24256    // The time to update the cache in microseconds.
24257    optional int64 update_cache_latency_us = 3;
24258
24259    // The number of users on the device.
24260    optional int32 user_count = 4;
24261
24262    // The number of packages on the device.
24263    optional int32 packages_count = 5;
24264
24265    // The size of the cache.
24266    optional int32 cache_size_bytes = 6;
24267}
24268
24269/**
24270* Logged during the watch face editing session in Wear Services
24271* This atom will log the duration with SessionStateEnum#END.
24272*
24273* Logged from :
24274* com/google/wear/services/watchfaces/editing/api/WatchFaceEditingApiImpl.java
24275*/
24276message WsWatchFaceEdited {
24277   // Depicts the state of the session eg: START/END/ABORT.
24278   optional android.app.wearservices.SessionStateEnum session_state = 1;
24279
24280   // Session duration for watch face editing.
24281   optional int32 session_duration_millis = 2;
24282
24283   // Enum to depict the source of the request. Values (PHONE, WATCH)
24284   optional android.app.wearservices.RequestSource request_source = 3;
24285
24286   // Component package for watch face.
24287   optional int32 component_package_uid = 4 [(is_uid) = true];
24288}
24289
24290/**
24291* Logged for watch face favorite feature in Wear Services.
24292*
24293* Logged from :
24294* com/google/wear/services/watchfaces/api/WatchFacesApiImpl.java
24295*/
24296message WsWatchFaceFavouriteActionReported {
24297   // Component package for watch face.
24298   optional int32 component_package_uid = 1 [(is_uid) = true];
24299
24300   // Depicts the action for wf favorites eg: Add/Remove.
24301   optional android.app.wearservices.ActionEnum favorite_action = 2;
24302
24303   // Enum to depict the source of the request. Values (PHONE, WATCH)
24304   optional android.app.wearservices.RequestSource request_source = 3;
24305}
24306
24307/**
24308* Logged for the watch face set feature in Wear Services.
24309*
24310* Logged from :
24311* com/google/wear/services/watchfaces/api/WatchFacesApiImpl.java
24312*/
24313message WsWatchFaceSetActionReported {
24314   // Component package for watch face.
24315   optional int32 component_package_uid = 1 [(is_uid) = true];
24316
24317  // Result for WF, whether it resulted in SAME/FAVORITE/FALLBACK
24318  optional android.app.wearservices.SetResultEnum wf_set_result = 2;
24319
24320  // Enum to depict the source of the request. Values (PHONE, WATCH)
24321   optional android.app.wearservices.RequestSource request_source = 3;
24322}
24323
24324/**
24325* Logged when tile list is modified (go/wear-dd-wearservices-telemetry)
24326*/
24327message WsTileListChanged {
24328    enum Event {
24329        EVENT_UNKNOWN = 0;
24330        TILE_ADDED = 1;
24331        TILE_REMOVED = 2;
24332    }
24333    // Component package for the tile that is being changed.
24334    optional int32 component_package_uid = 1 [(is_uid) = true];
24335
24336    // Class name for the tile.
24337    optional string component_class_name = 2;
24338
24339    // The event in result of which tile list has changed.
24340    optional Event event = 3;
24341
24342    // Where a tile has been changed from. When changed on the companion equals
24343    // to the phone source, otherwise watch source if it's changed from the watch.
24344    optional android.app.wearservices.RequestSource request_source = 4;
24345}
24346
24347/**
24348* A snapshot of all visible tiles in the order they appear on the watch.
24349* (go/wear-dd-wearservices-telemetry)
24350*/
24351message WsTileSnapshot {
24352    // Component package name for the tiles.
24353    repeated string component_package_name = 1;
24354
24355    // Class name for the tiles.
24356    repeated string component_class_name = 2;
24357}
24358/*
24359* Logs calls to getType of a contentProvider, where the caller has potentially no access to
24360* the provider.
24361*
24362* Logs from :
24363* frameworks/base/services/core/java/com/android/server/am/ContentProviderHelper.java
24364* frameworks/base/core/java/android/content/ContentProvider.java
24365*/
24366message GetTypeAccessedWithoutPermission{
24367  // Indicator of the type of permission failure
24368  enum FailureType{
24369      UNSPECIFIED = 0;
24370      AM_FRAMEWORK_PERMISSION = 1;
24371      AM_CHECK_URI_PERMISSION = 2;
24372      AM_ERROR = 3;
24373      PROVIDER_FRAMEWORK_PERMISSION = 4;
24374      PROVIDER_CHECK_URI_PERMISSION = 5;
24375      PROVIDER_ERROR = 6;
24376  }
24377  optional FailureType location = 1;
24378  // Name of the caller package
24379  optional int32 calling_uid = 2 [(is_uid) = true];
24380  // Name of the provider (authority) which is being accessed
24381  optional string provider = 3;
24382  // Type of the uri returned
24383  optional string type = 4;
24384}
24385
24386/** Logged when a complication is changed on a watch face. Both
24387  data for complication that is being placed in the complication
24388  slot (we call is new here) and for complication that is being
24389  replaced (we call is old) is reported.
24390*/
24391message WsWatchFaceComplicationSetChanged {
24392  // Watch face package uid
24393  optional int32 watch_face_package_uid = 1 [(is_uid) = true];
24394
24395  // Complication component package uid for complication that is being replaced.
24396  // Equals to -1 if new complication is placed on previously empty slot.
24397  optional int32 old_complication_component_package_uid = 2 [(is_uid) = true];
24398
24399  // Complication component class name for complication that is being replaced.
24400  // Equals to empty string if new complication is placed on previously empty slot.
24401  optional string old_complication_component_class_name = 3;
24402
24403  // Complication component package uid for new complication.
24404  // Equals to -1 if complication is removed from complication slot.
24405  optional int32 new_complication_component_package_uid = 4 [(is_uid) = true];
24406
24407  // Complication component class name for new complication.
24408  // Equals to empty string if complication is removed from complication slot.
24409  optional string new_complication_component_class_name = 5;
24410
24411  // Where a complication has been changed from. When changed on the companion equals
24412  // to SOURCE_PHONE, otherwise if it's changed from the watch SOURCE_WATCH.
24413  optional android.app.wearservices.RequestSource request_source = 6;
24414
24415  // Old complication type.
24416  optional int32 old_complication_type = 7;
24417
24418  // New complication type.
24419  optional int32 new_complication_type = 8;
24420}
24421
24422/** Snapshot of all active complications on the current watch face.
24423*   (go/wear-dd-wearservices-telemetry)
24424*/
24425message WsActiveWatchFaceComplicationSetSnapshot {
24426  // Complication package name.
24427  repeated string complication_component_package_name = 1;
24428
24429  // Complication component class name.
24430  repeated string complication_component_class_name = 2;
24431
24432  // Complication type.
24433  repeated int32 complication_type = 4;
24434
24435  // Active watch face package uid.
24436  optional int32 watch_face_package_uid = 3 [(is_uid) = true];
24437}
24438
24439message UnsafeIntentEventReported {
24440    enum EventType {
24441        UNKNOWN = 0;
24442        // When a component is matched with a null action.
24443        NULL_ACTION_MATCH = 1;
24444        // When a non-exported internal component is matched.
24445        INTERNAL_NON_EXPORTED_COMPONENT_MATCH = 2;
24446        // When an explicit intent does not match
24447        // an external component intent filter.
24448        EXPLICIT_INTENT_FILTER_UNMATCH = 3;
24449        // When a mutable pending intent for an implicit intent is retrieved
24450        NEW_MUTABLE_IMPLICIT_PENDING_INTENT_RETRIEVED = 4;
24451    }
24452    // Type of matching event.
24453    optional EventType event_type = 1;
24454    // The calling UID.
24455    optional int32 calling_uid = 2;
24456    // The component name of the intent.
24457    optional string component_name = 3;
24458    // The package name of the intent.
24459    optional string package_name = 4;
24460    // The action of the intent.
24461    optional string action = 5;
24462    // List of categories of the intent.
24463    repeated string categories = 6;
24464    // Data type of the intent.
24465    optional string data_type = 7;
24466    // Data scheme of the intent.
24467    optional string data_scheme = 8;
24468    // Is the unsafe intent event blocked by the system.
24469    optional bool is_blocked = 9;
24470}
24471
24472/**
24473 * Snapshot of all favorite watch faces from the watch.
24474 */
24475message WsFavouriteWatchFaceListSnapshot {
24476  repeated string watch_face_component_name = 1;
24477}
24478