• 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/atom_field_options.proto";
26import "frameworks/proto_logging/stats/enums/app/enums.proto";
27import "frameworks/proto_logging/stats/enums/app/job/enums.proto";
28import "frameworks/proto_logging/stats/enums/app/remoteprovisioner_enums.proto";
29import "frameworks/proto_logging/stats/enums/app/settings_enums.proto";
30import "frameworks/proto_logging/stats/enums/app/media_output_enum.proto";
31import "frameworks/proto_logging/stats/enums/app/tvsettings_enums.proto";
32import "frameworks/proto_logging/stats/enums/app/wearsettings_enums.proto";
33import "frameworks/proto_logging/stats/enums/bluetooth/a2dp/enums.proto";
34import "frameworks/proto_logging/stats/enums/bluetooth/enums.proto";
35import "frameworks/proto_logging/stats/enums/bluetooth/hci/enums.proto";
36import "frameworks/proto_logging/stats/enums/bluetooth/hfp/enums.proto";
37import "frameworks/proto_logging/stats/enums/bluetooth/leaudio/enums.proto";
38import "frameworks/proto_logging/stats/enums/bluetooth/smp/enums.proto";
39import "frameworks/proto_logging/stats/enums/contexthub/enums.proto";
40import "frameworks/proto_logging/stats/enums/debug/enums.proto";
41import "frameworks/proto_logging/stats/enums/hardware/biometrics/enums.proto";
42import "frameworks/proto_logging/stats/enums/hardware/sensor/assist/enums.proto";
43import "frameworks/proto_logging/stats/enums/hotword/enums.proto";
44import "frameworks/proto_logging/stats/enums/jank/enums.proto";
45import "frameworks/proto_logging/stats/enums/media/audio/enums.proto";
46import "frameworks/proto_logging/stats/enums/media/enums.proto";
47import "frameworks/proto_logging/stats/enums/mms/enums.proto";
48import "frameworks/proto_logging/stats/enums/nearby/enums.proto";
49import "frameworks/proto_logging/stats/enums/net/enums.proto";
50import "frameworks/proto_logging/stats/enums/neuralnetworks/enums.proto";
51import "frameworks/proto_logging/stats/enums/os/enums.proto";
52import "frameworks/proto_logging/stats/enums/server/connectivity/data_stall_event.proto";
53import "frameworks/proto_logging/stats/enums/server/display/enums.proto";
54import "frameworks/proto_logging/stats/enums/server/enums.proto";
55import "frameworks/proto_logging/stats/enums/server/job/enums.proto";
56import "frameworks/proto_logging/stats/enums/server/location/enums.proto";
57import "frameworks/proto_logging/stats/enums/service/enums.proto";
58import "frameworks/proto_logging/stats/enums/service/procstats_enum.proto";
59import "frameworks/proto_logging/stats/enums/stats/connectivity/network_stack.proto";
60import "frameworks/proto_logging/stats/enums/stats/connectivity/tethering.proto";
61import "frameworks/proto_logging/stats/enums/stats/dnsresolver/dns_resolver.proto";
62import "frameworks/proto_logging/stats/enums/stats/devicepolicy/device_policy.proto";
63import "frameworks/proto_logging/stats/enums/stats/devicepolicy/device_policy_enums.proto";
64import "frameworks/proto_logging/stats/enums/stats/docsui/docsui_enums.proto";
65import "frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto";
66import "frameworks/proto_logging/stats/enums/stats/enums.proto";
67import "frameworks/proto_logging/stats/enums/stats/hdmi/enums.proto";
68import "frameworks/proto_logging/stats/enums/stats/intelligence/enums.proto";
69import "frameworks/proto_logging/stats/enums/stats/launcher/launcher.proto";
70import "frameworks/proto_logging/stats/enums/stats/location/location_enums.proto";
71import "frameworks/proto_logging/stats/enums/stats/mediametrics/mediametrics.proto";
72import "frameworks/proto_logging/stats/enums/stats/mediaprovider/mediaprovider_enums.proto";
73import "frameworks/proto_logging/stats/enums/stats/storage/storage_enums.proto";
74import "frameworks/proto_logging/stats/enums/stats/style/style_enums.proto";
75import "frameworks/proto_logging/stats/enums/stats/sysui/notification_enums.proto";
76import "frameworks/proto_logging/stats/enums/stats/tls/enums.proto";
77import "frameworks/proto_logging/stats/enums/stats/tv/tif_enums.proto";
78import "frameworks/proto_logging/stats/enums/stats/wm/enums.proto";
79import "frameworks/proto_logging/stats/enums/system/security/keystore2/enums.proto";
80import "frameworks/proto_logging/stats/enums/telecomm/enums.proto";
81import "frameworks/proto_logging/stats/enums/telephony/enums.proto";
82import "frameworks/proto_logging/stats/enums/uwb/enums.proto";
83import "frameworks/proto_logging/stats/enums/view/enums.proto";
84import "frameworks/proto_logging/stats/enums/wifi/enums.proto";
85import "frameworks/proto_logging/stats/enums/stats/textclassifier/textclassifier_enums.proto";
86import "frameworks/proto_logging/stats/enums/stats/otaupdate/updateengine_enums.proto";
87import "frameworks/proto_logging/stats/message/mediametrics_message.proto";
88
89/**
90 * The primary atom class. This message defines all of the available
91 * raw stats log events from the Android system, also known as "atoms."
92 *
93 * This field contains a single oneof with all of the available messages.
94 * The stats-log-api-gen tool runs as part of the Android build and
95 * generates the android.util.StatsLog class, which contains the constants
96 * and methods that Android uses to log.
97 *
98 * This Atom class is not actually built into the Android system.
99 * Instead, statsd on Android constructs these messages synthetically,
100 * in the format defined here and in stats_log.proto.
101 */
102message Atom {
103    // Pushed atoms start at 2.
104    oneof pushed {
105        // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
106        BleScanStateChanged ble_scan_state_changed = 2
107                [(module) = "bluetooth", (module) = "statsdtest"];
108        ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
109        BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
110        SensorStateChanged sensor_state_changed =
111                5 [(module) = "framework", (module) = "statsdtest"];
112        GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
113        SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
114        ScheduledJobStateChanged scheduled_job_state_changed =
115                8 [(module) = "framework", (module) = "statsdtest"];
116        ScreenBrightnessChanged screen_brightness_changed =
117                9 [(module) = "framework", (module) = "statsdtest"];
118        WakelockStateChanged wakelock_state_changed =
119                10 [(module) = "framework", (module) = "statsdtest"];
120        LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
121                11 [(module) = "framework"];
122        MobileRadioPowerStateChanged mobile_radio_power_state_changed =
123                12 [(module) = "framework", (truncate_timestamp) = true];
124        WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
125        ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
126                14 [(module) = "framework"];
127        MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
128        ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
129        CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
130        ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
131        LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
132        BatterySaverModeStateChanged battery_saver_mode_state_changed =
133                20 [(module) = "framework", (module) = "statsdtest"];
134        DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
135        DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
136        AudioStateChanged audio_state_changed =
137                23 [(module) = "framework", (truncate_timestamp) = true];
138        MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
139        CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
140        FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
141        UidProcessStateChanged uid_process_state_changed =
142                27 [(module) = "framework", (module) = "statsdtest"];
143        ProcessLifeCycleStateChanged process_life_cycle_state_changed =
144                28 [(module) = "framework", (module) = "statsdtest"];
145        ScreenStateChanged screen_state_changed =
146                29 [(module) = "framework", (module) = "statsdtest"];
147        BatteryLevelChanged battery_level_changed =
148                30 [(module) = "framework", (module) = "statsdtest"];
149        ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
150        PluggedStateChanged plugged_state_changed = 32
151                [(module) = "framework", (module) = "statsdtest"];
152        InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
153        TouchEventReported touch_event_reported = 34;
154        WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
155        KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
156        WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
157        WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
158        WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
159        PhoneSignalStrengthChanged phone_signal_strength_changed =
160                40 [(module) = "framework", (truncate_timestamp) = true];
161        SettingChanged setting_changed = 41 [(module) = "framework"];
162        ActivityForegroundStateChanged activity_foreground_state_changed =
163                42 [(module) = "framework", (module) = "statsdtest"];
164        IsolatedUidChanged isolated_uid_changed =
165                43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
166        PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
167        WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
168        AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
169        AppBreadcrumbReported app_breadcrumb_reported = 47 [(module) = "statsd"];
170        AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
171        AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
172        AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
173        LmkKillOccurred lmk_kill_occurred = 51 [(module) = "framework"];
174        PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
175        WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
176        LmkStateChanged lmk_state_changed = 54 [(module) = "framework"];
177        AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
178        ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
179        BootSequenceReported boot_sequence_reported = 57;
180        DaveyOccurred davey_occurred = 58 [(module) = "statsd", deprecated = true];
181        OverlayStateChanged overlay_state_changed =
182                59 [(module) = "framework", (module) = "statsdtest"];
183        ForegroundServiceStateChanged foreground_service_state_changed
184                = 60 [(module) = "framework"];
185        CallStateChanged call_state_changed =
186                61 [(module) = "telecom", (truncate_timestamp) = true];
187        KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
188        KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
189        KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
190        AppDied app_died = 65 [(module) = "framework"];
191        ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
192        BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
193        BluetoothConnectionStateChanged bluetooth_connection_state_changed =
194                68 [(module) = "bluetooth"];
195        GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
196        UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
197        SpeakerImpedanceReported speaker_impedance_reported = 71;
198        HardwareFailed hardware_failed = 72;
199        PhysicalDropDetected physical_drop_detected = 73;
200        ChargeCyclesReported charge_cycles_reported = 74;
201        MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
202        MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
203        UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
204        AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
205        ANROccurred anr_occurred = 79 [(module) = "framework"];
206        WTFOccurred wtf_occurred = 80 [(module) = "framework"];
207        LowMemReported low_mem_reported = 81 [(module) = "framework"];
208        GenericAtom generic_atom = 82;
209        VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
210        DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
211        ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
212        BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
213        BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
214        BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
215        UiEventReported ui_event_reported = 90 [
216            (module) = "framework",
217            (module) = "sysui",
218            (module) = "mediaprovider"
219        ];
220        BatteryHealthSnapshot battery_health_snapshot = 91;
221        SlowIo slow_io = 92;
222        BatteryCausedShutdown battery_caused_shutdown = 93;
223        PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
224        PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
225        UserRestrictionChanged user_restriction_changed = 96;
226        SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
227        ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
228        // TODO: service state change is very noisy shortly after boot, as well
229        // as at other transitions - coming out of doze, device plugged in, etc.
230        // Consider removing this if it becomes a problem
231        ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
232        ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
233        FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
234        BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
235        DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
236        DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
237        DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
238            105 [(module) = "docsui"];
239        DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
240        DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
241        DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
242            108 [(module) = "docsui"];
243        DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
244        DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
245        DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
246        DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
247        WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
248        WifiRunningStateChanged wifi_running_state_changed = 114
249                [(module) = "framework", deprecated = true];
250        AppCompacted app_compacted = 115 [(module) = "framework"];
251        NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
252        DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
253            117 [(module) = "docsui"];
254        DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
255        DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
256        DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
257        DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
258        RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
259        SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
260        GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
261        BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
262                125 [(module) = "bluetooth"];
263        BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
264                126 [(module) = "bluetooth"];
265        BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
266                127 [(module) = "bluetooth"];
267        AppDowngraded app_downgraded = 128 [(module) = "framework"];
268        AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
269        LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
270        GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
271        GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
272        UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
273        NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
274        NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
275        NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
276        NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
277        NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
278        NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
279        SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
280        SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
281        BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
282                142 [(module) = "framework"];
283        AttentionManagerServiceResultReported attention_manager_service_result_reported =
284                143 [(module) = "framework"];
285        AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
286        SpeechDspStatReported speech_dsp_stat_reported = 145;
287        UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
288        WatchdogRollbackOccurred watchdog_rollback_occurred =
289                147 [(module) = "framework", (module) = "statsd"];
290        BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
291                148 [(module) = "framework"];
292        BubbleUIChanged bubble_ui_changed = 149 [(module) = "framework"];
293        ScheduledJobConstraintChanged scheduled_job_constraint_changed =
294                150 [(module) = "framework"];
295        BluetoothActiveDeviceChanged bluetooth_active_device_changed =
296                151 [(module) = "bluetooth"];
297        BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
298                152 [(module) = "bluetooth"];
299        BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
300                153 [(module) = "bluetooth"];
301        BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
302                154 [(module) = "bluetooth"];
303        BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
304                155 [(module) = "bluetooth"];
305        BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
306                156 [(module) = "bluetooth"];
307        BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
308                157 [(module) = "bluetooth"];
309        BluetoothDeviceFailedContactCounterReported
310                bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
311        BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
312                159 [(module) = "bluetooth"];
313        BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
314                160 [(module) = "bluetooth"];
315        BluetoothQualityReportReported bluetooth_quality_report_reported =
316                161 [(module) = "bluetooth"];
317        BluetoothDeviceInfoReported bluetooth_device_info_reported =
318                162 [(module) = "bluetooth"];
319        BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
320                163 [(module) = "bluetooth"];
321        BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
322                164 [(module) = "bluetooth"];
323        BluetoothBondStateChanged bluetooth_bond_state_changed =
324                165 [(module) = "bluetooth"];
325        BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
326                166 [(module) = "bluetooth"];
327        BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
328                167 [(module) = "bluetooth"];
329        ScreenTimeoutExtensionReported screen_timeout_extension_reported =
330                168 [(module) = "framework"];
331        ProcessStartTime process_start_time = 169 [(module) = "framework"];
332        PermissionGrantRequestResultReported permission_grant_request_result_reported =
333                170 [(module) = "permissioncontroller"];
334        BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed =
335                171 [(module) = "bluetooth"];
336        DeviceIdentifierAccessDenied device_identifier_access_denied =
337                172 [(module) = "telephony_common"];
338        BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
339        AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
340        AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
341        AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
342        TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
343        HiddenApiUsed hidden_api_used = 178 [(module) = "framework"];
344        StyleUIChanged style_ui_changed = 179 [(module) = "sysui", (module) = "wallpaper"];
345        PrivacyIndicatorsInteracted privacy_indicators_interacted =
346                180 [(module) = "permissioncontroller"];
347        AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
348                181 [(module) = "framework"];
349        NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
350        AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
351        BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
352        SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
353        TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
354        BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
355                187 [(module) = "bluetooth"];
356        IntelligenceEventReported intelligence_event_reported =
357                188 [(module) = "intelligence"];
358        ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
359                189 [(module) = "framework"];
360        RoleRequestResultReported role_request_result_reported =
361                190 [(module) = "permissioncontroller"];
362        MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
363        MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
364        MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
365        MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
366        MediametricsCodecReported mediametrics_codec_reported = 195;
367        MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
368        MediametricsExtractorReported mediametrics_extractor_reported = 197;
369        MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
370        MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
371        MediametricsRecorderReported mediametrics_recorder_reported = 200;
372        MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
373        CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
374        GarageModeInfo garage_mode_info = 204 [(module) = "car"];
375        TestAtomReported test_atom_reported = 205
376            [(module) = "cts", (module) = "statsdtest"];
377        ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
378                206 [(module) = "framework"];
379        ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
380        ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
381        ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
382        LocationManagerApiUsageReported location_manager_api_usage_reported =
383                210 [(module) = "framework"];
384        ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
385                211 [(module) = "permissioncontroller"];
386        RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
387                212 [(module) = "permissioncontroller"];
388        GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
389                213 [(module) = "permissioncontroller"];
390        LocationAccessCheckNotificationAction location_access_check_notification_action =
391                214 [(module) = "permissioncontroller"];
392        AppPermissionFragmentActionReported app_permission_fragment_action_reported =
393                215 [(module) = "permissioncontroller"];
394        AppPermissionFragmentViewed app_permission_fragment_viewed =
395                216 [(module) = "permissioncontroller"];
396        AppPermissionsFragmentViewed app_permissions_fragment_viewed =
397                217 [(module) = "permissioncontroller"];
398        PermissionAppsFragmentViewed permission_apps_fragment_viewed =
399                218  [(module) = "permissioncontroller"];
400        TextSelectionEvent text_selection_event = 219  [(module) = "textclassifier"];
401        TextLinkifyEvent text_linkify_event = 220  [(module) = "textclassifier"];
402        ConversationActionsEvent conversation_actions_event = 221  [(module) = "textclassifier"];
403        LanguageDetectionEvent language_detection_event = 222  [(module) = "textclassifier"];
404        ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
405        BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
406        UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
407        UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
408        CameraActionEvent camera_action_event = 227 [(module) = "framework"];
409        AppCompatibilityChangeReported app_compatibility_change_reported =
410                228 [(module) = "framework"];
411        PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
412        VmsClientConnectionStateChanged vms_client_connection_state_changed =
413                230 [(module) = "car"];
414        MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
415        MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
416        MediaProviderPermissionRequested media_provider_permission_requested =
417            235 [(module) = "mediaprovider"];
418        MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
419        MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
420            237 [(module) = "mediaprovider"];
421        RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
422        BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
423        BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
424                240 [(module) = "framework"];
425        BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
426        BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
427        UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
428        NotificationReported notification_reported = 244 [(module) = "framework"];
429        NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
430        NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
431        IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
432        IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
433        CellBroadcastMessageReported cb_message_reported =
434            249 [(module) = "cellbroadcast"];
435        CellBroadcastMessageError cb_message_error =
436            250 [(module) = "cellbroadcast"];
437        WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
438        WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
439        WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
440        AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
441        SnapshotMergeReported snapshot_merge_reported = 255;
442        ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
443            256  [(module) = "framework"];
444        // DisplayJankReported was deprecated in Android 12+
445        DisplayJankReported display_jank_reported = 257 [deprecated = true];
446        AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
447        SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
448        RankingSelected ranking_selected = 260 [
449            (module) = "framework",
450            (module) = "sysui",
451            (module) = "mediaprovider"
452        ];
453        TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
454        LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
455        PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
456        UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
457        UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
458        AccessibilityShortcutReported accessibility_shortcut_reported =
459            266 [(module) = "framework"];
460        AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
461        DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
462        AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
463        AutoRevokeNotificationClicked auto_revoke_notification_clicked =
464            270 [(module) = "permissioncontroller"];
465        AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
466            271 [(module) = "permissioncontroller"];
467        AutoRevokedAppInteraction auto_revoked_app_interaction =
468            272 [(module) = "permissioncontroller", (module) = "settings"];
469        AppPermissionGroupsFragmentAutoRevokeAction
470            app_permission_groups_fragment_auto_revoke_action =
471            273 [(module) = "permissioncontroller"];
472        EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
473        AudioPowerUsageDataReported audio_power_usage_data_reported = 275;
474        TvTunerStateChanged tv_tuner_state_changed = 276 [(module) = "framework"];
475        MediaOutputOpSwitchReported mediaoutput_op_switch_reported =
476            277 [(module) = "sysui"];
477        CellBroadcastMessageFiltered cb_message_filtered =
478            278 [(module) = "cellbroadcast"];
479        TvTunerDvrStatus tv_tuner_dvr_status = 279 [(module) = "framework"];
480        TvCasSessionOpenStatus tv_cas_session_open_status =
481            280 [(module) = "framework"];
482        AssistantInvocationReported assistant_invocation_reported = 281 [(module) = "framework"];
483        DisplayWakeReported display_wake_reported = 282 [(module) = "framework"];
484        CarUserHalModifyUserRequestReported car_user_hal_modify_user_request_reported =
485            283 [(module) = "car"];
486        CarUserHalModifyUserResponseReported car_user_hal_modify_user_response_reported =
487            284 [(module) = "car"];
488        CarUserHalPostSwitchResponseReported car_user_hal_post_switch_response_reported =
489            285 [(module) = "car"];
490        CarUserHalInitialUserInfoRequestReported car_user_hal_initial_user_info_request_reported =
491            286 [(module) = "car"];
492        CarUserHalInitialUserInfoResponseReported car_user_hal_initial_user_info_response_reported =
493            287 [(module) = "car"];
494        CarUserHalUserAssociationRequestReported car_user_hal_user_association_request_reported =
495            288 [(module) = "car"];
496        CarUserHalSetUserAssociationResponseReported car_user_hal_set_user_association_response_reported =
497            289 [(module) = "car"];
498        NetworkIpProvisioningReported network_ip_provisioning_reported =
499            290 [(module) = "network_stack"];
500        NetworkDhcpRenewReported network_dhcp_renew_reported = 291 [(module) = "network_stack"];
501        NetworkValidationReported network_validation_reported = 292 [(module) = "network_stack"];
502        NetworkStackQuirkReported network_stack_quirk_reported = 293 [(module) = "network_stack"];
503        MediametricsAudioRecordDeviceUsageReported mediametrics_audiorecorddeviceusage_reported =
504            294;
505        MediametricsAudioThreadDeviceUsageReported mediametrics_audiothreaddeviceusage_reported =
506            295;
507        MediametricsAudioTrackDeviceUsageReported mediametrics_audiotrackdeviceusage_reported =
508            296;
509        MediametricsAudioDeviceConnectionReported mediametrics_audiodeviceconnection_reported =
510            297;
511        BlobCommitted blob_committed = 298 [(module) = "framework"];
512        BlobLeased blob_leased = 299 [(module) = "framework"];
513        BlobOpened blob_opened = 300 [(module) = "framework"];
514        ContactsProviderStatusReported contacts_provider_status_reported = 301;
515        KeystoreKeyEventReported keystore_key_event_reported = 302;
516        NetworkTetheringReported  network_tethering_reported =
517            303 [(module) = "network_tethering"];
518        ImeTouchReported ime_touch_reported = 304 [(module) = "sysui"];
519        UIInteractionFrameInfoReported ui_interaction_frame_info_reported =
520            305 [(module) = "framework"];
521        UIActionLatencyReported ui_action_latency_reported = 306 [(module) = "framework"];
522        WifiDisconnectReported wifi_disconnect_reported = 307 [(module) = "wifi"];
523        WifiConnectionStateChanged wifi_connection_state_changed = 308 [(module) = "wifi"];
524        HdmiCecActiveSourceChanged hdmi_cec_active_source_changed = 309 [(module) = "framework"];
525        HdmiCecMessageReported hdmi_cec_message_reported = 310 [(module) = "framework"];
526        AirplaneMode airplane_mode = 311 [(module) = "telephony"];
527        ModemRestart modem_restart = 312 [(module) = "telephony"];
528        CarrierIdMismatchReported carrier_id_mismatch_reported = 313 [(module) = "telephony"];
529        CarrierIdTableUpdated carrier_id_table_updated = 314 [(module) = "telephony"];
530        DataStallRecoveryReported data_stall_recovery_reported = 315 [(module) = "telephony"];
531        MediametricsMediaParserReported mediametrics_mediaparser_reported = 316;
532        TlsHandshakeReported tls_handshake_reported = 317 [(module) = "conscrypt"];
533        TextClassifierApiUsageReported text_classifier_api_usage_reported = 318  [(module) = "textclassifier"];
534        CarWatchdogKillStatsReported car_watchdog_kill_stats_reported = 319 [(module) = "car"];
535        MediametricsPlaybackReported mediametrics_playback_reported = 320 [(module) = "media_metrics"];
536        MediaNetworkInfoChanged media_network_info_changed = 321 [(module) = "media_metrics"];
537        MediaPlaybackStateChanged media_playback_state_changed = 322 [(module) = "media_metrics"];
538        MediaPlaybackErrorReported media_playback_error_reported = 323 [(module) = "media_metrics"];
539        MediaPlaybackTrackChanged media_playback_track_changed = 324 [(module) = "media_metrics"];
540        WifiScanReported wifi_scan_reported = 325 [(module) = "wifi"];
541        WifiPnoScanReported wifi_pno_scan_reported = 326  [(module) = "wifi"];
542        TifTuneStateChanged tif_tune_changed = 327 [(module) = "framework"];
543        AutoRotateReported auto_rotate_reported = 328 [(module) = "framework"];
544        PerfettoTrigger perfetto_trigger = 329 [(module) = "perfetto"];
545        TranscodingData transcoding_data = 330 [(module) = "mediaprovider"];
546        ImsServiceEntitlementUpdated ims_service_entitlement_updated = 331 [(module) = "imsentitlement"];
547        ArtDatumReported art_datum_reported = 332 [(module) = "art"];
548        DeviceRotated device_rotated = 333 [(module) = "framework"];
549        SimSpecificSettingsRestored sim_specific_settings_restored = 334
550            [(module) = "telephony"];
551        TextClassifierDownloadReported text_classifier_download_reported = 335 [(module) = "textclassifier"];
552        PinStorageEvent pin_storage_event = 336 [(module) = "telephony"];
553        FaceDownReported face_down_reported = 337 [(module) = "framework"];
554        BluetoothHALCrashReasonReported bluetooth_hal_crash_reason_reported =
555            338 [(module) = "bluetooth"];
556        RebootEscrowPreparationReported reboot_escrow_preparation_reported =
557            339 [(module) = "framework"];
558        RebootEscrowLskfCaptureReported reboot_escrow_lskf_capture_reported =
559            340 [(module) = "framework"];
560        RebootEscrowRebootReported reboot_escrow_reboot_reported = 341 [(module) = "framework"];
561        BinderLatencyReported binder_latency_reported = 342 [(module) = "framework"];
562        MediametricsAAudioStreamReported mediametrics_aaudiostream_reported = 343;
563        MediaTranscodingSessionEnded media_transcoding_session_ended = 344
564            [(module) = "media"];
565        MagnificationUsageReported magnification_usage_reported =
566            345 [(module) = "framework"];
567        MagnificationModeWithImeOnReported magnification_mode_with_ime_on_reported =
568            346 [(module) = "framework"];
569        AppSearchCallStatsReported app_search_call_stats_reported = 347 [(module) = "appsearch"];
570        AppSearchPutDocumentStatsReported app_search_put_document_stats_reported = 348 [(module) = "appsearch"];
571        DeviceControlChanged device_control_changed = 349 [(module) = "sysui"];
572        DeviceStateChanged device_state_changed = 350 [(module) = "framework"];
573        InputDeviceRegistered inputdevice_registered = 351 [(module) = "framework"];
574        SmartSpaceCardReported smartspace_card_reported = 352 [(module) = "sysui"];
575        AuthPromptAuthenticateInvoked auth_prompt_authenticate_invoked = 353 [(module) = "framework"];
576        AuthManagerCanAuthenticateInvoked auth_manager_can_authenticate_invoked = 354 [(module) = "framework"];
577        AuthEnrollActionInvoked auth_enroll_action_invoked = 355 [(module) = "framework"];
578        AuthDeprecatedAPIUsed auth_deprecated_api_used = 356 [(module) = "framework"];
579        UnattendedRebootOccurred unattended_reboot_occurred = 357 [(module) = "scheduling"];
580        LongRebootBlockingReported long_reboot_blocking_reported = 358 [(module) = "scheduling"];
581        LocationTimeZoneProviderStateChanged location_time_zone_provider_state_changed =
582            359 [(module) = "framework"];
583        // 360-363 are reserved.
584        FdtrackEventOccurred fdtrack_event_occurred = 364 [(module) = "framework"];
585        TimeoutAutoExtendedReported timeout_auto_extended_reported = 365
586            [(module) = "framework"];
587        OdrefreshReported odrefresh_reported = 366 [(module) = "art"];
588        AlarmBatchDelivered alarm_batch_delivered = 367 [(module) = "framework"];
589        AlarmScheduled alarm_scheduled = 368 [(module) = "framework"];
590        CarWatchdogIoOveruseStatsReported car_watchdog_io_overuse_stats_reported = 369 [(module) = "car"];
591        UserLevelHibernationStateChanged user_level_hibernation_state_changed = 370 [(module) = "framework"];
592        AppSearchInitializeStatsReported app_search_initialize_stats_reported = 371 [(module) = "appsearch"];
593        AppSearchQueryStatsReported app_search_query_stats_reported = 372 [(module) = "appsearch"];
594        AppProcessDied app_process_died = 373 [(module) = "framework"];
595        NetworkIpReachabilityMonitorReported network_ip_reachability_monitor_reported =
596            374 [(module) = "network_stack"];
597        SlowInputEventReported slow_input_event_reported = 375 [(module) = "input"];
598        ANROccurredProcessingStarted anr_occurred_processing_started = 376 [(module) = "framework"];
599        AppSearchRemoveStatsReported app_search_remove_stats_reported = 377 [(module) = "appsearch"];
600        MediaCodecReported media_codec_reported = 378 [(module) = "framework"];
601        PermissionUsageFragmentInteraction permission_usage_fragment_interaction = 379 [(module) = "permissioncontroller"];
602        PermissionDetailsInteraction permission_details_interaction = 380 [(module) = "permissioncontroller"];
603        PrivacySensorToggleInteraction privacy_sensor_toggle_interaction = 381 [(module) = "framework"];
604        PrivacyToggleDialogInteraction privacy_toggle_dialog_interaction = 382 [(module) = "framework"];
605        AppSearchOptimizeStatsReported app_search_optimize_stats_reported = 383 [(module) = "appsearch"];
606        NonA11yToolServiceWarningReported non_a11y_tool_service_warning_report = 384 [(module) = "framework"];
607        AppSearchSetSchemaStatsReported app_search_set_schema_stats_reported = 385 [(module) = "appsearch"];
608        AppCompatStateChanged app_compat_state_changed = 386 [(module) = "framework"];
609        SizeCompatRestartButtonEventReported size_compat_restart_button_event_reported = 387 [(module) = "framework"];
610        SplitscreenUIChanged splitscreen_ui_changed = 388 [(module) = "framework"];
611        NetworkDnsHandshakeReported network_dns_handshake_reported = 389 [(module) = "resolv"];
612        BluetoothCodePathCounter bluetooth_code_path_counter =
613            390 [(module) = "bluetooth"];
614        BluetoothLeBatchScanReportDelay bluetooth_le_batch_scan_report_delay =
615            392 [(module) = "bluetooth"];
616        AccessibilityFloatingMenuUIChanged accessibility_floating_menu_ui_changed = 393 [(module) = "sysui"];
617        NeuralNetworksCompilationCompleted neuralnetworks_compilation_completed = 394
618            [(module) = "neuralnetworks"];
619        NeuralNetworksExecutionCompleted neuralnetworks_execution_completed = 395
620            [(module) = "neuralnetworks"];
621        NeuralNetworksCompilationFailed neuralnetworks_compilation_failed = 396
622            [(module) = "neuralnetworks"];
623        NeuralNetworksExecutionFailed neuralnetworks_execution_failed = 397
624            [(module) = "neuralnetworks"];
625        ContextHubBooted context_hub_booted = 398 [(module) = "contexthub"];
626        ContextHubRestarted context_hub_restarted = 399 [(module) = "contexthub"];
627        ContextHubLoadedNanoappSnapshotReported context_hub_loaded_nanoapp_snapshot_reported = 400
628            [(module) = "contexthub"];
629        ChreCodeDownloadTransacted chre_code_download_transacted = 401 [(module) = "contexthub"];
630        UwbSessionInitiated uwb_session_inited = 402 [(module) = "uwb"];
631        UwbSessionClosed uwb_session_closed = 403 [(module) = "uwb"];
632        UwbFirstRangingReceived uwb_first_ranging_received = 404 [(module) = "uwb"];
633        UwbRangingMeasurementReceived uwb_ranging_measurement_received = 405 [(module) = "uwb"];
634        TextClassifierDownloadWorkScheduled text_classifier_download_work_scheduled = 406 [(module) = "textclassifier"];
635        TextClassifierDownloadWorkCompleted text_classifier_download_work_completed = 407 [(module) = "textclassifier"];
636        ClipboardCleared clipboard_cleared = 408 [(module) = "framework"];
637        VmCreationRequested vm_creation_requested = 409 [(module) = "virtualizationservice"];
638        NearbyDeviceScanStateChanged nearby_device_scan_state_changed = 410 [(module) = "nearby"];
639        CameraCompatControlEventReported camera_compat_control_event_reported = 411 [(module) = "framework"];
640        ApplicationLocalesChanged application_locales_changed = 412 [(module) = "framework"];
641        MediametricsAudioTrackStatusReported mediametrics_audiotrackstatus_reported = 413;
642        FoldStateDurationReported fold_state_duration_reported = 414 [(module) = "framework"];
643        LocationTimeZoneProviderControllerStateChanged location_time_zone_provider_controller_state_changed =
644            415 [(module) = "framework"];
645        DisplayHbmStateChanged display_hbm_state_changed = 416 [(module) = "framework"];
646        DisplayHbmBrightnessChanged display_hbm_brightness_changed = 417 [(module) = "framework"];
647        PersistentUriPermissionsFlushed persistent_uri_permissions_flushed =
648            418 [(module) = "framework"];
649        EarlyBootCompOsArtifactsCheckReported early_boot_comp_os_artifacts_check_reported = 419 [(module) = "art"];
650        VBMetaDigestReported vbmeta_digest_reported = 420 [(module) = "framework"];
651        ApexInfoGathered apex_info_gathered = 421 [(module) = "framework"];
652        PvmInfoGathered pvm_info_gathered = 422 [(module) = "framework"];
653        WearSettingsUIInteracted wear_settings_ui_interacted = 423 [(module) = "wear_settings"];
654        TracingServiceReportEvent tracing_service_report_event = 424 [(module) = "framework"];
655        MediametricsAudioRecordStatusReported mediametrics_audiorecordstatus_reported = 425;
656        LauncherLatency launcher_latency = 426 [(module) = "sysui"];
657        DropboxEntryDropped dropbox_entry_dropped = 427 [(module) = "framework"];
658        WifiP2pConnectionReported wifi_p2p_connection_reported = 428 [(module) = "wifi"];
659        GameStateChanged game_state_changed = 429 [(module) = "framework"];
660        HotwordDetectorCreateRequested hotword_detector_create_requested = 430
661            [(module) = "framework"];
662        HotwordDetectionServiceInitResultReported hotword_detection_service_init_result_reported = 431
663            [(module) = "framework"];
664        HotwordDetectionServiceRestarted hotword_detection_service_restarted = 432
665            [(module) = "framework"];
666        HotwordDetectorKeyphraseTriggered hotword_detector_keyphrase_triggered = 433
667            [(module) = "framework"];
668        HotwordDetectorEvents hotword_detector_events = 434
669            [(module) = "framework"];
670        // 435, 436 not been used in this branch.
671        BootCompletedBroadcastCompletionLatencyReported boot_completed_broadcast_completion_latency_reported =
672            437 [(module) = "framework"];
673        ContactsIndexerUpdateStatsReported contacts_indexer_update_stats_reported = 440
674            [(module) = "appsearch"];
675        AppBackgroundRestrictionsInfo app_background_restrictions_info = 441
676            [(module) = "framework"];
677        MmsSmsProviderGetThreadIdFailed mms_sms_provider_get_thread_id_failed = 442 [(module) = "telephony"];
678        MmsSmsDatabaseHelperOnUpgradeFailed mms_sms_database_helper_on_upgrade_failed = 443 [(module) = "telephony"];
679        PermissionReminderNotificationInteracted permission_reminder_notification_interacted =
680            444 [(module) = "permissioncontroller"];
681        RecentPermissionDecisionsInteracted recent_permission_decisions_interacted =
682            445 [(module) = "permissioncontroller"];
683        GnssPsdsDownloadReported gnss_psds_download_reported = 446 [(module) = "framework"];
684        LeAudioConnectionSessionReported le_audio_connection_session_reported = 447 [(module) = "bluetooth"];
685        LeAudioBroadcastSessionReported le_audio_broadcast_session_reported = 448 [(module) = "bluetooth"];
686        DreamUiEventReported dream_ui_event_reported = 449 [(module) = "framework"];
687        TaskManagerEventReported task_manager_event_reported = 450 [(module) = "sysui"];
688        CdmAssociationAction cdm_association_action = 451 [(module) = "framework"];
689        MagnificationTripleTapAndHoldActivatedSessionReported magnification_triple_tap_and_hold_activated_session_reported =
690            452 [(module) = "framework"];
691        MagnificationFollowTypingFocusActivatedSessionReported magnification_follow_typing_focus_activated_session_reported =
692            453 [(module) = "framework"];
693        AccessibilityTextReadingOptionsChanged accessibility_text_reading_options_changed = 454 [(module) = "settings"];
694        WifiSetupFailureCrashReported wifi_setup_failure_crash_reported = 455 [(module) = "wifi"];
695        UwbDeviceErrorReported uwb_device_error_reported = 456 [(module) = "uwb"];
696        IsolatedCompilationScheduled isolated_compilation_scheduled = 457 [(module) = "art"];
697        IsolatedCompilationEnded isolated_compilation_ended = 458 [(module) = "art"];
698        OnsOpportunisticEsimProvisioningComplete ons_opportunistic_esim_provisioning_complete = 459 [(module) = "ons"];
699        TelephonyAnomalyDetected telephony_anomaly_detected = 461 [(module) = "telephony"];
700        LetterboxPositionChanged letterbox_position_changed = 462 [(module) = "framework"];
701        RemoteKeyProvisioningAttempt remote_key_provisioning_attempt = 463 [(module) = "remoteprovisioner"];
702        RemoteKeyProvisioningNetworkInfo remote_key_provisioning_network_info = 464 [(module) = "remoteprovisioner"];
703        RemoteKeyProvisioningTiming remote_key_provisioning_timing = 465 [(module) = "remoteprovisioner"];
704        MediaOutputOpInteractionReported mediaoutput_op_interaction_report = 466 [(module) = "sysui"];
705        BackgroundDexoptJobEnded background_dexopt_job_ended = 467 [(module) = "art"];
706        SyncExemptionOccurred sync_exemption_occurred = 468 [(module) = "framework"];
707        AutofillPresentationEventReported autofill_presentation_event_reported = 469 [(module) = "framework"];
708        DockStateChanged dock_state_changed = 470 [(module) = "framework"];
709        BroadcastDeliveryEventReported broadcast_delivery_event_reported =
710                475 [(module) = "framework"];
711        ServiceRequestEventReported service_request_event_reported = 476 [(module) = "framework"];
712        ProviderAcquisitionEventReported provider_acquisition_event_reported =
713                477 [(module) = "framework"];
714        BluetoothDeviceNameReported bluetooth_device_name_reported = 478 [(module) = "bluetooth"];
715        VibrationReported vibration_reported = 487 [(module) = "framework"];
716        // reserved 492
717        DisplayBrightnessChanged display_brightness_changed = 494 [(module) = "framework"];
718        ActivityActionBlocked activity_action_blocked = 495 [(module) = "framework"];
719        AmbientBrightnessStatsReported ambient_brightness_stats_reported = 507 [(module) = "framework"];
720        MediametricsSpatializerCapabilitiesReported mediametrics_spatializercapabilities_reported = 508;
721        MediametricsSpatializerDeviceEnabledReported mediametrics_spatializerdeviceenabled_reported = 509;
722        MediametricsHeadTrackerDeviceEnabledReported mediametrics_headtrackerdeviceenabled_reported = 510;
723        MediametricsHeadTrackerDeviceSupportedReported mediametrics_headtrackerdevicesupported_reported = 511;
724        HearingAidInfoReported hearing_aid_info_reported = 513 [(module) = "framework"];
725        DeviceWideJobConstraintChanged device_wide_job_constraint_changed =
726            514 [(module) = "framework"];
727        IwlanSetupDataCallResultReported iwlan_setup_data_call_result_reported = 519 [(module) = "iwlan"];
728        IwlanPdnDisconnectedReasonReported iwlan_pdn_disconnected_reason_reported = 520 [(module) = "iwlan"];
729        AirplaneModeSessionReported airplane_mode_session_reported = 521 [(module) = "wifi", (module) = "bluetooth"];
730        BluetoothDisconnectionReasonReported bluetooth_disconnection_reason_reported = 529 [(module) = "bluetooth"];
731        BluetoothLocalVersionsReported bluetooth_local_versions_reported = 530 [(module) = "bluetooth"];
732        BluetoothRemoteSupportedFeaturesReported bluetooth_remote_supported_features_reported = 531 [(module) = "bluetooth"];
733        BluetoothLocalSupportedFeaturesReported bluetooth_local_supported_features_reported = 532 [(module) = "bluetooth"];
734        BluetoothGattAppInfo bluetooth_gatt_app_info = 533 [(module) = "bluetooth"];
735        LauncherImpressionEvent launcher_impression_event = 547 [(module) = "sysui"];
736        BrightnessConfigurationUpdated brightness_configuration_updated = 534 [(module) = "framework"];
737        PerformanceHintSessionReported performance_hint_session_reported = 574 [(module) = "framework"];
738        HotwordAudioEgressEventReported hotword_audio_egress_event_reported = 578 [(module) = "framework"];
739        // StatsdStats tracks platform atoms with ids upto 750.
740        // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
741    }
742
743    // Pushed atom extensions.
744    // The atom definitions are under atoms/<feature>/<feature>_extension_atoms.proto
745    extensions 613; // BluetoothHashedDeviceNameReported bluetooth_hashed_device_name_reported
746    extensions 614; // BluetoothL2capCocClientConnection bluetooth_l2cap_coc_client_connection
747    extensions 615; // BluetoothL2capCocServerConnection bluetooth_l2cap_coc_server_connection
748    extensions 631; // FullScreenIntentLaunched full_screen_intent_launched
749    extensions 632; // BalAllowed bal_allowed
750    extensions 656; // BluetoothLeSessionConnected bluetooth_le_session_connected
751    extensions 9999; // Atom9999 atom_9999
752
753    // Pulled events will start at field 10000.
754    // Next: 10175
755    oneof pulled {
756        WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
757        WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
758        MobileBytesTransfer mobile_bytes_transfer =
759                10002 [(module) = "framework", (truncate_timestamp) = true];
760        MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
761                10003 [(module) = "framework", (truncate_timestamp) = true];
762        BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
763        KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
764        SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "framework", (module) = "statsdtest"];
765        CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
766        CpuTimePerUidFreq cpu_time_per_uid_freq =
767                10010 [(module) = "framework", (module) = "statsd"];
768        WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
769        ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
770        BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
771        ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
772        SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
773        SystemUptime system_uptime = 10015 [(module) = "framework"];
774        CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
775        CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
776        DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
777        RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
778        FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
779        Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
780        BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
781        BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
782        LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
783        DiskStats disk_stats = 10025 [(module) = "framework"];
784        DirectoryUsage directory_usage = 10026 [(module) = "framework"];
785        AppSize app_size = 10027 [(module) = "framework"];
786        CategorySize category_size = 10028 [(module) = "framework"];
787        ProcStats proc_stats = 10029 [(module) = "framework"];
788        BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
789        NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
790        DiskIo disk_io = 10032 [(module) = "framework"];
791        PowerProfile power_profile = 10033 [(module) = "framework"];
792        ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
793        ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
794        CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
795        OnDevicePowerMeasurement on_device_power_measurement = 10038 [(module) = "framework"];
796        DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
797        ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
798        BatteryLevel battery_level = 10043 [(module) = "framework"];
799        BuildInformation build_information = 10044 [(module) = "framework"];
800        BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
801        DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
802        DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
803        NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
804        RoleHolder role_holder = 10049 [(module) = "framework"];
805        DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
806        TrainInfo train_info = 10051 [(module) = "statsd"];
807        TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
808        ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
809        GpuStatsGlobalInfo gpu_stats_global_info = 10054;
810        GpuStatsAppInfo gpu_stats_app_info = 10055;
811        SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
812        AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
813        FaceSettings face_settings = 10058 [(module) = "framework"];
814        CoolingDevice cooling_device = 10059 [(module) = "framework"];
815        AppOps app_ops = 10060 [(module) = "framework"];
816        ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
817        SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
818        SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
819        ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
820        VmsClientStats vms_client_stats = 10065 [(module) = "car"];
821        NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
822        DangerousPermissionStateSampled dangerous_permission_state_sampled =
823                10067 [(module) = "framework"];
824        GraphicsStats graphics_stats = 10068 [(module) = "hwui"];
825        RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
826        IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
827        PackageNotificationPreferences package_notification_preferences =
828                10071 [(module) = "framework"];
829        PackageNotificationChannelPreferences package_notification_channel_preferences =
830                10072 [(module) = "framework"];
831        PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
832                10073 [(module) = "framework"];
833        GnssStats gnss_stats = 10074 [(module) = "framework"];
834        AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
835        VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
836        VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
837        SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
838        SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
839        SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
840        BlobInfo blob_info = 10081 [(module) = "framework"];
841        DataUsageBytesTransfer data_usage_bytes_transfer =
842                10082 [(module) = "framework", (truncate_timestamp) = true];
843        BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
844                10083 [(module) = "framework", (truncate_timestamp) = true];
845        DNDModeProto dnd_mode_rule = 10084 [(module) = "framework"];
846        GeneralExternalStorageAccessStats general_external_storage_access_stats =
847            10085 [(module) = "mediaprovider"];
848        IncomingSms incoming_sms = 10086 [(module) = "telephony"];
849        OutgoingSms outgoing_sms = 10087 [(module) = "telephony"];
850        CarrierIdTableVersion carrier_id_table_version = 10088 [(module) = "telephony"];
851        DataCallSession data_call_session = 10089 [(module) = "telephony"];
852        CellularServiceState cellular_service_state = 10090 [(module) = "telephony"];
853        CellularDataServiceSwitch cellular_data_service_switch = 10091 [(module) = "telephony"];
854        SystemMemory system_memory = 10092 [(module) = "framework"];
855        ImsRegistrationTermination ims_registration_termination = 10093 [(module) = "telephony"];
856        ImsRegistrationStats ims_registration_stats = 10094 [(module) = "telephony"];
857        CpuTimePerClusterFreq cpu_time_per_cluster_freq = 10095 [(module) = "framework"];
858        CpuCyclesPerUidCluster cpu_cycles_per_uid_cluster = 10096 [(module) = "framework"];
859        DeviceRotatedData device_rotated_data = 10097 [(module) = "framework"];
860        CpuCyclesPerThreadGroupCluster cpu_cycles_per_thread_group_cluster = 10098 [(module) = "framework"];
861        MediaDrmActivityInfo media_drm_activity_info = 10099;
862        OemManagedBytesTransfer oem_managed_bytes_transfer = 10100 [(module) = "framework"];
863        GnssPowerStats gnss_power_stats = 10101 [(module) = "framework"];
864        TimeZoneDetectorState time_zone_detector_state = 10102 [(module) = "framework"];
865        Keystore2StorageStats keystore2_storage_stats = 10103 [(module) = "framework"];
866        RkpPoolStats rkp_pool_stats = 10104 [(module) = "framework"];
867        ProcessDmabufMemory process_dmabuf_memory = 10105 [(module) = "framework"];
868        PendingAlarmInfo pending_alarm_info = 10106 [(module) = "framework"];
869        UserLevelHibernatedApps user_level_hibernated_apps = 10107 [(module) = "framework"];
870        LauncherLayoutSnapshot launcher_layout_snapshot = 10108
871            [(module) = "sysui"];
872        GlobalHibernatedApps global_hibernated_apps = 10109 [(module) = "framework"];
873        InputEventLatencySketch input_event_latency_sketch = 10110 [(module) = "input"];
874        BatteryUsageStatsBeforeReset battery_usage_stats_before_reset =
875            10111 [(module) = "framework"];
876        BatteryUsageStatsSinceReset battery_usage_stats_since_reset =
877            10112 [(module) = "framework"];
878        BatteryUsageStatsSinceResetUsingPowerProfileModel
879            battery_usage_stats_since_reset_using_power_profile_model =
880            10113 [(module) = "framework"];
881        InstalledIncrementalPackage installed_incremental_package = 10114 [(module) = "framework"];
882        TelephonyNetworkRequests telephony_network_requests =
883            10115 [(module) = "telephony", deprecated = true];
884        AppSearchStorageInfo app_search_storage_info = 10116 [(module) = "appsearch"];
885        VmStat vmstat = 10117 [(module) = "framework"];
886        Keystore2KeyCreationWithGeneralInfo keystore2_key_creation_with_general_info =
887                10118 [(module) = "framework"];
888        Keystore2KeyCreationWithAuthInfo keystore2_key_creation_with_auth_info =
889                10119 [(module) = "framework"];
890        Keystore2KeyCreationWithPurposeAndModesInfo
891                keystore2_key_creation_with_purpose_and_modes_info = 10120 [(module) = "framework"];
892        Keystore2AtomWithOverflow keystore2_atom_with_overflow = 10121 [(module) = "framework"];
893        Keystore2KeyOperationWithPurposeAndModesInfo
894                keystore2_key_operation_with_purpose_and_modes_info =
895                        10122 [(module) = "framework"];
896        Keystore2KeyOperationWithGeneralInfo keystore2_key_operation_with_general_info =
897                10123 [(module) = "framework"];
898        RkpErrorStats rkp_error_stats = 10124 [(module) = "framework"];
899        Keystore2CrashStats keystore2_crash_stats = 10125 [(module) = "framework"];
900        VendorApexInfo vendor_apex_info = 10126 [(module) = "framework"];
901        AccessibilityShortcutStats accessibility_shortcut_stats = 10127 [(module) = "framework"];
902        AccessibilityFloatingMenuStats accessibility_floating_menu_stats =
903            10128 [(module) = "framework"];
904        DataUsageBytesTransferV2 data_usage_bytes_transfer_v2 = 10129 [(module) = "framework",
905                (truncate_timestamp) = true];
906        MediaCapabilities media_capabilities = 10130 [(module) = "framework"];
907        CarWatchdogSystemIoUsageSummary car_watchdog_system_io_usage_summary =
908            10131 [(module) = "car"];
909        CarWatchdogUidIoUsageSummary car_watchdog_uid_io_usage_summary = 10132 [(module) = "car"];
910        ImsRegistrationFeatureTagStats ims_registration_feature_tag_stats =
911                10133 [(module) = "telephony"];
912        RcsClientProvisioningStats rcs_client_provisioning_stats =
913                10134 [(module) = "telephony"];
914        RcsAcsProvisioningStats rcs_acs_provisioning_stats =
915                10135 [(module) = "telephony"];
916        SipDelegateStats sip_delegate_stats = 10136 [(module) = "telephony"];
917        SipTransportFeatureTagStats sip_transport_feature_tag_stats =
918                10137 [(module) = "telephony"];
919        SipMessageResponse sip_message_response = 10138 [(module) = "telephony"];
920        SipTransportSession sip_transport_session = 10139 [(module) = "telephony"];
921        ImsDedicatedBearerListenerEvent ims_dedicated_bearer_listener_event =
922                10140 [(module) = "telephony"];
923        ImsDedicatedBearerEvent ims_dedicated_bearer_event = 10141 [(module) = "telephony"];
924        ImsRegistrationServiceDescStats ims_registration_service_desc_stats =
925                10142 [(module) = "telephony"];
926        UceEventStats uce_event_stats = 10143 [(module) = "telephony"];
927        PresenceNotifyEvent presence_notify_event = 10144 [(module) = "telephony"];
928        GbaEvent gba_event = 10145 [(module) = "telephony"];
929        PerSimStatus per_sim_status = 10146 [(module) = "telephony"];
930        GpuWorkPerUid gpu_work_per_uid = 10147;
931        PersistentUriPermissionsAmountPerPackage persistent_uri_permissions_amount_per_package =
932            10148 [(module) = "framework"];
933        SignedPartitionInfo signed_partition_info = 10149 [(module) = "framework"];
934        PinnedFileSizesPerPackage pinned_file_sizes_per_package = 10150
935            [(module) = "framework"];
936        PendingIntentsPerPackage pending_intents_per_package = 10151
937            [(module) = "framework"];
938        UserInfo user_info = 10152 [(module) = "framework"];
939        TelephonyNetworkRequestsV2 telephony_network_requests_v2 = 10153 [(module) = "telephony"];
940        DeviceTelephonyProperties device_telephony_properties = 10154 [(module) = "telephony"];
941        RemoteKeyProvisioningErrorCounts remote_key_provisioning_error_counts = 10155 [(module) = "remoteprovisioner"];
942        IncomingMms incoming_mms = 10157 [(module) = "mms"];
943        OutgoingMms outgoing_mms = 10158 [(module) = "mms"];
944        MultiUserInfo multi_user_info = 10160 [(module) = "framework"];
945        ProcessState process_state = 10171 [(module) = "framework"];
946        ProcessAssociation process_association = 10172 [(module) = "framework"];
947        ADPFSystemComponentInfo adpf_system_component_info = 10173 [(module) = "framework"];
948        NotificationMemoryUse notification_memory_use = 10174 [(module) = "sysui"];
949    }
950
951    // DO NOT USE field numbers above 100,000 in AOSP.
952    // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
953    // Field numbers 200,000 and above are reserved for future use; do not use them at all.
954    reserved 83, 360 to 363, 492, 10008, 10036, 10040, 10041;
955}
956
957/**
958 * This proto represents a node of an attribution chain.
959 * Note: All attribution chains are represented as a repeated field of type
960 * AttributionNode. It is understood that in such arrays, the order is that
961 * of calls, that is [A, B, C] if A calls B that calls C.
962 */
963message AttributionNode {
964    // The uid for a given element in the attribution chain.
965    optional int32 uid = 1;
966
967    // The (optional) string tag for an element in the attribution chain. If the
968    // element has no tag, it is encoded as an empty string.
969    optional string tag = 2;
970}
971
972
973/*
974 * *****************************************************************************
975 * Below are all of the individual atoms that are logged by Android via statsd.
976 *
977 * RULES:
978 *   - The field ids for each atom must start at 1, and count upwards by 1.
979 *     Skipping field ids is not allowed.
980 *   - These form an API, so renaming, renumbering or removing fields is
981 *     not allowed between android releases.  (This is not currently enforced,
982 *     but there will be a tool to enforce this restriction).
983 *   - The types must be built-in protocol buffer types, namely, no sub-messages
984 *     are allowed (yet).  The bytes type is also not allowed.
985 *   - The CamelCase name of the message type should match the
986 *     underscore_separated name as defined in Atom.
987 *   - If an atom represents work that can be attributed to an app, there can
988 *     be exactly one AttributionChain field. It must be field number 1.
989 *   - A field that is a uid should be a string field, tagged with the [xxx]
990 *     annotation. The generated code on android will be represented by UIDs,
991 *     and those UIDs will be translated in xxx to those strings.
992 *
993 * CONVENTIONS:
994 *   - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
995 *   - If there is a UID, it goes first. Think in an object-oriented fashion.
996 * *****************************************************************************
997 */
998
999/**
1000 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
1001 * Logs when the Thermal service HAL notifies the throttling start/stop events.
1002 *
1003 * Logged from:
1004 *   frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
1005 */
1006message ThermalThrottlingStateChanged {
1007    // The type of temperature being reported (CPU, GPU, SKIN, etc)
1008    optional android.os.TemperatureTypeEnum sensor_type = 1;
1009
1010    // Throttling state, this field is DEPRECATED
1011    enum State {
1012        UNKNOWN = 0;
1013        START = 1; // START indicated that throttling was triggered.
1014        STOP = 2; // STOP indicates that throttling was cleared.
1015    }
1016    optional State state = 2;
1017
1018    optional float temperature = 3;
1019}
1020
1021/**
1022 * Track transcoding service usage
1023 * Logged from:
1024 *   packages/providers/MediaProvider/src/com/android/providers/media/TranscodeHelper.java
1025 * Next Tag: 14
1026 */
1027message TranscodingData {
1028    // Reason that leads to the type of access.
1029    enum AccessReason {
1030        UNKNOWN = 0;
1031        SYSTEM_DEFAULT = 1; // Default option
1032        SYSTEM_CONFIG = 2;  // Server-side/on-device config
1033        APP_MANIFEST = 3;  // media_capabilites.xml
1034        APP_COMPAT = 4;   // App compat framework
1035        APP_EXTRA = 5;   // ApplicationMediaCapabilities API in open()
1036    }
1037
1038    // Causes that leads to the failure of transcode.
1039    enum FailureCause {
1040        CAUSE_UNKNOWN = 0;
1041        TRANSCODING_SERVICE_ERROR = 1;     // Error from transcoding service.
1042        TRANSCODING_CLIENT_TIMEOUT = 2;    // Timeout from MediaProvider.
1043        TRANSCODING_SESSION_CANCELED = 3; // MediaProvider cancels the transcode.
1044    }
1045
1046    enum AccessType {
1047        HEVC_WRITE = 1;
1048        READ_DIRECT = 2;
1049        READ_CACHE = 3;
1050        READ_TRANSCODE = 4;
1051        WRITE_CACHE = 5; // App trying to write to transcodeid avc file in cache, this is rare.
1052        AVC_WRITE = 6;
1053    }
1054
1055    enum Result {
1056        SUCCESS = 0;
1057        FAIL = 1;
1058        UNDEFINED = 2;
1059    }
1060
1061    optional string requestor_package = 1;
1062    optional AccessType access_type = 2;
1063    optional int64 file_size_bytes = 3;
1064    optional Result transcode_result = 4;
1065    optional int64 transcode_duration_millis = 5; // The duration of transcoding.
1066    optional int64 file_duration_millis = 6; // The duration of the video file.
1067    optional int64 file_framerate_fps = 7; // The framerate of the video file.
1068    optional AccessReason access_reason = 8;
1069    optional int64 width = 9;
1070    optional int64 height = 10;
1071    optional bool hit_anr = 11;
1072    optional FailureCause failure_cause = 12;   // This field is valid only when fails.
1073    optional int64 transcoding_service_error_code = 13; // Error code from transcoding service.
1074}
1075
1076/**
1077 * Logs when the screen state changes.
1078 *
1079 * Logged from:
1080 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1081 */
1082message ScreenStateChanged {
1083    // New screen state, from frameworks/proto_logging/stats/enums/view/enums.proto.
1084    optional android.view.DisplayStateEnum state = 1
1085            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
1086}
1087
1088/**
1089 * Part of the go/activity-security project. Logs information about activity
1090 * starts which would be blocked as part of the project.
1091 *
1092 * Logged from:
1093 *  - frameworks/base/services/core/java/com/android/server/wm/ActivityStarter.java
1094 */
1095message ActivityActionBlocked {
1096    optional int32 caller_uid = 1 [(is_uid) = true];
1097    optional string caller_activity_class_name = 2;
1098    optional int32 target_task_top_activity_uid = 3 [(is_uid) = true];
1099    optional string target_task_top_activity_class_name = 4;
1100    optional bool target_task_is_different = 5;
1101    optional int32 target_activity_uid = 6 [(is_uid) = true];
1102    optional string target_activity_class_name = 7;
1103    optional string target_intent_action = 8;
1104    optional int32 target_intent_flags = 9;
1105}
1106
1107/**
1108 * Logs that the process state of the uid, as determined by ActivityManager
1109 * (i.e. the highest process state of that uid's processes) has changed.
1110 *
1111 * Logged from:
1112 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1113 */
1114message UidProcessStateChanged {
1115    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
1116
1117    // The state, from frameworks/proto_logging/stats/enums/app/enums.proto.
1118    optional android.app.ProcessStateEnum state = 2
1119            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
1120}
1121
1122/**
1123 * Logs process state change of a process, as per the activity manager.
1124 *
1125 * Logged from:
1126 *   frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
1127 */
1128message ProcessStateChanged {
1129    optional int32 uid = 1;
1130    optional string process_name = 2;
1131    optional string package_name = 3;
1132    // TODO: remove this when validation is done
1133    optional int64 version = 5;
1134    // The state, from frameworks/proto_logging/stats/enums/app/enums.proto.
1135    optional android.app.ProcessStateEnum state = 4;
1136}
1137
1138/**
1139 * Logs how long a process was in each of the states.
1140 */
1141message ProcessState {
1142  optional int32 uid = 1 [(is_uid) = true];
1143  optional string process_name = 2;
1144
1145  // Measurement period. Can be used as denominator.
1146  // The gauge duration is not representative because we want uptime and also
1147  // the measurement usually ends at a time earlier than pull time.
1148  optional int32 measurement_start_uptime_seconds = 3;
1149  optional int32 measurement_end_uptime_seconds = 4;
1150  optional int32 measurement_duration_uptime_seconds = 5;
1151
1152  // Individual state breakdowns, summing up to total process runtime.
1153  // Flattening (instead of a dimensions - value pair) for two reasons:
1154  // 1. Makes metric filtering possible (can pull the entire process data based
1155  //    on a specific value.
1156  // 2. More efficient to encode (proto id serves as dimension).
1157  optional int32 top_seconds = 6;
1158  optional int32 fgs_seconds = 7;
1159  optional int32 bound_top_seconds = 8;
1160  optional int32 bound_fgs_seconds = 9;
1161  optional int32 important_foreground_seconds = 10;
1162  optional int32 cached_seconds = 11;
1163  optional int32 frozen_seconds = 12;
1164  optional int32 other_seconds = 13;
1165}
1166
1167/**
1168 * Logs association between processes.
1169 */
1170message ProcessAssociation {
1171  optional int32 client_uid = 1 [(is_uid) = true];
1172
1173  // If we only care about the package name name we do not need to upload this
1174  // (even though we should add it to the atom for filtering / sharding)
1175  optional string client_process = 2;
1176
1177  optional int32 service_uid = 3 [(is_uid) = true];
1178
1179  optional string service_name = 4;
1180
1181  optional string service_process = 10;
1182
1183  // Measurement period. Can be used as denominator.
1184  // The gauge duration is not representative because we want uptime and also
1185  // the measurement usually ends at a time earlier than pull time.
1186  optional int32 measurement_start_uptime_seconds = 5;
1187  optional int32 measurement_end_uptime_seconds = 6;
1188  optional int32 measurement_duration_uptime_seconds = 7;
1189
1190  optional int32 duration_seconds = 8;
1191
1192  // Number of times this association was established.
1193  optional int32 count = 9;
1194}
1195
1196/**
1197 * Logs when ActivityManagerService sleep state is changed.
1198 *
1199 * Logged from:
1200 *   frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
1201 */
1202message ActivityManagerSleepStateChanged {
1203    // TODO: import frameworks proto
1204    enum State {
1205        UNKNOWN = 0;
1206        ASLEEP = 1;
1207        AWAKE = 2;
1208    }
1209    optional State state = 1
1210            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
1211}
1212
1213/**
1214 * Logs when system memory state changes.
1215 *
1216 * Logged from:
1217 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1218 */
1219message MemoryFactorStateChanged {
1220    // TODO: import frameworks proto
1221    enum State {
1222        MEMORY_UNKNOWN = 0;
1223        NORMAL = 1;     // normal.
1224        MODERATE = 2;   // moderate memory pressure.
1225        LOW = 3;        // low memory.
1226        CRITICAL = 4;   // critical memory.
1227
1228    }
1229    optional State factor = 1 [(state_field_option).exclusive_state = true];
1230}
1231
1232/**
1233 * Logs when app is using too much cpu, according to ActivityManagerService.
1234 *
1235 * Logged from:
1236 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1237 */
1238message ExcessiveCpuUsageReported {
1239    optional int32 uid = 1;
1240    optional string process_name = 2;
1241    optional string package_name = 3;
1242    // package version. TODO: remove this when validation is done
1243    optional int64 version = 4;
1244}
1245
1246/**
1247 * Logs when a cached process is killed, along with its pss.
1248 *
1249 * Logged from:
1250 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1251 */
1252message CachedKillReported {
1253    optional int32 uid = 1;
1254    optional string process_name = 2;
1255    optional string package_name = 3;
1256    // TODO: remove this when validation is done
1257    optional int64 version = 5;
1258    optional int64 pss = 4;
1259}
1260
1261/**
1262 * Logs the change in wifi health.
1263 *
1264 * Logged from:
1265 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
1266 */
1267message WifiHealthStatReported {
1268    enum Band {
1269        UNKNOWN = 0;
1270        // All of 2.4GHz band
1271        BAND_2G = 1;
1272        // Frequencies in the range of [5150, 5250) GHz
1273        BAND_5G_LOW = 2;
1274        // Frequencies in the range of [5250, 5725) GHz
1275        BAND_5G_MIDDLE = 3;
1276        // Frequencies in the range of [5725, 5850) GHz
1277        BAND_5G_HIGH = 4;
1278        // Frequencies in the range of [5925, 6425) GHz
1279        BAND_6G_LOW = 5;
1280        // Frequencies in the range of [6425, 6875) GHz
1281        BAND_6G_MIDDLE = 6;
1282        // Frequencies in the range of [6875, 7125) GHz
1283        BAND_6G_HIGH = 7;
1284    }
1285    // duration this stat is obtained over in milliseconds
1286    optional int32 duration_millis = 1;
1287    // whether wifi is classified as sufficient for the user's data traffic, determined
1288    // by whether the calculated throughput exceeds the average demand within |duration_millis|
1289    optional bool is_sufficient = 2;
1290    // whether cellular data is available
1291    optional bool is_cell_data_available = 3;
1292    // the Band bucket the connected network is on
1293    optional Band band = 4;
1294}
1295
1296/**
1297 * Logged when wifi detects a significant change in connection failure rate.
1298 *
1299 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
1300 *
1301 */
1302message WifiFailureStatReported {
1303    enum AbnormalityType {
1304        UNKNOWN = 0;
1305        SIGNIFICANT_INCREASE = 1;
1306        SIGNIFICANT_DECREASE = 2;
1307        SIMPLY_HIGH = 3;
1308    }
1309    enum FailureType {
1310        FAILURE_UNKNOWN = 0;
1311        FAILURE_CONNECTION = 1;
1312        FAILURE_ASSOCIATION_REJECTION = 2;
1313        FAILURE_ASSOCIATION_TIMEOUT = 3;
1314        FAILURE_AUTHENTICATION = 4;
1315        FAILURE_NON_LOCAL_DISCONNECTION = 5;
1316        FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
1317    }
1318    // Reason for uploading this stat
1319    optional AbnormalityType abnormality_type = 1;
1320    // The particular type of failure
1321    optional FailureType failure_type = 2;
1322    // How many times we have encountered this combination of AbnormalityType and FailureType
1323    optional int32 failure_count = 3;
1324}
1325
1326/**
1327 * Logs whether a Wifi connection attempt was successful and reasons for failure if it wasn't.
1328 *
1329 * Logged from:
1330 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
1331 */
1332message WifiConnectionResultReported {
1333    enum FailureCode {
1334        FAILURE_UNKNOWN = 0;
1335        FAILURE_ASSOCIATION_TIMEOUT = 1;
1336        FAILURE_ASSOCIATION_REJECTION = 2;
1337        FAILURE_AUTHENTICATION_GENERAL = 3;
1338        FAILURE_AUTHENTICATION_EAP = 4;
1339        FAILURE_DHCP = 5;
1340        FAILURE_NETWORK_DISCONNECTION = 6;
1341        FAILURE_ROAM_TIMEOUT = 7;
1342        FAILURE_WRONG_PASSWORD = 8;
1343    }
1344
1345    enum Trigger {
1346        UNKNOWN = 0;
1347        // Connection attempt was initiated manually.
1348        MANUAL = 1;
1349        // Automatic reconnection to the same network as connected previously.
1350        RECONNECT_SAME_NETWORK = 2;
1351        // Automatic reconnection to a saved network, but not the previous one.
1352        AUTOCONNECT_CONFIGURED_NETWORK = 3;
1353        // Automatic first connection attempt after device boot.
1354        AUTOCONNECT_BOOT = 4;
1355    }
1356
1357    // True represents a successful connection.
1358    optional bool connection_result = 1;
1359    // Reason for the connection failure.
1360    optional FailureCode failure_code = 2;
1361    // Scan RSSI before the connection attempt.
1362    optional int32 rssi = 3;
1363    // Time taken by this connection attempt.
1364    optional int32 connection_attempt_duration_millis = 4;
1365    // Band bucket the connected network is on.
1366    optional android.net.wifi.WifiBandBucket band = 5;
1367    // Authentication type.
1368    optional android.net.wifi.WifiAuthType auth_type = 6;
1369    // What triggered this connection attempt.
1370    optional Trigger trigger = 7;
1371    // Whether this network was used (successfully connected to) previously.
1372    optional bool network_used = 8;
1373    // Time taken from the last successful connection (or device boot if that's the first one).
1374    optional int32 time_since_last_connection_seconds = 9;
1375}
1376
1377/**
1378 * Logs when a Wifi connection drops.
1379 *
1380 * Logged from:
1381 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
1382 */
1383message WifiDisconnectReported {
1384    enum FailureCode {
1385        UNKNOWN = 0;
1386
1387        // Wifi supplicant failure reason codes (IEEE Std 802.11-2016, 9.4.1.7, Table 9-45).
1388        // See ISupplicantStaIfaceCallback.java:ReasonCode
1389        UNSPECIFIED = 1;
1390        PREV_AUTH_NOT_VALID = 2;
1391        DEAUTH_LEAVING = 3;
1392        DISASSOC_DUE_TO_INACTIVITY = 4;
1393        DISASSOC_AP_BUSY = 5;
1394        CLASS2_FRAME_FROM_NONAUTH_STA = 6;
1395        CLASS3_FRAME_FROM_NONASSOC_STA = 7;
1396        DISASSOC_STA_HAS_LEFT = 8;
1397        STA_REQ_ASSOC_WITHOUT_AUTH = 9;
1398        PWR_CAPABILITY_NOT_VALID = 10;
1399        SUPPORTED_CHANNEL_NOT_VALID = 11;
1400        BSS_TRANSITION_DISASSOC = 12;
1401        INVALID_IE = 13;
1402        MICHAEL_MIC_FAILURE = 14;
1403        FOURWAY_HANDSHAKE_TIMEOUT = 15;
1404        GROUP_KEY_UPDATE_TIMEOUT = 16;
1405        IE_IN_4WAY_DIFFERS = 17;
1406        GROUP_CIPHER_NOT_VALID = 18;
1407        PAIRWISE_CIPHER_NOT_VALID = 19;
1408        AKMP_NOT_VALID = 20;
1409        UNSUPPORTED_RSN_IE_VERSION = 21;
1410        INVALID_RSN_IE_CAPAB = 22;
1411        IEEE_802_1X_AUTH_FAILED = 23;
1412        CIPHER_SUITE_REJECTED = 24;
1413        TDLS_TEARDOWN_UNREACHABLE = 25;
1414        TDLS_TEARDOWN_UNSPECIFIED = 26;
1415        SSP_REQUESTED_DISASSOC = 27;
1416        NO_SSP_ROAMING_AGREEMENT = 28;
1417        BAD_CIPHER_OR_AKM = 29;
1418        NOT_AUTHORIZED_THIS_LOCATION = 30;
1419        SERVICE_CHANGE_PRECLUDES_TS = 31;
1420        UNSPECIFIED_QOS_REASON = 32;
1421        NOT_ENOUGH_BANDWIDTH = 33;
1422        DISASSOC_LOW_ACK = 34;
1423        EXCEEDED_TXOP = 35;
1424        STA_LEAVING = 36;
1425        END_TS_BA_DLS = 37;
1426        UNKNOWN_TS_BA = 38;
1427        TIMEOUT = 39;
1428        PEERKEY_MISMATCH = 45;
1429        AUTHORIZED_ACCESS_LIMIT_REACHED = 46;
1430        EXTERNAL_SERVICE_REQUIREMENTS = 47;
1431        INVALID_FT_ACTION_FRAME_COUNT = 48;
1432        INVALID_PMKID = 49;
1433        INVALID_MDE = 50;
1434        INVALID_FTE = 51;
1435        MESH_PEERING_CANCELLED = 52;
1436        MESH_MAX_PEERS = 53;
1437        MESH_CONFIG_POLICY_VIOLATION = 54;
1438        MESH_CLOSE_RCVD = 55;
1439        MESH_MAX_RETRIES = 56;
1440        MESH_CONFIRM_TIMEOUT = 57;
1441        MESH_INVALID_GTK = 58;
1442        MESH_INCONSISTENT_PARAMS = 59;
1443        MESH_INVALID_SECURITY_CAP = 60;
1444        MESH_PATH_ERROR_NO_PROXY_INFO = 61;
1445        MESH_PATH_ERROR_NO_FORWARDING_INFO = 62;
1446        MESH_PATH_ERROR_DEST_UNREACHABLE = 63;
1447        MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64;
1448        MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65;
1449        MESH_CHANNEL_SWITCH_UNSPECIFIED = 66;
1450
1451        // ClientModeImpl error codes
1452        // Defined in /frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
1453        IFACE_DESTROYED = 10000;
1454        WIFI_DISABLED = 10001;
1455        SUPPLICANT_DISCONNECTED = 10002;
1456        CONNECTING_WATCHDOG_TIMER = 10003;
1457        ROAM_WATCHDOG_TIMER = 10004;
1458    }
1459
1460    // How long the session lasted from successful connection to disconnect.
1461    optional int32 connected_duration_seconds = 1;
1462
1463    // Reason for the disconnect.
1464    optional FailureCode failure_code = 2;
1465
1466    // Band bucket the connected network was on.
1467    optional android.net.wifi.WifiBandBucket band = 3;
1468
1469    // Authentication type.
1470    optional android.net.wifi.WifiAuthType auth_type = 4;
1471
1472    // Last seen RSSI before the disconnect.
1473    optional int32 last_rssi = 5;
1474
1475    // Last seen link speed before the disconnect.
1476    optional int32 last_link_speed = 6;
1477}
1478
1479/**
1480 * Logs when Wifi connection is established or dropped.
1481 *
1482 * Logged from:
1483 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
1484 */
1485message WifiConnectionStateChanged {
1486    optional bool is_connected = 1;
1487
1488    // Band bucket the connected network was on.
1489    // Filled for both connected and disconnected cases.
1490    optional android.net.wifi.WifiBandBucket band = 2;
1491
1492    // Authentication type.
1493    // Filled for both connected and disconnected cases.
1494    optional android.net.wifi.WifiAuthType auth_type = 3;
1495}
1496
1497/**
1498 * Logged when wifi peer to peer connection happens
1499 */
1500message WifiP2pConnectionReported {
1501    enum Type {
1502        UNSPECIFIED = 0;
1503        // fresh new connection.
1504        FRESH = 1;
1505        // reinvoke a group.
1506        REINVOKE = 2;
1507        // create a group with the current device as the group owner locally.
1508        LOCAL = 3;
1509        // create a group or join a group with config.
1510        FAST = 4;
1511    }
1512    enum FailureCode {
1513        // Failure is unknown.
1514        UNKNOWN = 0;
1515        // No failure.
1516        NONE = 1;
1517        // Timeout for current connecting request.
1518        TIMEOUT = 2;
1519        // The connecting request is canceled by the user.
1520        CANCEL = 3;
1521        // Provision discovery failure, e.g. no pin code, timeout, rejected by the peer.
1522        PROV_DISC_FAIL = 4;
1523        // Invitation failure, e.g. rejected by the peer.
1524        INVITATION_FAIL = 5;
1525        // Incoming request is rejected by the user.
1526        USER_REJECT = 6;
1527        // New connection request is issued before ending previous connecting request.
1528        NEW_CONNECTION_ATTEMPT = 7;
1529    }
1530    enum GroupRole {
1531        GROUP_UNKNOWN = 0;
1532        GROUP_OWNER = 1;
1533        GROUP_CLIENT = 2;
1534    }
1535    // Type of the connection.
1536    optional Type type = 1;
1537    // Duration to connect in millis.
1538    optional int32 latency_ms= 2;
1539    // Duration to connect in step size of 200 millis.
1540    optional int32 latency_200ms= 3;
1541    // Failure code
1542    optional FailureCode failure_code = 4;
1543    // Group role. This could be unknown with connect() call when the WifiConfig doesn't have the
1544    // credential.
1545    optional GroupRole group_role = 5;
1546}
1547
1548/**
1549 * Logged when wifi setup failure or crash reported
1550 */
1551message WifiSetupFailureCrashReported {
1552    enum Type {
1553        UNKNOWN = 0;
1554        // Wifi HAL crash
1555        HAL_CRASH = 1;
1556        // Wificond crash
1557        WIFICOND_CRASH = 2;
1558        // Supplicant crash
1559        SUPPLICANT_CRASH = 3;
1560        // hostapd crash
1561        HOSTAPD_CRASH = 4;
1562        // HAL error on WifiNative.setupInterfaceForClientMode
1563        CLIENT_FAILURE_HAL = 5;
1564        // Wificond error on WifiNative.setupInterfaceForClientMode
1565        CLIENT_FAILURE_WIFICOND = 6;
1566        // Supplicant error on WifiNative.setupInterfaceForClientMode
1567        CLIENT_FAILURE_SUPPLICANT = 7;
1568        // HAL error on WifiNative.setupInterfaceForSoftApMode
1569        SOFT_AP_FAILURE_HAL = 8;
1570        // Wificond error on WifiNative.setupInterfaceForSoftApMode
1571        SOFT_AP_FAILURE_WIFICOND = 9;
1572        // Hostapd error on WifiNative.setupInterfaceForSoftApMode
1573        SOFT_AP_FAILURE_HOSTAPD = 10;
1574    }
1575    // Type of failure
1576    optional Type type= 1;
1577}
1578
1579/**
1580 * Logs when memory stats of a process is reported.
1581 *
1582 * Logged from:
1583 *   frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
1584 */
1585message ProcessMemoryStatReported {
1586    optional int32 uid = 1;
1587    optional string process_name = 2;
1588    optional string package_name = 3;
1589    //TODO: remove this when validation is done
1590    optional int64 version = 9;
1591    optional int64 pss = 4;
1592    optional int64 uss = 5;
1593    optional int64 rss = 6;
1594    enum Type {
1595        ADD_PSS_INTERNAL_SINGLE = 0;
1596        ADD_PSS_INTERNAL_ALL_MEM = 1;
1597        ADD_PSS_INTERNAL_ALL_POLL = 2;
1598        ADD_PSS_EXTERNAL = 3;
1599        ADD_PSS_EXTERNAL_SLOW = 4;
1600    }
1601    optional Type type = 7;
1602    optional int64 duration_millis = 8;
1603
1604    // Keep in sync with
1605    // frameworks/base/services/core/java/com/android/server/am/ProcessProfileRecord.java
1606    enum HostingComponentType {
1607        HOSTING_COMPONENT_TYPE_EMPTY = 0x0;
1608        HOSTING_COMPONENT_TYPE_SYSTEM = 0x0001;
1609        HOSTING_COMPONENT_TYPE_PERSISTENT = 0x0002;
1610        HOSTING_COMPONENT_TYPE_BACKUP = 0x0004;
1611        HOSTING_COMPONENT_TYPE_INSTRUMENTATION = 0x0008;
1612        HOSTING_COMPONENT_TYPE_ACTIVITY = 0x0010;
1613        HOSTING_COMPONENT_TYPE_BROADCAST_RECEIVER = 0x0020;
1614        HOSTING_COMPONENT_TYPE_PROVIDER = 0x0040;
1615        HOSTING_COMPONENT_TYPE_STARTED_SERVICE = 0x0080;
1616        HOSTING_COMPONENT_TYPE_FOREGROUND_SERVICE = 0x0100;
1617        HOSTING_COMPONENT_TYPE_BOUND_SERVICE = 0x0200;
1618    }
1619
1620    // The types of the components this process is hosting at the moment this
1621    // snapshot is taken.
1622    // See the available types in HostingComponentType above.
1623    optional int32 current_hosting_component_types = 10;
1624
1625    // The historical types of the components this process is or was hosting
1626    // since it's born.
1627    // See the available types in HostingComponentType above.
1628    optional int32 historical_hosting_component_types = 11;
1629}
1630
1631/**
1632 * Logs that a process started, finished, crashed, or ANRed.
1633 *
1634 * Logged from:
1635 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1636 */
1637message ProcessLifeCycleStateChanged {
1638    optional int32 uid = 1 [(is_uid) = true];
1639
1640    // The process name (usually same as the app name).
1641    optional string process_name = 2;
1642
1643    // What lifecycle state the process changed to.
1644    // This enum is specific to atoms.proto.
1645    enum State {
1646        FINISHED = 0;
1647        STARTED = 1;
1648        CRASHED = 2;
1649    }
1650    optional State state = 3;
1651}
1652
1653/**
1654 * Logs when the ble scan state changes.
1655 *
1656 * Logged from:
1657 *   packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
1658 */
1659message BleScanStateChanged {
1660    repeated AttributionNode attribution_node = 1
1661            [(state_field_option).primary_field_first_uid = true];
1662
1663    enum State {
1664        OFF = 0;
1665        ON = 1;
1666        // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
1667        RESET = 2;
1668    }
1669    optional State state = 2 [
1670        (state_field_option).exclusive_state = true,
1671        (state_field_option).default_state_value = 0 /* State.OFF */,
1672        (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
1673        (state_field_option).nested = true
1674    ];
1675
1676    // Does the scan have a filter.
1677    optional bool is_filtered = 3 [(state_field_option).primary_field = true];
1678    // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
1679    optional bool is_first_match = 4 [(state_field_option).primary_field = true];
1680    // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
1681    optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
1682}
1683
1684/**
1685 * Logs reporting of a ble scan finding results.
1686 *
1687 * Logged from:
1688 *   packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
1689 */
1690// TODO: Consider also tracking per-scanner-id.
1691message BleScanResultReceived {
1692    repeated AttributionNode attribution_node = 1;
1693
1694    // Number of ble scan results returned.
1695    optional int32 num_results = 2;
1696}
1697
1698/**
1699 * Logs when a sensor state changes.
1700 *
1701 * Logged from:
1702 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1703 */
1704message SensorStateChanged {
1705    repeated AttributionNode attribution_node = 1;
1706
1707    // The id (int) of the sensor.
1708    optional int32 sensor_id = 2;
1709
1710    enum State {
1711        OFF = 0;
1712        ON = 1;
1713    }
1714    optional State state = 3;
1715}
1716
1717/**
1718 * Logs when GPS state changes.
1719 *
1720 * Logged from:
1721 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1722 */
1723message GpsScanStateChanged {
1724    repeated AttributionNode attribution_node = 1;
1725
1726    enum State {
1727        OFF = 0;
1728        ON = 1;
1729    }
1730    optional State state = 2;
1731}
1732
1733/**
1734 * Logs when GPS signal quality.
1735 *
1736 * Logged from:
1737 *   /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
1738 */
1739message GpsSignalQualityChanged {
1740    optional android.server.location.GpsSignalQualityEnum level = 1;
1741}
1742
1743
1744/**
1745 * Logs when a sync manager sync state changes.
1746 *
1747 * Logged from:
1748 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1749 */
1750message SyncStateChanged {
1751    repeated AttributionNode attribution_node = 1;
1752
1753    // Name of the sync (as named in the app). Can be chosen at run-time.
1754    optional string sync_name = 2;
1755
1756    enum State {
1757        OFF = 0;
1758        ON = 1;
1759    }
1760    optional State state = 3;
1761}
1762
1763/*
1764 * Deferred job stats.
1765 *
1766 * Logged from:
1767 *   frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
1768*/
1769message DeferredJobStatsReported {
1770    repeated AttributionNode attribution_node = 1;
1771
1772    // Number of jobs deferred.
1773    optional int32 num_jobs_deferred = 2;
1774
1775    // Time since the last job runs.
1776    optional int64 time_since_last_job_millis = 3;
1777}
1778
1779/**
1780 * Logs when a job scheduler job state changes.
1781 *
1782 * Logged from:
1783 *   frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
1784 *   frameworks/base/services/core/java/com/android/server/job/JobServiceContext.java
1785 *
1786 * Next tag: 22
1787 */
1788message ScheduledJobStateChanged {
1789    repeated AttributionNode attribution_node = 1;
1790
1791    // Name of the job (as named in the app)
1792    optional string job_name = 2;
1793
1794    enum State {
1795        FINISHED = 0;
1796        STARTED = 1;
1797        SCHEDULED = 2;
1798    }
1799    optional State state = 3;
1800
1801    // The internal reason a job has stopped.
1802    // This is only applicable when the state is FINISHED.
1803    // The default value is INTERNAL_STOP_REASON_UNKNOWN.
1804    optional android.app.job.InternalStopReasonEnum internal_stop_reason = 4;
1805
1806    // The publicly returned reason onStopJob() was called.
1807    // This is only applicable when the state is FINISHED, but may be undefined if
1808    // JobService.onStopJob() was never called for the job.
1809    // The default value is STOP_REASON_UNDEFINED.
1810    optional android.app.job.StopReasonEnum public_stop_reason = 17;
1811
1812    // The standby bucket of the app that scheduled the job. These match the framework constants
1813    // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1814    // already assigned 0.
1815    enum Bucket {
1816        UNKNOWN = -1;
1817        ACTIVE = 0;
1818        WORKING_SET = 1;
1819        FREQUENT = 2;
1820        RARE = 3;
1821        NEVER = 4;
1822        RESTRICTED = 5;
1823    }
1824    optional Bucket standby_bucket = 5 [default = UNKNOWN];
1825
1826    // The job id (as assigned by the app).
1827    optional int32 job_id = 6;
1828
1829    // One flag for each of the API constraints defined by JobScheduler. Does not include implicit
1830    // constraints as they are always assumed to be set.
1831    optional bool has_charging_constraint = 7;
1832    optional bool has_battery_not_low_constraint = 8;
1833    optional bool has_storage_not_low_constraint = 9;
1834    optional bool has_timing_delay_constraint = 10;
1835    optional bool has_deadline_constraint = 11;
1836    optional bool has_idle_constraint = 12;
1837    optional bool has_connectivity_constraint = 13;
1838    optional bool has_content_trigger_constraint = 14;
1839    optional bool is_prefetch = 18;
1840
1841    // True if the app has requested this run as an expedited job.
1842    optional bool is_requested_expedited_job = 15;
1843    // True if the job is running as an expedited job. Only valid for STARTED and FINISHED states.
1844    optional bool is_running_as_expedited_job = 16;
1845
1846    // The priority set by the app (via JobInfo.Builder.setPriority()).
1847    optional int32 requested_priority = 19;
1848    // The priority JobScheduler ran the job at. Only valid for STARTED and FINISHED states.
1849    optional int32 effective_priority = 20;
1850
1851    // Number of times JobScheduler has tried to run this particular job. This value is incremented
1852    // when a job is stopped and rescheduled for various reasons (lost network, constraints no
1853    // longer satisfied, etc). For periodic jobs, this value is reset after a successful run.
1854    optional int32 num_previous_attempts = 21;
1855}
1856
1857/**
1858 * Logs when the audio state changes.
1859 *
1860 * Logged from:
1861 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1862 */
1863message AudioStateChanged {
1864    repeated AttributionNode attribution_node = 1;
1865
1866    enum State {
1867        OFF = 0;
1868        ON = 1;
1869        // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1870        RESET = 2;
1871    }
1872    optional State state = 2;
1873}
1874
1875/**
1876 * Logs when the video codec state changes.
1877 *
1878 * Logged from:
1879 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1880 */
1881message MediaCodecStateChanged {
1882    repeated AttributionNode attribution_node = 1;
1883
1884    enum State {
1885        OFF = 0;
1886        ON = 1;
1887        // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1888        RESET = 2;
1889    }
1890    optional State state = 2;
1891}
1892
1893/**
1894 * Logs when the flashlight state changes.
1895 *
1896 * Logged from:
1897 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1898 */
1899message FlashlightStateChanged {
1900    repeated AttributionNode attribution_node = 1;
1901
1902    enum State {
1903        OFF = 0;
1904        ON = 1;
1905        // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1906        RESET = 2;
1907    }
1908    optional State state = 2;
1909}
1910
1911/**
1912 * Logs when the camera state changes.
1913 *
1914 * Logged from:
1915 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1916 */
1917message CameraStateChanged {
1918    repeated AttributionNode attribution_node = 1;
1919
1920    enum State {
1921        OFF = 0;
1922        ON = 1;
1923        // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1924        RESET = 2;
1925    }
1926    optional State state = 2;
1927}
1928
1929/**
1930 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
1931 *
1932 * Logged from:
1933 *   TODO
1934 */
1935message WakelockStateChanged {
1936    repeated AttributionNode attribution_node = 1
1937            [(state_field_option).primary_field_first_uid = true];
1938
1939    // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1940    // From frameworks/proto_logging/stats/enums/os/enums.proto.
1941    optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
1942
1943    // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1944    optional string tag = 3 [(state_field_option).primary_field = true];
1945
1946    enum State {
1947        RELEASE = 0;
1948        ACQUIRE = 1;
1949        CHANGE_RELEASE = 2;
1950        CHANGE_ACQUIRE = 3;
1951    }
1952    optional State state = 4 [
1953        (state_field_option).exclusive_state = true,
1954        (state_field_option).default_state_value = 0,
1955        (state_field_option).nested = true
1956    ];
1957}
1958
1959/**
1960 * Logs when a partial wakelock is considered 'long' (over 1 min).
1961 *
1962 * Logged from:
1963 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1964 */
1965message LongPartialWakelockStateChanged {
1966    repeated AttributionNode attribution_node = 1;
1967
1968    // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1969    optional string tag = 2;
1970
1971    // TODO: I have no idea what this is.
1972    optional string history_tag = 3;
1973
1974    enum State {
1975        OFF = 0;
1976        ON = 1;
1977    }
1978    optional State state = 4;
1979}
1980
1981/**
1982 * Logs when the device is interactive, according to the PowerManager Notifier.
1983 *
1984 * Logged from:
1985 *   frameworks/base/services/core/java/com/android/server/power/Notifier.java
1986 */
1987message InteractiveStateChanged {
1988    enum State {
1989        OFF = 0;
1990        ON = 1;
1991    }
1992    optional State state = 1;
1993}
1994
1995/**
1996 * Logs Battery Saver state change.
1997 *
1998 * Logged from:
1999 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2000 */
2001message BatterySaverModeStateChanged {
2002    enum State {
2003        OFF = 0;
2004        ON = 1;
2005    }
2006    optional State state = 1
2007            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2008}
2009
2010/**
2011 * Logs Doze mode state change.
2012 *
2013 * Logged from:
2014 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2015 */
2016message DeviceIdleModeStateChanged {
2017    optional android.server.DeviceIdleModeEnum state = 1
2018            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2019}
2020
2021
2022/**
2023 * Logs state change of Doze mode including maintenance windows.
2024 *
2025 * Logged from:
2026 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2027 */
2028message DeviceIdlingModeStateChanged {
2029    optional android.server.DeviceIdleModeEnum state = 1
2030            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2031}
2032
2033/**
2034 * Logs screen brightness level.
2035 *
2036 * Logged from:
2037 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2038 */
2039message ScreenBrightnessChanged {
2040    // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
2041    optional int32 level = 1;
2042}
2043
2044/**
2045 * Logs battery level (percent full, from 0 to 100).
2046 *
2047 * Logged from:
2048 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2049 */
2050message BatteryLevelChanged {
2051    // Battery level. Should be in [0, 100].
2052    optional int32 battery_level = 1;
2053}
2054
2055/**
2056 * Logs change in charging status of the device.
2057 *
2058 * Logged from:
2059 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2060 */
2061message ChargingStateChanged {
2062    // State of the battery, from frameworks/proto_logging/stats/enums/os/enums.proto.
2063    optional android.os.BatteryStatusEnum state = 1
2064            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2065}
2066
2067/**
2068 * Logs whether the device is plugged in, and what power source it is using.
2069 *
2070 * Logged from:
2071 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2072 */
2073message PluggedStateChanged {
2074    // Whether the device is plugged in, from frameworks/proto_logging/stats/enums/os/enums.proto.
2075    optional android.os.BatteryPluggedStateEnum state = 1
2076            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2077}
2078
2079/**
2080 * Logs whether the device is docked, and what type of dock it is using.
2081 *
2082 * Logged from:
2083 *   services/core/java/com/android/server/power/PowerManagerService.java
2084 */
2085message DockStateChanged {
2086    // The device dock state, from frameworks/proto_logging/stats/enums/server/enums.proto.
2087    optional android.server.DockStateEnum state = 1
2088    [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2089}
2090
2091/**
2092 * Logs when an app's wakeup alarm fires.
2093 *
2094 * Logged from:
2095 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2096 */
2097message WakeupAlarmOccurred {
2098    repeated AttributionNode attribution_node = 1;
2099
2100    // Name of the wakeup alarm.
2101    optional string tag = 2;
2102
2103    // Name of source package (for historical reasons, since BatteryStats tracked it).
2104    optional string package_name = 3;
2105
2106    // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
2107    optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
2108}
2109
2110/**
2111 * Logs when an an app causes the mobile radio to change state.
2112 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
2113 *
2114 * Logged from:
2115 *   frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
2116 */
2117message MobileRadioPowerStateChanged {
2118    repeated AttributionNode attribution_node = 1;
2119
2120    // Power state, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
2121    optional android.telephony.DataConnectionPowerStateEnum state = 2;
2122}
2123
2124/**
2125 * Logs when an an app causes the wifi radio to change state.
2126 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
2127 *
2128 * Logged from:
2129 *   frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
2130 */
2131message WifiRadioPowerStateChanged {
2132    repeated AttributionNode attribution_node = 1;
2133
2134    // Power state, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
2135    optional android.telephony.DataConnectionPowerStateEnum state = 2;
2136}
2137
2138/**
2139 * Logs kernel wakeup reasons and aborts.
2140 *
2141 * Logged from:
2142 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2143 */
2144message KernelWakeupReported {
2145    // Name of the kernel wakeup reason (or abort).
2146    optional string wakeup_reason_name = 1;
2147
2148    // Duration (in microseconds) for the wake-up interrupt to be serviced.
2149    optional int64 duration_micros = 2;
2150}
2151
2152/**
2153 * Logs when Wifi is toggled on/off.
2154 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
2155 *
2156 * Logged from:
2157 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2158 */
2159message WifiEnabledStateChanged {
2160    enum State {
2161        OFF = 0;
2162        ON = 1;
2163    }
2164    optional State state = 1;
2165}
2166
2167/**
2168 * This atom is deprecated starting in R.
2169 *
2170 * Logs when an app causes Wifi to run. In this context, 'to run' means to use Wifi Client Mode.
2171 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
2172 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
2173 *
2174 * Logged from:
2175 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
2176 */
2177message WifiRunningStateChanged {
2178    repeated AttributionNode attribution_node = 1;
2179
2180    enum State {
2181        OFF = 0;
2182        ON = 1;
2183    }
2184    optional State state = 2;
2185}
2186
2187/**
2188 * Logs wifi locks held by an app.
2189 *
2190 * Logged from:
2191 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2192 */
2193message WifiLockStateChanged {
2194    repeated AttributionNode attribution_node = 1;
2195
2196    enum State {
2197        OFF = 0;
2198        ON = 1;
2199    }
2200    optional State state = 2;
2201
2202    // WifiLock type, from frameworks/proto_logging/stats/enums/wifi/enums.proto.
2203    optional android.net.wifi.WifiModeEnum mode = 3;
2204}
2205
2206/**
2207 * Logs wifi signal strength changes.
2208 *
2209 * Logged from:
2210 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
2211 */
2212message WifiSignalStrengthChanged {
2213    // Signal strength, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
2214    optional android.telephony.SignalStrengthEnum signal_strength = 1;
2215}
2216
2217/**
2218 * Logs wifi scans performed by an app.
2219 *
2220 * Logged from:
2221 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
2222 */
2223message WifiScanStateChanged {
2224    repeated AttributionNode attribution_node = 1;
2225
2226    enum State {
2227        OFF = 0;
2228        ON = 1;
2229    }
2230    optional State state = 2;
2231}
2232
2233/**
2234 * Logs wifi multicast locks held by an app
2235 *
2236 * Logged from:
2237 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
2238 */
2239message WifiMulticastLockStateChanged {
2240    repeated AttributionNode attribution_node = 1;
2241
2242    enum State {
2243        OFF = 0;
2244        ON = 1;
2245    }
2246    optional State state = 2;
2247
2248    optional string tag = 3;
2249}
2250
2251/**
2252 * Logs shutdown reason and duration on next boot.
2253 *
2254 * Logged from:
2255 *   frameworks/base/core/java/com/android/server/BootReceiver.java
2256 */
2257message ShutdownSequenceReported {
2258    // True if shutdown is for a reboot. Default: false if we do not know.
2259    optional bool reboot = 1;
2260
2261    // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
2262    optional string reason = 2;
2263
2264    // Beginning of shutdown time in ms using wall clock time since unix epoch.
2265    // Default: 0 if no start time received.
2266    optional int64 start_time_millis = 3;
2267
2268    // Duration of shutdown in ms. Default: 0 if no duration received.
2269    optional int64 duration_millis = 4;
2270}
2271
2272
2273/**
2274 * Logs boot reason and duration.
2275 *
2276 * Logged from:
2277 *   system/core/bootstat/bootstat.cpp
2278 */
2279message BootSequenceReported {
2280    // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
2281    // Default: "<EMPTY>" if not available.
2282    optional string bootloader_reason = 1;
2283
2284    // Reason for system boot. Eg. bootloader, reboot,userrequested
2285    // Default: "<EMPTY>" if not available.
2286    optional string system_reason = 2;
2287
2288    // End of boot time in ms from unix epoch using system wall clock.
2289    optional int64 end_time_millis = 3;
2290
2291    // Total boot duration in ms.
2292    optional int64 total_duration_millis = 4;
2293
2294    // Bootloader duration in ms.
2295    optional int64 bootloader_duration_millis = 5;
2296
2297    // Time since last boot in ms. Default: 0 if not available.
2298    optional int64 time_since_last_boot = 6;
2299}
2300
2301
2302/**
2303 * Logs call state and disconnect cause (if applicable).
2304 *
2305 * Logged from:
2306 *   packages/services/Telecomm/src/com/android/server/telecom/Call.java
2307 */
2308message CallStateChanged {
2309    // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
2310    // From frameworks/proto_logging/stats/enums/telecomm/enums.proto.
2311    optional android.telecom.CallStateEnum call_state = 1;
2312
2313    // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
2314    // This value is only applicable when the call_state is DISCONNECTED, and
2315    // should always be UNKNOWN if the call_state is not DISCONNECTED.
2316    // From frameworks/proto_logging/stats/enums/telecomm/enums.proto.
2317    optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
2318
2319    // True if the call is self-managed, which are apps that use the
2320    // telecom infrastructure to make their own calls.
2321    optional bool self_managed = 3;
2322
2323    // True if call is external. External calls are calls on connected Wear
2324    // devices but show up in Telecom so the user can pull them onto the device.
2325    optional bool external_call = 4;
2326}
2327
2328/**
2329 * Logs keyguard state. The keyguard is the lock screen.
2330 *
2331 * Logged from:
2332 *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
2333 */
2334message KeyguardStateChanged {
2335    enum State {
2336        UNKNOWN = 0;
2337        // The keyguard is hidden when the phone is unlocked.
2338        HIDDEN = 1;
2339        // The keyguard is shown when the phone is locked (screen turns off).
2340        SHOWN= 2;
2341        // The keyguard is occluded when something is overlaying the keyguard.
2342        // Eg. Opening the camera while on the lock screen.
2343        OCCLUDED = 3;
2344    }
2345    optional State state = 1;
2346}
2347
2348/**
2349 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
2350 * prompts the user to enter a password (pattern, pin, etc).
2351 *
2352 * Logged from:
2353 *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
2354 */
2355
2356message KeyguardBouncerStateChanged {
2357    enum State {
2358        UNKNOWN = 0;
2359        // Bouncer is hidden, either as a result of successfully entering the
2360        // password, screen timing out, or user going back to lock screen.
2361        HIDDEN = 1;
2362        // The user is being prompted to enter the password and the keyguard is NOT in one
2363        // handed mode.
2364        SHOWN = 2;
2365        // The user is being prompted to enter the password and the keyguard shows in one
2366        // handed mode and left aligned.
2367        SHOWN_LEFT = 3;
2368        // The user is being prompted to enter the password and the keyguard shows in one
2369        // handed mode and right aligned.
2370        SHOWN_RIGHT = 4;
2371        // The keyguard switches to the left side while it is in one handed mode.
2372        SWITCH_LEFT = 5;
2373        // The keyguard switches to the right side while it is in one handed mode.
2374        SWITCH_RIGHT = 6;
2375    }
2376    optional State state = 1;
2377}
2378
2379/**
2380 * Logs the result of entering a password into the keyguard bouncer.
2381 *
2382 * Logged from:
2383 *   frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
2384 */
2385message KeyguardBouncerPasswordEntered {
2386    enum BouncerResult {
2387        UNKNOWN = 0;
2388        // The password entered was incorrect.
2389        FAILURE = 1;
2390        // The password entered was correct.
2391        SUCCESS = 2;
2392    }
2393    optional BouncerResult result = 1;
2394
2395    enum BouncerSide {
2396        DEFAULT = 0;
2397        LEFT = 1;
2398        RIGHT = 2;
2399    }
2400    optional BouncerSide side = 2;
2401}
2402
2403/*
2404 * Logs changes to the configuration of the device. The configuration is defined
2405 * in frameworks/base/core/java/android/content/res/Configuration.java
2406 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
2407 * Please go there to interpret the possible values each field can be.
2408 *
2409 * Logged from:
2410 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2411 */
2412message ResourceConfigurationChanged {
2413    // Bit mask of color capabilities of the screen.
2414    // Contains information about the color gamut and hdr mode of the screen.
2415    // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
2416    optional int32 color_mode = 1;
2417
2418    // The target screen density being rendered to.
2419    // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
2420    optional int32 density_dpi = 2;
2421
2422    // Current user preference for the scaling factor for fonts,
2423    // relative to the base density scaling.
2424    // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
2425    optional float font_scale = 3;
2426
2427    // Flag indicating whether the hard keyboard is hidden.
2428    // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
2429    optional int32 hard_keyboard_hidden = 4;
2430
2431    // The type of keyboard attached to the device.
2432    // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
2433    optional int32 keyboard = 5;
2434
2435    // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
2436    // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
2437    optional int32 keyboard_hidden = 6;
2438
2439    // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
2440    // 0 if undefined.
2441    // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
2442    optional int32 mcc = 7;
2443
2444    // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
2445    // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
2446    // MNC_ZERO symbol defined in Configuration.java.
2447    // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
2448    optional int32 mnc = 8;
2449
2450    // The kind of navigation available on the device.
2451    // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
2452    optional int32 navigation = 9;
2453
2454    // Flag indicating whether the navigation is available.
2455    // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
2456    optional int32 navigation_hidden = 10;
2457
2458    // Overall orientation of the screen.
2459    // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
2460    optional int32 orientation = 11;
2461
2462    // The current height of the available screen space, in dp units.
2463    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
2464    optional int32 screen_height_dp = 12;
2465
2466    // Bit mask of overall layout of the screen.
2467    // Contains information about screen size, whether the screen is wider/taller
2468    // than normal, whether the screen layout is right-tl-left or left-to-right,
2469    // and whether the screen has a rounded shape.
2470    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
2471    optional int32 screen_layout = 13;
2472
2473    // Current width of the available screen space, in dp units.
2474    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
2475    optional int32 screen_width_dp = 14;
2476
2477    // The smallest screen size an application will see in normal operation.
2478    // This is the smallest value of both screenWidthDp and screenHeightDp
2479    // in portrait and landscape.
2480    // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
2481    optional int32 smallest_screen_width_dp = 15;
2482
2483    // The type of touch screen attached to the device.
2484    // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
2485    optional int32 touchscreen = 16;
2486
2487    // Bit mask of the ui mode.
2488    // Contains information about the overall ui mode of the device.
2489    // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
2490    // Also contains information about whether the device is in night mode.
2491    // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
2492    optional int32 ui_mode = 17;
2493}
2494
2495
2496/**
2497 * Logs changes in the connection state of the mobile radio.
2498 *
2499 * Logged from:
2500 *    frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
2501 */
2502message MobileConnectionStateChanged {
2503    // States are from the state machine DataConnection.java.
2504    enum State {
2505        UNKNOWN = 0;
2506        // The connection is inactive, or disconnected.
2507        INACTIVE = 1;
2508        // The connection is being activated, or connecting.
2509        ACTIVATING = 2;
2510        // The connection is active, or connected.
2511        ACTIVE = 3;
2512        // The connection is disconnecting.
2513        DISCONNECTING = 4;
2514        // The connection is disconnecting after creating a connection.
2515        DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
2516    }
2517    optional State state  = 1;
2518    // For multi-sim phones, this distinguishes between the sim cards.
2519    optional int32 sim_slot_index = 2;
2520    // Used to identify the connection. Starts at 0 and increments by 1 for
2521    // every new network created. Resets whenever the device reboots.
2522    optional int32 data_connection_id = 3;
2523    // A bitmask for the capabilities of this connection.
2524    // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
2525    // Default value (if we have no information): 0
2526    optional int64 capabilities = 4;
2527    // If this connection has internet.
2528    // This just checks if the DEFAULT bit of capabilities is set.
2529    optional bool has_internet = 5;
2530}
2531
2532/**
2533 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
2534 *
2535 * Logged from:
2536 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
2537 */
2538message MobileRadioTechnologyChanged {
2539    optional android.telephony.NetworkTypeEnum state = 1;
2540    // For multi-sim phones, this distinguishes between the sim cards.
2541    optional int32 sim_slot_index = 2;
2542}
2543
2544/**
2545 * Logs the VID and PID of any connected USB devices.
2546 *
2547 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
2548 *
2549 * Logged by Vendor.
2550 */
2551message UsbDeviceAttached {
2552    optional int32 vid = 1;
2553    optional int32 pid = 2;
2554    optional bool has_audio = 3;
2555    optional bool has_hid = 4;
2556    optional bool has_storage = 5;
2557    enum State {
2558        STATE_DISCONNECTED = 0;
2559        STATE_CONNECTED = 1;
2560    }
2561    optional State state = 6;
2562    optional int64 last_connect_duration_millis = 7;
2563}
2564
2565
2566/**
2567 * Logs when Bluetooth is enabled and disabled.
2568 *
2569 * Logged from:
2570 *   services/core/java/com/android/server/BluetoothManagerService.java
2571 */
2572message BluetoothEnabledStateChanged {
2573    repeated AttributionNode attribution_node = 1;
2574    // Whether or not bluetooth is enabled on the device.
2575    enum State {
2576        UNKNOWN = 0;
2577        ENABLED = 1;
2578        DISABLED = 2;
2579    }
2580    optional State state = 2;
2581    // The reason for being enabled/disabled.
2582    // Eg. Airplane mode, crash, application request.
2583    optional android.bluetooth.EnableDisableReasonEnum reason = 3;
2584    // If the reason is an application request, this will be the package name.
2585    optional string pkg_name = 4;
2586}
2587
2588/**
2589 * Logs when profiles on a Bluetooth device connects and disconnects.
2590 *
2591 * Logged from:
2592 *    packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2593 *
2594 * Next Tag: 6
2595 */
2596message BluetoothConnectionStateChanged {
2597    // The state of the connection.
2598    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
2599    optional android.bluetooth.ConnectionStateEnum state = 1;
2600    // An identifier that can be used to match connect and disconnect events.
2601    // Currently is last two bytes of a hash of a device level ID and
2602    // the mac address of the bluetooth device that is connected.
2603    // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
2604    optional int32 obfuscated_id = 2 [deprecated = true];
2605    // The profile that is connected. Eg. GATT, A2DP, HEADSET.
2606    // From android.bluetooth.BluetoothAdapter.java
2607    // Default: 0 when not used
2608    optional int32 bt_profile = 3;
2609    // An identifier that can be used to match events for this device.
2610    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2611    // Salt: Randomly generated 256 bit value
2612    // Hash algorithm: HMAC-SHA256
2613    // Size: 32 byte
2614    // Default: null or empty if the device identifier is not known
2615    optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2616    // An identifier that can be used to match events for this device.
2617    // The incremental identifier is locally generated and guaranteed not derived
2618    // from any globally unique hardware id.
2619    // For paired devices, it stays consistent between Bluetooth toggling for the
2620    // same remote device.
2621    // For unpaired devices, it stays consistent within the same Bluetooth adapter
2622    // session for the same remote device.
2623    // Default: 0 if the device's metric id is unknown.
2624    optional int32 metric_id = 5;
2625    // An index to group connection events by session. It's a counter generated by
2626    // each profile. e.g. Gatt server generate such id to identify Gatt apps
2627    optional int32 session_index = 6;
2628    // An identifier that indicates the connection failure reason
2629    optional int32 connection_reason = 7;
2630}
2631
2632/**
2633 * Logs when a Bluetooth device connects and disconnects over ACL
2634 *
2635 * Logged from:
2636 *    packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
2637 *
2638 * Next Tag: 4
2639 */
2640message BluetoothAclConnectionStateChanged {
2641    // An identifier that can be used to match events for this device.
2642    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2643    // Salt: Randomly generated 256 bit value
2644    // Hash algorithm: HMAC-SHA256
2645    // Size: 32 byte
2646    // Default: null or empty if the device identifier is not known
2647    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2648    // The state of the connection.
2649    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
2650    optional android.bluetooth.ConnectionStateEnum state = 2;
2651    // An identifier that can be used to match events for this device.
2652    // The incremental identifier is locally generated and guaranteed not derived
2653    // from any globally unique hardware id.
2654    // For paired devices, it stays consistent between Bluetooth toggling for the
2655    // same remote device.
2656    // For unpaired devices, it stays consistent within the same Bluetooth adapter
2657    // session for the same remote device.
2658    // Default: 0 if the device's metric id is unknown.
2659    optional int32 metric_id = 3;
2660    // Used transport of this event.
2661    optional android.bluetooth.TransportTypeEnum transport = 4;
2662}
2663
2664/**
2665 * Logs when a Bluetooth device connects and disconnects over SCO
2666 *
2667 * Logged from:
2668 *    packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
2669 *    packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
2670 *
2671 * Next Tag: 5
2672 */
2673message BluetoothScoConnectionStateChanged {
2674    // An identifier that can be used to match events for this device.
2675    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2676    // Salt: Randomly generated 256 bit value
2677    // Hash algorithm: HMAC-SHA256
2678    // Size: 32 byte
2679    // Default: null or empty if the device identifier is not known
2680    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2681    // The state of the connection.
2682    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
2683    optional android.bluetooth.ConnectionStateEnum state = 2;
2684    // Codec used for this SCO connection
2685    // Default: UNKNOWN
2686    optional android.bluetooth.hfp.ScoCodec codec = 3;
2687    // An identifier that can be used to match events for this device.
2688    // The incremental identifier is locally generated and guaranteed not derived
2689    // from any globally unique hardware id.
2690    // For paired devices, it stays consistent between Bluetooth toggling for the
2691    // same remote device.
2692    // For unpaired devices, it stays consistent within the same Bluetooth adapter
2693    // session for the same remote device.
2694    // Default: 0 if the device's metric id is unknown.
2695    optional int32 metric_id = 4;
2696}
2697
2698/**
2699 * Logged when active device of a profile changes
2700 *
2701 * Logged from:
2702 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2703 *     packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
2704 *     packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
2705 */
2706message BluetoothActiveDeviceChanged {
2707    // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
2708    // From android.bluetooth.BluetoothProfile
2709    optional int32 bt_profile = 1;
2710    // An identifier that can be used to match events for this new active device.
2711    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2712    // Salt: Randomly generated 256 bit value
2713    // Hash algorithm: HMAC-SHA256
2714    // Size: 32 byte
2715    // Default: null or empty if there is no active device for this profile
2716    optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
2717    // An identifier that can be used to match events for this device.
2718    // The incremental identifier is locally generated and guaranteed not derived
2719    // from any globally unique hardware id.
2720    // For paired devices, it stays consistent between Bluetooth toggling for the
2721    // same remote device.
2722    // For unpaired devices, it stays consistent within the same Bluetooth adapter
2723    // session for the same remote device.
2724    // Default: 0 if the device's metric id is unknown.
2725    optional int32 metric_id = 3;
2726}
2727
2728// Logs when there is an event affecting Bluetooth device's link layer connection.
2729// - This event is triggered when there is a related HCI command or event
2730// - Users of this metrics can deduce Bluetooth device's connection state from these events
2731// - HCI commands are logged before the command is sent, after receiving command status, and after
2732//   receiving command complete
2733// - HCI events are logged when they arrive
2734//
2735// Low level log from system/bt
2736//
2737// Bluetooth classic commands:
2738// - CMD_CREATE_CONNECTION
2739// - CMD_DISCONNECT
2740// - CMD_CREATE_CONNECTION_CANCEL
2741// - CMD_ACCEPT_CONNECTION_REQUEST
2742// - CMD_REJECT_CONNECTION_REQUEST
2743// - CMD_SETUP_ESCO_CONNECTION
2744// - CMD_ACCEPT_ESCO_CONNECTION
2745// - CMD_REJECT_ESCO_CONNECTION
2746// - CMD_ENH_SETUP_ESCO_CONNECTION
2747// - CMD_ENH_ACCEPT_ESCO_CONNECTION
2748//
2749// Bluetooth low energy commands:
2750// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
2751// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
2752// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
2753// - CMD_BLE_CLEAR_WHITE_LIST
2754// - CMD_BLE_ADD_WHITE_LIST
2755// - CMD_BLE_REMOVE_WHITE_LIST
2756//
2757// Bluetooth classic events:
2758// - EVT_CONNECTION_COMP
2759// - EVT_CONNECTION_REQUEST
2760// - EVT_DISCONNECTION_COMP
2761// - EVT_ESCO_CONNECTION_COMP
2762// - EVT_ESCO_CONNECTION_CHANGED
2763//
2764// Bluetooth low energy meta events:
2765// - BLE_EVT_CONN_COMPLETE_EVT
2766// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
2767//
2768// Next tag: 10
2769message BluetoothLinkLayerConnectionEvent {
2770    // An identifier that can be used to match events for this device.
2771    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2772    // Salt: Randomly generated 256 bit value
2773    // Hash algorithm: HMAC-SHA256
2774    // Size: 32 byte
2775    // Default: null or empty if the device identifier is not known
2776    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2777    // Connection handle of this connection if available
2778    // Range: 0x0000 - 0x0EFF (12 bits)
2779    // Default: 0xFFFF if the handle is unknown
2780    optional int32 connection_handle = 2;
2781    // Direction of the link
2782    // Default: DIRECTION_UNKNOWN
2783    optional android.bluetooth.DirectionEnum direction = 3;
2784    // Type of this link
2785    // Default: LINK_TYPE_UNKNOWN
2786    optional android.bluetooth.LinkTypeEnum type = 4;
2787
2788    // Reason metadata for this link layer connection event, rules for interpretation:
2789    // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
2790    //    EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
2791    // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
2792    //    set and valid, ignore hci_ble_event
2793
2794    // HCI command associated with this event
2795    // Default: CMD_UNKNOWN
2796    optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
2797    // HCI event associated with this event
2798    // Default: EVT_UNKNOWN
2799    optional android.bluetooth.hci.EventEnum hci_event = 6;
2800    // HCI BLE meta event associated with this event
2801    // Default: BLE_EVT_UNKNOWN
2802    optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
2803    // HCI command status code if this is triggerred by hci_cmd
2804    // Default: STATUS_UNKNOWN
2805    optional android.bluetooth.hci.StatusEnum cmd_status = 8;
2806    // HCI reason code associated with this event
2807    // Default: STATUS_UNKNOWN
2808    optional android.bluetooth.hci.StatusEnum reason_code = 9;
2809    // An identifier that can be used to match events for this device.
2810    // The incremental identifier is locally generated and guaranteed not derived
2811    // from any globally unique hardware id.
2812    // For paired devices, it stays consistent between Bluetooth toggling for the
2813    // same remote device.
2814    // For unpaired devices, it stays consistent within the same Bluetooth adapter
2815    // session for the same remote device.
2816    // Default: 0 if the device's metric id is unknown.
2817    optional int32 metric_id = 10;
2818}
2819
2820/**
2821 * Logs when a module is rolled back by Watchdog.
2822 *
2823 * Logged from: Rollback Manager
2824 */
2825message WatchdogRollbackOccurred {
2826    enum RollbackType {
2827        UNKNOWN = 0;
2828        ROLLBACK_INITIATE = 1;
2829        ROLLBACK_SUCCESS = 2;
2830        ROLLBACK_FAILURE = 3;
2831        ROLLBACK_BOOT_TRIGGERED = 4;
2832    }
2833    optional RollbackType rollback_type = 1;
2834
2835    optional string package_name = 2;
2836
2837    optional int32 package_version_code = 3;
2838
2839    enum RollbackReasonType {
2840        REASON_UNKNOWN = 0;
2841        REASON_NATIVE_CRASH = 1;
2842        REASON_EXPLICIT_HEALTH_CHECK = 2;
2843        REASON_APP_CRASH = 3;
2844        REASON_APP_NOT_RESPONDING = 4;
2845        REASON_NATIVE_CRASH_DURING_BOOT = 5;
2846    }
2847    optional RollbackReasonType rollback_reason = 4;
2848
2849    // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2850    // is initiated. Empty if the package is unknown.
2851    optional string failing_package_name = 5;
2852
2853    optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
2854}
2855
2856/**
2857 * Logs when there is a change in Bluetooth A2DP playback state
2858 *
2859 * Logged from:
2860 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2861 */
2862message BluetoothA2dpPlaybackStateChanged {
2863    // An identifier that can be used to match events for this device.
2864    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2865    // Salt: Randomly generated 256 bit value
2866    // Hash algorithm: HMAC-SHA256
2867    // Size: 32 byte
2868    // Default: null or empty if the device identifier is not known
2869    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2870    // Current playback state
2871    // Default: PLAYBACK_STATE_UNKNOWN
2872    optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2873    // Current audio coding mode
2874    // Default: AUDIO_CODING_MODE_UNKNOWN
2875    optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
2876    // An identifier that can be used to match events for this device.
2877    // The incremental identifier is locally generated and guaranteed not derived
2878    // from any globally unique hardware id.
2879    // For paired devices, it stays consistent between Bluetooth toggling for the
2880    // same remote device.
2881    // For unpaired devices, it stays consistent within the same Bluetooth adapter
2882    // session for the same remote device.
2883    // Default: 0 if the device's metric id is unknown.
2884    optional int32 metric_id = 4;
2885}
2886
2887/**
2888 * Logs when there is a change in A2DP codec config for a particular remote device
2889 *
2890 * Logged from:
2891 *     frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2892 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2893 */
2894message BluetoothA2dpCodecConfigChanged {
2895    // An identifier that can be used to match events for this device.
2896    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2897    // Salt: Randomly generated 256 bit value
2898    // Hash algorithm: HMAC-SHA256
2899    // Size: 32 byte
2900    // Default: null or empty if the device identifier is not known
2901    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2902    // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2903    // Default SOURCE_CODEC_TYPE_INVALID
2904    optional int32 codec_type = 2;
2905    // Codec priroity, the higher the more preferred, -1 for disabled
2906    // Default: CODEC_PRIORITY_DEFAULT
2907    optional int32 codec_priority = 3;
2908    // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2909    // Default: SAMPLE_RATE_NONE
2910    optional int32 sample_rate = 4;
2911    // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2912    // Default: BITS_PER_SAMPLE_NONE
2913    optional int32 bits_per_sample = 5;
2914    // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2915    // Default: CHANNEL_MODE_NONE
2916    optional int32 channel_mode = 6;
2917    // Codec specific values
2918    // Default 0
2919    optional int64 codec_specific_1 = 7;
2920    optional int64 codec_specific_2 = 8;
2921    optional int64 codec_specific_3 = 9;
2922    optional int64 codec_specific_4 = 10;
2923    // An identifier that can be used to match events for this device.
2924    // The incremental identifier is locally generated and guaranteed not derived
2925    // from any globally unique hardware id.
2926    // For paired devices, it stays consistent between Bluetooth toggling for the
2927    // same remote device.
2928    // For unpaired devices, it stays consistent within the same Bluetooth adapter
2929    // session for the same remote device.
2930    // Default: 0 if the device's metric id is unknown.
2931    optional int32 metric_id = 11;
2932}
2933
2934/**
2935 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2936 * Each codec's capability is logged separately due to statsd restriction
2937 *
2938 * Logged from:
2939 *     frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2940 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2941 */
2942message BluetoothA2dpCodecCapabilityChanged {
2943    // An identifier that can be used to match events for this device.
2944    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2945    // Salt: Randomly generated 256 bit value
2946    // Hash algorithm: HMAC-SHA256
2947    // Size: 32 byte
2948    // Default: null or empty if the device identifier is not known
2949    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2950    // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2951    // Default SOURCE_CODEC_TYPE_INVALID
2952    optional int32 codec_type = 2;
2953    // Codec priroity, the higher the more preferred, -1 for disabled
2954    // Default: CODEC_PRIORITY_DEFAULT
2955    optional int32 codec_priority = 3;
2956    // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2957    // in BluetoothCodecConfig
2958    // Default: empty and SAMPLE_RATE_NONE for individual item
2959    optional int32 sample_rate = 4;
2960    // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2961    // in BluetoothCodecConfig
2962    // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2963    optional int32 bits_per_sample = 5;
2964    // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2965    // BluetoothCodecConfig
2966    // Default: empty and CHANNEL_MODE_NONE for individual item
2967    optional int32 channel_mode = 6;
2968    // Codec specific values
2969    // Default 0
2970    optional int64 codec_specific_1 = 7;
2971    optional int64 codec_specific_2 = 8;
2972    optional int64 codec_specific_3 = 9;
2973    optional int64 codec_specific_4 = 10;
2974    // An identifier that can be used to match events for this device.
2975    // The incremental identifier is locally generated and guaranteed not derived
2976    // from any globally unique hardware id.
2977    // For paired devices, it stays consistent between Bluetooth toggling for the
2978    // same remote device.
2979    // For unpaired devices, it stays consistent within the same Bluetooth adapter
2980    // session for the same remote device.
2981    // Default: 0 if the device's metric id is unknown.
2982    optional int32 metric_id = 11;
2983}
2984
2985/**
2986 * Logs when A2DP failed to read from PCM source.
2987 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2988 *
2989 * Logged from:
2990 *     system/bt
2991 */
2992message BluetoothA2dpAudioUnderrunReported {
2993    // An identifier that can be used to match events for this device.
2994    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2995    // Salt: Randomly generated 256 bit value
2996    // Hash algorithm: HMAC-SHA256
2997    // Size: 32 byte
2998    // Default: null or empty if the device identifier is not known
2999    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3000    // Encoding interval in nanoseconds
3001    // Default: 0
3002    optional int64 encoding_interval_nanos = 2;
3003    // Number of bytes of PCM data that could not be read from the source
3004    // Default: 0
3005    optional int32 num_missing_pcm_bytes = 3;
3006    // An identifier that can be used to match events for this device.
3007    // The incremental identifier is locally generated and guaranteed not derived
3008    // from any globally unique hardware id.
3009    // For paired devices, it stays consistent between Bluetooth toggling for the
3010    // same remote device.
3011    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3012    // session for the same remote device.
3013    // Default: 0 if the device's metric id is unknown.
3014    optional int32 metric_id = 4;
3015}
3016
3017/**
3018 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
3019 * buffer queue is full and we have to drop data
3020 *
3021 * Logged from:
3022 *     system/bt
3023 */
3024message BluetoothA2dpAudioOverrunReported {
3025    // An identifier that can be used to match events for this device.
3026    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3027    // Salt: Randomly generated 256 bit value
3028    // Hash algorithm: HMAC-SHA256
3029    // Size: 32 byte
3030    // Default: null or empty if the device identifier is not known
3031    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3032    // Encoding interval in nanoseconds
3033    // Default: 0
3034    optional int64 encoding_interval_nanos = 2;
3035    // Number of buffers dropped in this event
3036    // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
3037    // Default: 0
3038    optional int32 num_dropped_buffers = 3;
3039    // Number of encoded buffers dropped in this event
3040    // Default 0
3041    optional int32 num_dropped_encoded_frames = 4;
3042    // Number of encoded bytes dropped in this event
3043    // Default: 0
3044    optional int32 num_dropped_encoded_bytes = 5;
3045    // An identifier that can be used to match events for this device.
3046    // The incremental identifier is locally generated and guaranteed not derived
3047    // from any globally unique hardware id.
3048    // For paired devices, it stays consistent between Bluetooth toggling for the
3049    // same remote device.
3050    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3051    // session for the same remote device.
3052    // Default: 0 if the device's metric id is unknown.
3053    optional int32 metric_id = 6;
3054}
3055
3056/**
3057 * Logs when we receive reports regarding a device's RSSI value
3058 *
3059 * Logged from:
3060 *     system/bt
3061 */
3062message BluetoothDeviceRssiReported {
3063    // An identifier that can be used to match events for this device.
3064    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3065    // Salt: Randomly generated 256 bit value
3066    // Hash algorithm: HMAC-SHA256
3067    // Size: 32 byte
3068    // Default: null or empty if the device identifier is not known
3069    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3070    // Connection handle of this connection if available
3071    // Range: 0x0000 - 0x0EFF (12 bits)
3072    // Default: 0xFFFF if the handle is unknown
3073    optional int32 connection_handle = 2;
3074    // HCI command status code if this is triggerred by hci_cmd
3075    // Default: STATUS_UNKNOWN
3076    optional android.bluetooth.hci.StatusEnum hci_status = 3;
3077    // BR/EDR
3078    //   Range: -128 ≤ N ≤ 127 (signed integer)
3079    //   Units: dB
3080    // LE:
3081    //   Range: -127 to 20, 127 (signed integer)
3082    //   Units: dBm
3083    // Invalid when an out of range value is reported
3084    optional int32 rssi = 4;
3085    // An identifier that can be used to match events for this device.
3086    // The incremental identifier is locally generated and guaranteed not derived
3087    // from any globally unique hardware id.
3088    // For paired devices, it stays consistent between Bluetooth toggling for the
3089    // same remote device.
3090    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3091    // session for the same remote device.
3092    // Default: 0 if the device's metric id is unknown.
3093    optional int32 metric_id = 5;
3094}
3095
3096/**
3097 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
3098 *
3099 * Logged from:
3100 *     system/bt
3101 */
3102message BluetoothDeviceFailedContactCounterReported {
3103    // An identifier that can be used to match events for this device.
3104    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3105    // Salt: Randomly generated 256 bit value
3106    // Hash algorithm: HMAC-SHA256
3107    // Size: 32 byte
3108    // Default: null or empty if the device identifier is not known
3109    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3110    // Connection handle of this connection if available
3111    // Range: 0x0000 - 0x0EFF (12 bits)
3112    // Default: 0xFFFF if the handle is unknown
3113    optional int32 connection_handle = 2;
3114    // HCI command status code if this is triggerred by hci_cmd
3115    // Default: STATUS_UNKNOWN
3116    optional android.bluetooth.hci.StatusEnum cmd_status = 3;
3117    // Number of consecutive failed contacts for a connection corresponding to the Handle
3118    // Range: uint16_t, 0-0xFFFF
3119    // Default: 0xFFFFF
3120    optional int32 failed_contact_counter = 4;
3121    // An identifier that can be used to match events for this device.
3122    // The incremental identifier is locally generated and guaranteed not derived
3123    // from any globally unique hardware id.
3124    // For paired devices, it stays consistent between Bluetooth toggling for the
3125    // same remote device.
3126    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3127    // session for the same remote device.
3128    // Default: 0 if the device's metric id is unknown.
3129    optional int32 metric_id = 5;
3130}
3131
3132/**
3133 * Logs when we receive reports regarding the tranmit power level used for a specific connection
3134 *
3135 * Logged from:
3136 *     system/bt
3137 */
3138message BluetoothDeviceTxPowerLevelReported {
3139    // An identifier that can be used to match events for this device.
3140    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3141    // Salt: Randomly generated 256 bit value
3142    // Hash algorithm: HMAC-SHA256
3143    // Size: 32 byte
3144    // Default: null or empty if the device identifier is not known
3145    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3146    // Connection handle of this connection if available
3147    // Range: 0x0000 - 0x0EFF (12 bits)
3148    // Default: 0xFFFF if the handle is unknown
3149    optional int32 connection_handle = 2;
3150    // HCI command status code if this is triggered by hci_cmd
3151    // Default: STATUS_UNKNOWN
3152    optional android.bluetooth.hci.StatusEnum hci_status = 3;
3153    // Range: -30 ≤ N ≤ 20
3154    // Units: dBm
3155    // Invalid when an out of range value is reported
3156    optional int32 transmit_power_level = 4;
3157    // An identifier that can be used to match events for this device.
3158    // The incremental identifier is locally generated and guaranteed not derived
3159    // from any globally unique hardware id.
3160    // For paired devices, it stays consistent between Bluetooth toggling for the
3161    // same remote device.
3162    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3163    // session for the same remote device.
3164    // Default: 0 if the device's metric id is unknown.
3165    optional int32 metric_id = 5;
3166}
3167
3168/**
3169 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
3170 * receiving an HCI command from the host
3171 *
3172 * Logged from: system/bt
3173 */
3174message BluetoothHciTimeoutReported {
3175    // HCI command associated with this event
3176    // Default: CMD_UNKNOWN
3177    optional android.bluetooth.hci.CommandEnum hci_command = 1;
3178}
3179
3180/**
3181 * Logs when we receive Bluetooth Link Quality Report event from the controller
3182 * See Android Bluetooth HCI specification for more details
3183 *
3184 * Note: all count and bytes field are counted since last event
3185 *
3186 * Logged from: system/bt
3187 */
3188message BluetoothQualityReportReported {
3189    // Quality report ID
3190    // Original type: uint8_t
3191    // Default: BQR_ID_UNKNOWN
3192    optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
3193    // Packet type of the connection
3194    // Original type: uint8_t
3195    // Default: BQR_PACKET_TYPE_UNKNOWN
3196    optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
3197    // Connection handle of the connection
3198    // Original type: uint16_t
3199    optional int32 connection_handle = 3;
3200    // Performing Role for the connection
3201    // Original type: uint8_t
3202    optional int32 connection_role = 4;
3203    // Current Transmit Power Level for the connection. This value is the same as the controller's
3204    // response to the HCI_Read_Transmit_Power_Level HCI command
3205    // Original type: uint8_t
3206    optional int32 tx_power_level = 5;
3207    // Received Signal Strength Indication (RSSI) value for the connection. This value is an
3208    // absolute receiver signal strength value
3209    // Original type: int8_t
3210    optional int32 rssi = 6;
3211    // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
3212    // channels used by the link currently
3213    // Original type: uint8_t
3214    optional int32 snr = 7;
3215    // Indicates the number of unused channels in AFH_channel_map
3216    // Original type: uint8_t
3217    optional int32 unused_afh_channel_count = 8;
3218    // Indicates the number of the channels which are interfered and quality is bad but are still
3219    // selected for AFH
3220    // Original type: uint8_t
3221    optional int32 afh_select_unideal_channel_count = 9;
3222    // Current Link Supervision Timeout Setting
3223    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
3224    // Original type: uint16_t
3225    optional int32 lsto = 10;
3226    // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
3227    // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
3228    // 0x01 (Piconet Clock)
3229    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
3230    // Original type: uint32_t
3231    optional int64 connection_piconet_clock = 11;
3232    // The count of retransmission
3233    // Original type: uint32_t
3234    optional int64 retransmission_count = 12;
3235    // The count of no RX
3236    // Original type: uint32_t
3237    optional int64 no_rx_count = 13;
3238    // The count of NAK (Negative Acknowledge)
3239    // Original type: uint32_t
3240    optional int64 nak_count = 14;
3241    // Controller timestamp of last TX ACK
3242    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
3243    // Original type: uint32_t
3244    optional int64 last_tx_ack_timestamp = 15;
3245    // The count of Flow-off (STOP)
3246    // Original type: uint32_t
3247    optional int64 flow_off_count = 16;
3248    // Controller timestamp of last Flow-on (GO)
3249    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
3250    // Original type: uint32_t
3251    optional int64 last_flow_on_timestamp = 17;
3252    // Buffer overflow count (how many bytes of TX data are dropped) since the last event
3253    // Original type: uint32_t
3254    optional int64 buffer_overflow_bytes = 18;
3255    // Buffer underflow count (in byte) since last event
3256    // Original type: uint32_t
3257    optional int64 buffer_underflow_bytes = 19;
3258}
3259
3260/**
3261 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
3262 *
3263 * Notes:
3264 * - Each event can be partially filled as we might learn different pieces of device
3265 *   information at different time
3266 * - Multiple device info events can be combined to give more complete picture
3267 * - When multiple device info events tries to describe the same information, the
3268 *   later one wins
3269 *
3270 * Logged from:
3271 *     packages/apps/Bluetooth
3272 */
3273message BluetoothDeviceInfoReported {
3274    // An identifier that can be used to match events for this device.
3275    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3276    // Salt: Randomly generated 256 bit value
3277    // Hash algorithm: HMAC-SHA256
3278    // Size: 32 byte
3279    // Default: null or empty if the device identifier is not known
3280    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3281    // Where is this device info obtained from
3282    optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
3283    // Name of the data source
3284    // For EXTERNAL: package name of the data source
3285    // For INTERNAL: null for general case, component name otherwise
3286    optional string source_name = 3;
3287    // Name of the manufacturer of this device
3288    optional string manufacturer = 4;
3289    // Model of this device
3290    optional string model = 5;
3291    // Hardware version of this device
3292    optional string hardware_version = 6;
3293    // Software version of this device
3294    optional string software_version = 7;
3295    // An identifier that can be used to match events for this device.
3296    // The incremental identifier is locally generated and guaranteed not derived
3297    // from any globally unique hardware id.
3298    // For paired devices, it stays consistent between Bluetooth toggling for the
3299    // same remote device.
3300    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3301    // session for the same remote device.
3302    // Default: 0 if the device's metric id is unknown.
3303    optional int32 metric_id = 8;
3304    // A flag indicating if the MAC address of the remote device is public or
3305    // random.
3306    optional android.bluetooth.AddressTypeEnum address_type = 9;
3307    // The first byte of MAC address
3308    optional int32 byte1 = 10;
3309    // The second byte of MAC address
3310    optional int32 byte2 = 11;
3311    // The third byte of MAC address
3312    optional int32 byte3 = 12;
3313
3314}
3315
3316/**
3317 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
3318 * device, as documented by the Bluetooth Core HCI specification
3319 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
3320 * Vol 2, Part E, Page 1118
3321 *
3322 * Logged from:
3323 *     system/bt
3324 */
3325message BluetoothRemoteVersionInfoReported {
3326    // Connection handle of the connection
3327    // Original type: uint16_t
3328    optional int32 connection_handle = 1;
3329    // HCI command status code
3330    // Default: STATUS_UNKNOWN
3331    optional android.bluetooth.hci.StatusEnum hci_status = 2;
3332    // 1 byte Version of current LMP in the remote controller
3333    optional int32 lmp_version = 3;
3334    // 2 bytes LMP manufacturer code of the remote controller
3335    // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
3336    optional int32 lmp_manufacturer_code = 4;
3337    // 4 bytes subversion of the LMP in the remote controller
3338    optional int32 lmp_subversion = 5;
3339}
3340
3341/**
3342 * Logs when certain Bluetooth SDP attributes are discovered
3343 * Constant definitions are from:
3344 *     https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
3345 *
3346 * Current logged attributes:
3347 * - BluetoothProfileDescriptorList
3348 * - Supported Features Bitmask
3349 *
3350 * Logged from:
3351 *     system/bt
3352 */
3353message BluetoothSdpAttributeReported {
3354    // An identifier that can be used to match events for this device.
3355    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3356    // Salt: Randomly generated 256 bit value
3357    // Hash algorithm: HMAC-SHA256
3358    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3359    // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
3360    // Original type: uint16_t
3361    optional int32 protocol_uuid = 2;
3362    // Short form UUIDs used to identify Bluetooth SDP attribute types
3363    // Original type: uint16_t
3364    optional int32 attribute_id = 3;
3365    // Attribute value for the particular attribute
3366    optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
3367    // An identifier that can be used to match events for this device.
3368    // The incremental identifier is locally generated and guaranteed not derived
3369    // from any globally unique hardware id.
3370    // For paired devices, it stays consistent between Bluetooth toggling for the
3371    // same remote device.
3372    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3373    // session for the same remote device.
3374    // Default: 0 if the device's metric id is unknown.
3375    optional int32 metric_id = 5;
3376}
3377
3378/**
3379* Logs the user created Bluetooth device's name.
3380* It is pushed at Bluetooth pairing and connection.
3381* The metric will only be collected from dogfooders.
3382*
3383* Logged from:
3384*     packages/modules/Bluetooth
3385*/
3386message BluetoothDeviceNameReported {
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 = 1;
3396
3397   // Name of the Bluetooth device. It is created by the user.
3398   optional string device_name = 2;
3399}
3400
3401/**
3402 * Logs when bond state of a Bluetooth device changes
3403 *
3404 * Logged from:
3405 *     frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
3406 *     packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
3407 */
3408message BluetoothBondStateChanged {
3409    // An identifier that can be used to match events for this device.
3410    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3411    // Salt: Randomly generated 256 bit value
3412    // Hash algorithm: HMAC-SHA256
3413    // Size: 32 byte
3414    // Default: null or empty if the device identifier is not known
3415    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3416    // Preferred transport type to remote dual mode device
3417    // Default: TRANSPORT_AUTO means no preference
3418    optional android.bluetooth.TransportTypeEnum transport = 2;
3419    // The type of this Bluetooth device (Classic, LE, or Dual mode)
3420    // Default: UNKNOWN
3421    optional android.bluetooth.DeviceTypeEnum type = 3;
3422    // Current bond state (NONE, BONDING, BONDED)
3423    // Default: BOND_STATE_UNKNOWN
3424    optional android.bluetooth.BondStateEnum bond_state = 4;
3425    // Bonding sub state
3426    // Default: BOND_SUB_STATE_UNKNOWN
3427    optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
3428    // Unbond Reason
3429    // Default: UNBOND_REASON_UNKNOWN
3430    optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
3431    // An identifier that can be used to match events for this device.
3432    // The incremental identifier is locally generated and guaranteed not derived
3433    // from any globally unique hardware id.
3434    // For paired devices, it stays consistent between Bluetooth toggling for the
3435    // same remote device.
3436    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3437    // session for the same remote device.
3438    // Default: 0 if the device's metric id is unknown.
3439    optional int32 metric_id = 7;
3440}
3441
3442/**
3443 * Logs there is an event related Bluetooth classic pairing
3444 *
3445 * Logged from:
3446 *     system/bt
3447 */
3448message BluetoothClassicPairingEventReported {
3449    // An identifier that can be used to match events for this device.
3450    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3451    // Salt: Randomly generated 256 bit value
3452    // Hash algorithm: HMAC-SHA256
3453    // Size: 32 byte
3454    // Default: null or empty if the device identifier is not known
3455    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3456    // Connection handle of this connection if available
3457    // Range: 0x0000 - 0x0EFF (12 bits)
3458    // Default: 0xFFFF if the handle is unknown
3459    optional int32 connection_handle = 2;
3460    // HCI command associated with this event
3461    // Default: CMD_UNKNOWN
3462    optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
3463    // HCI event associated with this event
3464    // Default: EVT_UNKNOWN
3465    optional android.bluetooth.hci.EventEnum hci_event = 4;
3466    // HCI command status code if this is triggerred by hci_cmd
3467    // Default: STATUS_UNKNOWN
3468    optional android.bluetooth.hci.StatusEnum cmd_status = 5;
3469    // HCI reason code associated with this event
3470    // Default: STATUS_UNKNOWN
3471    optional android.bluetooth.hci.StatusEnum reason_code = 6;
3472    // A status value related to this specific event
3473    // Default: 0
3474    optional int64 event_value = 7;
3475    // An identifier that can be used to match events for this device.
3476    // The incremental identifier is locally generated and guaranteed not derived
3477    // from any globally unique hardware id.
3478    // For paired devices, it stays consistent between Bluetooth toggling for the
3479    // same remote device.
3480    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3481    // session for the same remote device.
3482    // Default: 0 if the device's metric id is unknown.
3483    optional int32 metric_id = 8;
3484}
3485
3486/**
3487 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
3488 *
3489 * Logged from:
3490 *     system/bt
3491 */
3492message BluetoothSmpPairingEventReported {
3493    // An identifier that can be used to match events for this device.
3494    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3495    // Salt: Randomly generated 256 bit value
3496    // Hash algorithm: HMAC-SHA256
3497    // Size: 32 byte
3498    // Default: null or empty if the device identifier is not known
3499    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3500    // SMP command sent or received over L2CAP
3501    // Default: CMD_UNKNOWN
3502    optional android.bluetooth.smp.CommandEnum smp_command = 2;
3503    // Whether this command is sent or received
3504    // Default: DIRECTION_UNKNOWN
3505    optional android.bluetooth.DirectionEnum direction = 3;
3506    // SMP failure reason code
3507    // Default: PAIRING_FAIL_REASON_DEFAULT
3508    optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
3509    // An identifier that can be used to match events for this device.
3510    // The incremental identifier is locally generated and guaranteed not derived
3511    // from any globally unique hardware id.
3512    // For paired devices, it stays consistent between Bluetooth toggling for the
3513    // same remote device.
3514    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3515    // session for the same remote device.
3516    // Default: 0 if the device's metric id is unknown.
3517    optional int32 metric_id = 5;
3518}
3519
3520/**
3521 * Logs when a Bluetooth socket’s connection state changed
3522 *
3523 * Logged from:
3524 *   system/bt
3525 */
3526message BluetoothSocketConnectionStateChanged {
3527    // An identifier that can be used to match events for this device.
3528    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3529    // Salt: Randomly generated 256 bit value
3530    // Hash algorithm: HMAC-SHA256
3531    // Size: 32 byte
3532    // Default: null or empty if this is a server listener socket
3533    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3534    // Temporary port of this socket for the current connection or session only
3535    // Default 0 when unknown or don't care
3536    optional int32 port = 2;
3537    // Socket type as mentioned in
3538    // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
3539    // Default: SOCKET_TYPE_UNKNOWN
3540    optional android.bluetooth.SocketTypeEnum type = 3;
3541    // Socket connection state
3542    // Default: SOCKET_CONNECTION_STATE_UNKNOWN
3543    optional android.bluetooth.SocketConnectionstateEnum state = 4;
3544    // Number of bytes sent to remote device during this connection
3545    optional int64 tx_bytes = 5;
3546    // Number of bytes received from remote device during this connection
3547    optional int64 rx_bytes = 6;
3548    // Socket owner's UID
3549    optional int32 uid = 7 [(is_uid) = true];
3550    // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
3551    // |port| must be spawned by |server_port|
3552    // Default 0 when unknown or don't care
3553    optional int32 server_port = 8;
3554    // Whether this is a server listener socket
3555    optional android.bluetooth.SocketRoleEnum is_server = 9;
3556    // An identifier that can be used to match events for this device.
3557    // The incremental identifier is locally generated and guaranteed not derived
3558    // from any globally unique hardware id.
3559    // For paired devices, it stays consistent between Bluetooth toggling for the
3560    // same remote device.
3561    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3562    // session for the same remote device.
3563    // Default: 0 if the device's metric id is unknown.
3564    optional int32 metric_id = 10;
3565}
3566
3567/**
3568 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
3569 *
3570 * Logged from:
3571 *   packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
3572 *   packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
3573 *
3574 */
3575message BluetoothClassOfDeviceReported {
3576    // An identifier that can be used to match events for this device.
3577    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3578    // Salt: Randomly generated 256 bit value
3579    // Hash algorithm: HMAC-SHA256
3580    // Size: 32 byte
3581    // Default: null or empty if this is a server listener socket
3582    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
3583    // Class of Device (CoD) value including both Major, Minor device class and service class
3584    // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
3585    // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
3586    // Default: 0
3587    optional int32 class_of_device = 2;
3588    // An identifier that can be used to match events for this device.
3589    // The incremental identifier is locally generated and guaranteed not derived
3590    // from any globally unique hardware id.
3591    // For paired devices, it stays consistent between Bluetooth toggling for the
3592    // same remote device.
3593    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3594    // session for the same remote device.
3595    // Default: 0 if the device's metric id is unknown.
3596    optional int32 metric_id = 3;
3597}
3598
3599/**
3600 * Logs when there is a crash in hardware abstraction layer (HAL)
3601 *
3602 * Logged from:
3603 *   system/bt
3604 *
3605 */
3606message BluetoothHALCrashReasonReported {
3607    // An identifier that can be used to match events for this device.
3608    // The incremental identifier is locally generated and guaranteed not derived
3609    // from any globally unique hardware id.
3610    // For paired devices, it stays consistent between Bluetooth toggling for the
3611    // same remote device.
3612    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3613    // session for the same remote device.
3614    // Default: 0 if the device's metric id is unknown.
3615    optional int32 metric_id = 1;
3616    // An identifier that can be used to match events for this device.
3617    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
3618    // Salt: Randomly generated 256 bit value
3619    // Hash algorithm: HMAC-SHA256
3620    // Size: 32 byte
3621    // Default: null or empty if the device identifier is not known
3622    optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
3623    // Bluetooth HAL crash reason error code.
3624    // Original type: uint8_t
3625    // Default: 0x00 (DEFAULT)
3626    optional int32 error_code = 3;
3627    // Bluetooth HAL crash reason vendor error code.
3628    // Original type: uint8_t
3629    // Default: 0x00 (DEFAULT)
3630    optional int32 vendor_error_code = 4;
3631}
3632
3633/**
3634 * Logs when an LE Audio connection session ended
3635 *
3636 * Logged from:
3637 *   packages/modules/Bluetooth
3638 *
3639 */
3640message LeAudioConnectionSessionReported {
3641    // Size of this CSIS group
3642    optional int32 group_size = 1;
3643    // An identifier that can be used to match events for this CSIS group.
3644    // The incremental identifier is locally generated and guaranteed not derived
3645    // from any globally unique hardware id.
3646    // For paired groups, it stays consistent between Bluetooth toggling for the
3647    // same remote group.
3648    // For unpaired groups, it stays consistent within the same Bluetooth adapter
3649    // session for the same remote group.
3650    // Default: 0 if the group's metric id is unknown.
3651    optional int32 group_metric_id = 2;
3652    // Total duration of this LeAudioConnectionSession
3653    optional int64 duration_nanos = 3;
3654
3655    // Connecting timestamp offset to the beginning of this session of each device session
3656    repeated int64 device_connecting_offset_nanos = 4;
3657    // Connected timestamp offset to the beginning of this session of each device session
3658    repeated int64 device_connected_offset_nanos = 5;
3659    // Duration of each device session
3660    repeated int64 device_connection_duration_nanos = 6;
3661    // Connection status of each device session
3662    repeated android.bluetooth.leaudio.ConnectionStatus device_connection_status = 7;
3663    // Disconnection status of each device session
3664    repeated android.bluetooth.leaudio.ConnectionStatus device_disconnection_status = 8;
3665    // An identifier that can be used to match events for this device.
3666    // The incremental identifier is locally generated and guaranteed not derived
3667    // from any globally unique hardware id.
3668    // For paired devices, it stays consistent between Bluetooth toggling for the
3669    // same remote device.
3670    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3671    // session for the same remote device.
3672    // Default: 0 if the device's metric id is unknown.
3673    repeated int32 device_metric_id = 9;
3674
3675    // Streaming beginning timestamp offset to the beginning of this session
3676    repeated int64 streaming_session_offset_nanos = 10;
3677    // Streaming ending timestamp offset to the beginning of this session
3678    repeated int64 streaming_session_duration_nanos = 11;
3679    // Streaming context type of each steaming session
3680    repeated android.bluetooth.leaudio.ContextType streaming_context_type = 12;
3681}
3682
3683/**
3684 * Logs when an LE Audio broadcast session ended
3685 *
3686 * Logged from:
3687 *   packages/modules/Bluetooth
3688 *
3689 */
3690message LeAudioBroadcastSessionReported {
3691    // Broadcast duration
3692    optional int64 duration_nanos = 1;
3693}
3694
3695/* Logs input device information when input device is registered with Android device.
3696 * Reported at when a new input device is found by EventHub.
3697 *
3698 * Logged from:
3699 *   frameworks/native/services/inputflinger
3700 */
3701message InputDeviceRegistered {
3702    // The Input Device Name
3703    optional string name = 1;
3704    // The Input Device Vendor ID
3705    optional int32 vendor_id = 2;
3706    // The Input Device Product ID
3707    optional int32 product_id = 3;
3708    // The Input Device Version ID
3709    optional int32 version_id = 4;
3710    // The Input Device Bus ID
3711    optional int32 bus_id = 5;
3712    // The Input Device identifier generated from kernel device.
3713    // Hash algorithm: HMAC-SHA256
3714    optional string obfuscated_id = 6;
3715    // The Input Device Classes
3716    optional int32 device_classes = 7;
3717}
3718
3719/**
3720 * Logs when the counter is incremented
3721 *
3722 * Logged from:
3723 *   system/bt
3724 *   packages/apps/Bluetooth
3725 *
3726 */
3727message BluetoothCodePathCounter {
3728    // Keys of events with enum ranges to be defined
3729    optional android.bluetooth.CodePathCounterKeyEnum key = 1;
3730    // Number of frequency of events
3731    optional int64 number = 2;
3732}
3733
3734/**
3735 * Logs when an application attempts to start a Bluetooth Low Energy scan.
3736 * It only happens when the scan is initiated and does not repeatedly call
3737 * while the scan is running.
3738 *
3739 * Logged from:
3740 *   packages/apps/Bluetooth/src/com/android/bluetooth/gatt/GattService.java
3741 *
3742 */
3743message BluetoothLeBatchScanReportDelay {
3744    optional int32 application_uid = 1;
3745    optional int64 application_report_delay_millis = 2;
3746}
3747
3748message BluetoothLocalVersionsReported {
3749    // Chip Manufacturer name
3750    optional int32 lmp_manufacturer_name = 1;
3751    // LMP Version
3752    optional int32 lmp_version = 2;
3753    // LMP Subversion
3754    optional int32 lmp_subversion = 3;
3755    // HCI Version
3756    optional int32 hci_version = 4;
3757    // HCI Revision
3758    optional int32 hci_revision = 5;
3759}
3760
3761message BluetoothRemoteSupportedFeaturesReported {
3762    // An identifier that can be used to match events for this device.
3763    // The incremental identifier is locally generated and guaranteed not derived
3764    // from any globally unique hardware id.
3765    // For paired devices, it stays consistent between Bluetooth toggling for the
3766    // same remote device.
3767    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3768    // session for the same remote device.
3769    // Default: 0 if the device's metric id is unknown.
3770    optional int32 metric_id = 1;
3771    // Page of the feature bit masks
3772    optional int32 page = 2;
3773    // Bit mask of features
3774    optional int64 features_page2 = 3;
3775    // Connection handle of this connection if available
3776    // Range: 0x0000 - 0x0EFF (12 bits)
3777    // Default: 0xFFFF if the handle is unknown
3778    optional int32 connection_handle = 4;
3779}
3780
3781message BluetoothLocalSupportedFeaturesReported {
3782    // Page of the feature bit masks
3783    optional int32 page_num = 1;
3784    // Bit mask of features
3785    optional int64 features_page = 2;
3786}
3787
3788message BluetoothDisconnectionReasonReported {
3789    // Disconnection reason
3790    optional int32 reason = 1;
3791    // An identifier that can be used to match events for this device.
3792    // The incremental identifier is locally generated and guaranteed not derived
3793    // from any globally unique hardware id.
3794    // For paired devices, it stays consistent between Bluetooth toggling for the
3795    // same remote device.
3796    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3797    // session for the same remote device.
3798    // Default: 0 if the device's metric id is unknown.
3799    optional int32 metric_id = 2;
3800    // Connection handle of this connection if available
3801    // Range: 0x0000 - 0x0EFF (12 bits)
3802    // Default: 0xFFFF if the handle is unknown
3803    optional int32 connection_handle = 3;
3804}
3805
3806message BluetoothGattAppInfo {
3807    // An index to group connection events by session. It's a counter generated by
3808    // each profile. e.g. Gatt server generate such id to identify Gatt apps
3809    optional int32 session_index = 1;
3810    // An identifier that can be used to match events for this device.
3811    // The incremental identifier is locally generated and guaranteed not derived
3812    // from any globally unique hardware id.
3813    // For paired devices, it stays consistent between Bluetooth toggling for the
3814    // same remote device.
3815    // For unpaired devices, it stays consistent within the same Bluetooth adapter
3816    // session for the same remote device.
3817    // Default: 0 if the device's metric id is unknown.
3818    optional int32 metric_id = 2;
3819    // UID of the GATT app
3820    optional int32 uid = 3 [(is_uid) = true];
3821}
3822
3823/**
3824 * Logs when something is plugged into or removed from the USB-C connector.
3825 *
3826 * Logged from:
3827 *  UsbService
3828 */
3829message UsbConnectorStateChanged {
3830    enum State {
3831        STATE_DISCONNECTED = 0;
3832        STATE_CONNECTED = 1;
3833    }
3834    optional State state = 1
3835            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
3836    optional string id = 2 [(state_field_option).primary_field = true];
3837    // Last active session in ms.
3838    // 0 when the port is in connected state.
3839    optional int64 last_connect_duration_millis = 3;
3840}
3841
3842/**
3843 * Logs the reported speaker impedance.
3844 *
3845 * Logged from:
3846 *  Vendor audio implementation.
3847 */
3848message SpeakerImpedanceReported {
3849    optional int32 speaker_location = 1;
3850    optional int32 impedance = 2;
3851}
3852
3853/**
3854 * Logs the report of a failed hardware.
3855 *
3856 * Logged from:
3857 *  Vendor HALs.
3858 *
3859 */
3860message HardwareFailed {
3861    enum HardwareType {
3862        HARDWARE_FAILED_UNKNOWN = 0;
3863        HARDWARE_FAILED_MICROPHONE = 1;
3864        HARDWARE_FAILED_CODEC = 2;
3865        HARDWARE_FAILED_SPEAKER = 3;
3866        HARDWARE_FAILED_FINGERPRINT = 4;
3867    }
3868    optional HardwareType hardware_type = 1;
3869
3870   /**
3871    * hardware_location allows vendors to differentiate between multiple instances of
3872    * the same hardware_type.  The specific locations are vendor defined integers,
3873    * referring to board-specific numbering schemes.
3874    */
3875    optional int32 hardware_location = 2;
3876
3877    /**
3878     * failure_code is specific to the HardwareType of the failed hardware.
3879     * It should use one of the enum values defined below.
3880     */
3881    enum HardwareErrorCode {
3882        UNKNOWN = 0;
3883        COMPLETE = 1;
3884        SPEAKER_HIGH_Z = 2;
3885        SPEAKER_SHORT = 3;
3886        FINGERPRINT_SENSOR_BROKEN = 4;
3887        FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
3888        DEGRADE = 6;
3889    }
3890    optional int32 failure_code = 3;
3891}
3892
3893/**
3894 * Log an event when the device has been physically dropped.
3895 * Reported from the /vendor partition.
3896 */
3897message PhysicalDropDetected {
3898    // Confidence that the event was actually a drop, 0 -> 100
3899    optional int32 confidence_pctg = 1;
3900    // Peak acceleration of the drop, in 1/1000s of a g.
3901    optional int32 accel_peak_thousandths_g = 2;
3902    // Duration of freefall in ms
3903    optional int32 freefall_time_millis = 3;
3904}
3905
3906/**
3907 * Log bucketed battery charge cycles.
3908 *
3909 * Each bucket represents cycles of the battery past
3910 * a given charge point.  For example, if 10 cycle buckets are
3911 * initialized, bucket 1 is the lowest 1/10th of the battery,
3912 * and bucket 10 is 100%.
3913 *
3914 * Logged from:
3915 * /sys/class/power_supply/bms/cycle_count, via Vendor.
3916 */
3917message ChargeCyclesReported {
3918    optional int32 cycle_bucket_1 = 1;
3919    optional int32 cycle_bucket_2 = 2;
3920    optional int32 cycle_bucket_3 = 3;
3921    optional int32 cycle_bucket_4 = 4;
3922    optional int32 cycle_bucket_5 = 5;
3923    optional int32 cycle_bucket_6 = 6;
3924    optional int32 cycle_bucket_7 = 7;
3925    optional int32 cycle_bucket_8 = 8;
3926    optional int32 cycle_bucket_9 = 9;
3927    optional int32 cycle_bucket_10 = 10;
3928}
3929
3930/**
3931 * Log battery health snapshot.
3932 *
3933 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
3934 * are snapshotted periodically over 24hrs.
3935 */
3936message BatteryHealthSnapshot {
3937    enum BatterySnapshotType {
3938        UNKNOWN = 0;
3939        MIN_TEMP = 1;         // Snapshot at min batt temp over 24hrs.
3940        MAX_TEMP = 2;         // Snapshot at max batt temp over 24hrs.
3941        MIN_RESISTANCE = 3;   // Snapshot at min batt resistance over 24hrs.
3942        MAX_RESISTANCE = 4;   // Snapshot at max batt resistance over 24hrs.
3943        MIN_VOLTAGE = 5;      // Snapshot at min batt voltage over 24hrs.
3944        MAX_VOLTAGE = 6;      // Snapshot at max batt voltage over 24hrs.
3945        MIN_CURRENT = 7;      // Snapshot at min batt current over 24hrs.
3946        MAX_CURRENT = 8;      // Snapshot at max batt current over 24hrs.
3947        MIN_BATT_LEVEL = 9;   // Snapshot at min battery level (SoC) over 24hrs.
3948        MAX_BATT_LEVEL = 10;  // Snapshot at max battery level (SoC) over 24hrs.
3949        AVG_RESISTANCE = 11;  // Snapshot at average battery resistance over 24hrs.
3950    }
3951    optional BatterySnapshotType type = 1;
3952    // Temperature, in 1/10ths of degree C.
3953    optional int32 temperature_deci_celsius = 2;
3954    // Voltage Battery Voltage, in microVolts.
3955    optional int32 voltage_micro_volt = 3;
3956    // Current Battery current, in microAmps.
3957    optional int32 current_micro_amps = 4;
3958    // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
3959    optional int32 open_circuit_micro_volt = 5;
3960    // Resistance Battery Resistance, in microOhms.
3961    optional int32 resistance_micro_ohm = 6;
3962    // Level Battery Level, as % of full.
3963    optional int32 level_percent = 7;
3964}
3965
3966/**
3967 * Log slow I/O operations on the primary storage.
3968 */
3969message SlowIo {
3970    // Classifications of IO Operations.
3971    enum IoOperation {
3972        UNKNOWN = 0;
3973        READ = 1;
3974        WRITE = 2;
3975        UNMAP = 3;
3976        SYNC = 4;
3977    }
3978    optional IoOperation operation = 1;
3979
3980    // The number of slow IO operations of this type over 24 hours.
3981    optional int32 count = 2;
3982}
3983
3984/**
3985 * Log battery caused shutdown with the last recorded voltage.
3986 */
3987message BatteryCausedShutdown {
3988    // The last recorded battery voltage prior to shutdown.
3989    optional int32 last_recorded_micro_volt = 1;
3990}
3991
3992/**
3993 * Logs when ThermalService receives throttling events.
3994 *
3995 * Logged from:
3996 *   frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
3997 */
3998message ThermalThrottlingSeverityStateChanged {
3999    // The type of temperature being reported (CPU, GPU, SKIN, etc)
4000    optional android.os.TemperatureTypeEnum sensor_type = 1;
4001
4002    // The name of the temperature source. Eg. CPU0
4003    optional string sensor_name = 2;
4004
4005    // Temperature in tenths of a degree C.
4006    // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
4007    optional int32 temperature_deci_celsius = 3;
4008
4009    // Relative severity of the throttling, see enum definition.
4010    optional android.os.ThrottlingSeverityEnum severity = 4;
4011}
4012
4013/**
4014 * Logs the duration of a davey (jank of >=700ms) when it occurs
4015 *
4016 * Logged from:
4017 *   frameworks/base/libs/hwui/JankTracker.cpp
4018 */
4019message DaveyOccurred {
4020    // The UID that logged this atom.
4021    optional int32 uid = 1 [(is_uid) = true];
4022
4023    // Amount of time it took to render the frame. Should be >=700ms.
4024    optional int64 jank_duration_millis = 2;
4025}
4026
4027/**
4028 * Logs phone signal strength changes.
4029 *
4030 * Logged from:
4031 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
4032 */
4033message PhoneSignalStrengthChanged {
4034    // Signal strength, from frameworks/proto_logging/stats/enums/telephony/enums.proto.
4035    optional android.telephony.SignalStrengthEnum signal_strength = 1;
4036}
4037
4038
4039/**
4040 * Logs when the phone state, sim state or signal strength changes
4041 *
4042 * Logged from:
4043 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
4044 */
4045message PhoneServiceStateChanged {
4046    optional android.telephony.ServiceStateEnum state = 1;
4047    optional android.telephony.SimStateEnum sim_state = 2;
4048    optional android.telephony.SignalStrengthEnum signal_strength = 3;
4049}
4050
4051/**
4052 * Logs when the phone becomes on or off.
4053 *
4054 * Logged from:
4055 *   frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
4056 */
4057message PhoneStateChanged {
4058    enum State {
4059        OFF = 0;
4060        ON = 1;
4061    }
4062    optional State state = 1;
4063}
4064
4065message BackGesture {
4066    enum BackType {
4067        DEFAULT_BACK_TYPE = 0;
4068        COMPLETED = 1;
4069        COMPLETED_REJECTED = 2; // successful because coming from rejected area
4070        INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
4071        INCOMPLETE = 4;  // Unsuccessful, for reasons other than below.
4072        INCOMPLETE_FAR_FROM_EDGE = 5;  // Unsuccessful, far from the edge.
4073        INCOMPLETE_MULTI_TOUCH = 6;  // Unsuccessful, multi touch.
4074        INCOMPLETE_LONG_PRESS = 7;  // Unsuccessful, long press.
4075        INCOMPLETE_VERTICAL_MOVE = 8;  // Unsuccessful, move vertically.
4076    }
4077    optional BackType type = 1;
4078
4079    optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
4080    optional int32 start_x = 4;  // X coordinate for ACTION_DOWN event.
4081    optional int32 start_y = 5;  // Y coordinate for ACTION_DOWN event.
4082    optional int32 end_x = 6;   // X coordinate for ACTION_MOVE event.
4083    optional int32 end_y = 7;  // Y coordinate for ACTION_MOVE event.
4084    optional int32 left_boundary = 8;  // left edge width + left inset
4085    optional int32 right_boundary = 9;  // screen width - (right edge width + right inset)
4086    // The score between 0 and 1 which is the prediction output for the Back Gesture model.
4087    optional float ml_model_score = 10;
4088    optional string package_name = 11;  // The name of the top 100 most used package by all users.
4089
4090    enum WindowHorizontalLocation {
4091        DEFAULT_LOCATION = 0;
4092        LEFT = 1;
4093        RIGHT = 2;
4094    }
4095    optional WindowHorizontalLocation x_location = 3 [deprecated = true];
4096}
4097
4098message ExclusionRectStateChanged {
4099    optional string component_name = 1;    // if not available, simply packageName
4100    optional int32 requested_height = 2;   // px
4101    optional int32 rejected_height = 3;    // px
4102
4103    enum WindowHorizontalLocation {
4104        DEFAULT_LOCATION = 0;
4105        LEFT = 1;
4106        RIGHT = 2;
4107    }
4108    optional WindowHorizontalLocation x_location = 4;
4109    optional bool landscape = 5;
4110    optional bool splitscreen = 6 [deprecated = true];
4111    optional int32 duration_millis = 7;
4112}
4113
4114/**
4115 * Logs when IME is on.
4116 *
4117 * Logged from: /packages/SystemUI/src/com/android/systemui/
4118                statusbar/phone/NavigationBarView.java
4119 *
4120 */
4121message ImeTouchReported {
4122    optional int32 x_coordinate = 1;  // X coordinate for ACTION_DOWN event.
4123    optional int32 y_coordinate = 2;  // Y coordinate for ACTION_DOWN event.
4124}
4125
4126/**
4127 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
4128 *
4129 * Logged from:
4130 *   packages/apps/Launcher3
4131 */
4132message LauncherUIChanged {
4133    optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
4134    optional android.stats.launcher.LauncherState src_state = 2;
4135    optional android.stats.launcher.LauncherState dst_state = 3;
4136    optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
4137    optional bool is_swipe_up_enabled = 5 [deprecated = true];
4138
4139    // The event id (e.g., app launch, drag and drop, long press)
4140    optional int32 event_id = 6;
4141    // The event's source or target id (e.g., icon, task, button)
4142    optional int32 target_id = 7;
4143    // If the target needs to be tracked, use this id field
4144    optional int32 instance_id = 8;
4145    optional int32 uid = 9 [(is_uid) = true];
4146    optional string package_name = 10;
4147    optional string component_name = 11;
4148
4149    // (x, y) coordinate and the index information of the target on the container
4150    optional int32 grid_x = 12 [default = -1];
4151    optional int32 grid_y = 13 [default = -1];
4152    optional int32 page_id = 14 [default = -2];
4153
4154    // e.g., folder icon's (x, y) location and index information on the workspace
4155    optional int32 grid_x_parent = 15 [default = -1];
4156    optional int32 grid_y_parent = 16 [default = -1];
4157    optional int32 page_id_parent = 17 [default = -2];
4158
4159    // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
4160    optional int32 hierarchy = 18;
4161
4162    optional bool is_work_profile = 19;
4163
4164    // Used to store the predicted rank of the target
4165    optional int32 rank = 20 [default = -1];
4166
4167    // e.g., folderLabelState can be captured in the following two fields
4168    optional int32 from_state = 21;
4169    optional int32 to_state = 22;
4170
4171    // e.g., autofilled or suggested texts that are not user entered
4172    optional string edittext = 23;
4173
4174    // e.g., number of contents inside a container (e.g., icons inside a folder)
4175    optional int32 cardinality = 24;
4176
4177    // Used to store features of the target (e.g. widget is reconfigurable, etc)
4178    optional int32 features = 25;
4179
4180    // Used to store on-device search related features of the target
4181    // (e.g. spell-corrected query etc)
4182    optional int32 search_attributes = 26;
4183
4184    // List of attributes attached to the event.
4185    optional LauncherAttributes attributes = 27 [(log_mode) = MODE_BYTES];
4186}
4187
4188message LauncherAttributes{
4189
4190  // Integer value of item attribute enum
4191  // (e.g. SUGGESTED_LABEL, ALL_APPS_SEARCH_RESULT_SETTING etc)
4192  repeated int32 item_attributes = 1;
4193}
4194
4195message SmartSpaceCardReported {
4196    // Different SmartSpace cards.
4197    // DEPRECATED CardType enum. Use SmartspaceTarget.mFeatureType, which matches the list from:
4198    // google3/java/com/google/android/apps/miphone/aiai/echo/smartspace/Constants.kt
4199    enum CardType {
4200        option deprecated = true;
4201        UNKNOWN_CARD = 0;
4202        COMMUTE = 1;
4203        CALENDAR = 2;
4204        FLIGHT = 3;
4205        WEATHER = 4;
4206        WEATHER_ALERT = 5;
4207        AT_A_STORE_SHOPPING_LIST = 6;
4208        AT_A_STORE_LOYALTY_CARD = 7;
4209        HEADPHONE_RESUME_MEDIA = 8;
4210        HEADPHONE_MEDIA_RECOMMENDATIONS = 9;
4211        TIMER = 10;
4212        STOPWATCH = 11;
4213        FITNESS_ACTIVITY = 12;
4214        UPCOMING_REMINDER = 13;
4215        UPCOMING_BEDTIME = 14;
4216        TIME_TO_LEAVE = 15;
4217        PACKAGE_DELIVERED = 16;
4218        TIPS = 17;
4219        DOORBELL = 18;
4220        CROSS_DEVICE_TIMER = 19;
4221    }
4222
4223    // The surface that SmartSpace card is shown.
4224    enum DisplaySurface {
4225        DEFAULT_SURFACE = 0;
4226        HOMESCREEN = 1;
4227        LOCKSCREEN = 2;
4228        AOD = 3;
4229        SHADE = 4;
4230        DREAM_OVERLAY = 5;
4231    }
4232
4233    // The event id (e.g., impression, click, longpress, dismiss)
4234    optional int32 event_id = 1;
4235    // Uniquely identifies a card. Should persist through updates.
4236    optional int32 instance_id = 2;
4237    // Uniquely identifies one of the possible types of the SmartSpace cards.
4238    // Deprecated. Please read card_type_id instead.
4239    optional CardType card_type = 3 [deprecated = true];
4240    // Location of the card when the event occurred.
4241    optional DisplaySurface display_surface = 4;
4242    // The position of the card in the carousel when the event occurred.
4243    optional int32 rank = 5;
4244    // The number of cards shown to the user.
4245    optional int32 cardinality = 6;
4246    // Uniquely identifies one of the possible types of the SmartSpace cards.
4247    // To replace card_type. See go/smartspace-aster-metrics#card-type-id.
4248    optional int32 card_type_id = 7;
4249    // The app that the Smartspace card is tied to.
4250    optional int32 uid = 8 [(is_uid) = true];
4251    // This represents the interacted subaction for the given card.
4252    optional int32 interacted_subcard_rank = 9;
4253    // This represents the number of displayed subactions on the given card when a subaction click
4254    // occurred.
4255    optional int32 interacted_subcard_cardinality = 10;
4256    // The time it takes in ms from smartspace target is created to sysui receives
4257    // the target.
4258    optional int32 received_latency_millis = 11;
4259    // The sub cards.
4260    optional SmartSpaceSubcards subcards_info = 12 [(log_mode) = MODE_BYTES];
4261    // Holds all the dimensions for this event. See go/ss-dimensional-logging for details.
4262    optional SmartspaceCardDimensionalInfo dimensional_info = 13 [(log_mode) = MODE_BYTES];
4263}
4264
4265// Holds all the dimensions tied to a Smartspace event.
4266message SmartspaceCardDimensionalInfo {
4267    repeated SmartspaceFeatureDimension feature_dimensions = 1;
4268}
4269
4270message SmartspaceFeatureDimension {
4271    // This maps to an enum value in Android System Intelligence.
4272    optional int32 feature_dimension_id = 1;
4273
4274    // The value for this dimension.
4275    optional int32 feature_dimension_value = 2;
4276}
4277
4278/**
4279 * This message represents information about any SmartSpace subcards.
4280 * Logged from
4281 *   vendor/unbundled_google/packages/SystemUIGoogle/bcsmartspace/src/com/google/android/systemui/smartspace/BcSmartspaceLogger.java
4282 *   vendor/unbundled_google/packages/NexusLauncher/src/com/google/android/apps/nexuslauncher/qsb/SmartspaceViewContainer.java
4283 * Next Tag: 3
4284 */
4285message SmartSpaceSubcards {
4286    // List of subcards.
4287    repeated SmartSpaceCardMetadata subcards = 1;
4288    // The index of the clicked subcard, if applicable.
4289    // This index is 1 indexed as opposed to 0 indexed due to sint32 encoding
4290    // limitation when using -1 as a default.
4291    // Default will be 0 to denote that no subcard was clicked.
4292    // Please note this has no information about whether the primary card was
4293    // clicked or not. Basically if this has the value 0, just ignore this field.
4294    optional int32 clicked_subcard_index = 2;
4295}
4296
4297/**
4298 * This message represents metadata for a SmartSpace card.
4299 * Logged from
4300 *   vendor/unbundled_google/packages/SystemUIGoogle/bcsmartspace/src/com/google/android/systemui/smartspace/BcSmartspaceLogger.java
4301 *   vendor/unbundled_google/packages/NexusLauncher/src/com/google/android/apps/nexuslauncher/qsb/SmartspaceViewContainer.java
4302 * Next Tag: 3
4303 */
4304message SmartSpaceCardMetadata {
4305    // Uniquely identifies a card. Should persist through updates.
4306    optional int32 instance_id = 1;
4307    // The type of the card.
4308    optional int32 card_type_id = 2;
4309}
4310
4311/**
4312 * Used for snapshot of the HomeScreen UI elements
4313 *
4314 * Logged from:
4315 *   packages/apps/Launcher3
4316 */
4317message LauncherStaticLayout {
4318    // The event id (e.g., snapshot, drag and drop)
4319    optional int32 event_id = 1;
4320    // The event's source or target id (e.g., icon, shortcut, widget)
4321    optional int32 target_id = 2;
4322    // If the target needs to be tracked, use this id field
4323    optional int32 instance_id = 3;
4324    optional int32 uid = 4 [(is_uid) = true];
4325    optional string package_name = 5;
4326    optional string component_name = 6;
4327
4328    // (x, y) coordinate and the index information of the target on the container
4329    optional int32 grid_x = 7 [default = -1];
4330    optional int32 grid_y = 8 [default = -1];
4331    optional int32 page_id = 9 [default = -2];
4332
4333    // e.g., folder icon's (x, y) location and index information on the workspace
4334    // e.g., when used with widgets target, use these values for (span_x, span_y)
4335    optional int32 grid_x_parent = 10 [default = -1];
4336    optional int32 grid_y_parent = 11 [default = -1];
4337    optional int32 page_id_parent = 12 [default = -2];
4338
4339    // UNKNOWN = 0
4340    // HOTSEAT = 1
4341    // WORKSPACE = 2
4342    // FOLDER_HOTSEAT = 3
4343    // FOLDER_WORKSPACE = 4
4344    optional int32 hierarchy = 13;
4345
4346    optional bool is_work_profile = 14;
4347
4348    // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
4349    optional int32 origin = 15;
4350
4351    // e.g., number of icons inside a folder
4352    optional int32 cardinality = 16;
4353
4354    // e.g., (x, y) span of the widget inside homescreen grid system
4355    optional int32 span_x = 17 [default = 1];
4356    optional int32 span_y = 18 [default = 1];
4357
4358    // Used to store features of the target (e.g. widget is reconfigurable, etc)
4359    optional int32 features = 19;
4360
4361    // List of attributes attached to the event.
4362    optional LauncherAttributes attributes = 20 [(log_mode) = MODE_BYTES];
4363}
4364
4365/**
4366 * Used for logging launcher static elements using pulled atom.
4367 *
4368 * Logged from:
4369 *   packages/apps/Launcher3
4370 */
4371message LauncherLayoutSnapshot {
4372  // The event id (e.g., snapshot, drag and drop)
4373  optional int32 event_id = 1;
4374  // The event's source or target id (e.g., icon, shortcut, widget)
4375  optional int32 item_id = 2;
4376  // If the target needs to be tracked, use this id field
4377  optional int32 instance_id = 3;
4378  optional int32 uid = 4 [(is_uid) = true];
4379  optional string package_name = 5;
4380  optional string component_name = 6;
4381
4382  // (x, y) coordinate and the index information of the target on the container
4383  optional int32 grid_x = 7 [default = -1];
4384  optional int32 grid_y = 8 [default = -1];
4385  optional int32 page_id = 9 [default = -2];
4386
4387  // e.g., folder icon's (x, y) location and index information on the workspace
4388  // e.g., when used with widgets target, use these values for (span_x, span_y)
4389  optional int32 grid_x_parent = 10 [default = -1];
4390  optional int32 grid_y_parent = 11 [default = -1];
4391  optional int32 page_id_parent = 12 [default = -2];
4392
4393  // UNKNOWN = 0
4394  // HOTSEAT = 1
4395  // WORKSPACE = 2
4396  // FOLDER_HOTSEAT = 3
4397  // FOLDER_WORKSPACE = 4
4398  optional int32 container_id = 13;
4399
4400  optional bool is_work_profile = 14;
4401
4402  // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
4403  optional int32 attribute_id = 15;
4404
4405  // e.g., number of icons inside a folder
4406  optional int32 cardinality = 16;
4407
4408  // e.g., (x, y) span of the widget inside homescreen grid system
4409  optional int32 span_x = 17 [default = 1];
4410  optional int32 span_y = 18 [default = 1];
4411
4412  // List of attributes attached to the event.
4413  optional LauncherAttributes attributes = 19 [(log_mode) = MODE_BYTES];
4414
4415  optional bool is_kids_mode = 20;
4416}
4417
4418/**
4419 * Logs when Wallpaper or ThemePicker UI has changed.
4420 *
4421 * Logged from:
4422 *   packages/apps/ThemePicker
4423 *   packages/apps/WallpaperPicker2
4424 */
4425message StyleUIChanged {
4426    optional android.stats.style.Action action = 1;
4427    optional int32 color_package_hash = 2;
4428    optional int32 font_package_hash  = 3;
4429    optional int32 shape_package_hash = 4;
4430    optional int32 clock_package_hash = 5;
4431    optional int32 launcher_grid = 6;
4432    optional int32 wallpaper_category_hash = 7;
4433    optional int32 wallpaper_id_hash = 8;
4434    optional int32 color_preference = 9;
4435    optional android.stats.style.LocationPreference location_preference = 10;
4436    optional android.stats.style.DatePreference date_preference = 11;
4437    optional android.stats.style.LaunchedPreference launched_preference = 12;
4438    optional android.stats.style.EffectPreference effect_preference = 13;
4439    optional int32 effect_id_hash = 14;
4440    optional int32 lock_wallpaper_category_hash = 15;
4441    optional int32 lock_wallpaper_id_hash = 16;
4442    optional int32 first_launch_date_since_setup = 17;
4443    optional int32 first_wallpaper_apply_date_since_setup = 18;
4444    optional int32 app_launch_count = 19;
4445    optional int32 color_variant = 20;
4446    optional int64 time_elapsed_millis = 21;
4447    optional int32 effect_status_code = 22;
4448}
4449
4450/**
4451 * Logs when Settings UI has changed.
4452 *
4453 * Logged from:
4454 *   packages/apps/Settings
4455 */
4456message SettingsUIChanged {
4457    /**
4458     * Where this SettingsUIChange event comes from. For example, if
4459     * it's a PAGE_VISIBLE event, where the page is opened from.
4460     */
4461    optional android.app.settings.PageId attribution = 1;
4462
4463    /**
4464     * What the UI action is.
4465     */
4466    optional android.app.settings.Action action = 2;
4467
4468    /**
4469     * Where the action is happening
4470     */
4471    optional android.app.settings.PageId page_id = 3;
4472
4473    /**
4474     * What preference changed in this event.
4475     */
4476    optional string changed_preference_key = 4;
4477
4478    /**
4479     * The new value of the changed preference.
4480     */
4481    optional int64 changed_preference_int_value = 5;
4482}
4483
4484/**
4485 * Logs basic timing information about touch events.
4486 * Reported at most every 5 minutes while device is being interacted with.
4487 *
4488 * Logged from:
4489 *   frameworks/native/services/inputflinger
4490 */
4491message TouchEventReported {
4492    /**
4493     * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
4494     * and the standard deviation of the time spent processing touchscreen events
4495     * in the kernel and inputflinger. The units are microseconds.
4496     *
4497     * On supported devices, the starting point is taken during the hard interrupt inside the
4498     * kernel touch driver. On all other devices, the starting point is taken inside
4499     * the kernel's input event subsystem upon receipt of the input event.
4500     * The ending point is taken inside InputDispatcher, just after the input event
4501     * is sent to the app.
4502     */
4503    // Minimum value
4504    optional float latency_min_micros = 1;
4505    // Maximum value
4506    optional float latency_max_micros = 2;
4507    // Average value
4508    optional float latency_mean_micros = 3;
4509    // Standard deviation
4510    optional float latency_stdev_micros = 4;
4511    // Number of touch events (input_event) in this report
4512    optional int32 count = 5;
4513}
4514
4515/**
4516 * Logs slow input events.
4517 * The reports are rate-limited via a configurable server flag.
4518 *
4519 * Logged from:
4520 *   frameworks/native/services/inputflinger
4521 */
4522message SlowInputEventReported {
4523    /**
4524     * This is logged when a slow input event occurs. The threshold for what is considered a slow
4525     * event is applied to the 'end_to_end' latency number, and is configurable via a server flag.
4526     *
4527     * The goal of this data is to identify the bottlenecks in processing of input events.
4528     * All of the *_micros fields below are durations. The start and end points for each value
4529     * are described in the comments.
4530     */
4531    // Whether or not this is a DOWN event. If false, this is a MOVE event
4532    optional bool is_down = 1;
4533    // Start: the input event was created (touch events: the touch interrupt received in the driver)
4534    // End: the event was read in userspace (in EventHub)
4535    optional int32 event_to_read_micros = 2;
4536    // Start: the event was read in EventHub
4537    // End: the event was send to the app via the InputChannel (written to the socket)
4538    optional int32 read_to_deliver_micros = 3;
4539    // Start: the input event was sent to the app
4540    // End: the app consumed the input event
4541    optional int32 deliver_to_consume_micros = 4;
4542    // Start: the app consumed the event
4543    // End: the app's 'finishInputEvent' call was received in inputflinger
4544    // The end point can also be called "the app finished processing input event"
4545    optional int32 consume_to_finish_micros = 5;
4546    // Start: the app consumed the input event
4547    // End: the app produced a buffer
4548    optional int32 consume_to_gpu_complete_micros = 6;
4549    // Start: the app produced a buffer
4550    // End: the frame was shown on the display
4551    optional int32 gpu_complete_to_present_micros = 7;
4552    // The end-to-end touch latency
4553    // Start: the input event was created (touch events: the touch interrupt received in the driver)
4554    // End: the frame was presented on the display
4555    optional int32 end_to_end_micros = 8;
4556    // Since the last time this atom was reported, how many total events occurred?
4557    optional int32 num_events_since_last_report = 9;
4558    // Since the last time this atom was reported, how many slow events did not get reported
4559    // due to rate limiting?
4560    optional int32 num_skipped_slow_events_since_last_report = 10;
4561}
4562
4563/**
4564 * Logs gesture classification and timing information for touch events.
4565 *
4566 * Logged from:
4567 *   frameworks/base/core/java/android/view/GestureDetector.java
4568 *   frameworks/base/core/java/android/view/View.java
4569 */
4570message TouchGestureClassified {
4571    // The source of the classification (e.g. Java class name).
4572    optional string source = 1;
4573
4574    enum Classification {
4575        UNKNOWN_CLASSIFICATION = 0;
4576        SINGLE_TAP = 1;
4577        DOUBLE_TAP = 2;
4578        LONG_PRESS = 3;
4579        DEEP_PRESS = 4;
4580        SCROLL = 5;
4581    }
4582    // The classification of the gesture.
4583    optional Classification classification = 2;
4584
4585    // The interval from the start of a touch event stream until the
4586    // classification was made.
4587    optional int32 latency_millis = 3;
4588
4589    // The distance from the location of the first touch event to the
4590    // location of the touch event when the classification was made.
4591    optional float displacement_px = 4;
4592}
4593
4594/**
4595 * Logs that a setting was updated.
4596 * Logged from:
4597 *   frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
4598 * The tag and is_default allow resetting of settings to default values based on the specified
4599 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
4600 */
4601message SettingChanged {
4602    // The name of the setting.
4603    optional string setting = 1;
4604
4605    // The change being imposed on this setting. May represent a number, eg "3".
4606    optional string value = 2;
4607
4608    // The new value of this setting. For most settings, this is same as value. For some settings,
4609    // value is +X or -X where X represents an element in a set. For example, if the previous value
4610    // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
4611    // The +/- feature is currently only used for location_providers_allowed.
4612    optional string new_value = 3;
4613
4614    // The previous value of this setting.
4615    optional string prev_value = 4;
4616
4617    // The tag used with the is_default for resetting sets of settings. This is generally null.
4618    optional string tag = 5;
4619
4620    // True if this setting with tag should be resettable.
4621    optional bool is_default = 6;
4622
4623    // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
4624    optional int32 user = 7;
4625
4626    enum ChangeReason {
4627        UPDATED = 1; // Updated can be an insertion or an update.
4628        DELETED = 2;
4629    }
4630    optional ChangeReason reason = 8;
4631}
4632
4633/**
4634 * Logs activity going to foreground or background
4635 *
4636 * Logged from:
4637  *   frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
4638 */
4639message ActivityForegroundStateChanged {
4640    optional int32 uid = 1 [(is_uid) = true];
4641    optional string pkg_name = 2;
4642    optional string class_name = 3;
4643
4644    enum State {
4645        BACKGROUND = 0;
4646        FOREGROUND = 1;
4647    }
4648    optional State state = 4;
4649}
4650
4651/**
4652 * Logs when a volume entered low Storage state.
4653 * Logged from:
4654 *      frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
4655 */
4656message LowStorageStateChanged {
4657    // Volume that ran out of storage.
4658    optional string volume_description = 1;
4659
4660    enum State {
4661        UNKNOWN = 0;
4662        OFF = 1;
4663        ON = 2;
4664    }
4665    optional State state = 2;
4666}
4667
4668/**
4669 * Logs when an app is downgraded.
4670 * Logged from:
4671 *      frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
4672 */
4673message AppDowngraded {
4674    optional string package_name = 1;
4675    // Size of the package (all data) before being downgraded.
4676    optional int64 size_in_bytes_before = 2;
4677    // Size of the package (all data) after being downgraded.
4678    optional int64 size_in_bytes_after = 3;
4679
4680    optional bool aggressive = 4;
4681}
4682
4683/**
4684 * Logs when an app is optimized after being downgraded.
4685 * Logged from:
4686 *      frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
4687 */
4688message AppOptimizedAfterDowngraded {
4689    optional string package_name = 1;
4690}
4691
4692/**
4693 * Logs whenever an app is installed on external storage.
4694 * Logged from:
4695        frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4696 */
4697message AppInstallOnExternalStorageReported {
4698    // The type of external storage.
4699    optional android.stats.storage.ExternalStorageType storage_type = 1;
4700    // The name of the package that is installed on the sd card.
4701    optional string package_name = 2;
4702}
4703
4704/**
4705 * Logs when an app crashes.
4706 * Logged from:
4707 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4708 */
4709message AppCrashOccurred {
4710    optional int32 uid = 1 [(is_uid) = true];
4711
4712    optional string event_type = 2;
4713
4714    // The name of the process.
4715    // system_server if it is not by an app
4716    optional string process_name = 3;
4717
4718    // The pid if available. -1 means not available.
4719    optional int32 pid = 4;
4720
4721    optional string package_name = 5;
4722
4723    enum InstantApp {
4724        UNAVAILABLE = 0;
4725        FALSE = 1;
4726        TRUE = 2;
4727    }
4728    optional InstantApp is_instant_app = 6;
4729
4730    enum ForegroundState {
4731        UNKNOWN = 0;
4732        BACKGROUND = 1;
4733        FOREGROUND = 2;
4734    }
4735    optional ForegroundState foreground_state = 7;
4736
4737    optional android.server.ErrorSource error_source = 8;
4738
4739    optional bool is_incremental = 9;
4740
4741    optional float loading_progress = 10;
4742
4743    optional int64 millis_since_oldest_pending_read = 11;
4744
4745    // Status code to represent the health of the file system backing storage, as defined in
4746    // frameworks/base/core/java/android/os/incremental/IStorageHealthListener.aidl.
4747    // Value -1 if the app is not installed on Incremental
4748    optional int32 storage_health_code = 12;
4749
4750    // Status code to represent the status of data loader, as defined in
4751    // frameworks/base/core/java/android/content/pm/IDataLoaderStatusListener.aidl.
4752    // Value -1 if the app is not installed on Incremental
4753    optional int32 data_loader_status_code = 13;
4754
4755    // Whether read logs collection is enabled
4756    optional bool read_logs_enabled = 14;
4757
4758    // Duration since last attempt to bind data loader. 0 means did not attempt to bind.
4759    // -1 means the app is not installed on Incremental.
4760    optional int64 millis_since_last_data_loader_bind = 15;
4761
4762    // Delay for retrying to bind data loader. If not bound, it shows how soon it will be bound.
4763    optional int64 data_loader_bind_delay_millis = 16;
4764
4765    // Total count of delayed reads, as reported by Incremental File System.
4766    optional int32 total_delayed_reads = 17;
4767
4768    // Total count of failed reads (timeout or hash errors) as reported by Incremental File System.
4769    optional int32 total_failed_reads = 18;
4770
4771    // UID of the process that tried to read a page from the app but failed.
4772    // This shows whether the read was initiated by the system, the app itself, or some other apps.
4773    // -1 means there was no read error or the app is not installed on Incremental.
4774    optional int32 last_read_error_uid = 19;
4775
4776    // Duration since that last read failure.
4777    // -1 means there was no read error or the app is not installed on Incremental.
4778    optional int64 last_read_error_millis_since = 20;
4779
4780    // Error code of last read failure. ETIME (value=62) for timeout, EBADMSG (value=74) for hash
4781    // and other positive values for other errors. -1 means app is not installed on Incremental.
4782    optional int32 last_read_error_code = 21;
4783
4784    // Total duration of delayed reads in milliseconds
4785    optional int64 total_delayed_reads_duration_millis = 22;
4786}
4787
4788/**
4789 * Logs when a WTF (What a Terrible Failure) happened.
4790 * Logged from:
4791 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4792 */
4793message WTFOccurred {
4794    optional int32 uid = 1 [(is_uid) = true];
4795
4796    optional string tag = 2;
4797
4798    // The name of the process.
4799    // system_server if it is not by an app
4800    optional string process_name = 3;
4801
4802    // The pid if available. -1 means not available.
4803    optional int32 pid = 4;
4804
4805    optional android.server.ErrorSource error_source = 5;
4806}
4807
4808/**
4809 * Logs when system server reports low memory.
4810 * Logged from:
4811 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4812 */
4813message LowMemReported {
4814}
4815
4816/**
4817 * Logs when an app ANR (App Not Responding) occurs.
4818 * Logged from:
4819 *      frameworks/base/services/core/java/com/android/server/am/AppErrors.java
4820 */
4821message ANROccurred {
4822    optional int32 uid = 1 [(is_uid) = true];
4823
4824    optional string process_name = 2;
4825
4826    optional string short_component_name = 3;
4827
4828    optional string reason = 4;
4829
4830    enum InstantApp {
4831        UNAVAILABLE = 0;
4832        FALSE = 1;
4833        TRUE = 2;
4834    }
4835    optional InstantApp is_instant_app = 5;
4836
4837    enum ForegroundState {
4838        UNKNOWN = 0;
4839        BACKGROUND = 1;
4840        FOREGROUND = 2;
4841    }
4842    optional ForegroundState foreground_state = 6;
4843
4844    optional android.server.ErrorSource error_source = 7;
4845
4846    optional string package_name = 8;
4847
4848    optional bool is_incremental = 9;
4849
4850    optional float loading_progress = 10;
4851
4852    optional int64 millis_since_oldest_pending_read = 11;
4853
4854    // Status code to represent the health of the file system backing storage, as defined in
4855    // frameworks/base/core/java/android/os/incremental/IStorageHealthListener.aidl.
4856    // Value -1 if the app is not installed on Incremental
4857    optional int32 storage_health_code = 12;
4858
4859    // Status code to represent the status of data loader, as defined in
4860    // frameworks/base/core/java/android/content/pm/IDataLoaderStatusListener.aidl.
4861    // Value -1 if the app is not installed on Incremental
4862    optional int32 data_loader_status_code = 13;
4863
4864    // Whether read logs collection is enabled
4865    optional bool read_logs_enabled = 14;
4866
4867    // Duration since last attempt to bind data loader. 0 means did not attempt to bind.
4868    // -1 means the app is not installed on Incremental.
4869    optional int64 millis_since_last_data_loader_bind = 15;
4870
4871    // Delay for retrying to bind data loader. If not bound, it shows how soon it will be bound.
4872    optional int64 data_loader_bind_delay_millis = 16;
4873
4874    // Total count of delayed reads, as reported by Incremental File System.
4875    optional int32 total_delayed_reads = 17;
4876
4877    // Total count of failed reads (timeout or hash errors) as reported by Incremental File System.
4878    optional int32 total_failed_reads = 18;
4879
4880    // UID of the process that tried to read a page from the app but failed.
4881    // This shows whether the read was initiated by the system, the app itself, or some other apps.
4882    // -1 means there was no read error or the app is not installed on Incremental.
4883    optional int32 last_read_error_uid = 19;
4884
4885    // Duration since that last read failure.
4886    // -1 means there was no read error or the app is not installed on Incremental.
4887    optional int64 last_read_error_millis_since = 20;
4888
4889    // Error code of last read failure. ETIME (value=62) for timeout, EBADMSG (value=74) for hash
4890    // and other positive values for other errors. -1 means app is not installed on Incremental.
4891    optional int32 last_read_error_code = 21;
4892
4893    // Total duration of delayed reads in milliseconds
4894    optional int64 total_delayed_reads_duration_millis = 22;
4895}
4896
4897/**
4898 * Logs immediately after an app ANR (App Not Responding) occurs. In contrast, ANROccurred (the
4899 * atom above) logs some time (not necessarily immediately) after the ANR is detected.
4900 * Logged from:
4901 *      frameworks/base/services/core/java/com/android/server/am/AppErrors.java
4902 */
4903message ANROccurredProcessingStarted {
4904  optional string process_name = 1;
4905}
4906
4907/**
4908 * Logs when the vibrator state changes.
4909 * Logged from:
4910 *      frameworks/base/services/core/java/com/android/vibrator/VibratorManagerService.java
4911 */
4912message VibratorStateChanged {
4913    repeated AttributionNode attribution_node = 1;
4914
4915    enum State {
4916        OFF = 0;
4917        ON = 1;
4918    }
4919    optional State state = 2;
4920
4921    // Duration (in milliseconds) requested to keep the vibrator on.
4922    // Only applicable for State == ON.
4923    optional int64 duration_millis = 3;
4924}
4925
4926/**
4927 * Logs vibration request.
4928 * Logged from:
4929 *      frameworks/base/services/core/java/com/android/server/vibrator/VibratorManagerService.java
4930 */
4931// Next tag: 26
4932message VibrationReported {
4933  repeated AttributionNode attribution_node = 1;
4934
4935  enum VibrationType {
4936    UNKNOWN = 0;
4937    SINGLE = 1;
4938    REPEATED = 2;
4939    EXTERNAL = 3;
4940  }
4941
4942  // Vibration identifiers for aggregation.
4943  optional VibrationType vibration_type = 2;
4944  // One of VibrationAttributes.USAGE_* constant values.
4945  optional int32 vibration_usage = 3;
4946  optional int32 vibration_status = 4;
4947
4948  // Vibration completion causes.
4949  // Flag indicating if the vibration was canceled by the same process
4950  // or superseded/canceled by another vibration from the same process.
4951  optional bool ended_by_same_uid = 5;
4952  // Usage value of the vibration that superseded/canceled this one.
4953  optional int32 ended_by_usage = 6;
4954  // Usage value of the vibration that was superseded/canceled by this one.
4955  optional int32 interrupted_usage = 7;
4956
4957  // Vibration execution counters.
4958  optional int32 repeat_count = 8;
4959  // Total duration of this vibration at the service, including setup and cleanup.
4960  optional int64 vibration_duration_millis = 9;
4961  // Total duration the vibrator motor was active with non-zero amplitude.
4962  optional int64 vibrator_on_duration_millis = 10;
4963  // Delta between the incoming binder call to vibrate and the first step in the
4964  // vibration conductor (closest measure of starting HAL interactions).
4965  optional int64 start_latency_millis = 11;
4966  // Delta between the HAL reporting the last vibrate operation has completed and
4967  // vibrator service has finished the vibration and become idle.
4968  optional int64 end_latency_millis = 12;
4969
4970  // Vibrator hardware HAL API interaction counters.
4971  // The majority of vibrations will populate only a couple of the fields below.
4972  optional int32 hal_compose_count = 13;
4973  optional int32 hal_compose_pwle_count = 14;
4974  optional int32 hal_on_count = 15;
4975  optional int32 hal_off_count = 16;
4976  optional int32 hal_perform_count = 17;
4977  optional int32 hal_set_amplitude_count = 18;
4978  optional int32 hal_set_external_control_count = 19;
4979
4980  // Vibrator hardware HAL API constants used (deduped).
4981  // Values from CompositionPrimitive.aidl successfully triggered by this vibration at least once.
4982  repeated int32 hal_supported_composition_primitives_used = 20;
4983  // Values from Effect.aidl triggered by this vibration at least once.
4984  repeated int32 hal_supported_effects_used = 21;
4985  // Values from CompositionPrimitive.aidl triggered but not supported by the device.
4986  repeated int32 hal_unsupported_composition_primitives_used = 22;
4987  // Values from Effect.aidl triggered but not supported by the device.
4988  repeated int32 hal_unsupported_effects_used = 23;
4989  // Vibrator hardware HAL argument sizes (total).
4990  optional int32 hal_composition_size = 24;
4991  optional int32 hal_pwle_size = 25;
4992}
4993
4994/*
4995 * Allows other apps to push events into statsd.
4996 * Logged from:
4997 *      frameworks/base/core/java/android/util/StatsLog.java
4998 */
4999message AppBreadcrumbReported {
5000    // The uid of the application that sent this custom atom.
5001    optional int32 uid = 1 [(is_uid) = true];
5002
5003    // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
5004    optional int32 label = 2;
5005
5006    // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
5007    // predicates for the metrics).
5008    enum State {
5009        UNKNOWN = 0;
5010        UNSPECIFIED = 1;  // For events that are known to not represent START/STOP.
5011        STOP = 2;
5012        START = 3;
5013    }
5014    optional State state = 3;
5015}
5016
5017/**
5018 * Logs the wall-clock time when a significant wall-clock time shift occurs.
5019 * For example, this could be due to the user manually changing the time.
5020 *
5021 * Logged from:
5022 *   frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
5023 */
5024message WallClockTimeShifted {
5025    // New wall-clock time in milliseconds, according to System.currentTimeMillis().
5026    optional int64 wall_clock_timestamp_millis = 1;
5027}
5028
5029/**
5030 * Logs when statsd detects an anomaly.
5031 *
5032 * Logged from:
5033 *   frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
5034 */
5035message AnomalyDetected {
5036    // Uid that owns the config whose anomaly detection alert fired.
5037    optional int32 config_uid = 1 [(is_uid) = true];
5038
5039    // Id of the config whose anomaly detection alert fired.
5040    optional int64 config_id = 2;
5041
5042    // Id of the alert (i.e. name of the anomaly that was detected).
5043    optional int64 alert_id = 3;
5044}
5045
5046message AppStartOccurred {
5047    // The uid if available. -1 means not available.
5048    optional int32 uid = 1 [(is_uid) = true];
5049
5050    // The app package name.
5051    optional string pkg_name = 2;
5052
5053    enum TransitionType {
5054        UNKNOWN = 0;
5055        WARM = 1;
5056        HOT = 2;
5057        COLD = 3;
5058        RELAUNCH = 4;
5059    }
5060    // The transition type.
5061    optional TransitionType type = 3;
5062
5063    // The activity name.
5064    optional string activity_name = 4;
5065
5066    // The name of the calling app. Empty if not set.
5067    optional string calling_pkg_name = 5;
5068
5069    // Whether the app is an instant app.
5070    optional bool is_instant_app = 6;
5071
5072    // Device uptime when activity started. Deprecated: use activity_start_timestamp_millis instead.
5073    optional int64 activity_start_millis = 7 [deprecated = true];
5074
5075    optional android.app.AppTransitionReasonEnum reason = 8;
5076
5077    optional int32 transition_delay_millis = 9;
5078    // -1 if not set.
5079    optional int32 starting_window_delay_millis = 10;
5080    // -1 if not set.
5081    optional int32 bind_application_delay_millis = 11;
5082    optional int32 windows_drawn_delay_millis = 12;
5083
5084    // Empty if not set.
5085    optional string launch_token = 13;
5086
5087    // The reason why the package was optimized.
5088    optional int32 package_optimization_compilation_reason = 14;
5089
5090    // The compiler filter used when when the package was optimized.
5091    optional int32 package_optimization_compilation_filter = 15;
5092
5093    enum SourceType {
5094        UNAVAILABLE = 0;
5095        LAUNCHER = 1;
5096        NOTIFICATION = 2;
5097        LOCKSCREEN = 3;
5098        RECENTS_ANIMATION = 4;
5099    }
5100    // The type of the startup source.
5101    optional SourceType source_type = 16;
5102
5103    // The time from the startup source to the beginning of handling the startup event.
5104    // -1 means not available.
5105    optional int32 source_event_delay_millis = 17;
5106
5107    // Whether the app is hibernating when it started
5108    optional bool is_hibernating = 18;
5109
5110    // Whether the app is installed on Incremental File System.
5111    optional bool is_incremental = 19;
5112
5113    // Whether the app is still being streamed.
5114    optional bool is_loading = 20;
5115
5116    // The hash value of the activity name.
5117    optional int32 activity_name_hash = 21;
5118
5119    // The timestamp(SystemClock#elapsedRealtime()) when starting activity.
5120    optional int64 activity_start_timestamp_millis = 22;
5121
5122    /**
5123     * The process state of apps, keep in sync with
5124     * frameworks/base/core/java/android/app/ActivityManager.java
5125     */
5126    enum AppProcessState {
5127        PROCESS_STATE_UNKNOWN = -1;
5128        PROCESS_STATE_PERSISTENT = 0;
5129        PROCESS_STATE_PERSISTENT_UI = 1;
5130        PROCESS_STATE_TOP = 2;
5131        PROCESS_STATE_BOUND_TOP = 3;
5132        PROCESS_STATE_FOREGROUND_SERVICE = 4;
5133        PROCESS_STATE_BOUND_FOREGROUND_SERVICE = 5;
5134        PROCESS_STATE_IMPORTANT_FOREGROUND = 6;
5135        PROCESS_STATE_IMPORTANT_BACKGROUND = 7;
5136        PROCESS_STATE_TRANSIENT_BACKGROUND = 8;
5137        PROCESS_STATE_BACKUP = 9;
5138        PROCESS_STATE_SERVICE = 10;
5139        PROCESS_STATE_RECEIVER = 11;
5140        PROCESS_STATE_TOP_SLEEPING = 12;
5141        PROCESS_STATE_HEAVY_WEIGHT = 13;
5142        PROCESS_STATE_HOME = 14;
5143        PROCESS_STATE_LAST_ACTIVITY = 15;
5144        PROCESS_STATE_CACHED_ACTIVITY = 16;
5145        PROCESS_STATE_CACHED_ACTIVITY_CLIENT = 17;
5146        PROCESS_STATE_CACHED_RECENT = 18;
5147        PROCESS_STATE_CACHED_EMPTY = 19;
5148        PROCESS_STATE_NONEXISTENT = 20;
5149    }
5150
5151    // The process state of the launching activity prior to the launch.
5152    optional AppProcessState process_state = 23;
5153
5154    // The oom adj score of the launching activity prior to the launch.
5155    optional int32 process_oom_adj = 24;
5156}
5157
5158message AppStartCanceled {
5159    // The uid if available. -1 means not available.
5160    optional int32 uid = 1 [(is_uid) = true];
5161
5162    // The app package name.
5163    optional string pkg_name = 2;
5164
5165    enum TransitionType {
5166        UNKNOWN = 0;
5167        WARM = 1;
5168        HOT = 2;
5169        COLD = 3;
5170        RELAUNCH = 4;
5171    }
5172    // The transition type.
5173    optional TransitionType type = 3;
5174
5175    // The activity name.
5176    optional string activity_name = 4;
5177}
5178
5179message AppStartFullyDrawn {
5180    // The uid if available. -1 means not available.
5181    optional int32 uid = 1 [(is_uid) = true];
5182
5183    // The app package name.
5184    optional string pkg_name = 2;
5185
5186    enum TransitionType {
5187        UNKNOWN = 0;
5188        WITH_BUNDLE = 1;
5189        WITHOUT_BUNDLE = 2;
5190    }
5191    // The transition type.
5192    optional TransitionType type = 3;
5193
5194    // The activity name.
5195    optional string activity_name = 4;
5196
5197    optional bool transition_process_running = 5;
5198
5199    // App startup time (until call to Activity#reportFullyDrawn()).
5200    optional int64 app_startup_time_millis = 6;
5201
5202    // The reason why the package was optimized.
5203    optional int32 package_optimization_compilation_reason = 7;
5204
5205    // The compiler filter used when when the package was optimized.
5206    optional int32 package_optimization_compilation_filter = 8;
5207
5208    enum SourceType {
5209        UNAVAILABLE = 0;
5210        LAUNCHER = 1;
5211        NOTIFICATION = 2;
5212        LOCKSCREEN = 3;
5213    }
5214    // The type of the startup source.
5215    optional SourceType source_type = 9;
5216
5217    // The time from the startup source to the beginning of handling the startup event.
5218    // -1 means not available.
5219    optional int32 source_event_delay_millis = 10;
5220
5221    // Whether the app is installed on Incremental File System.
5222    optional bool is_incremental = 11;
5223
5224    // Whether the app is still being streamed.
5225    optional bool is_loading = 12;
5226
5227    // The hash value of the activity name.
5228    optional int32 activity_name_hash = 13;
5229}
5230
5231/**
5232 * Logs when an app enters a different App Compat state.
5233 *
5234 * Logged from:
5235 *   frameworks/base/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
5236 */
5237message AppCompatStateChanged {
5238    // UID of the package whose state changed.
5239    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
5240
5241    enum State {
5242        UNKNOWN = 0;
5243        // The app is not visible or has been closed.
5244        NOT_VISIBLE = 1;
5245        // The app’s bounds aren’t letterboxed.
5246        NOT_LETTERBOXED = 2;
5247        // The app’s bounds are letterboxed because of size-compat-mode.
5248        LETTERBOXED_FOR_SIZE_COMPAT_MODE = 3;
5249        // The app’s bounds are letterboxed because of fixed orientation.
5250        LETTERBOXED_FOR_FIXED_ORIENTATION = 4;
5251        // The app’s bounds are letterboxed because of aspect ratio restrictions.
5252        LETTERBOXED_FOR_ASPECT_RATIO = 5;
5253    }
5254
5255    // Position of the letterbox
5256    enum Position {
5257        UNKNOWN_POSITION = 0;
5258        NOT_LETTERBOXED_POSITION = 1;
5259        CENTER = 2;
5260        LEFT = 3;
5261        RIGHT = 4;
5262        TOP = 5;
5263        BOTTOM = 6;
5264    }
5265
5266    // The state that was entered.
5267    optional State state = 2 [
5268      (state_field_option).exclusive_state = true,
5269      (state_field_option).nested = false];
5270
5271    optional Position letterbox_position = 3;
5272}
5273
5274/**
5275 * Logs when an app that is letterboxed changes position.
5276 *
5277 * Logged from:
5278 *   frameworks/base/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
5279 */
5280
5281message LetterboxPositionChanged {
5282    // UID of the package that is letterboxed.
5283    optional int32 uid = 1 [(is_uid) = true];
5284
5285    // The new position of the letterbox
5286    enum PositionChange {
5287        UNKNOWN = 0;
5288        CENTER_TO_LEFT = 1;
5289        LEFT_TO_CENTER = 2;
5290        CENTER_TO_RIGHT= 3;
5291        RIGHT_TO_CENTER = 4;
5292        CENTER_TO_TOP = 5;
5293        TOP_TO_CENTER = 6;
5294        CENTER_TO_BOTTOM = 7;
5295        BOTTOM_TO_CENTER = 8;
5296    }
5297
5298    optional PositionChange position_change = 2;
5299
5300}
5301
5302/**
5303 * Logs events reported for the Size Compat restart button of an app.
5304 *
5305 * Logged from:
5306 *   frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
5307 */
5308message SizeCompatRestartButtonEventReported {
5309    // UID of the package that has the button.
5310    optional int32 uid = 1 [(is_uid) = true];
5311
5312    enum Event {
5313        UNKNOWN = 0;
5314        APPEARED = 1;
5315        CLICKED = 2;
5316    }
5317
5318    // The event that was reported.
5319    optional Event event = 2;
5320}
5321
5322/**
5323 * Logs events reported for the Camera App Compat control, which is used to
5324 * correct stretched viewfinder in apps that don't handle all possible
5325 * configurations, and changes between them, correctly.
5326 *
5327 * Logged from:
5328 *   frameworks/base/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
5329 */
5330message CameraCompatControlEventReported {
5331  // UID of the package that has the control.
5332  optional int32 uid = 1 [(is_uid) = true];
5333
5334  enum Event {
5335    UNKNOWN = 0;
5336    // Button to apply the treatment appeared.
5337    APPEARED_APPLY_TREATMENT = 1;
5338    // Button to revert the treatment appeared.
5339    APPEARED_REVERT_TREATMENT = 2;
5340    // Users clicked on the button to apply the treatment.
5341    CLICKED_APPLY_TREATMENT = 3;
5342    // Users clicked on the button to revert the treatment.
5343    CLICKED_REVERT_TREATMENT = 4;
5344    // Users clicked on the button to dismiss the control.
5345    CLICKED_DISMISS = 5;
5346  }
5347
5348  // The event that was reported.
5349  optional Event event = 2;
5350}
5351
5352/**
5353 * Logs a picture-in-picture action
5354 * Logged from:
5355 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5356 *      frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
5357 *      frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
5358 */
5359message PictureInPictureStateChanged {
5360    // -1 if it is not available
5361    optional int32 uid = 1 [(is_uid) = true];
5362
5363    optional string short_name = 2;
5364
5365    enum State {
5366        ENTERED = 1;
5367        EXPANDED_TO_FULL_SCREEN = 2;
5368        MINIMIZED = 3;
5369        DISMISSED = 4;
5370    }
5371    optional State state = 3;
5372}
5373
5374/**
5375 * Logs overlay action
5376 * Logged from:
5377 *     services/core/java/com/android/server/wm/Session.java
5378 */
5379message OverlayStateChanged {
5380    optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
5381
5382    optional string package_name = 2 [(state_field_option).primary_field = true];
5383
5384    optional bool using_alert_window = 3;
5385
5386    enum State {
5387        ENTERED = 1;
5388        EXITED = 2;
5389    }
5390    optional State state = 4
5391            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
5392}
5393
5394/**
5395 * Logs foreground service starts and stops.
5396 * Note that this is not when a service starts or stops, but when it is
5397 * considered foreground.
5398 * Logged from
5399 *     frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
5400 */
5401message ForegroundServiceStateChanged {
5402    optional int32 uid = 1 [(is_uid) = true];
5403    // package_name + "/" + class_name
5404    optional string short_name = 2;
5405
5406    enum State {
5407        ENTER = 1;
5408        EXIT = 2;
5409        DENIED = 3;
5410    }
5411    optional State state = 3;
5412
5413    // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
5414    // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
5415    optional bool allow_while_in_use_permission = 4;
5416    // the reason why FGS is allowed or denied to start. The reason code is defined as
5417    // PowerExemptionManager#ReasonCode.
5418    optional int32 fgs_start_reason_code = 5;
5419    // FGS service's targetSdkVersion.
5420    optional int32 target_sdk_version = 6;
5421    // uid of the app that start/bind this service.
5422    optional int32 calling_uid = 7;
5423    // targetSdkVersion of the app that start/bind this service.
5424    optional int32 caller_target_sdk_version = 8;
5425    // uid of the app that set the temp-allowlist, INVALID_UID (-1) if not in any
5426    // temp-allowlist.
5427    optional int32 temp_allow_list_calling_uid = 9;
5428    // FGS notification was deferred.
5429    optional bool fgs_notification_deferred = 10;
5430    // FGS notification was shown before the FGS finishes, or it wasn't deferred in the first place.
5431    optional bool fgs_notification_shown = 11;
5432    // The duration from state ENTER to state EXIT. Only meaningful when the state is EXIT.
5433    optional int32 fgs_duration_ms = 12;
5434    // Number of times startForeground() is called on this service.
5435    optional int32 fgs_start_count = 13;
5436    // SHA-1 hashed short_name combined with ANDROID_ID.
5437    optional int32 short_name_hash = 14;
5438    // Whether this FGS package had permission to notify the user.
5439    optional bool fgs_has_notification_permission = 15;
5440
5441    // Keep in sync with frameworks/base/core/java/android/content/pm/ServiceInfo.java
5442    enum ForegroundServiceType {
5443        FOREGROUND_SERVICE_TYPE_NONE = 0;
5444        FOREGROUND_SERVICE_TYPE_DATA_SYNC = 0x0001; // 1 << 0
5445        FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK = 0x0002; // 1 << 1
5446        FOREGROUND_SERVICE_TYPE_PHONE_CALL = 0x0004; //1 << 2
5447        FOREGROUND_SERVICE_TYPE_LOCATION = 0x0008; // 1 << 3
5448        FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE = 0x0010; // 1 << 4
5449        FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION = 0x0020; // 1 << 5
5450        FOREGROUND_SERVICE_TYPE_CAMERA = 0x0040; // 1 << 6
5451        FOREGROUND_SERVICE_TYPE_MICROPHONE = 0x0080; // 1 << 7
5452    }
5453
5454    // The foreground service types, must be one or a combination of the types
5455    // in the ForegroundServiceType above.
5456    optional int32 fgs_types = 16;
5457}
5458
5459/**
5460 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
5461 * A foreground service session is any continuous period during which the uid holds at least one
5462 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
5463 * Accesses initiated while the uid is in the TOP state are ignored.
5464 * Sessions with no attempted accesses are not logged.
5465 * Logged from
5466 *     frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
5467 */
5468message ForegroundServiceAppOpSessionEnded {
5469    optional int32 uid = 1 [(is_uid) = true];
5470
5471    // The operation's name.
5472    // Only following four ops are logged
5473    // COARSE_LOCATION = 0
5474    // FINE_LOCATION = 1
5475    // CAMERA = 26
5476    // RECORD_AUDIO = 27
5477    optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
5478
5479    // The uid's permission mode for accessing the AppOp during this fgs session.
5480    enum Mode {
5481        MODE_UNKNOWN = 0;
5482        MODE_ALLOWED = 1; // Always allowed
5483        MODE_IGNORED = 2; // Denied
5484        MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
5485    }
5486    optional Mode app_op_mode = 3;
5487
5488    // Number of times this AppOp was requested and allowed.
5489    optional int32 count_ops_accepted = 4;
5490    // Number of times this AppOp was requested but denied.
5491    optional int32 count_ops_rejected = 5;
5492}
5493
5494/**
5495 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
5496 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
5497 * attributed back to the parent (host) uid. One example is Chrome.
5498 *
5499 * Logged from:
5500 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
5501 */
5502message IsolatedUidChanged {
5503    // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
5504    // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
5505    // This field is ignored when event == REMOVED.
5506    optional int32 parent_uid = 1;
5507
5508    optional int32 isolated_uid = 2;
5509
5510    // We expect an isolated uid to be removed before if it's used for another parent uid.
5511    enum Event {
5512        REMOVED = 0;
5513        CREATED = 1;
5514    }
5515    optional Event event = 3;
5516}
5517
5518/*
5519 * Logs the reception of an incoming network packet causing the main system to wake up for
5520 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
5521 * and processed by WakeupController.cpp.
5522 */
5523message PacketWakeupOccurred {
5524    // The uid owning the socket into which the packet was delivered, or -1 if the packet was
5525    // delivered nowhere.
5526    optional int32 uid = 1 [(is_uid) = true];
5527    // The interface name on which the packet was received.
5528    optional string iface = 2;
5529    // The ethertype value of the packet.
5530    optional int32 ethertype = 3;
5531    // String representation of the destination MAC address of the packet.
5532    optional string destination_hardware_address = 4;
5533    // String representation of the source address of the packet if this was an IP packet.
5534    optional string source_ip = 5;
5535    // String representation of the destination address of the packet if this was an IP packet.
5536    optional string destination_ip = 6;
5537    // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
5538    // field if this was an IPv6 packet. The range of possible values is the same for both IP
5539    // families.
5540    optional int32 ip_next_header = 7;
5541    // The source port if this was a TCP or UDP packet.
5542    optional int32 source_port = 8;
5543    // The destination port if this was a TCP or UDP packet.
5544    optional int32 destination_port = 9;
5545}
5546
5547/*
5548 * Logs the memory stats for an app on startup.
5549 * Logged from:
5550 *     frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5551 */
5552message AppStartMemoryStateCaptured {
5553    // The uid if available. -1 means not available.
5554    optional int32 uid = 1 [(is_uid) = true];
5555
5556    // The process name.
5557    optional string process_name = 2;
5558
5559    // The activity name.
5560    optional string activity_name = 3;
5561
5562    // # of page-faults
5563    optional int64 page_fault = 4;
5564
5565    // # of major page-faults
5566    optional int64 page_major_fault = 5;
5567
5568    // RSS
5569    optional int64 rss_in_bytes = 6;
5570
5571    // CACHE
5572    optional int64 cache_in_bytes = 7;
5573
5574    // SWAP
5575    optional int64 swap_in_bytes = 8;
5576}
5577
5578/*
5579 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
5580 * for LMK event.
5581 * Logged from:
5582 *      system/core/lmkd/lmkd.c
5583 */
5584message LmkStateChanged {
5585    enum State {
5586        UNKNOWN = 0;
5587        START = 1;
5588        STOP = 2;
5589    }
5590    optional State state = 1;
5591}
5592
5593/*
5594 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
5595 * Logged from:
5596 *      system/core/lmkd/lmkd.c
5597 */
5598message LmkKillOccurred {
5599    enum Reason {
5600        UNKNOWN = 0;
5601        PRESSURE_AFTER_KILL = 1;
5602        NOT_RESPONDING = 2;
5603        LOW_SWAP_AND_THRASHING = 3;
5604        LOW_MEM_AND_SWAP = 4;
5605        LOW_MEM_AND_THRASHING = 5;
5606        DIRECT_RECL_AND_THRASHING = 6;
5607        LOW_MEM_AND_SWAP_UTIL = 7;
5608        LOW_FILECACHE_AFTER_THRASHING = 8;
5609    }
5610
5611    // The uid if available. -1 means not available.
5612    optional int32 uid = 1 [(is_uid) = true];
5613
5614    // The process name.
5615    optional string process_name = 2;
5616
5617    // oom adj score.
5618    optional int32 oom_adj_score = 3;
5619
5620    // # of page-faults
5621    optional int64 page_fault = 4;
5622
5623    // # of major page-faults
5624    optional int64 page_major_fault = 5;
5625
5626    // RSS
5627    optional int64 rss_in_bytes = 6;
5628
5629    // CACHE
5630    optional int64 cache_in_bytes = 7;
5631
5632    // SWAP
5633    optional int64 swap_in_bytes = 8;
5634
5635    // The elapsed real time of start of the process.
5636    optional int64 process_start_time_nanos = 9;
5637
5638    // Min oom adj score considered by lmkd.
5639    optional int32 min_oom_score = 10;
5640
5641    // Free physical memory on device at LMK time.
5642    optional int32 free_mem_kb = 11;
5643
5644    // Free swap on device at LMK time.
5645    optional int32 free_swap_kb = 12;
5646
5647    // What triggered the LMK event.
5648    optional Reason reason = 13;
5649
5650    // Current thrashing levels (workingset_refaults/filecache in %).
5651    optional int32 thrashing = 14;
5652
5653    // Max thrashing levels (workingset_refaults/filecache in %).
5654    optional int32 max_thrashing = 15;
5655
5656    // How many active foreground services across the system
5657    optional int32 total_foreground_services = 16;
5658
5659    // How many processes hosting foreground services
5660    optional int32 procs_with_foreground_services = 17;
5661}
5662
5663/*
5664 * Logs when the ActivityManagerService detects that an app died.
5665 *
5666 * Logged from:
5667 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5668 */
5669message AppDied {
5670    // timestamp(elapsedRealtime) of record creation
5671    optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
5672}
5673
5674/**
5675 * An atom for generic metrics logging. Available from Android Q.
5676 */
5677message GenericAtom {
5678    // The uid of the application that sent this custom atom.
5679    optional int32 uid = 1 [(is_uid) = true];
5680
5681    // An event_id indicates the type of event.
5682    optional android.stats.EventType event_id = 2;
5683}
5684
5685/**
5686 * Atom for simple logging of user interaction and impression events, such as "the user touched
5687 * this button" or "this dialog was displayed".
5688 * Keep the UI event stream clean: don't use for system or background events.
5689 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
5690 *
5691 * Logged from:
5692 *   frameworks/base/services/core/java/com/android/server/
5693 *   frameworks/base/packages/SystemUI/src/com/android/systemui/
5694 */
5695message UiEventReported {
5696    // The event_id.
5697    optional int32 event_id = 1;
5698    // The event's source or target uid and package, if applicable.
5699    // For example, the package posting a notification, or the destination package of a share.
5700    optional int32 uid = 2 [(is_uid) = true];
5701    optional string package_name = 3;
5702    // An identifier used to disambiguate which logs refer to a particular instance of some
5703    // UI element. Useful when there might be multiple instances simultaneously active.
5704    optional int32 instance_id = 4;
5705}
5706
5707/**
5708 * Atom for logging Dream user interaction and impression events.
5709 *
5710 * Logged from:
5711 *   frameworks/base/services/core/java/com/android/server/
5712 */
5713message DreamUiEventReported {
5714    // The event's source or target uid, if applicable.
5715    optional int32 uid = 1 [(is_uid) = true];
5716    // The event_id (as for UiEventReported).
5717    optional int32 event_id = 2;
5718    // An identifier used to disambiguate which logs refer to a particular instance of some
5719    // UI element. Useful when there might be multiple instances simultaneously active.
5720    optional int32 instance_id = 3;
5721
5722    // The name of the dream component, which identifies the type of the dream.
5723    optional string dream_component_name = 4;
5724}
5725
5726/**
5727 * Reports a notification was created or updated.
5728 *
5729 * Logged from:
5730 *   frameworks/base/services/core/java/com/android/server/notification/
5731 */
5732message NotificationReported {
5733    // The event_id (as for UiEventReported).
5734    optional int32 event_id = 1;
5735    // The notifying app's uid and package.
5736    optional int32 uid = 2 [(is_uid) = true];
5737    optional string package_name = 3;
5738    // A small system-assigned identifier for the notification.
5739    // Locally probably-unique, but expect collisions across users and/or days.
5740    optional int32 instance_id = 4;
5741    optional int32 notification_id_hash = 5;  // Small hash of the app-assigned notif ID + tag
5742    optional int32 channel_id_hash = 6;  // Small hash of app-assigned channel ID
5743
5744    // Grouping information
5745    optional int32 group_id_hash = 7;  // Small hash of the group ID of the notification
5746    optional int32 group_instance_id = 8;  // Instance_id of the group-summary notification
5747    optional bool is_group_summary = 9;  // Tags the group-summary notification
5748
5749    // Attributes
5750    optional string category = 10;   // App-assigned notification category (API-defined strings)
5751    optional int32 style = 11;       // App-assigned notification style
5752    optional int32 num_people = 12;  // Number of Person records attached to the notification
5753
5754    // Ordering, importance and interruptiveness
5755
5756    optional int32 position = 13;    // Position in NotificationManager's list
5757
5758    optional android.stats.sysui.NotificationImportance importance = 14;
5759    optional int32 alerting = 15;    // Bitfield, 1=buzz 2=beep 4=blink
5760
5761    enum NotificationImportanceExplanation {
5762        IMPORTANCE_EXPLANATION_UNKNOWN = 0;
5763        IMPORTANCE_EXPLANATION_APP = 1;     // App-specified channel importance.
5764        IMPORTANCE_EXPLANATION_USER = 2;    // User-specified channel importance.
5765        IMPORTANCE_EXPLANATION_ASST = 3;    // Notification Assistant override.
5766        IMPORTANCE_EXPLANATION_SYSTEM = 4;  // System override.
5767        // Like _APP, but based on pre-channels priority signal.
5768        IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
5769    }
5770
5771    optional NotificationImportanceExplanation importance_source = 16;
5772    optional android.stats.sysui.NotificationImportance importance_initial = 17;
5773    optional NotificationImportanceExplanation importance_initial_source = 18;
5774    optional android.stats.sysui.NotificationImportance importance_asst = 19;
5775    optional int32 assistant_hash = 20;
5776    optional float assistant_ranking_score = 21;
5777
5778    // Fields for tracking ongoing and foreground service notifications
5779    optional bool is_ongoing = 22;
5780    optional bool is_foreground_service = 23;
5781    // Fields to know about the timeout for notifications.
5782    optional int64 timeout_millis = 24;
5783}
5784
5785message Notification {
5786    // The notifying app's uid and package.
5787    optional int32 uid = 1 [(is_uid) = true];
5788    optional string package_name = 2;
5789    // A small system-assigned identifier for the notification.
5790    optional int32 instance_id = 3;
5791
5792    // Grouping information.
5793    optional int32 group_instance_id = 4;
5794    optional bool is_group_summary = 5;
5795
5796    // The section of the shade that the notification is in.
5797    // See SystemUI Notifications.proto.
5798    enum NotificationSection {
5799        SECTION_UNKNOWN = 0;
5800        SECTION_HEADS_UP = 1;
5801        SECTION_MEDIA_CONTROLS = 2;
5802        SECTION_PEOPLE = 3;
5803        SECTION_ALERTING = 4;
5804        SECTION_SILENT = 5;
5805        SECTION_FOREGROUND_SERVICE = 6;
5806    }
5807    optional NotificationSection section = 6;
5808}
5809
5810message NotificationList {
5811    repeated Notification notifications = 1;  // An ordered sequence of notifications.
5812}
5813
5814/**
5815 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
5816 *
5817 * Logged from:
5818 *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
5819 */
5820message NotificationPanelReported {
5821    // The event_id (as for UiEventReported).
5822    optional int32 event_id = 1;
5823    optional int32 num_notifications = 2;
5824    // The notifications in the panel, in the order that they appear there.
5825    optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
5826}
5827
5828/**
5829 * Reports a notification channel, or channel group, was created, updated, or deleted.
5830 *
5831 * Logged from:
5832 *   frameworks/base/services/core/java/com/android/server/notification/
5833 */
5834message NotificationChannelModified {
5835    // The event_id (as for UiEventReported).
5836    optional int32 event_id = 1;
5837    // The notifying app's uid and package.
5838    optional int32 uid = 2 [(is_uid) = true];
5839    optional string package_name = 3;
5840    // Hash of app-assigned notification channel ID or channel-group ID
5841    optional int32 channel_id_hash = 4;
5842    // Previous importance setting, if applicable
5843    optional android.stats.sysui.NotificationImportance old_importance = 5;
5844    // New importance setting
5845    optional android.stats.sysui.NotificationImportance importance = 6;
5846    // whether or not this channel represents a conversation
5847    optional bool is_conversation = 7;
5848    // Hash of app-assigned notification conversation id
5849    optional int32 conversation_id_hash = 8;
5850    // whether or not the user demoted this channel out of the conversation space
5851    optional bool is_conversation_demoted = 9;
5852    // whether this conversation is marked as being a priority
5853    optional bool is_conversation_priority = 10;
5854}
5855
5856/**
5857 * Snapshot of notification memory use aggregated per-package and per-style.
5858 * One message for each notification style of each package showing notifications.
5859 * Logged from
5860 *    frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging
5861 */
5862 message NotificationMemoryUse {
5863    // UID if the application (can be mapped to package and version)
5864    optional int32 uid = 1;
5865    // Integer enum value showing aggregated notification style.
5866    optional int32 style = 2;
5867    // Number of notifications that were aggregated into this metric.
5868    optional int32 count = 3;
5869    // Number of notifications with actually inflated views in this metric.
5870    optional int32 countWithInflatedViews = 4;
5871    // Memory use of small icon Bitmaps in KB.
5872    optional int32 smallIconObject = 5;
5873    // Count of notifications with small icons as bitmaps.
5874    optional int32 smallIconBitmapCount = 6;
5875    // Memory use of large icon Bitmaps in KB.
5876    optional int32 largeIconObject = 7;
5877    // Count of notifications with large icons as bitmaps.
5878    optional int32 largeIconBitmapCount = 8;
5879    // Memory use of big picture style Bitmaps in KB.
5880    optional int32 bigPictureObject = 9;
5881    // Count of notifications with big picture images as bitmaps.
5882    optional int32 bigPictureBitmapCount = 10;
5883    // Complete memory use of extras in Notification object, in KB.
5884    optional int32 extras = 11;
5885    // Memory use of extenders in KB.
5886    optional int32 extenders = 12;
5887    // Combined memory use of small icon drawables in views, in KB.
5888    optional int32 smallIconViews = 13;
5889    // Combined memory use of large icon drawables in views, in KB.
5890    optional int32 largeIconViews = 14;
5891    // Combined memory use of system icon drawables in views, in KB.
5892    optional int32 systemIconViews = 15;
5893    // Combined memory use of style drawables (e.g. BigPicture) in views, in KB.
5894    optional int32 styleViews = 16;
5895    // Combined memory use of custom view drawables in views, in KB.
5896    optional int32 customViews = 17;
5897    // Extra memory used due to usage of software bitmaps, in KB.
5898    optional int32 softwareBitmaps = 18;
5899    // How many notifications were actually ever shown to the user.
5900    optional int32 seenCount = 19;
5901}
5902
5903/**
5904 * Logged when notification are dismissed. If multiple notifications are dismissed together,
5905 * this is only logged once per style per UID.
5906 * Logged from
5907 *    frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging
5908 */
5909message NotificationDismissed {
5910    // UID if the application (can be mapped to package and version)
5911    optional int32 uid = 1 [(is_uid) = true];
5912    // Integer enum value showing aggregated notification style.
5913    optional android.stats.sysui.NotificationStyle style = 2;
5914    // Reason for dismissal, based on REASON_ constants in
5915    // frameworks/base/core/java/android/service/notification/NotificationListenerService.java
5916    optional int32 reason = 3;
5917    // Number of notifications dismissed.
5918    optional int32 count = 4;
5919    // Memory use of Notification object being dismissed, in KB.
5920    optional int32 notificationObjectMemoryUse = 5;
5921    // Memory use of Notification views being dismissed, in KB.
5922    optional int32 notificationViewMemoryUse = 6;
5923    // Current memory use of SystemUI, RSS Anon in KB.
5924    optional int32 systemUiMemoryUse = 7;
5925}
5926
5927/**
5928 * Logs when a biometric acquire event occurs.
5929 *
5930 * Logged from:
5931 *   frameworks/base/services/core/java/com/android/server/biometrics
5932 */
5933message BiometricAcquired {
5934    // Biometric modality that was acquired.
5935    optional android.hardware.biometrics.ModalityEnum modality = 1;
5936    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
5937    optional int32 user = 2;
5938    // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
5939    optional bool is_crypto = 3;
5940    // Action that the device is performing. Acquired messages are only expected for enroll and
5941    // authenticate. Other actions may indicate an error.
5942    optional android.hardware.biometrics.ActionEnum action = 4;
5943    // The client that this acquisition was received for.
5944    optional android.hardware.biometrics.ClientEnum client = 5;
5945    // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
5946    optional int32 acquire_info = 6;
5947    // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
5948    optional int32 acquire_info_vendor = 7;
5949    // Dictates if this message should trigger additional debugging.
5950    optional bool debug = 8;
5951    // The ID of the biometric sensor associated with this action.
5952    optional int32 sensor_id = 9;
5953    // The ID of the session this event occurred in (if any)
5954    optional int32 session_id = 10;
5955    // The type of session (i.e. CUJ)
5956    optional android.hardware.biometrics.SessionTypeEnum session_type = 11;
5957    // If the AoD was on when this event occurred.
5958    optional bool is_aod = 12;
5959}
5960
5961/**
5962 * Logs when a biometric authentication event occurs.
5963 *
5964 * Logged from:
5965 *   frameworks/base/services/core/java/com/android/server/biometrics
5966 */
5967message BiometricAuthenticated {
5968    // Biometric modality that was used.
5969    optional android.hardware.biometrics.ModalityEnum modality = 1;
5970    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
5971    optional int32 user = 2;
5972    // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
5973    // storage.
5974    optional bool is_crypto = 3;
5975    // The client that this acquisition was received for.
5976    optional android.hardware.biometrics.ClientEnum client = 4;
5977    // If authentication requires user confirmation. See BiometricPrompt's
5978    // setRequireConfirmation(bool) method.
5979    optional bool require_confirmation = 5;
5980
5981    enum State {
5982        UNKNOWN = 0;
5983        REJECTED = 1;
5984        PENDING_CONFIRMATION = 2;
5985        CONFIRMED = 3;
5986    }
5987
5988    // State of the current auth attempt.
5989    optional State state = 6;
5990    // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
5991    // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
5992    // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
5993    // CONFIRMED.
5994    optional int64 latency_millis = 7;
5995    // Dictates if this message should trigger additional debugging.
5996    optional bool debug = 8;
5997    // The ID of the biometric sensor associated with this action.
5998    optional int32 sensor_id = 9;
5999    // The ambient light lux when authenticated.
6000    optional float ambient_light_lux = 10;
6001    // The ID of the session this event occurred in (if any)
6002    optional int32 session_id = 11;
6003    // The type of session (i.e. CUJ)
6004    optional android.hardware.biometrics.SessionTypeEnum session_type = 12;
6005    // If the AoD was on when this event occurred.
6006    optional bool is_aod = 13;
6007}
6008
6009/**
6010 * Logs when a biometric error occurs.
6011 *
6012 * Logged from:
6013 *   frameworks/base/services/core/java/com/android/server/biometrics
6014 */
6015message BiometricErrorOccurred {
6016    // Biometric modality that was used.
6017    optional android.hardware.biometrics.ModalityEnum modality = 1;
6018    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
6019    optional int32 user = 2;
6020    // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
6021    optional bool is_crypto = 3;
6022    // Action that the device is performing.
6023    optional android.hardware.biometrics.ActionEnum action = 4;
6024    // The client that this acquisition was received for.
6025    optional android.hardware.biometrics.ClientEnum client = 5;
6026    // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
6027    // are unique to modality.
6028    optional int32 error_info = 6;
6029    // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
6030    // by the vendor and not specified by the HIDL interface.
6031    optional int32 error_info_vendor = 7;
6032    // Dictates if this message should trigger additional debugging.
6033    optional bool debug = 8;
6034    // Time spent during the authentication attempt.
6035    optional int64 latency_millis = 9;
6036    // The ID of the biometric sensor associated with this action.
6037    optional int32 sensor_id = 10;
6038    // The ID of the session this event occurred in (if any)
6039    optional int32 session_id = 11;
6040    // The type of session (i.e. CUJ)
6041    optional android.hardware.biometrics.SessionTypeEnum session_type = 12;
6042    // If the AoD was on when this event occurred.
6043    optional bool is_aod = 13;
6044}
6045
6046/**
6047 * Logs when a system health issue is detected.
6048 * Logged from:
6049 *   frameworks/base/services/core/java/com/android/server/biometrics
6050 */
6051message BiometricSystemHealthIssueDetected {
6052    // Biometric modality.
6053    optional android.hardware.biometrics.ModalityEnum modality = 1;
6054    // Type of issue detected.
6055    optional android.hardware.biometrics.IssueEnum issue = 2;
6056    // Dictates if this message should trigger additional debugging.
6057    optional bool debug = 3;
6058    // The ID of the biometric sensor associated with this action.
6059    optional int32 sensor_id = 4;
6060}
6061
6062/**
6063 * Logs when a biometric enrollment occurs.
6064 *
6065 * Logged from:
6066 *   frameworks/base/services/core/java/com/android/server/biometrics
6067 */
6068message BiometricEnrolled {
6069    // Biometric modality that was used.
6070    optional android.hardware.biometrics.ModalityEnum modality = 1;
6071    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
6072    optional int32 user = 2;
6073    // The amount of time the enrollment took in milliseconds.
6074    optional int64 latency_millis = 3;
6075    // Whether or not the enrollment was successful.
6076    optional bool success = 4;
6077    // The ID of the biometric sensor associated with this action.
6078    optional int32 sensor_id = 5;
6079    // The ambient light lux when the user enrolled.
6080    optional float ambient_light_lux = 6;
6081}
6082
6083/*
6084 * Logs when one of the BiometricPrompt#authenticate() method variants is called.
6085 *
6086 * Logged from:
6087 *   frameworks/base/services/core/java/com/android/server/biometrics
6088 *
6089 */
6090 message AuthPromptAuthenticateInvoked {
6091    // Whether an explicit CryptoObject was passed to the biometric prompt.
6092    optional bool is_crypto = 1;
6093    // The value passed to setConfirmationRequired(boolean), or true if not set.
6094    optional bool is_confirmation_required = 2;
6095    // The value passed to setDeviceCredentialAllowed(boolean), or false if not set.
6096    optional bool is_credential_allowed = 3;
6097    // Whether a value was passed to setAllowedAuthenticators(int).
6098    optional bool is_allowed_authenticators_set = 4;
6099    // The value passed to setAllowedAuthenticators(int), if any.
6100    optional int32 allowed_authenticators = 5;
6101}
6102
6103/*
6104 * Logs when one of the BiometricPrompt#canAuthenticate() method variants is called.
6105 *
6106 * Logged from:
6107 *   frameworks/base/services/core/java/com/android/server/biometrics
6108 *
6109 */
6110message AuthManagerCanAuthenticateInvoked {
6111    // Whether a bit field of allowed authenticator types was provided as an argument.
6112    optional bool is_allowed_authenticators_set = 1;
6113    // The bit field of allowed authenticator types provided, if any.
6114    optional int32 allowed_authenticators = 2;
6115    // The authentication status code that was returned.
6116    optional int32 result_code = 3;
6117}
6118
6119/*
6120 * Logs when Biometric enrollment is requested via the ACTION_BIOMETRIC_ENROLL intent action.
6121 *
6122 * Logged from:
6123 *   frameworks/base/services/core/java/com/android/server/biometrics
6124 *
6125 */
6126message AuthEnrollActionInvoked {
6127    // Whether a Class 3 (strong) biometric was previously enrolled on this device.
6128    optional bool is_strong_biometric_enrolled = 1;
6129    // Whether a Class 2 (weak) biometric was previously enrolled on this device.
6130    optional bool is_weak_biometric_enrolled = 2;
6131    // Whether a PIN/pattern/password was previously enrolled on this device.
6132    optional bool is_device_credential_enrolled = 3;
6133    // Whether a bit field of allowed authenticator types was provided as an extra.
6134    optional bool is_allowed_authenticators_set = 4;
6135    // The bit field of allowed authenticator types provided, if any.
6136    optional int32 allowed_authenticators = 5;
6137}
6138
6139/*
6140 * Logs when an application uses a deprecated biometric or authentication API feature.
6141 *
6142 * Logged from:
6143 *   frameworks/base/services/core/java/com/android/server/biometrics
6144 */
6145 message AuthDeprecatedAPIUsed {
6146    enum APIEnum {
6147        API_UNKNOWN = 0;
6148        // android.hardware.fingerprint.FingerprintManager#authenticate(CryptoObject,
6149        // CancellationSignal, int, AuthenticationCallback, Handler)
6150        API_FINGERPRINT_MANAGER_AUTHENTICATE = 1;
6151        // android.hardware.fingerprint.FingerprintManager#hasEnrolledFingerprints()
6152        API_FINGERPRINT_MANAGER_HAS_ENROLLED_FINGERPRINTS = 2;
6153        // android.hardware.fingerprint.FingerprintManager#isHardwareDetected()
6154        API_FINGERPRINT_MANAGER_IS_HARDWARE_DETECTED = 3;
6155        // android.hardware.biometrics.BiometricManager#canAuthenticate()
6156        API_BIOMETRIC_MANAGER_CAN_AUTHENTICATE = 4;
6157    }
6158
6159     // The deprecated API feature that was used.
6160     optional APIEnum deprecated_api = 1;
6161     // The UID of the application that used the deprecated API.
6162     optional int32 app_uid = 2;
6163     // The target SDK version (API level) of the application that used the deprecated API.
6164     optional int32 target_sdk = 3;
6165 }
6166
6167/*
6168 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
6169 */
6170message FlagFlipUpdateOccurred {
6171    // If the event is from a flag config package, specify the package name.
6172    optional string flag_flip_package_name = 1;
6173
6174    // The order id of the package
6175    optional int64 order_id = 2;
6176}
6177
6178/**
6179 * Potential experiment ids that goes with a train install.
6180 * Should be kept in sync with experiment_ids.proto.
6181 */
6182message TrainExperimentIds {
6183    repeated int64 experiment_id = 1;
6184}
6185
6186/*
6187 * Logs when a binary push state changes.
6188 * Logged by the installer via public api.
6189 */
6190message BinaryPushStateChanged {
6191    // Name of the train.
6192    optional string train_name = 1;
6193    // Version code for a "train" of packages that need to be installed atomically
6194    optional int64 train_version_code = 2;
6195    // After installation of this package, device requires a restart.
6196    optional bool requires_staging = 3;
6197    // Rollback should be enabled for this install.
6198    optional bool rollback_enabled = 4;
6199    // Requires low latency monitoring if possible.
6200    optional bool requires_low_latency_monitor = 5;
6201
6202    enum State {
6203        UNKNOWN = 0;
6204        INSTALL_REQUESTED = 1;
6205        INSTALL_STARTED = 2;
6206        INSTALL_STAGED_NOT_READY = 3;
6207        INSTALL_STAGED_READY = 4;
6208        INSTALL_SUCCESS = 5;
6209        // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6210        // and INSTALL_FAILURE_COMMIT.
6211        INSTALL_FAILURE = 6  [deprecated = true];
6212        // This enum is for installs that are manually cancelled via the Manual Update UI.
6213        INSTALL_CANCELLED = 7;
6214        INSTALLER_ROLLBACK_REQUESTED = 8;
6215        INSTALLER_ROLLBACK_INITIATED = 9;
6216        INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6217        INSTALLER_ROLLBACK_STAGED = 11;
6218        INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6219        INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6220        INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6221        INSTALLER_ROLLBACK_SUCCESS = 15;
6222        INSTALLER_ROLLBACK_FAILURE = 16;
6223        INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6224        INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6225        INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6226        INSTALL_STAGED_CANCEL_REQUESTED = 20;
6227        INSTALL_STAGED_CANCEL_SUCCESS = 21;
6228        INSTALL_STAGED_CANCEL_FAILURE = 22;
6229        INSTALL_FAILURE_DOWNLOAD = 23;
6230        INSTALL_FAILURE_STATE_MISMATCH = 24;
6231        INSTALL_FAILURE_COMMIT = 25;
6232        REBOOT_TRIGGERED = 26;
6233        // Logged after INSTALL_REQUESTED for devices installing a train that
6234        // contains no module requiring reboot.
6235        REBOOT_NOT_REQUIRED = 27;
6236        // Logged after INSTALL_REQUESTED for devices that are installing a train
6237        // which requires reboot and eligible for soft restart.
6238        SOFT_RESTART_ELIGIBLE = 28;
6239        // Logged after INSTALL_REQUESTED for devices that are installing a train
6240        // which requires reboot and eligible for notification restart.
6241        NOTIFICATION_RESTART_ELIGIBLE = 29;
6242        // Logged after INSTALL_REQUESTED for devices that are installing a train
6243        // which requires reboot and not eligible for any reboot promotion strategy
6244        // (e.g. soft restart, notification restart).
6245        NO_REBOOT_PROMOTION_STRATEGY_ELIGIBLE = 30;
6246        REBOOT_TRIGGER_FAILURE = 31;
6247        // Logged after INSTALL_REQUESTED for devices installing a train which
6248        // requires reboot and eligible for unattended reboot.
6249        UNATTENDED_REBOOT_ELIGIBLE = 32;
6250        // Logged when Phonesky trys to prepare LSKF.
6251        LSKF_PREPARATION_INITITATED = 33;
6252        // Logged when LSKF preparation succeeded.
6253        LSKF_PREPARATION_SUCCESS = 34;
6254        // Logged when LSKF preparation failed.
6255        LSKF_PREPARATION_FAILURE = 35;
6256        // Logged when Phonesky cannot schedule reboot job on a unattended reboot
6257        // eligible device.
6258        UNATTENDED_REBOOT_NOT_TRIGGERED = 36;
6259        // Logged when SIM PIN recovery preparation succeeded.
6260        SIM_PIN_PREPARATION_SUCCESS = 37;
6261        // Logged when SIM PIN recovery preparation failed.
6262        SIM_PIN_PREPARATION_FAILURE = 38 [deprecated = true];
6263        // Logged when unattended reboot is aborted and falls back to organic
6264        // reboot.
6265        UNATTENDED_REBOOT_ABORT = 39;
6266        // Logged when Phonesky re-prepares LSKF.
6267        LSKF_PREPARATION_RETRY = 40;
6268        // Logged when the device doesn’t support checkpoint and cannot stage
6269        // multiple sessions.
6270        CHECKPOINT_NOT_SUPPORTED = 41;
6271        // Logged when Phonesky instructs Android platform to monitor reboot
6272        // readiness signal.
6273        PENDING_REBOOT_MARKED = 42;
6274        // Logged when Phonesky instructs Android platform to stop monitoring reboot
6275        // readiness signal.
6276        PENDING_REBOOT_CANCELLED = 43 [deprecated = true];
6277        // Logged when Phonesky receives reboot readiness broadcast and the device
6278        // is ready to reboot.
6279        SIGNAL_READY_TO_REBOOT_RECEIVED = 44;
6280        // Logged when Phonesky receives reboot readiness broadcast and the device
6281        // is not ready to reboot.
6282        SIGNAL_NOT_READY_TO_REBOOT_RECEIVED = 45;
6283        // Logged when Phonesky cancels an untracked train.
6284        UNTRACKED_TRAIN_CANCELLED = 46;
6285    }
6286    optional State state = 6;
6287    // Possible experiment ids for monitoring this push.
6288    optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
6289    // Index of the Android User. E.g. 0 for primary profile, 10, 11, 12
6290    // for guest and secondary profiles. Not PII.
6291    optional int32 user_id = 8;
6292    // Log additional info for a state when needed.
6293    // When state = REBOOT_TRIGGERED, this field logs the reboot type:
6294    //  USERSPACE_REBOOT = 1.
6295    //  FORCED_REBOOT = 2.
6296    //  NOTIFICATION_RESTART_REBOOT = 3.
6297    //  UNATTENDED_REBOOT_SECURED_AND_SIM_PIN = 4.
6298    //  UNATTENDED_REBOOT_SECURED_NO_SIM_PIN = 5.
6299    //  UNATTENDED_REBOOT_UNSECURED_AND_SIM_PIN = 6.
6300    //  UNATTENDED_REBOOT_UNSECURED_NO_SIM_PIN = 7.
6301    // When state = INSTALL_FAILURE, this field logs the Install errors related
6302    // statusCode
6303    // When state = UNATTENDED_REBOOT_ABORT, this field logs the cancellation
6304    // reason:
6305    //  LSKF_RETRY_EXCEED_MAXIMUM = 1.
6306    //  SIM_PIN_NOT_PREPARED = 2.
6307    // When state = UNATTENDED_REBOOT_ELIGIBLE, this field logs the cancellation
6308    // reason:
6309    //  UNATTENDED_REBOOT_SECURED_AND_SIM_PIN = 1.
6310    //  UNATTENDED_REBOOT_SECURED_NO_SIM_PIN = 2.
6311    //  UNATTENDED_REBOOT_UNSECURED_AND_SIM_PIN = 3.
6312    //  UNATTENDED_REBOOT_UNSECURED_NO_SIM_PIN = 4.
6313    // When state = UNATTENDED_REBOOT_NOT_TRIGGERED, this field logs the
6314    // cancellation reason:
6315    //  LSKF_NOT_PREPARED = 1.
6316    //  REBOOT_NOT_READY = 2.
6317    // When state = PENDING_REBOOT_CANCELLED, this field logs the cancellation
6318    // reason:
6319    //  LSKF_NOT_PREPARED = 1.
6320    //  NO_STAGED_TRAIN = 2.
6321    //  HAS_SIM_PIN_AND_SIM_PIN_STORAGE_DISABLED = 3.
6322    optional int32 reason = 9;
6323    // Whether or not this is a rollback event.
6324    optional bool is_rollback = 10;
6325}
6326
6327/* Test atom, is not logged anywhere */
6328message TestAtomReported {
6329    repeated AttributionNode attribution_node = 1;
6330    optional int32 int_field = 2;
6331    optional int64 long_field = 3;
6332    optional float float_field = 4;
6333    optional string string_field = 5;
6334    optional bool boolean_field = 6;
6335    enum State {
6336        UNKNOWN = 0;
6337        OFF = 1;
6338        ON = 2;
6339    }
6340    optional State state = 7;
6341    optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
6342    repeated int32 repeated_int_field = 9;
6343    repeated int64 repeated_long_field = 10;
6344    repeated float repeated_float_field = 11;
6345    repeated string repeated_string_field = 12;
6346    repeated bool repeated_boolean_field = 13;
6347    repeated State repeated_enum_field = 14;
6348}
6349
6350/** Represents USB port overheat event. */
6351message UsbPortOverheatEvent {
6352    /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
6353    optional int32 plug_temperature_deci_c = 1;
6354
6355    /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
6356    optional int32 max_temperature_deci_c = 2;
6357
6358    /* Time between USB plug event and overheat threshold trip, in seconds. */
6359    optional int32 time_to_overheat_secs = 3;
6360
6361    /* Time between overheat threshold trip and hysteresis, in seconds. */
6362    optional int32 time_to_hysteresis_secs = 4;
6363
6364    /* Time between hysteresis and active mitigation ending, in seconds. */
6365    optional int32 time_to_inactive_secs = 5;
6366};
6367
6368/**
6369 * Logs total effective full charge and discharge cycles on a battery.
6370 * Here are some examples of one effective cycle:
6371 *   1) the battery charges from 0% to 100% and drains back to 0%,
6372 *   2) charging from 50% to 100% and draining back to 50% twice.
6373 * Pulled from:
6374 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
6375 */
6376message BatteryCycleCount {
6377    /* Number of total charge and discharge cycles on the system battery. */
6378    optional int32 cycle_count = 1;
6379}
6380
6381/**
6382 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
6383 * others), its type (public or private) and the size in bytes.
6384 * Pulled from:
6385 *   StatsCompanionService
6386 */
6387
6388message ExternalStorageInfo {
6389
6390    enum VolumeType {
6391        UNKNOWN = 0;
6392        PUBLIC = 1;
6393        PRIVATE = 2;
6394        OTHER = 3;
6395    }
6396
6397    // The type of external storage.
6398    optional android.stats.storage.ExternalStorageType storage_type = 1;
6399    // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
6400    optional VolumeType volume_type = 2;
6401    // Total size of the sd card in bytes.
6402    optional int64 size_bytes = 3;
6403}
6404
6405/*
6406 * Logs when a connection becomes available and lost.
6407 * Logged in StatsCompanionService.java
6408 */
6409message ConnectivityStateChanged {
6410  // Id of the network.
6411  optional int32 net_id = 1;
6412
6413  enum State {
6414    UNKNOWN = 0;
6415    CONNECTED = 1;
6416    DISCONNECTED = 2;
6417  }
6418  // Connected state of a network.
6419  optional State state = 2;
6420}
6421
6422/**
6423 * Logs when a service starts and stops.
6424 * Logged from:
6425 *   services/core/java/com/android/server/am/ActiveServices.java
6426 */
6427message ServiceStateChanged {
6428
6429    optional int32 uid = 1 [(is_uid) = true];
6430
6431    optional string package_name = 2;
6432
6433    optional string service_name = 3;
6434
6435    enum State {
6436        START = 1;
6437        STOP = 2;
6438    }
6439
6440    optional State state = 4;
6441}
6442
6443/**
6444 * Logs when a service is launched.
6445 * Logged from:
6446 *   services/core/java/com/android/server/am/ActiveServices.java
6447 */
6448message ServiceLaunchReported {
6449
6450    optional int32 uid = 1 [(is_uid) = true];
6451
6452    optional string package_name = 2;
6453
6454    optional string service_name = 3;
6455}
6456
6457/**
6458 * The type of process start. It's the same as ProcessStartTime.StartType but we
6459 * can't re-type that for background compatibility.
6460 */
6461enum ProcessStartType {
6462    PROCESS_START_TYPE_UNKNOWN = 0;
6463    PROCESS_START_TYPE_WARM = 1;
6464    PROCESS_START_TYPE_HOT = 2;
6465    PROCESS_START_TYPE_COLD = 3;
6466}
6467
6468/**
6469 * Logs when a service request is made.
6470 * Logged from:
6471 *   services/core/java/com/android/server/am/ActiveServices.java
6472 */
6473message ServiceRequestEventReported {
6474    /** The package uid of the service host. */
6475    optional int32 uid = 1 [(is_uid) = true];
6476
6477    /** The package uid of the service launch request. */
6478    optional int32 requester_uid = 2 [(is_uid) = true];
6479
6480    /** The action name of the service request. */
6481    optional string action_name = 3;
6482
6483    /**
6484     * The types of the requests to the service.
6485     */
6486    enum RequestType {
6487        UNKNOWN = 0;
6488        START = 1;
6489        BIND = 2;
6490    }
6491
6492    /** The type of the current request to the service.*/
6493    optional RequestType request_type = 4;
6494
6495    /** Whether or not it's requested to start as a foreground service. */
6496    optional bool fg_required = 5;
6497
6498    /** The start type of the host process. */
6499    optional ProcessStartType proc_start_type = 6;
6500}
6501
6502/**
6503 * Logs indicating a broadcast is being delivered to a receiver.
6504 *
6505 * Logged from:
6506 *     frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6507 */
6508message BroadcastDeliveryEventReported {
6509    /** The package uid of the broadcast receiver. */
6510    optional int32 uid = 1 [(is_uid) = true];
6511
6512    /** The package uid of the broadcast sender. */
6513    optional int32 sender_uid = 2 [(is_uid) = true];
6514
6515    /** The action name of the broadcast. */
6516    optional string action_name = 3;
6517
6518    /**
6519     * The types of the broadcast receivers.
6520     */
6521    enum ReceiverType {
6522        UNKNOWN = 0;
6523        RUNTIME = 1;
6524        MANIFEST = 2;
6525    }
6526
6527    /** The type of the current broadcast receiver. */
6528    optional ReceiverType receiver_type = 4;
6529
6530    /** The start type of the host process. */
6531    optional ProcessStartType proc_start_type = 5;
6532
6533    /** The delay in ms from enqueue to dispatch of this intent to the set of receivers. */
6534    optional int64 dispatch_delay = 6;
6535
6536    /** The delay in ms from beginning of dispatch to this specific receiver. */
6537    optional int64 receive_delay = 7;
6538
6539    /** The delay in ms from dispatch to finish the handling of this intent. */
6540    optional int64 finish_delay = 8;
6541}
6542
6543/**
6544 * Logs indicating a client is requesting to acquire a provider,
6545 * this doesn't include the case where the provider has been installed in the
6546 * client's process space and it's just increasing a ref count.
6547 *
6548 * Logged from:
6549 *      frameworks/base/services/core/java/com/android/server/am/ContentProviderHelper.java
6550 */
6551message ProviderAcquisitionEventReported {
6552    /** The package uid of the content provider host. */
6553    optional int32 uid = 1 [(is_uid) = true];
6554
6555    /** The package uid of the content provider client who makes the request. */
6556    optional int32 client_uid = 2 [(is_uid) = true];
6557
6558    /** The start type of the host process. */
6559    optional ProcessStartType proc_start_type = 3;
6560}
6561
6562/**
6563 * Logs when a hidden API is used.
6564 *
6565 * Logged from:
6566 *     libcore/libart/src/main/java/dalvik/system/VMRuntime.java
6567 */
6568message HiddenApiUsed {
6569    // The uid of the app making the hidden access.
6570    optional int32 uid = 1 [(is_uid) = true];
6571
6572    // Signature of the method or field accessed.
6573    optional string signature = 2;
6574
6575    enum AccessMethod {
6576        NONE = 0;
6577        REFLECTION = 1;
6578        JNI = 2;
6579        LINKING = 3;
6580    }
6581
6582    // Type of access.
6583    optional AccessMethod access_method = 3;
6584
6585    // Whether the access was prevented or not.
6586    optional bool access_denied = 4;
6587}
6588
6589/**
6590 * Logs user interaction with the Privacy Indicators added in Q. In particular:
6591 * - When user sees privacy chip
6592 * - When user clicks privacy chip
6593 * - How does the user exit the Privacy Dialog
6594 * Logged from:
6595 *   packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
6596 */
6597message PrivacyIndicatorsInteracted {
6598
6599    enum Type {
6600        UNKNOWN = 0;
6601        CHIP_VIEWED = 1;
6602        CHIP_CLICKED = 2;
6603        reserved 3; // Used only in beta builds, never shipped
6604        DIALOG_DISMISS = 4;
6605        DIALOG_LINE_ITEM = 5;
6606    }
6607
6608    optional Type type = 1 [(state_field_option).exclusive_state = true];
6609}
6610
6611/**
6612 * Logs information about a package that is moved from the internal to external storage and vice
6613 * versa.
6614 * It logs the package name, the type of the external storage where the package is installed
6615 * (if moved to external storage, or UNKNOWN if moved to internal storage),
6616 * and the move type: if it's from internal to external or the other way around.
6617 *
6618 * Logged from:
6619        frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
6620 */
6621message AppMovedStorageReported {
6622    enum MoveType {
6623        UNKNOWN = 0;
6624        TO_EXTERNAL = 1;
6625        TO_INTERNAL = 2;
6626    }
6627    // The type of the external storage.
6628    optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6629    // The type of move.
6630    optional MoveType move_type = 2;
6631    // The name of the package that was moved.
6632    optional string package_name = 3;
6633}
6634
6635/**
6636 * Logs when system server watchdog occurs.
6637 * Logged from:
6638 *      frameworks/base/services/core/java/com/android/server/Watchdog.java
6639 */
6640message SystemServerWatchdogOccurred {
6641    optional string subject = 1;
6642}
6643
6644/**
6645 * Logs when new file added to tombstones.
6646 * Logged from:
6647 *      frameworks/base/core/java/com/android/server/BootReceiver.java
6648 */
6649message TombStoneOccurred {
6650}
6651
6652/*
6653 * Information about a role request
6654 *
6655 * Logged from:
6656 *   packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
6657 */
6658message RoleRequestResultReported {
6659    // UID of application requesting the role
6660    optional int32 requesting_uid = 1;
6661
6662    // Package name of application requesting the role
6663    optional string requesting_package_name = 2;
6664
6665    // The role to be granted
6666    optional string role_name = 3;
6667
6668    // The count of applications qualifying for the role
6669    optional int32 qualifying_count = 4;
6670
6671    // UID of application current granted the role
6672    optional int32 current_uid = 5;
6673
6674    // Package name of application current granted the role
6675    optional string current_package_name = 6;
6676
6677    // UID of another application that user chose to grant the role to, instead of the requesting
6678    // application
6679    optional int32 granted_another_uid = 7;
6680
6681    // Package name of another application that user chose to grant the role to, instead of the
6682    // requesting application
6683    optional string granted_another_package_name = 8;
6684
6685    enum Result {
6686        UNDEFINED = 0;
6687        // role request was ignored
6688        IGNORED = 1;
6689        // role request was ignored because it's already granted
6690        IGNORED_ALREADY_GRANTED = 2;
6691        // role request was ignored because the application isn't qualified
6692        IGNORED_NOT_QUALIFIED = 3;
6693        // role request was ignored because user said it should be always denied
6694        IGNORED_USER_ALWAYS_DENIED = 4;
6695        // role was granted by user action
6696        USER_GRANTED = 5;
6697        // role was denied by user action
6698        USER_DENIED = 6;
6699        // role was denied by user granting another application the role
6700        USER_DENIED_GRANTED_ANOTHER = 7;
6701        // role was denied and set to be always denied by the user
6702        USER_DENIED_WITH_ALWAYS = 8;
6703    }
6704    // The result of the role request
6705    optional Result result = 9;
6706}
6707
6708/**
6709 * Logs when a Vehicle Maps Service client's connection state has changed
6710 *
6711 * Logged from:
6712 *   packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
6713 */
6714message VmsClientConnectionStateChanged {
6715    // The UID of the VMS client app
6716    optional int32 uid = 1 [(is_uid) = true];
6717
6718    enum State {
6719        UNKNOWN = 0;
6720        // Attempting to connect to the client
6721        CONNECTING = 1;
6722        // Client connection established
6723        CONNECTED = 2;
6724        // Client connection closed unexpectedly
6725        DISCONNECTED = 3;
6726        // Client connection closed by VMS
6727        TERMINATED = 4;
6728        // Error establishing the client connection
6729        CONNECTION_ERROR = 5;
6730    }
6731
6732    optional State state  = 2;
6733}
6734
6735message MimeTypes {
6736    repeated string mime_types = 1;
6737}
6738
6739/**
6740 * Logs statistics regarding accesses to external storage.
6741 * All stats are normalized for one day period.
6742 *
6743 * Logged from:
6744 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
6745 */
6746message GeneralExternalStorageAccessStats {
6747    optional int32 uid = 1 [(is_uid) = true];
6748    // Total number of accesses like creation, open, delete and rename/update.
6749    // Includes file path and ContentResolver accesses
6750    optional uint32 total_accesses = 2;
6751    // Number of file path accesses, as opposed to file path and ContentResolver.
6752    optional uint32 file_path_accesses = 3;
6753    // Number of accesses on secondary volumes like SD cards.
6754    // Includes file path and ContentResolver accesses
6755    optional uint32 secondary_storage_accesses = 4;
6756    // Comma-separated list of mime types that were accessed.
6757    optional MimeTypes mime_types_accessed = 5 [(log_mode) = MODE_BYTES];
6758}
6759
6760/**
6761 * Logs when MediaProvider has successfully finished scanning a storage volume.
6762 *
6763 * Logged from:
6764 *   packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
6765 */
6766message MediaProviderScanOccurred {
6767    enum Reason {
6768        // Scan triggered due to unknown reason
6769        UNKNOWN = 0;
6770        // Scan triggered due to storage volume being mounted
6771        MOUNTED = 1;
6772        // Scan triggered due to explicit user action or app request
6773        DEMAND = 2;
6774        // Scan triggered due to idle maintenance
6775        IDLE = 3;
6776    }
6777
6778    // Volume type that this event pertains to
6779    optional android.stats.mediaprovider.VolumeType volume_type = 1;
6780    // Reason why this scan was triggered
6781    optional Reason reason = 2;
6782    // Total number of files scanned
6783    optional int64 item_count = 3;
6784    // Duration of scan, normalized per file
6785    optional float normalized_duration_millis = 4;
6786    // Number of database inserts, normalized per file
6787    optional float normalized_insert_count = 5;
6788    // Number of database updates, normalized per file
6789    optional float normalized_update_count = 6;
6790    // Number of database deletes, normalized per file
6791    optional float normalized_delete_count = 7;
6792}
6793
6794/**
6795 * Logs when an app has asked MediaProvider to delete media belonging to the user.
6796 *
6797 * Logged from:
6798 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
6799 */
6800message MediaContentDeleted {
6801    // Volume type that this event pertains to
6802    optional android.stats.mediaprovider.VolumeType volume_type = 1;
6803    // UID of app that requested deletion
6804    optional int32 uid = 2 [(is_uid) = true];
6805    // Number of items that were deleted
6806    optional int32 item_count = 3;
6807}
6808
6809/**
6810 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
6811 *
6812 * Logged from:
6813 *   packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
6814 */
6815message MediaProviderPermissionRequested {
6816    enum Result {
6817        UNKNOWN = 0;
6818        USER_GRANTED = 1;
6819        AUTO_GRANTED = 2;
6820        USER_DENIED = 3;
6821        USER_DENIED_WITH_PREJUDICE = 4;
6822        AUTO_DENIED = 5;
6823    }
6824
6825    // Volume type that this event pertains to
6826    optional android.stats.mediaprovider.VolumeType volume_type = 1;
6827    // UID of app that requested permission
6828    optional int32 uid = 2 [(is_uid) = true];
6829    // Number of items that were requested
6830    optional int32 item_count = 3;
6831    // Result of this request
6832    optional Result result = 4;
6833}
6834
6835/**
6836 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
6837 *
6838 * Logged from:
6839 *   packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
6840 */
6841message MediaProviderSchemaChanged {
6842    // Volume type that this event pertains to
6843    optional android.stats.mediaprovider.VolumeType volume_type = 1;
6844    // Old database version code
6845    optional int32 version_from = 2;
6846    // New database version code
6847    optional int32 version_to = 3;
6848    // Total number of files in database
6849    optional int64 item_count = 4;
6850    // Duration of schema change, normalized per file
6851    optional float normalized_duration_millis = 5;
6852}
6853
6854/**
6855 * Logs when MediaProvider has finished an idle maintenance job.
6856 *
6857 * Logged from:
6858 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
6859 */
6860message MediaProviderIdleMaintenanceFinished {
6861    // Volume type that this event pertains to
6862    optional android.stats.mediaprovider.VolumeType volume_type = 1;
6863
6864    // Total number of files in database
6865    optional int64 item_count = 2;
6866    // Duration of idle maintenance, normalized per file
6867    optional float normalized_duration_millis = 3;
6868    // Number of thumbnails found to be stale, normalized per file
6869    optional float normalized_stale_thumbnails = 4;
6870    // Number of items found to be expired, normalized per file
6871    optional float normalized_expired_media = 5;
6872}
6873
6874/**
6875 * Represents boot time event with duration in ms.
6876 *
6877 * Logged from: bootstat and various system server components. Check each enums for details.
6878 */
6879message BootTimeEventDuration {
6880    enum DurationEvent {
6881        UNKNOWN = 0;
6882        // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
6883        ABSOLUTE_BOOT_TIME = 1;
6884        // Bootloader's 1st stage execution time.
6885        // Logged from bootstat.
6886        BOOTLOADER_FIRST_STAGE_EXEC = 2;
6887        // Bootloader's 1st stage loading time.
6888        // Logged from bootstat.
6889        BOOTLOADER_FIRST_STAGE_LOAD = 3;
6890        // Bootloader's kernel loading time.
6891        // Logged from bootstat.
6892        BOOTLOADER_KERNEL_LOAD = 4;
6893        // Bootloader's 2nd stage execution time.
6894        // Logged from bootstat.
6895        BOOTLOADER_SECOND_STAGE_EXEC = 5;
6896        // Bootloader's 2nd stage loading time.
6897        // Logged from bootstat.
6898        BOOTLOADER_SECOND_STAGE_LOAD = 6;
6899        // Duration for Bootloader to show unlocked device's warning UI. This should not happen
6900        // for locked device.
6901        // Logged from bootstat.
6902        BOOTLOADER_UI_WAIT = 7;
6903        // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
6904        // Logged from bootstat.
6905        BOOTLOADER_TOTAL = 8;
6906        // Shutdown duration inside init for the reboot before the current boot up.
6907        // Logged from f/b/services/.../BootReceiver.java.
6908        SHUTDOWN_DURATION = 9;
6909        // Total time for mounting of disk devices during bootup.
6910        // Logged from f/b/services/.../BootReceiver.java.
6911        MOUNT_DEFAULT_DURATION = 10;
6912        // Total time for early stage mounting of disk devices during bootup.
6913        // Logged from f/b/services/.../BootReceiver.java.
6914        MOUNT_EARLY_DURATION = 11;
6915        // Total time for late stage mounting of disk devices during bootup.
6916        // Logged from f/b/services/.../BootReceiver.java.
6917        MOUNT_LATE_DURATION = 12;
6918        // Average time to scan non-system app after OTA
6919        // Logged from f/b/services/.../PackageManagerService.java
6920        OTA_PACKAGE_MANAGER_INIT_TIME = 13;
6921        // Time to initialize Package manager after OTA
6922        // Logged from f/b/services/.../PackageManagerService.java
6923        OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
6924        // Time to scan all system app from Package manager after OTA
6925        // Logged from f/b/services/.../PackageManagerService.java
6926        OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
6927        // Init's total time for cold boot stage.
6928        // Logged from bootstat.
6929        COLDBOOT_WAIT = 16;
6930        // Init's total time for initializing selinux.
6931        // Logged from bootstat.
6932        SELINUX_INIT = 17;
6933        // Time since last factory reset.
6934        // Logged from bootstat.
6935        FACTORY_RESET_TIME_SINCE_RESET = 18;
6936        // Init's total time spent for completing the 1st stage.
6937        // Logged from bootstat.
6938        ANDROID_INIT_STAGE_1 = 19;
6939    }
6940
6941    // Type of the event.
6942    optional DurationEvent event = 1;
6943    // Duration of the event in ms.
6944    optional int64 duration_millis = 2;
6945}
6946
6947/**
6948 * Represents the start of specific boot time event during bootup in ms. This is usually a time
6949 * since boot-up.
6950 *
6951 * Logged from: bootstat and various system server components. Check each enums for details.
6952 */
6953message BootTimeEventElapsedTime {
6954    enum ElapsedTimeEvent {
6955        UNKNOWN = 0;
6956        // Time when init starts 1st stage. Logged from bootstat.
6957        ANDROID_INIT_STAGE_1 = 1;
6958        // Time when sys.boot_completed prop is set.
6959        // Logged from bootstat.
6960        BOOT_COMPLETE = 2;
6961        // BOOT_COMPLETE for encrypted device.
6962        BOOT_COMPLETE_ENCRYPTION = 3;
6963        // BOOT_COMPLETE for device with no encryption.
6964        BOOT_COMPLETE_NO_ENCRYPTION = 4;
6965        // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
6966        BOOT_COMPLETE_POST_DECRYPT = 5;
6967        // BOOT_COMPLETE after factory reset.
6968        FACTORY_RESET_BOOT_COMPLETE = 6;
6969        // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
6970        FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
6971        // BOOT_COMPLETE_POST_DECRYPT after factory reset.
6972        FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
6973        // BOOT_COMPLETE after OTA.
6974        OTA_BOOT_COMPLETE = 9;
6975        // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
6976        OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
6977        // BOOT_COMPLETE_POST_DECRYPT after OTA.
6978        OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
6979        // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
6980        // Logged from  f/b/services/.../UserController.java
6981        FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
6982        // Time when the system starts sending BOOT_COMPLETED broadcast.
6983        // Logged from  f/b/services/.../UserController.java
6984        FRAMEWORK_BOOT_COMPLETED = 13;
6985        // Time when the package manager starts init.
6986        // Logged from f/b/services/.../SystemServer.java
6987        PACKAGE_MANAGER_INIT_START = 14;
6988        // Time when package manager is ready
6989        // Logged from f/b/services/.../SystemServer.java
6990        PACKAGE_MANAGER_INIT_READY = 15;
6991        // Represents the time when user has entered unlock credential for system with user pin.
6992        // Logged from bootstat.
6993        POST_DECRYPT = 16;
6994        // Represents the start of zygote's init.
6995        // Logged from zygote itself.
6996        ZYGOTE_INIT_START = 17;
6997        // Represents the start of secondary zygote's init.
6998        // TODO: add logging to zygote
6999        SECONDARY_ZYGOTE_INIT_START = 18;
7000        // Represents the start of system server's init.
7001        // Logged from f/b/services/.../SystemServer.java
7002        SYSTEM_SERVER_INIT_START = 19;
7003        // Represents the completion of system server's init.
7004        // Logged from f/b/services/.../SystemServer.java
7005        SYSTEM_SERVER_READY = 20;
7006        // Represents the start of launcher during boot-up.
7007        // TODO: add logging
7008        LAUNCHER_START = 21;
7009        // Represents the completion of launcher's initial rendering. User can use other apps from
7010        // launcher from this point.
7011        // TODO: add logging
7012        LAUNCHER_SHOWN = 22;
7013    }
7014
7015    // Type of the event.
7016    optional ElapsedTimeEvent event = 1;
7017    // Time since bootup for the event.
7018    // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
7019    optional int64 time_millis = 2;
7020}
7021
7022/**
7023 * Boot time events with UTC time.
7024 *
7025 * Logged from: bootstat and various system server components. Check each enums for details.
7026 */
7027message BootTimeEventUtcTime {
7028    enum UtcTimeEvent {
7029        UNKNOWN = 0;
7030        // Time of the bootstat's marking of 1st boot after the last factory reset.
7031        // Logged from bootstat.
7032        FACTORY_RESET_RESET_TIME = 1;
7033        // The time when bootstat records FACTORY_RESET_* events. This is close to
7034        // BOOT_COMPLETE time for the current bootup.
7035        // Logged from bootstat.
7036        FACTORY_RESET_CURRENT_TIME = 2;
7037        // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
7038        // Logged from bootstat.
7039        FACTORY_RESET_RECORD_VALUE = 3;
7040    }
7041
7042    // Type of the event.
7043    optional UtcTimeEvent event = 1;
7044    // UTC time for the event.
7045    optional int64 utc_time_secs = 2;
7046}
7047
7048/**
7049 * Boot time events representing specific error code during bootup.
7050 * Meaning of error code can be different per each event type.
7051 *
7052 * Logged from: bootstat and various system server components. Check each enums for details.
7053 */
7054message BootTimeEventErrorCode {
7055    enum ErrorCodeEvent {
7056        UNKNOWN = 0;
7057        // Linux error code for time() call to get the current UTC time.
7058        // Logged from bootstat.
7059        FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
7060        // Represents UmountStat before the reboot for the current boot up. Error codes defined
7061        // as UMOUNT_STAT_* from init/reboot.cpp.
7062        // Logged from f/b/services/.../BootReceiver.java.
7063        SHUTDOWN_UMOUNT_STAT = 2;
7064        // Reprepsents fie system mounting error code of /data partition for the current boot.
7065        // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
7066        // Logged from f/b/services/.../BootReceiver.java.
7067        FS_MGR_FS_STAT_DATA_PARTITION = 3;
7068    }
7069
7070    // Type of the event.
7071    optional ErrorCodeEvent event = 1;
7072    // error code defined per each event type.
7073    // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
7074    // FS_MGR_FS_STAT.
7075    optional int32 error_code = 2;
7076}
7077
7078/**
7079 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
7080 * after an OTA.
7081 *
7082 * Logged from:
7083 *  - system/update_engine/cleanup_previous_update_action.cc
7084 */
7085message SnapshotMergeReported {
7086    // Keep in sync with
7087    // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
7088    enum UpdateState {
7089        // No update or merge is in progress.
7090        NONE = 0;
7091        // An update is applying; snapshots may already exist.
7092        INITIATED = 1;
7093        // An update is pending, but has not been successfully booted yet.
7094        UNVERIFIED = 2;
7095        // The kernel is merging in the background.
7096        MERGING = 3;
7097        // Post-merge cleanup steps could not be completed due to a transient
7098        // error, but the next reboot will finish any pending operations.
7099        MERGE_NEEDS_REBOOT = 4;
7100        // Merging is complete, and needs to be acknowledged.
7101        MERGE_COMPLETED = 5;
7102        // Merging failed due to an unrecoverable error.
7103        MERGE_FAILED = 6;
7104        // The update was implicitly cancelled, either by a rollback or a flash
7105        // operation via fastboot. This state can only be returned by WaitForMerge.
7106        CANCELLED = 7;
7107    };
7108
7109    // Status codes correspond to specific failure conditions in
7110    // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.cpp
7111    //
7112    // Keep in sync with
7113    // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
7114    enum MergeFailureCode {
7115        OK = 0;
7116        READ_STATUS = 1;
7117        GET_TABLE_INFO = 2;
7118        UNKNOWN_TABLE = 3;
7119        GET_TABLE_PARAMS = 4;
7120        ACTIVATE_NEW_TABLE = 5;
7121        ACQUIRE_LOCK = 6;
7122        LIST_SNAPSHOTS = 7;
7123        WRITE_STATUS = 8;
7124        UNKNOWN_TARGET_TYPE = 9;
7125        QUERY_SNAPSHOT_STATUS = 10;
7126        EXPECTED_MERGE_TARGET = 11;
7127        UNMERGED_SECTORS_AFTER_COMPLETION = 12;
7128        UNEXPECTED_MERGE_STATE = 13;
7129        GET_COW_PATH_CONSISTENCY_CHECK = 14;
7130        OPEN_COW_CONSISTENCY_CHECK = 15;
7131        PARSE_COW_CONSISTENCY_CHECK = 16;
7132        OPEN_COW_DIRECT_CONSISTENCY_CHECK = 17;
7133        MEM_ALIGN_CONSISTENCY_CHECK = 18;
7134        DIRECT_READ_CONSISTENCY_CHECK = 19;
7135        WRONG_MERGE_COUNT_CONSISTENCY_CHECK = 20;
7136    };
7137
7138    // Status of the update after the merge attempts.
7139    optional UpdateState final_state = 1;
7140
7141    // Time to complete a merge operation in milliseconds.
7142    // A negative value corresponds to the case in which the merge operation
7143    // was interrupted and resumed (e.g. in case of a system reboot during the
7144    // merge).
7145    optional int64 duration_millis = 2;
7146
7147    // Number of reboots that occurred after issuing and before completing the
7148    // merge of all the snapshot devices.
7149    optional int32 intermediate_reboots = 3;
7150
7151    // The device has been upgraded to Virtual A/B.
7152    optional bool is_vab_retrofit = 4;
7153
7154    // Space that has been temporarily allocated in the /data partition
7155    // containing the dm-snapshot's copy-on-write data generated during a
7156    // Virtual A/B update.
7157    optional int64 cow_file_size_bytes = 5;
7158
7159    // Whether the device enables Virtual A/B compression.
7160    optional bool vab_compression_enabled = 6;
7161
7162    // Whether this update attempt uses Virtual A/B compression.
7163    optional bool vab_compression_used = 7;
7164
7165    // Total size used by COWs, including /data and the super partition.
7166    optional int64 total_cow_size_bytes = 8;
7167
7168    // Sum of the estimated COW fields in the OTA manifest.
7169    optional int64 estimated_cow_size_bytes = 9;
7170
7171    // Time from boot to sys.boot_completed, in milliseconds.
7172    optional int32 boot_complete_time_millis = 10;
7173
7174    // Time from sys.boot_completed to merge start, in milliseconds.
7175    optional int32 boot_complete_to_merge_start_time_millis = 11;
7176
7177    optional MergeFailureCode merge_failure_code = 12;
7178
7179    // Build fingerprint at the time the OTA was downloaded.
7180    optional string source_build_fingerprint = 13;
7181
7182    // Build fingerprint at the time the merge was initiated.
7183    optional string target_build_fingerprint = 14;
7184}
7185
7186/**
7187 * Event representing when BlobStoreManager.Session#commit() is called
7188 *
7189 * Logged from:
7190 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
7191 */
7192message BlobCommitted {
7193    // Uid of the Blob committer
7194    optional int32 uid = 1 [(is_uid) = true];
7195
7196    // Id of the Blob committed
7197    optional int64 blob_id = 2;
7198
7199    // Size of the Blob
7200    optional int64 size = 3;
7201
7202    enum Result {
7203        UNKNOWN = 0;
7204        // Commit Succeeded
7205        SUCCESS = 1;
7206        // Commit Failed: Error occurred during commit
7207        ERROR_DURING_COMMIT = 2;
7208        // Commit Failed: Digest of the data did not match Blob digest
7209        DIGEST_MISMATCH = 3;
7210        // Commit Failed: Allowed count limit exceeded
7211        COUNT_LIMIT_EXCEEDED = 4;
7212    }
7213    optional Result result = 4;
7214}
7215
7216/**
7217 * Event representing when BlobStoreManager#acquireLease() is called
7218 *
7219 * Logged from:
7220 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
7221 */
7222message BlobLeased{
7223    // Uid of the Blob leasee
7224    optional int32 uid = 1 [(is_uid) = true];
7225
7226    // Id of the Blob leased or 0 if the Blob does not exist
7227    optional int64 blob_id = 2;
7228
7229    // Size of the Blob or 0 if the Blob does not exist
7230    optional int64 size = 3;
7231
7232    enum Result {
7233        UNKNOWN = 0;
7234        // Lease Succeeded
7235        SUCCESS = 1;
7236        // Lease Failed: Blob does not exist
7237        BLOB_DNE = 2;
7238        // Lease Failed: Leasee does not have access to the Blob
7239        ACCESS_NOT_ALLOWED = 3;
7240        // Lease Failed: Leasee requested an invalid expiry duration
7241        LEASE_EXPIRY_INVALID = 4;
7242        // Lease Failed: Leasee has exceeded the total data lease limit
7243        DATA_SIZE_LIMIT_EXCEEDED = 5;
7244        // Leasee Failed: Allowed count limit exceeded
7245        COUNT_LIMIT_EXCEEDED = 6;
7246    }
7247    optional Result result = 4;
7248}
7249
7250/**
7251 * Event representing when BlobStoreManager#openBlob() is called
7252 *
7253 * Logged from:
7254 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
7255 */
7256message BlobOpened{
7257    // Uid of the Blob opener
7258    optional int32 uid = 1 [(is_uid) = true];
7259
7260    // Id of the Blob opened or 0 if the Blob does not exist
7261    optional int64 blob_id = 2;
7262
7263    // Size of the Blob or 0 if the Blob does not exist
7264    optional int64 size = 3;
7265
7266    enum Result {
7267        UNKNOWN = 0;
7268        // Open Succeeded
7269        SUCCESS = 1;
7270        // Open Failed: Blob does not exist
7271        BLOB_DNE = 2;
7272        // Open Failed: Opener does not have access to the Blob
7273        ACCESS_NOT_ALLOWED = 3;
7274    }
7275    optional Result result = 4;
7276}
7277
7278/**
7279 * Event to track Jank for various system interactions.
7280 *
7281 * Logged from:
7282 *  frameworks/base/core/java/com/android/internal/jank/FrameTracker.java
7283 *
7284 * Next Tag: 8
7285 */
7286message UIInteractionFrameInfoReported {
7287    optional android.jank.InteractionType interaction_type = 1;
7288
7289    // Number of frames rendered during the interaction.
7290    optional int64 total_frames = 2;
7291
7292    // Number of frames that were skipped in rendering during the interaction.
7293    optional int64 missed_frames = 3;
7294
7295    // Number of frames that were missed in Surface Flinger during the interaction.
7296    optional int64 sf_missed_frames = 5;
7297
7298    // Number of frames that were missed in the app during the interaction.
7299    optional int64 app_missed_frames = 6;
7300
7301    // Maximum time it took to render a single frame during the interaction.
7302    optional int64 max_frame_time_nanos = 4;
7303
7304    // Maximum number of successive frames missed.
7305    optional int64 max_successive_missed_frames = 7;
7306}
7307
7308/**
7309 * Event to track various latencies in SystemUI.
7310 *
7311 * Logged from:
7312 *  frameworks/base/core/java/com/android/internal/util/LatencyTracker.java
7313 */
7314message UIActionLatencyReported {
7315    optional android.jank.ActionType action = 1;
7316
7317    optional int64 latency_millis = 2;
7318}
7319
7320//////////////////////////////////////////////////////////////////////
7321// Pulled atoms below this line //
7322//////////////////////////////////////////////////////////////////////
7323
7324/**
7325 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
7326 *
7327 * Pulled from:
7328 *   StatsCompanionService (using BatteryStats to get which interfaces are wifi)
7329 */
7330message WifiBytesTransfer {
7331    optional int32 uid = 1 [(is_uid) = true];
7332
7333    optional int64 rx_bytes = 2;
7334
7335    optional int64 rx_packets = 3;
7336
7337    optional int64 tx_bytes = 4;
7338
7339    optional int64 tx_packets = 5;
7340}
7341
7342/**
7343 * Pulls bytes transferred via wifi (separated by foreground and background usage).
7344 *
7345 * Pulled from:
7346 *   StatsCompanionService (using BatteryStats to get which interfaces are wifi)
7347 */
7348message WifiBytesTransferByFgBg {
7349    optional int32 uid = 1 [(is_uid) = true];
7350
7351    // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
7352    optional bool is_foreground = 2;
7353
7354    optional int64 rx_bytes = 3;
7355
7356    optional int64 rx_packets = 4;
7357
7358    optional int64 tx_bytes = 5;
7359
7360    optional int64 tx_packets = 6;
7361}
7362
7363/**
7364 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
7365 *
7366 * Pulled from:
7367 *   StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
7368 */
7369message MobileBytesTransfer {
7370    optional int32 uid = 1 [(is_uid) = true];
7371
7372    optional int64 rx_bytes = 2;
7373
7374    optional int64 rx_packets = 3;
7375
7376    optional int64 tx_bytes = 4;
7377
7378    optional int64 tx_packets = 5;
7379}
7380
7381/**
7382 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
7383 *
7384 * Pulled from:
7385 *   StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
7386 */
7387message MobileBytesTransferByFgBg {
7388    optional int32 uid = 1 [(is_uid) = true];
7389
7390    // 1 denotes foreground and 0 denotes background. This is called Set in
7391    // NetworkStats.
7392    optional bool is_foreground = 2;
7393
7394    optional int64 rx_bytes = 3;
7395
7396    optional int64 rx_packets = 4;
7397
7398    optional int64 tx_bytes = 5;
7399
7400    optional int64 tx_packets = 6;
7401}
7402
7403/**
7404 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
7405 * Note that the data is expected to be sliced into more dimensions in future. In other words,
7406 * the caller must not assume any row of data is one full report when filtering with a set of
7407 * matching conditions, because future data may represent with multiple rows what is currently
7408 * represented by one.
7409 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
7410 * query all the existing columns.
7411 *
7412 * Pulled from:
7413 *   StatsPullAtomService (using NetworkStatsService to get NetworkStats)
7414 */
7415message DataUsageBytesTransfer {
7416    // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
7417    // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
7418    // states combined, not including debug states. See NetworkStats#SET_*.
7419    optional int32 state = 1;
7420
7421    optional int64 rx_bytes = 2;
7422
7423    optional int64 rx_packets = 3;
7424
7425    optional int64 tx_bytes = 4;
7426
7427    optional int64 tx_packets = 5;
7428
7429    // Radio Access Technology (RAT) type of this record, should be one of
7430    // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
7431    // the record is for all rat types combined.
7432    optional int32 rat_type = 6;
7433
7434    // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
7435    // record is combined across subscriptions.
7436    optional string sim_mcc = 7;
7437    optional string sim_mnc = 8;
7438
7439    // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
7440    // See TelephonyManager#getSimCarrierId.
7441    optional int32 carrier_id = 9;
7442
7443    // Enumeration of opportunistic states with an additional ALL state indicates the record is
7444    // combined regardless of the boolean value in its field.
7445    enum DataSubscriptionState {
7446        UNKNOWN = 0; // For server side backward compatibility.
7447        ALL = 1;
7448        OPPORTUNISTIC = 2;
7449        NOT_OPPORTUNISTIC = 3;
7450    }
7451    // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
7452    // record is combined across opportunistic data subscriptions.
7453    // See {@link SubscriptionManager#setOpportunistic}.
7454    optional DataSubscriptionState opportunistic_data_sub = 10;
7455
7456    // Indicate whether NR is connected, server side could use this with RAT type to determine if
7457    // the record is for 5G NSA (Non Stand Alone) mode, where the primary cell is still LTE and
7458    // network allocates a secondary 5G cell so telephony reports RAT = LTE along with NR state as
7459    // connected.
7460    optional bool is_nr_connected = 11;
7461}
7462
7463/**
7464 * Note: This is a copy from DataUsageBytesTransfer and add a metered field.
7465 * TODO: DataUsageBytesTransfer should be eventually replaced with DataUsageBytesTransferV2.
7466 *
7467 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
7468 * Note that the data is expected to be sliced into more dimensions in future. In other words,
7469 * the caller must not assume any row of data is one full report when filtering with a set of
7470 * matching conditions, because future data may represent with multiple rows what is currently
7471 * represented by one.
7472 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
7473 * query all the existing columns.
7474 *
7475 * Pulled from:
7476 *   StatsPullAtomService (using NetworkStatsService to get NetworkStats)
7477 */
7478message DataUsageBytesTransferV2 {
7479    // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
7480    // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
7481    // states combined, not including debug states. See NetworkStats#SET_*.
7482    optional int32 state = 1;
7483
7484    optional int64 rx_bytes = 2;
7485
7486    optional int64 rx_packets = 3;
7487
7488    optional int64 tx_bytes = 4;
7489
7490    optional int64 tx_packets = 5;
7491
7492    // Radio Access Technology (RAT) type of this record, should be one of
7493    // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
7494    // the record is for all rat types combined.
7495    optional int32 rat_type = 6;
7496
7497    // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
7498    // record is combined across subscriptions.
7499    optional string sim_mcc = 7;
7500    optional string sim_mnc = 8;
7501
7502    // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
7503    // See TelephonyManager#getSimCarrierId.
7504    optional int32 carrier_id = 9;
7505
7506    // Enumeration of opportunistic states with an additional DSS_ALL state indicates the record is
7507    // combined regardless of the boolean value in its field.
7508    enum DataSubscriptionState {
7509        DSS_UNKNOWN = 0; // For server side backward compatibility.
7510        DSS_ALL = 1;
7511        DSS_OPPORTUNISTIC = 2;
7512        DSS_NOT_OPPORTUNISTIC = 3;
7513    }
7514    // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
7515    // record is combined across opportunistic data subscriptions.
7516    // See {@link SubscriptionManager#setOpportunistic}.
7517    optional DataSubscriptionState opportunistic_data_sub = 10;
7518
7519    // Indicate whether NR is connected, server side could use this with RAT type to determine if
7520    // the record is for 5G NSA (Non Stand Alone) mode, where the primary cell is still LTE and
7521    // network allocates a secondary 5G cell so telephony reports RAT = LTE along with NR state as
7522    // connected.
7523    optional bool is_nr_connected = 11;
7524
7525    // Enumeration of metered states.
7526    enum MeteredState {
7527        METERED_UNKNOWN = 0;
7528        METERED_ALL = 1;
7529        METERED_NO = 2;
7530        METERED_YES = 3;
7531    }
7532    // Mark the reported data is metered or non-metered, and METERED_ALL indicates the record is
7533    // combined across metered data.
7534    optional MeteredState metered = 12;
7535}
7536
7537/**
7538 * Pulls bytes transferred via OEM managed networks. Data is split up by which
7539 * type of OEM managed network it is, what transport it went over, and if it was
7540 * in the foreground or background.
7541 *
7542 * Pulled from:
7543 *   StatsPullAtomService
7544 */
7545 message OemManagedBytesTransfer {
7546    optional int32 uid = 1 [(is_uid) = true];
7547
7548    // 1 denotes foreground and 0 denotes background. This is called Set in
7549    // NetworkStats.
7550    optional bool is_foreground = 2;
7551
7552    // Corresponds to the type of OEM managed network, see
7553    // {@link NetworkTemplate#OEM_MANAGED_ANY} and {@code NetworkIdentity#OEM_*}.
7554    optional int32 oem_managed_type = 3;
7555
7556    // Corresponds to the type of transport the bytes were transferred over, see
7557    // {@link NetworkTemplate#transportToMatchRule} and
7558    // {@code NetworkCapabilities#TRANSPORT_*}
7559    optional int32 transport_type = 4;
7560
7561    optional int64 rx_bytes = 5;
7562
7563    optional int64 rx_packets = 6;
7564
7565    optional int64 tx_bytes = 7;
7566
7567    optional int64 tx_packets = 8;
7568  }
7569
7570/**
7571 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
7572 *
7573 * Pulled from:
7574 *   StatsCompanionService
7575 */
7576message BluetoothBytesTransfer {
7577    optional int32 uid = 1 [(is_uid) = true];
7578
7579    optional int64 rx_bytes = 2;
7580
7581    optional int64 tx_bytes = 3;
7582}
7583
7584/**
7585 * Pulls the kernel wakelock durations. This atom is adapted from
7586 * android/internal/os/KernelWakelockStats.java
7587 *
7588 * Pulled from:
7589 *   StatsCompanionService using KernelWakelockReader.
7590 */
7591message KernelWakelock {
7592    optional string name = 1;
7593
7594    optional int32 count = 2;
7595
7596    optional int32 version = 3;
7597
7598    optional int64 time_micros = 4;
7599}
7600
7601/**
7602 * Pulls power state information.
7603 * Pulled from:
7604 *   frameworks/base/services/core/java/com/android/server/powerstats/StatsPullAtomCallbackImpl.java
7605 */
7606message SubsystemSleepState {
7607    // Subsystem name
7608    optional string subsystem_name = 1;
7609    // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
7610    // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
7611    // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
7612    //    powerEntityStateName from the corresponding PowerEntityStateInfo.
7613    optional string subname = 2;
7614    // The number of times it entered, or voted for entering the sleep state
7615    optional uint64 count = 3;
7616    // The length of time spent in, or spent voting for, the sleep state
7617    optional uint64 time_millis = 4;
7618}
7619
7620/**
7621 * Pulls on-device power measurement information.
7622 * Pulled from:
7623 *   frameworks/base/services/core/java/com/android/server/powerstats/StatsPullAtomCallbackImpl.java
7624 */
7625message OnDevicePowerMeasurement {
7626    // Name of the subsystem (to which the rail belongs).
7627    optional string subsystem_name = 1;
7628
7629    // Rail name. The rail lies within the subsystem.
7630    optional string rail_name = 2;
7631
7632    // Time (in ms since boot) at which the rail energy value was measured.
7633    // This may differ slightly from the time that statsd logs this information.
7634    optional uint64 measurement_timestamp_millis = 3;
7635
7636    // Accumulated energy used via the rail since device boot in uWs.
7637    optional uint64 energy_microwatt_secs = 4;
7638}
7639
7640/**
7641 * Pulls Cpu time per cluster per frequency.
7642 * This is tracked by the time_in_state eBPF program.
7643 */
7644message CpuTimePerClusterFreq {
7645    optional uint32 cluster = 1;
7646    optional uint32 freq_khz = 2;
7647    // Time spent at this frequency excluding sleep since tracking started.
7648    optional uint64 time_millis = 3;
7649}
7650
7651/**
7652 * Pulls Cpu Time Per Uid.
7653 * Note that isolated process uid time should be attributed to host uids.
7654 */
7655message CpuTimePerUid {
7656    optional int32 uid = 1 [(is_uid) = true];
7657    optional uint64 user_time_micros = 2;
7658    optional uint64 sys_time_micros = 3;
7659}
7660
7661/**
7662 * Pulls Cpu Cycles Per Uid Per Cluster.
7663 * Note that uids are transformed to reduce the number of uploaded entries. Shared GIDs are
7664 * combined under single uid LAST_SHARED_APPLICATION_GID. Individual isolated uids are excluded
7665 * because they are recycled and removed from the underlying data source. All uids are normalized
7666 * to their base uids.
7667 */
7668message CpuCyclesPerUidCluster {
7669    optional int32 uid = 1 [(is_uid) = true];
7670    optional int32 cluster = 2;
7671    // Megacycles, i.e. millions of cycles.
7672    optional int64 mcycles = 3;
7673    // Time excluding sleep since tracking started.
7674    optional int64 time_millis = 4;
7675    // Power estimate: time * average power for frequency / 1000.
7676    optional int64 power_profile_estimate = 5;
7677}
7678
7679/**
7680 * Pulls Cpu Time Per Uid per frequency.
7681 * Note that uids are transformed to reduce the number of uploaded entries. Shared GIDs are
7682 * combined under single uid LAST_SHARED_APPLICATION_GID. Individual isolated uids are excluded
7683 * because they are recycled and removed from the underlying data source. All uids are normalized
7684 * to their base uids.
7685 */
7686message CpuTimePerUidFreq {
7687    optional int32 uid = 1 [(is_uid) = true];
7688    optional uint32 freq_index = 2;
7689    optional uint64 time_millis = 3;
7690}
7691
7692/**
7693  * Pulls Cpu Cycles Per ThreadGroup Per Cluster.
7694  * This is tracked by the time_in_state eBPF program.
7695  */
7696message CpuCyclesPerThreadGroupCluster {
7697    enum ThreadGroup {
7698        UNKNOWN_THREAD_GROUP = 0;
7699
7700        // System server threads serving Binder calls.
7701        SYSTEM_SERVER_BINDER = 1;
7702
7703        // All system server threads.
7704        SYSTEM_SERVER = 2;
7705
7706        // All surface flinger threads.
7707        SURFACE_FLINGER = 3;
7708    }
7709    optional ThreadGroup thread_group = 1;
7710
7711    optional int32 cluster = 2;
7712
7713    // Megacycles, i.e. millions of cycles.
7714    optional int64 mcycles = 3;
7715    // Time excluding sleep since tracking started.
7716    optional int64 time_millis = 4;
7717}
7718
7719/**
7720 * Pulls Wifi Controller Activity Energy Info
7721 */
7722message WifiActivityInfo {
7723    // timestamp(wall clock) of record creation
7724    optional uint64 timestamp_millis = 1;
7725    // stack reported state
7726    // TODO: replace this with proto enum
7727    optional int32 stack_state = 2;
7728    // tx time in millis
7729    optional uint64 controller_tx_time_millis = 3;
7730    // rx time in millis
7731    optional uint64 controller_rx_time_millis = 4;
7732    // idle time in millis
7733    optional uint64 controller_idle_time_millis = 5;
7734    // product of current(mA), voltage(V) and time(ms)
7735    optional uint64 controller_energy_used = 6;
7736}
7737
7738/**
7739 * Pulls Modem Activity Energy Info
7740 */
7741message ModemActivityInfo {
7742    // timestamp(wall clock) of record creation
7743    optional uint64 timestamp_millis = 1;
7744    // sleep time in millis.
7745    optional uint64 sleep_time_millis = 2;
7746    // idle time in millis
7747    optional uint64 controller_idle_time_millis = 3;
7748    /**
7749     * Tx power index
7750     * index 0 = tx_power < 0dBm
7751     * index 1 = 0dBm < tx_power < 5dBm
7752     * index 2 = 5dBm < tx_power < 15dBm
7753     * index 3 = 15dBm < tx_power < 20dBm
7754     * index 4 = tx_power > 20dBm
7755     */
7756    // tx time in ms at power level 0
7757    optional uint64 controller_tx_time_pl0_millis = 4;
7758    // tx time in ms at power level 1
7759    optional uint64 controller_tx_time_pl1_millis = 5;
7760    // tx time in ms at power level 2
7761    optional uint64 controller_tx_time_pl2_millis = 6;
7762    // tx time in ms at power level 3
7763    optional uint64 controller_tx_time_pl3_millis = 7;
7764    // tx time in ms at power level 4
7765    optional uint64 controller_tx_time_pl4_millis = 8;
7766    // rx time in ms at power level 5
7767    optional uint64 controller_rx_time_millis = 9;
7768    // product of current(mA), voltage(V) and time(ms)
7769    optional uint64 energy_used = 10 [deprecated=true];
7770}
7771
7772/**
7773 * Pulls Bluetooth Activity Energy Info
7774 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
7775 */
7776message BluetoothActivityInfo {
7777    // timestamp(wall clock) of record creation
7778    optional uint64 timestamp_millis = 1;
7779    // bluetooth stack state
7780    optional int32 bluetooth_stack_state = 2;
7781    // tx time in millis
7782    optional uint64 controller_tx_time_millis = 3;
7783    // rx time in millis
7784    optional uint64 controller_rx_time_millis = 4;
7785    // idle time in millis
7786    optional uint64 controller_idle_time_millis = 5;
7787    // product of current(mA), voltage(V) and time(ms)
7788    optional uint64 energy_used = 6;
7789}
7790
7791/*
7792 * Logs the memory stats for a process.
7793 *
7794 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
7795 */
7796message ProcessMemoryState {
7797    // The uid if available. -1 means not available.
7798    optional int32 uid = 1 [(is_uid) = true];
7799
7800    // The process name.
7801    // Usually package name, "system" for system server.
7802    // Provided by ActivityManagerService.
7803    optional string process_name = 2;
7804
7805    // Current OOM score adjustment. Value read from ProcessRecord.
7806    optional int32 oom_adj_score = 3;
7807
7808    // # of page-faults
7809    optional int64 page_fault = 4;
7810
7811    // # of major page-faults
7812    optional int64 page_major_fault = 5;
7813
7814    // RSS
7815    // Value is read from memory.stat, field total_rss if per-app memory
7816    // cgroups are enabled. Otherwise, value from /proc/pid/stat.
7817    optional int64 rss_in_bytes = 6;
7818
7819    // CACHE
7820    // Value is read from memory.stat, field total_cache if per-app memory
7821    // cgroups are enabled. Otherwise, 0.
7822    optional int64 cache_in_bytes = 7;
7823
7824    // SWAP
7825    // Value is read from memory.stat, field total_swap if per-app memory
7826    // cgroups are enabled. Otherwise, 0.
7827    optional int64 swap_in_bytes = 8;
7828
7829    // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
7830    optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
7831
7832    // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
7833    optional int64 start_time_nanos = 10 [deprecated = true];
7834
7835    // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
7836    optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
7837}
7838
7839/*
7840 * Logs the memory high-water mark for a process.
7841 *
7842 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
7843 * and for selected native processes.
7844 *
7845 * Pulling this atom resets high-water mark counters for all processes.
7846 */
7847message ProcessMemoryHighWaterMark {
7848    // The uid if available. -1 means not available.
7849    optional int32 uid = 1 [(is_uid) = true];
7850
7851    // The process name.
7852    // Usually package name or process cmdline.
7853    // Provided by ActivityManagerService or read from /proc/PID/cmdline.
7854    optional string process_name = 2;
7855
7856    // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
7857    // computed by converting kilobytes to bytes.
7858    optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
7859
7860    // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
7861    // /proc/PID/status.
7862    optional int32 rss_high_water_mark_in_kilobytes = 4;
7863}
7864
7865/*
7866 * Logs the memory stats for a process.
7867 *
7868 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
7869 * and for selected native processes.
7870 */
7871message ProcessMemorySnapshot {
7872    // The uid if available. -1 means not available.
7873    optional int32 uid = 1 [(is_uid) = true];
7874
7875    // The process name.
7876    // Usually package name or process cmdline.
7877    // Provided by ActivityManagerService or read from /proc/PID/cmdline.
7878    optional string process_name = 2;
7879
7880    // The pid of the process.
7881    // Allows to disambiguate instances of the process.
7882    optional int32 pid = 3;
7883
7884    // The current OOM score adjustment value.
7885    // Read from ProcessRecord for managed processes.
7886    // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
7887    optional int32 oom_score_adj = 4;
7888
7889    // The current RSS of the process.
7890    // VmRSS from /proc/pid/status.
7891    optional int32 rss_in_kilobytes = 5;
7892
7893    // The current anon RSS of the process.
7894    // RssAnon from /proc/pid/status.
7895    optional int32 anon_rss_in_kilobytes = 6;
7896
7897    // The current swap size of the process.
7898    // VmSwap from /proc/pid/status.
7899    optional int32 swap_in_kilobytes = 7;
7900
7901    // The sum of rss_in_kilobytes and swap_in_kilobytes.
7902    optional int32 anon_rss_and_swap_in_kilobytes = 8;
7903
7904    // GPU memory usage as measured by the kernel tracepoints
7905    // Equivalent to dumpsys gpu --gpumem
7906    optional int32 gpu_memory_kb = 9;
7907
7908    // Whether or not this process is hosting one or more foregound services.
7909    optional bool has_foreground_services = 10;
7910}
7911
7912/*
7913 * Elapsed real time from SystemClock.
7914 */
7915message SystemElapsedRealtime {
7916    optional uint64 time_millis = 1;
7917}
7918
7919/*
7920 * Up time from SystemClock.
7921 */
7922message SystemUptime {
7923    // Milliseconds since the system was booted.
7924    // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
7925    // for external input).
7926    // It is not affected by clock scaling, idle, or other power saving mechanisms.
7927    optional uint64 uptime_millis = 1;
7928}
7929
7930/*
7931 * Reads from /proc/uid_concurrent_active_time which has the format:
7932 * active: X (X is # cores)
7933 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
7934 * [uid1]: [time-0] [time-1] [time-2] ... ...
7935 * ...
7936 * Time-N means the CPU time a UID spent running concurrently with N other processes.
7937 * The file contains a monotonically increasing count of time for a single boot.
7938 */
7939message CpuActiveTime {
7940    optional int32 uid = 1 [(is_uid) = true];
7941    optional uint64 time_millis = 2;
7942}
7943
7944/**
7945 * Reads from /proc/uid_concurrent_policy_time which has the format:
7946 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
7947 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
7948 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
7949 * ...
7950 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
7951 * The file contains a monotonically increasing count of time for a single boot.
7952 */
7953message CpuClusterTime {
7954    optional int32 uid = 1 [(is_uid) = true];
7955    optional int32 cluster_index = 2;
7956    optional uint64 time_millis = 3;
7957}
7958
7959/*
7960 * Pulls free disk space, for data, system partition and temporary directory.
7961 */
7962message DiskSpace {
7963    // available bytes in data partition
7964    optional uint64 data_available_bytes = 1;
7965    // available bytes in system partition
7966    optional uint64 system_available_bytes = 2;
7967    // available bytes in download cache or temp directories
7968    optional uint64 temp_available_bytes = 3;
7969}
7970
7971/**
7972 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
7973 *
7974 * Pulled from StatsCompanionService.java
7975 */
7976message RemainingBatteryCapacity {
7977    optional int32 charge_micro_ampere_hour = 1;
7978}
7979
7980/**
7981 * Pulls battery capacity, which is the battery capacity when full in uAh.
7982 * Pulled from:
7983 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
7984 */
7985message FullBatteryCapacity {
7986    optional int32 capacity_micro_ampere_hour = 1;
7987}
7988
7989/**
7990 * Pulls battery voltage.
7991 * Pulled from:
7992 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
7993 */
7994message BatteryVoltage {
7995    // The voltage of the battery, in millivolts.
7996    optional int32 voltage_millivolt = 1;
7997}
7998
7999/**
8000 * Pulls battery level (percent full, from 0 to 100).
8001 *
8002 * Pulled from:
8003 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
8004 */
8005message BatteryLevel {
8006    // Battery level. Should be in [0, 100].
8007    optional int32 battery_level = 1;
8008}
8009
8010/**
8011 * Pulls the temperature of various parts of the device.
8012 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
8013 *
8014 * Pulled from StatsCompanionService.java
8015 */
8016message Temperature {
8017    // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
8018    optional android.os.TemperatureTypeEnum sensor_location = 1;
8019
8020    // The name of the temperature source. Eg. CPU0
8021    optional string sensor_name = 2;
8022
8023    // Temperature in tenths of a degree C.
8024    // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
8025    optional int32 temperature_deci_celsius = 3;
8026
8027    // Relative severity of the throttling, see enum definition.
8028    optional android.os.ThrottlingSeverityEnum severity = 4;
8029}
8030
8031/**
8032 * Pulls the statistics of calls to Binder.
8033 *
8034 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
8035 * config on the device.
8036 *
8037 * Next tag: 15
8038 */
8039message BinderCalls {
8040    // UID of the process responsible for the binder transaction. It will be set if the process
8041    // executing the binder transaction attribute the transaction to another uid using
8042    // Binder.setThreadWorkSource().
8043    //
8044    // If not set, the value will be -1.
8045    optional int32 uid = 1 [(is_uid) = true];
8046    // UID of the process executing the binder transaction.
8047    optional int32 direct_caller_uid = 14;
8048    // Fully qualified class name of the API call.
8049    //
8050    // This is a system server class name.
8051    //
8052    // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
8053    // gets recycled and we have isolated uids, we might attribute the data incorrectly.
8054    // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
8055    // commonly used APIs.
8056    optional string service_class_name = 2;
8057    // Method name of the API call. It can also be a transaction code if we cannot
8058    // resolve it to a name. See Binder#getTransactionName.
8059    //
8060    // This is a system server method name.
8061    optional string service_method_name = 3;
8062    // Total number of API calls.
8063    optional int64 call_count = 4;
8064    // True if the screen was interactive PowerManager#isInteractive at the end of the call.
8065    optional bool screen_interactive = 13;
8066    // Total number of API calls we have data recorded for. If we collected data for all the calls,
8067    // call_count will be equal to recorded_call_count.
8068    //
8069    // If recorded_call_count is different than call_count, it means data collection has been
8070    // sampled. All the fields below will be sampled in this case.
8071    optional int64 recorded_call_count = 12;
8072    // Number of exceptions thrown by the API.
8073    optional int64 recorded_exception_count = 5;
8074    // Total latency of all API calls.
8075    // Average can be computed using total_latency_micros / recorded_call_count.
8076    optional int64 recorded_total_latency_micros = 6;
8077    // Maximum latency of one API call.
8078    optional int64 recorded_max_latency_micros = 7;
8079    // Total CPU usage of all API calls.
8080    // Average can be computed using total_cpu_micros / recorded_call_count.
8081    // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
8082    optional int64 recorded_total_cpu_micros = 8;
8083    // Maximum CPU usage of one API call.
8084    optional int64 recorded_max_cpu_micros = 9;
8085    // Maximum parcel reply size of one API call.
8086    optional int64 recorded_max_reply_size_bytes = 10;
8087    // Maximum parcel request size of one API call.
8088    optional int64 recorded_max_request_size_bytes = 11;
8089}
8090
8091/**
8092 * Pulls the statistics of exceptions during calls to Binder.
8093 *
8094 * Binder stats are cumulative from boot unless somebody reset the data using
8095 * > adb shell dumpsys binder_calls_stats --reset
8096 */
8097message BinderCallsExceptions {
8098    // Exception class name, e.g. java.lang.IllegalArgumentException.
8099    //
8100    // This is an exception class name thrown by the system server.
8101    optional string exception_class_name = 1;
8102    // Total number of exceptions.
8103    optional int64 exception_count = 2;
8104}
8105
8106/**
8107 * Pulls the statistics of message dispatching on HandlerThreads.
8108 *
8109 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
8110 * config on the device.
8111 *
8112 * Next tag: 11
8113 */
8114message LooperStats {
8115    // The uid that made a call to the System Server and caused the message to be enqueued.
8116    optional int32 uid = 1 [(is_uid) = true];
8117
8118    // Fully qualified class name of the handler target class.
8119    //
8120    // This field does not contain PII. This is a system server class name.
8121    optional string handler_class_name = 2;
8122
8123    // The name of the thread that runs the Looper.
8124    //
8125    // This field does not contain PII. This is a system server thread name.
8126    optional string looper_thread_name = 3;
8127
8128    // The name of the dispatched message.
8129    //
8130    // This field does not contain PII. This is a system server constant or class
8131    // name.
8132    optional string message_name = 4;
8133
8134    // Total number of successfully dispatched messages.
8135    optional int64 message_count = 5;
8136
8137    // Total number of messages that failed dispatching.
8138    optional int64 exception_count = 6;
8139
8140    // Total number of processed messages we have data recorded for. If we
8141    // collected data for all the messages, message_count will be equal to
8142    // recorded_message_count.
8143    //
8144    // If recorded_message_count is different than message_count, it means data
8145    // collection has been sampled. The fields below will be sampled in this case.
8146    optional int64 recorded_message_count = 7;
8147
8148    // Total latency of all processed messages.
8149    // Average can be computed using recorded_total_latency_micros /
8150    // recorded_message_count.
8151    optional int64 recorded_total_latency_micros = 8;
8152
8153    // Total CPU usage of all processed message.
8154    // Average can be computed using recorded_total_cpu_micros /
8155    // recorded_message_count. Total can be computed using
8156    // recorded_total_cpu_micros / recorded_message_count * message_count.
8157    optional int64 recorded_total_cpu_micros = 9;
8158
8159    // True if the screen was interactive PowerManager#isInteractive at the end of the call.
8160    optional bool screen_interactive = 10;
8161
8162    // Max recorded CPU usage of all processed messages.
8163    optional int64 recorded_max_cpu_micros = 11;
8164
8165    // Max recorded latency of all processed messages.
8166    optional int64 recorded_max_latency_micros = 12;
8167
8168    // Total number of messages we tracked the dispatching delay for. If we
8169    // collected data for all the messages, message_count will be equal to
8170    // recorded_delay_message_count.
8171    //
8172    // If recorded_delay_message_count is different than message_count, it means data
8173    // collection has been sampled or/and not all messages specified the target dispatch time.
8174    // The fields below will be sampled in this case.
8175    optional int64 recorded_delay_message_count = 13;
8176
8177    // Total dispatching delay of all processed messages.
8178    // Calculated as a difference between the target dispatching time (Message.when)
8179    // and the actual dispatching time.
8180    // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
8181    optional int64 recorded_total_delay_millis = 14;
8182
8183    // Max dispatching delay of all processed messages.
8184    // Calculated as a difference between the target dispatching time (Message.when)
8185    // and the actual dispatching time.
8186    optional int64 recorded_max_delay_millis = 15;
8187}
8188
8189/**
8190 * Pulls disk information, such as write speed and latency.
8191 */
8192message DiskStats {
8193    // Time taken to open, write 512B to, and close a file.
8194    // -1 if error performing the check.
8195    optional int64 data_write_latency_millis = 1;
8196
8197    optional bool file_based_encryption = 2;
8198
8199    // Recent disk write speed in kB/s.
8200    // -1 if error querying storageed.
8201    // 0 if data is unavailable.
8202    optional int32 recent_disk_write_speed = 3;
8203}
8204
8205
8206/**
8207 * Free and total bytes of the Data, Cache, System, and Metadata partitions.
8208 */
8209message DirectoryUsage {
8210    enum Directory {
8211        UNKNOWN = 0;
8212        DATA = 1;
8213        CACHE = 2;
8214        SYSTEM = 3;
8215        METADATA = 4;
8216    }
8217    optional Directory directory = 1;
8218    optional int64 free_bytes = 2;
8219    optional int64 total_bytes = 3;
8220}
8221
8222
8223/**
8224 * Size of an application: apk size, data size, and cache size.
8225 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
8226 * Information is only reported for apps with the primary user (user 0).
8227 * Sizes are aggregated by package name.
8228 */
8229message AppSize {
8230    // Including uids will involve modifying diskstats logic.
8231    optional string package_name = 1;
8232    // App size in bytes. -1 if unavailable.
8233    optional int64 app_size_bytes = 2;
8234    // App data size in bytes. -1 if unavailable.
8235    optional int64 app_data_size_bytes = 3;
8236    // App cache size in bytes. -1 if unavailable.
8237    optional int64 app_cache_size_bytes = 4;
8238    // Time that the cache file was produced.
8239    // Uses System.currentTimeMillis(), which is wall clock time.
8240    optional int64 cache_time_millis = 5;
8241}
8242
8243
8244/**
8245 * Size of a particular category. Eg: photos, videos.
8246 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
8247 */
8248message CategorySize {
8249    enum Category {
8250        UNKNOWN = 0;
8251        APP_SIZE = 1;
8252        APP_DATA_SIZE = 2;
8253        APP_CACHE_SIZE = 3;
8254        PHOTOS = 4;
8255        VIDEOS = 5;
8256        AUDIO = 6;
8257        DOWNLOADS = 7;
8258        SYSTEM = 8;
8259        OTHER = 9;
8260    }
8261    optional Category category = 1;
8262    // Category size in bytes.
8263    optional int64 size_bytes = 2;
8264    // Time that the cache file was produced.
8265    // Uses System.currentTimeMillis(), which is wall clock time.
8266    optional int64 cache_time_millis = 3;
8267}
8268
8269/**
8270 * Pulls per uid I/O stats. The stats are cumulative since boot.
8271 *
8272 * Read/write bytes are I/O events from a storage device
8273 * Read/write chars are data requested by read/write syscalls, and can be
8274 *   satisfied by caching.
8275 *
8276 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
8277 */
8278message DiskIo {
8279    optional int32 uid = 1 [(is_uid) = true];
8280    optional int64 fg_chars_read = 2;
8281    optional int64 fg_chars_write = 3;
8282    optional int64 fg_bytes_read = 4;
8283    optional int64 fg_bytes_write = 5;
8284    optional int64 bg_chars_read = 6;
8285    optional int64 bg_chars_write = 7;
8286    optional int64 bg_bytes_read = 8;
8287    optional int64 bg_bytes_write = 9;
8288    optional int64 fg_fsync = 10;
8289    optional int64 bg_fsync= 11;
8290}
8291
8292
8293/**
8294 * Pulls the number of fingerprints for each user.
8295 *
8296 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
8297 */
8298message NumFingerprintsEnrolled {
8299    // The associated user. Eg: 0 for owners, 10+ for others.
8300    // Defined in android/os/UserHandle.java
8301    optional int32 user = 1;
8302    // Number of fingerprints registered to that user.
8303    optional int32 num_fingerprints_enrolled = 2;
8304}
8305
8306/**
8307 * Pulls the number of faces for each user.
8308 *
8309 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
8310 */
8311message NumFacesEnrolled {
8312    // The associated user. Eg: 0 for owners, 10+ for others.
8313    // Defined in android/os/UserHandle.java
8314    optional int32 user = 1;
8315    // Number of faces registered to that user.
8316    optional int32 num_faces_enrolled = 2;
8317}
8318/**
8319 * A mapping of role holder -> role
8320 */
8321message RoleHolder {
8322    // uid of the role holder
8323    optional int32 uid = 1 [(is_uid) = true];
8324
8325    // package name of the role holder
8326    optional string package_name = 2;
8327
8328    // the role held
8329    optional string role = 3;
8330}
8331
8332message AggStats {
8333    // These are all in byte resolution.
8334    optional int64 min = 1 [deprecated = true];
8335    optional int64 average = 2 [deprecated = true];
8336    optional int64 max = 3 [deprecated = true];
8337
8338    // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
8339    // int64 fields.
8340    optional int32 mean_kb = 4;
8341    optional int32 max_kb = 5;
8342}
8343
8344// A reduced subset of process states; reducing the number of possible states allows more
8345// aggressive device-side aggregation of statistics and hence reduces metric upload size.
8346enum ProcessStateAggregated {
8347    PROCESS_STATE_UNKNOWN = 0;
8348    // Persistent system process.
8349    PROCESS_STATE_PERSISTENT = 1;
8350    // Top activity; actually any visible activity.
8351    PROCESS_STATE_TOP = 2;
8352    // Process binding to top or a foreground service.
8353    PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
8354    // Processing running a foreground service.
8355    PROCESS_STATE_FGS = 4;
8356    // Important foreground process (ime, wallpaper, etc).
8357    PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
8358    // Important background process.
8359    PROCESS_STATE_BACKGROUND = 6;
8360    // Process running a receiver.
8361    PROCESS_STATE_RECEIVER = 7;
8362    // All kinds of cached processes.
8363    PROCESS_STATE_CACHED = 8;
8364}
8365
8366// Next tag: 13
8367message ProcessStatsStateProto {
8368    optional android.service.procstats.ScreenState screen_state = 1;
8369
8370    optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
8371
8372    // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
8373    // and not frameworks/base/core/java/android/app/ActivityManager.java
8374    optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
8375
8376    optional ProcessStateAggregated process_state_aggregated = 10;
8377
8378    // Millisecond uptime duration spent in this state
8379    optional int64 duration_millis = 4 [deprecated = true];
8380    // Same as above, but with minute resolution so it fits into an int32.
8381    optional int32 duration_minutes = 11;
8382
8383    // Millisecond elapsed realtime duration spent in this state
8384    optional int64 realtime_duration_millis = 9 [deprecated = true];
8385    // Same as above, but with minute resolution so it fits into an int32.
8386    optional int32 realtime_duration_minutes = 12;
8387
8388    // # of samples taken
8389    optional int32 sample_size = 5;
8390
8391    // PSS is memory reserved for this process
8392    optional AggStats pss = 6 [deprecated = true];
8393
8394    // USS is memory shared between processes, divided evenly for accounting
8395    optional AggStats uss = 7 [deprecated = true];
8396
8397    // RSS is memory resident for this process
8398    optional AggStats rss = 8;
8399}
8400
8401// Next Tag: 8
8402message ProcessStatsProto {
8403    // Name of process.
8404    optional string process = 1;
8405
8406    // Uid of the process.
8407    optional int32 uid = 2 [(is_uid) = true];
8408
8409    // Information about how often kills occurred
8410    message Kill {
8411        // Count of excessive CPU kills
8412        optional int32 cpu = 1;
8413
8414        // Count of kills when cached
8415        optional int32 cached = 2;
8416
8417        // PSS stats during cached kill
8418        optional AggStats cached_pss = 3;
8419    }
8420    optional Kill kill = 3 [deprecated = true];
8421
8422    // Time and memory spent in various states.
8423    repeated ProcessStatsStateProto states = 5;
8424
8425    // Total time process has been running...  screen_state, memory_state, and process_state
8426    // will not be set.
8427    optional ProcessStatsStateProto total_running_state = 6;
8428
8429    // Association data for this process in this state;
8430    // each entry here is one association.
8431    repeated ProcessStatsAssociationProto assocs = 7;
8432}
8433
8434// Next Tag: 6
8435message ProcessStatsAssociationProto {
8436    // Procss Name of the associated process (client process of service binding)
8437    optional string assoc_process_name = 1;
8438
8439    // Package Name of the associated package (client package of service binding)
8440    optional string assoc_package_name = 2 [deprecated = true];
8441
8442    // UID of the associated process/package (client package of service binding)
8443    optional int32 assoc_uid = 5 [(is_uid) = true];
8444
8445    // Total count of the times this association (service binding) appeared.
8446    optional int32 total_count = 3;
8447
8448    // Uptime total duration in seconds this association (service binding) was around.
8449    optional int32 total_duration_secs = 4;
8450}
8451
8452message PackageServiceOperationStatsProto {
8453    // Operate enum: Started, Foreground, Bound, Executing
8454    optional android.service.procstats.ServiceOperationState operation = 1;
8455
8456    // Number of times the service was in this operation.
8457    optional int32 count = 2;
8458
8459    // Information about a state the service can be in.
8460    message StateStats {
8461        // Screen state enum.
8462        optional android.service.procstats.ScreenState screen_state = 1;
8463        // Memory state enum.
8464        optional android.service.procstats.MemoryState memory_state = 2;
8465
8466        // duration in milliseconds.
8467        optional int64 duration_millis = 3;
8468        // Millisecond elapsed realtime duration spent in this state
8469        optional int64 realtime_duration_millis = 4;
8470    }
8471    repeated StateStats state_stats = 3;
8472}
8473
8474message PackageServiceStatsProto {
8475    // Name of service component.
8476    optional string service_name = 1;
8477
8478    // The operation stats.
8479    // The package_name, package_uid, package_version, service_name will not be set to save space.
8480    repeated PackageServiceOperationStatsProto operation_stats = 2;
8481}
8482
8483message PackageAssociationSourceProcessStatsProto {
8484    // Uid of the process.
8485    optional int32 process_uid = 1;
8486    // Process name.
8487    optional string process_name = 2;
8488    // Package name.
8489    optional string package_name = 7;
8490    // Total count of the times this association appeared.
8491    optional int32 total_count = 3;
8492
8493    // Millisecond uptime total duration this association was around.
8494    optional int64 total_duration_millis = 4;
8495
8496    // Total count of the times this association became actively impacting its target process.
8497    optional int32 active_count = 5;
8498
8499    // Information on one source in this association.
8500    message StateStats {
8501        // Process state enum.
8502        optional android.service.procstats.ProcessState process_state = 1;
8503        // Millisecond uptime duration spent in this state
8504        optional int64 duration_millis = 2;
8505        // Millisecond elapsed realtime duration spent in this state
8506        optional int64 realtime_duration_mmillis = 3;
8507    }
8508    repeated StateStats active_state_stats = 6;
8509}
8510
8511message PackageAssociationProcessStatsProto {
8512    // Name of the target component.
8513    optional string component_name = 1;
8514    // Information on one source in this association.
8515    repeated PackageAssociationSourceProcessStatsProto sources = 2;
8516}
8517
8518
8519message ProcessStatsPackageProto {
8520    // Name of package.
8521    optional string package = 1;
8522
8523    // Uid of the package.
8524    optional int32 uid = 2;
8525
8526    // Version of the package.
8527    optional int64 version = 3;
8528
8529    // Stats for each process running with the package loaded in to it.
8530    repeated ProcessStatsProto process_stats = 4;
8531
8532    // Stats for each of the package's services.
8533    repeated PackageServiceStatsProto service_stats = 5;
8534
8535    // Stats for each association with the package.
8536    repeated PackageAssociationProcessStatsProto association_stats = 6;
8537}
8538
8539message ProcessStatsSectionProto {
8540    // Elapsed realtime at start of report.
8541    optional int64 start_realtime_millis = 1;
8542
8543    // Elapsed realtime at end of report.
8544    optional int64 end_realtime_millis = 2;
8545
8546    // CPU uptime at start of report.
8547    optional int64 start_uptime_millis = 3;
8548
8549    // CPU uptime at end of report.
8550    optional int64 end_uptime_millis = 4;
8551
8552    // System runtime library. e.g. "libdvm.so", "libart.so".
8553    optional string runtime = 5;
8554
8555    // whether kernel reports swapped pss.
8556    optional bool has_swapped_pss = 6;
8557
8558    // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
8559    enum Status {
8560        STATUS_UNKNOWN = 0;
8561        STATUS_COMPLETE = 1;
8562        STATUS_PARTIAL = 2;
8563        STATUS_SHUTDOWN = 3;
8564        STATUS_SYSPROPS = 4;
8565    }
8566    repeated Status status = 7;
8567
8568    // Number of pages available of various types and sizes, representation fragmentation.
8569    repeated ProcessStatsAvailablePagesProto available_pages = 10;
8570
8571    // Stats for each process.
8572    repeated ProcessStatsProto process_stats = 8;
8573
8574    // Stats for each package.
8575    repeated ProcessStatsPackageProto package_stats = 9;
8576}
8577
8578message ProcessStatsAvailablePagesProto {
8579    // Node these pages are in (as per /proc/pagetypeinfo)
8580    optional int32 node = 1;
8581
8582    // Zone these pages are in (as per /proc/pagetypeinfo)
8583    optional string zone = 2;
8584
8585    // Label for the type of these pages (as per /proc/pagetypeinfo)
8586    optional string label = 3;
8587
8588    // Distribution of number of pages available by order size.  First entry in array is
8589    // order 0, second is order 1, etc.  Each order increase is a doubling of page size.
8590    repeated int32 pages_per_order = 4;
8591}
8592
8593/**
8594 * Pulled from ProcessStatsService.java
8595 */
8596message ProcStats {
8597    optional ProcessStatsSectionProto proc_stats_section = 1 [(log_mode) = MODE_BYTES];
8598    // Data pulled from device into this is sometimes sharded across multiple atoms to work around
8599    // a size limit. When this happens, this shard ID will contain an increasing 1-indexed integer
8600    // with the number of this shard.
8601    optional int32 shard_id = 2;
8602}
8603
8604/**
8605 * Pulled from ProcessStatsService.java
8606 */
8607message ProcStatsPkgProc {
8608    optional ProcessStatsSectionProto proc_stats_section = 1 [(log_mode) = MODE_BYTES];
8609}
8610
8611// Next Tag: 2
8612message PackageRemoteViewInfoProto {
8613    optional string package_name = 1;
8614    // add per-package additional info here (like channels)
8615}
8616
8617// Next Tag: 2
8618message NotificationRemoteViewsProto {
8619    repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
8620}
8621
8622/**
8623 * Pulled from NotificationManagerService.java
8624 */
8625message NotificationRemoteViews {
8626    optional NotificationRemoteViewsProto notification_remote_views = 1 [(log_mode) = MODE_BYTES];
8627}
8628
8629/**
8630 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
8631 */
8632message PackageNotificationPreferences {
8633    // Uid under which the package is installed.
8634    optional int32 uid = 1 [(is_uid) = true];
8635    // Notification importance, which specifies when and how a notification is displayed.
8636    // Specified under core/java/android/app/NotificationManager.java.
8637    optional int32 importance = 2;
8638    // Lockscreen visibility as set by the user.
8639    optional int32 visibility = 3;
8640    // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
8641    // PreferencesHelper.java)
8642    optional int32 user_locked_fields = 4;
8643    // Indicates if the package importance was set by the user (rather than system default).
8644    optional bool user_set_importance = 5;
8645}
8646
8647/**
8648 * Atom that contains a list of a package's channel preferences, pulled from
8649 * NotificationManagerService.java.
8650 */
8651message PackageNotificationChannelPreferences {
8652    // Uid under which the package is installed.
8653    optional int32 uid = 1 [(is_uid) = true];
8654    // Channel's ID. Should always be available.
8655    optional string channel_id = 2;
8656    // Channel's name. Should always be available.
8657    optional string channel_name = 3;
8658    // Channel's description. Optionally set by the channel creator.
8659    optional string description = 4;
8660    // Notification importance, which specifies when and how a notification is displayed. Specified
8661    // under core/java/android/app/NotificationManager.java.
8662    optional int32 importance = 5;
8663    // Bitmask representing which fields have been set by the user. See field bitmask descriptions
8664    // at core/java/android/app/NotificationChannel.java
8665    optional int32 user_locked_fields = 6;
8666    // Indicates if the channel was deleted by the app.
8667    optional bool is_deleted = 7;
8668    // Indicates if the channel was marked as a conversation by the app.
8669    optional bool is_conversation = 8;
8670    // Indicates if the channel is a conversation that was demoted by the user.
8671    optional bool is_demoted_conversation = 9;
8672    // Indicates if the channel is a conversation that was marked as important by the user.
8673    optional bool is_important_conversation = 10;
8674}
8675
8676/**
8677 * Atom that represents an item in the list of Do Not Disturb rules, pulled from
8678 * NotificationManagerService.java.
8679 */
8680message DNDModeProto {
8681    enum Mode {
8682        ROOT_CONFIG = -1;  // Used to distinguish the config (one per user) from the rules.
8683        ZEN_MODE_OFF = 0;
8684        ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
8685        ZEN_MODE_NO_INTERRUPTIONS = 2;
8686        ZEN_MODE_ALARMS = 3;
8687    }
8688    optional int32 user = 1;  // Android user ID (0, 1, 10, ...)
8689    optional bool enabled = 2;  // true for ROOT_CONFIG if a manualRule is enabled
8690    optional bool channels_bypassing = 3; // only valid for ROOT_CONFIG
8691    optional Mode zen_mode = 4;
8692    // id is one of the system default rule IDs, or empty
8693    // May also be "MANUAL_RULE" to indicate app-activation of the manual rule.
8694    optional string id = 5;
8695    optional int32 uid = 6 [(is_uid) = true]; // currently only SYSTEM_UID or 0 for other
8696    optional DNDPolicyProto policy = 7 [(log_mode) = MODE_BYTES];
8697}
8698
8699/**
8700 * Atom that represents a Do Not Disturb policy, an optional detail proto for DNDModeProto.
8701 */
8702message DNDPolicyProto {
8703    enum State {
8704        STATE_UNSET = 0;
8705        STATE_ALLOW = 1;
8706        STATE_DISALLOW = 2;
8707    }
8708    optional State calls = 1;
8709    optional State repeat_callers = 2;
8710    optional State messages = 3;
8711    optional State conversations = 4;
8712    optional State reminders = 5;
8713    optional State events = 6;
8714    optional State alarms = 7;
8715    optional State media = 8;
8716    optional State system = 9;
8717    optional State fullscreen = 10;
8718    optional State lights = 11;
8719    optional State peek = 12;
8720    optional State status_bar = 13;
8721    optional State badge = 14;
8722    optional State ambient = 15;
8723    optional State notification_list = 16;
8724
8725    enum PeopleType {
8726        PEOPLE_UNSET = 0;
8727        PEOPLE_ANYONE = 1;
8728        PEOPLE_CONTACTS = 2;
8729        PEOPLE_STARRED = 3;
8730        PEOPLE_NONE = 4;
8731    }
8732
8733    optional PeopleType allow_calls_from = 17;
8734    optional PeopleType allow_messages_from = 18;
8735
8736    enum ConversationType {
8737        CONV_UNSET = 0;
8738        CONV_ANYONE = 1;
8739        CONV_IMPORTANT = 2;
8740        CONV_NONE = 3;
8741    }
8742
8743    optional ConversationType allow_conversations_from = 19;
8744}
8745
8746/**
8747 * Atom that contains a list of a package's channel group preferences, pulled from
8748 * NotificationManagerService.java.
8749 */
8750message PackageNotificationChannelGroupPreferences {
8751    // Uid under which the package is installed.
8752    optional int32 uid = 1 [(is_uid) = true];
8753    // Channel Group's ID. Should always be available.
8754    optional string group_id = 2;
8755    // Channel Group's name. Should always be available.
8756    optional string group_name = 3;
8757    // Channel Group's description. Optionally set by group creator.
8758    optional string description = 4;
8759    // Indicates if notifications from this channel group are blocked.
8760    optional bool is_blocked = 5;
8761    // Bitmask representing which fields have been set by the user. See field bitmask descriptions
8762    // at core/java/android/app/NotificationChannelGroup.java
8763    optional int32 user_locked_fields = 6;
8764}
8765
8766message PowerProfileProto {
8767    optional double cpu_suspend = 1;
8768
8769    optional double cpu_idle = 2;
8770
8771    optional double cpu_active = 3;
8772
8773    message CpuCluster {
8774        optional int32 id = 1;
8775        optional double cluster_power = 2;
8776        optional int32 cores = 3;
8777        repeated int64 speed = 4;
8778        repeated double core_power = 5;
8779    }
8780
8781    repeated CpuCluster cpu_cluster = 40;
8782
8783    optional double wifi_scan = 4;
8784
8785    optional double wifi_on = 5;
8786
8787    optional double wifi_active = 6;
8788
8789    optional double wifi_controller_idle = 7;
8790
8791    optional double wifi_controller_rx = 8;
8792
8793    optional double wifi_controller_tx = 9;
8794
8795    repeated double wifi_controller_tx_levels = 10;
8796
8797    optional double wifi_controller_operating_voltage = 11;
8798
8799    optional double bluetooth_controller_idle = 12;
8800
8801    optional double bluetooth_controller_rx = 13;
8802
8803    optional double bluetooth_controller_tx = 14;
8804
8805    optional double bluetooth_controller_operating_voltage = 15;
8806
8807    optional double modem_controller_sleep = 16;
8808
8809    optional double modem_controller_idle = 17;
8810
8811    optional double modem_controller_rx = 18;
8812
8813    repeated double modem_controller_tx = 19;
8814
8815    optional double modem_controller_operating_voltage = 20;
8816
8817    optional double gps_on = 21;
8818
8819    repeated double gps_signal_quality_based = 22;
8820
8821    optional double gps_operating_voltage = 23;
8822
8823    optional double bluetooth_on = 24;
8824
8825    optional double bluetooth_active = 25;
8826
8827    optional double bluetooth_at_cmd = 26;
8828
8829    optional double ambient_display = 27;
8830
8831    optional double screen_on = 28;
8832
8833    optional double radio_on = 29;
8834
8835    optional double radio_scanning = 30;
8836
8837    optional double radio_active = 31;
8838
8839    optional double screen_full = 32;
8840
8841    optional double audio = 33;
8842
8843    optional double video = 34;
8844
8845    optional double flashlight = 35;
8846
8847    optional double memory = 36;
8848
8849    optional double camera = 37;
8850
8851    optional double wifi_batched_scan = 38;
8852
8853    optional double battery_capacity = 39;
8854}
8855
8856/**
8857 * power_profile.xml and other constants for power model calculations.
8858 * Pulled from PowerProfile.java
8859 */
8860message PowerProfile {
8861    optional PowerProfileProto power_profile = 1 [(log_mode) = MODE_BYTES];
8862}
8863
8864/**
8865 * Logs when a user restriction was added or removed.
8866 *
8867 * Logged from:
8868 *   frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
8869 */
8870message UserRestrictionChanged {
8871    // The raw string of the user restriction as defined in UserManager.
8872    // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
8873    optional string restriction = 1;
8874    // Whether the restriction is enabled or disabled.
8875    optional bool enabled = 2;
8876}
8877
8878/**
8879 * Pulls process user time and system time. Puller takes a snapshot of all pids
8880 * in the system and returns cpu stats for those that are working at the time.
8881 * Dead pids will be dropped. Kernel processes are excluded.
8882 * Min cool-down is 5 sec.
8883 */
8884message ProcessCpuTime {
8885    optional int32 uid = 1 [(is_uid) = true];
8886
8887    optional string process_name = 2;
8888    // Process cpu time in user space, cumulative from boot/process start
8889    optional int64 user_time_millis = 3;
8890    // Process cpu time in system space, cumulative from boot/process start
8891    optional int64 system_time_millis = 4;
8892}
8893
8894/**
8895 * Pulls the CPU usage for each thread.
8896 *
8897 * Read from /proc/$PID/task/$TID/time_in_state files.
8898 *
8899 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
8900 * time_in_state files not being present on some phones, have not been addressed. These should be
8901 * considered before a public release.
8902 */
8903message CpuTimePerThreadFreq {
8904    // UID that owns the process.
8905    optional int32 uid = 1 [(is_uid) = true];
8906    // ID of the process.
8907    optional int32 process_id = 2;
8908    // ID of the thread.
8909    optional int32 thread_id = 3;
8910    // Name of the process taken from `/proc/$PID/cmdline`.
8911    optional string process_name = 4;
8912    // Name of the thread taken from `/proc/$PID/task/$TID/comm`
8913    optional string thread_name = 5;
8914
8915    // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
8916    // are given in KHz, and time is given in milliseconds since the thread started. All eight
8917    // frequencies are given here as the alternative is sending eight separate atoms. This method
8918    // significantly reduces the amount of data created
8919    optional int32 frequency1_khz = 6;
8920    optional int32 time1_millis = 7;
8921    optional int32 frequency2_khz = 8;
8922    optional int32 time2_millis = 9;
8923    optional int32 frequency3_khz = 10;
8924    optional int32 time3_millis = 11;
8925    optional int32 frequency4_khz = 12;
8926    optional int32 time4_millis = 13;
8927    optional int32 frequency5_khz = 14;
8928    optional int32 time5_millis = 15;
8929    optional int32 frequency6_khz = 16;
8930    optional int32 time6_millis = 17;
8931    optional int32 frequency7_khz = 18;
8932    optional int32 time7_millis = 19;
8933    optional int32 frequency8_khz = 20;
8934    optional int32 time8_millis = 21;
8935}
8936
8937/**
8938 * Pulls information about the device's build.
8939 */
8940message BuildInformation {
8941    // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
8942    // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
8943    optional string fingerprint = 1;
8944
8945    // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
8946    optional string brand = 2;
8947
8948    // Build.PRODUCT. The name of the overall product.
8949    optional string product = 3;
8950
8951    // Build.DEVICE. The name of the industrial design.
8952    optional string device = 4;
8953
8954    // Build.VERSION.RELEASE. The user-visible version string.  E.g., "1.0" or "3.4b5" or "bananas".
8955    optional string version_release = 5;
8956
8957    // Build.ID. E.g. a label like "M4-rc20".
8958    optional string id = 6;
8959
8960    // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
8961    // represent this build.
8962    optional string version_incremental = 7;
8963
8964    // Build.TYPE. The type of build, like "user" or "eng".
8965    optional string type = 8;
8966
8967    // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
8968    optional string tags = 9;
8969}
8970
8971/**
8972 * Logs information about mismatched caller for content capture.
8973 *
8974 * Logged from:
8975 *   frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
8976 */
8977message ContentCaptureCallerMismatchReported {
8978    optional string intended_package = 1;
8979    optional string calling_package = 2;
8980}
8981
8982/**
8983 * Logs information about content capture service events.
8984 *
8985 * Logged from:
8986 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
8987 */
8988message ContentCaptureServiceEvents {
8989    // The type of event.
8990    enum Event {
8991        UNKNOWN = 0;
8992        ON_CONNECTED = 1;
8993        ON_DISCONNECTED = 2;
8994        SET_WHITELIST = 3;
8995        SET_DISABLED = 4;
8996        ON_USER_DATA_REMOVED = 5;
8997        ON_DATA_SHARE_REQUEST = 6;
8998        ACCEPT_DATA_SHARE_REQUEST = 7;
8999        REJECT_DATA_SHARE_REQUEST = 8;
9000        DATA_SHARE_WRITE_FINISHED = 9;
9001        DATA_SHARE_ERROR_IOEXCEPTION = 10;
9002        DATA_SHARE_ERROR_EMPTY_DATA = 11;
9003        DATA_SHARE_ERROR_CLIENT_PIPE_FAIL = 12;
9004        DATA_SHARE_ERROR_SERVICE_PIPE_FAIL = 13;
9005        DATA_SHARE_ERROR_CONCURRENT_REQUEST = 14;
9006        DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED = 15;
9007        ON_REMOTE_SERVICE_DIED = 16;
9008    }
9009    optional Event event = 1;
9010    // component/package of content capture service.
9011    optional string service_info = 2;
9012    // component/package of target.
9013    // it's a concatenated list of component/package for SET_WHITELIST event
9014    // separated by " ".
9015    // Deprecated: should not log app package
9016    optional string target_info = 3 [deprecated = true];
9017    // The number of packages in the allow list
9018    optional int32 set_allowlist_package_count = 4;
9019    // The number of activities in the allow list
9020    optional int32 set_allowlist_activity_count = 5;
9021}
9022
9023/**
9024 * Logs information about content capture session events.
9025 *
9026 * Logged from:
9027 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
9028 */
9029message ContentCaptureSessionEvents {
9030    // The type of event.
9031    enum Event {
9032        UNKNOWN = 0;
9033        ON_SESSION_STARTED = 1;
9034        ON_SESSION_FINISHED = 2;
9035        SESSION_NOT_CREATED = 3;
9036    }
9037    optional int32 session_id = 1;
9038    optional Event event = 2;
9039    // (n/a on session finished)
9040    optional int32 state_flags = 3;
9041    // component/package of content capture service.
9042    optional string service_info = 4;
9043    // component/package of app.
9044    // (n/a on session finished)
9045    // Deprecated: should not log app package
9046    optional string app_info = 5 [deprecated = true];
9047    optional bool is_child_session = 6;
9048}
9049
9050/**
9051 * Logs information about session being flushed.
9052 *
9053 * Logged from:
9054 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
9055 */
9056message ContentCaptureFlushed {
9057    optional int32 session_id = 1;
9058    // component/package of content capture service.
9059    optional string service_info = 2;
9060    // component/package of app.
9061    // Deprecated: should not log app package
9062    optional string app_info = 3 [deprecated = true];
9063    // session start/finish events
9064    optional int32 child_session_started = 4;
9065    optional int32 child_session_finished = 5;
9066    // count of view events.
9067    optional int32 view_appeared_count = 6;
9068    optional int32 view_disappeared_count = 7;
9069    optional int32 view_text_changed_count = 8;
9070
9071    // Flush stats.
9072    optional int32 max_events = 9;
9073    optional int32 idle_flush_freq = 10;
9074    optional int32 text_flush_freq = 11;
9075    optional int32 flush_reason = 12;
9076}
9077
9078/**
9079 * Pulls on-device BatteryStats power use calculations for the overall device.
9080 */
9081message DeviceCalculatedPowerUse {
9082    // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
9083    // BatteryStats last reset (i.e. roughly since device was last significantly charged).
9084    // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
9085    optional int64 computed_power_nano_amp_secs = 1;
9086}
9087
9088// Keep in sync with frameworks/base/core/proto/android/os/batteryusagestats.proto
9089/**
9090 * Represents a device's BatteryUsageStats, with power usage information about the device
9091 * and each app.
9092 */
9093message BatteryUsageStatsAtomsProto {
9094
9095    // The session start timestamp in UTC milliseconds since January 1, 1970, per Date#getTime().
9096    // All data is no older than this time.
9097    optional int64 session_start_millis = 1;
9098
9099    // The session end timestamp in UTC milliseconds since January 1, 1970, per Date#getTime().
9100    // All data is no more recent than this time.
9101    optional int64 session_end_millis = 2;
9102
9103    // Length that the reported data covered. This usually will be equal to the entire session,
9104    // session_end_millis - session_start_millis, but may not be if some data during this time frame
9105    // is missing.
9106    optional int64 session_duration_millis = 3;
9107
9108    // Represents usage of a consumer, storing all of its power component usage.
9109    message BatteryConsumerData {
9110        // Total power consumed by this BatteryConsumer (including all of its PowerComponents).
9111        // May not equal the sum of the PowerComponentUsage due to under- or over-estimations.
9112        // Multiply by 1/36 to obtain mAh.
9113        optional int64 total_consumed_power_deci_coulombs = 1;
9114
9115        // Represents power and time usage of a particular power component.
9116        message PowerComponentUsage {
9117            // Holds android.os.PowerComponentEnum, or custom component value between 1000 and 9999.
9118            // Evidently, if one attempts to write an int to an enum field that is out of range, it
9119            // is treated as 0, so we must make this an int32.
9120            optional int32 component = 1;
9121
9122            // Power consumed by this component. Multiply by 1/36 to obtain mAh.
9123            optional int64 power_deci_coulombs = 2;
9124
9125            optional int64 duration_millis = 3;
9126        }
9127        repeated PowerComponentUsage power_components = 2;
9128
9129        // Represents a slice of power attribution, e.g. "cpu while in the background"
9130        // or "wifi when running a background service".  Queries that care about
9131        // PowerComponentUsage slices need to be aware of all supported dimensions.
9132        // There are no roll-ups included in the slices - it is up to the clients
9133        // of this data to aggregate values as needed.
9134        message PowerComponentUsageSlice {
9135            optional PowerComponentUsage power_component = 1;
9136
9137            enum ProcessState {
9138                UNSPECIFIED = 0;
9139                FOREGROUND = 1;
9140                BACKGROUND = 2;
9141                FOREGROUND_SERVICE = 3;
9142            }
9143
9144            optional ProcessState process_state = 2;
9145        }
9146
9147        repeated PowerComponentUsageSlice slices = 3;
9148    }
9149
9150    // Total power usage for the device during this session.
9151    optional BatteryConsumerData device_battery_consumer = 4;
9152
9153    // Power usage by a uid during this session.
9154    message UidBatteryConsumer {
9155        optional int32 uid = 1 [(is_uid) = true];
9156        optional BatteryConsumerData battery_consumer_data = 2;
9157        optional int64 time_in_foreground_millis = 3;
9158        optional int64 time_in_background_millis = 4;
9159    }
9160    repeated UidBatteryConsumer uid_battery_consumers = 5;
9161
9162    // Sum of all discharge percentage point drops during the reported session.
9163    optional int32 session_discharge_percentage = 6;
9164
9165    // Total amount of time battery was discharging during the reported session
9166    optional int64 discharge_duration_millis = 7;
9167}
9168
9169/**
9170 * Pulls on-device BatteryStats on-battery power use calculations, in the form of BatteryUsageStats,
9171 * using the best data available.
9172 *
9173 * Includes the data since the last time statsd pulled this atom (i.e. since the
9174 * last-BatteryStats-reset-prior-to-last-statsd-pull) until the most recent BatteryStats reset.
9175 *
9176 * Does NOT include data after the most recent reset (use BatteryUsageStatsSinceReset too for that).
9177 *
9178 * Pulled from BatteryManager.getBatteryUsageStats().
9179 */
9180message BatteryUsageStatsBeforeReset {
9181    optional BatteryUsageStatsAtomsProto battery_usage_stats = 1 [(log_mode) = MODE_BYTES];
9182}
9183
9184/**
9185 * Pulls on-device BatteryStats on-battery power use calculations, in the form of BatteryUsageStats,
9186 * using the best data available.
9187 *
9188 * Includes all data since the most recent BatteryStats reset event, but none prior to it.
9189 *
9190 * Pulled from BatteryManager.getBatteryUsageStats().
9191 */
9192message BatteryUsageStatsSinceReset {
9193    optional BatteryUsageStatsAtomsProto battery_usage_stats = 1 [(log_mode) = MODE_BYTES];
9194}
9195
9196/**
9197 * Pulls on-device BatteryStats on-battery power use calculations, in the form of BatteryUsageStats,
9198 * using only PowerProfile Model data (even if better data is available).
9199 *
9200 * Includes all data since the most recent BatteryStats reset event, but none prior to it.
9201 *
9202 * @see android.os.BatteryUsageStatsQuery#FLAG_BATTERY_USAGE_STATS_POWER_PROFILE_MODEL
9203 * Pulled from BatteryManager.getBatteryUsageStats().
9204 */
9205message BatteryUsageStatsSinceResetUsingPowerProfileModel {
9206    optional BatteryUsageStatsAtomsProto battery_usage_stats = 1 [(log_mode) = MODE_BYTES];
9207}
9208
9209/**
9210 * Logs device policy features.
9211 *
9212 * Logged from:
9213 *   frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
9214 *   packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
9215 */
9216message DevicePolicyEvent {
9217    // The event id - unique for each event.
9218    optional android.stats.devicepolicy.EventId event_id = 1;
9219    // The admin package name.
9220    optional string admin_package_name = 2;
9221    // A generic integer parameter.
9222    optional int32 integer_value = 3;
9223    // A generic boolean parameter.
9224    optional bool boolean_value = 4;
9225    // A parameter specifying a time period in milliseconds.
9226    optional uint64 time_period_millis = 5;
9227    // A parameter specifying a list of package names, bundle extras or string parameters.
9228    optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
9229}
9230
9231/**
9232 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
9233 *
9234 * Logged from:
9235 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9236 */
9237message DocsUILaunchReported {
9238    optional android.stats.docsui.LaunchAction launch_action = 1;
9239    optional bool has_initial_uri = 2;
9240    optional android.stats.docsui.MimeType mime_type = 3;
9241    optional android.stats.docsui.Root initial_root = 4;
9242}
9243
9244/**
9245 * Logs root/app visited event in file managers/picker. Call this when the user
9246 * taps on root/app in hamburger menu.
9247 *
9248 * Logged from:
9249 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9250 */
9251message DocsUIRootVisitedReported {
9252    optional android.stats.docsui.ContextScope scope = 1;
9253    optional android.stats.docsui.Root root = 2;
9254}
9255
9256/**
9257 * Logs file operation stats. Call this when a file operation has completed.
9258 *
9259 * Logged from:
9260 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9261 */
9262message DocsUIFileOperationReported {
9263    optional android.stats.docsui.Provider provider = 1;
9264    optional android.stats.docsui.FileOperation file_op = 2;
9265}
9266
9267/**
9268 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
9269 * mode.
9270 *
9271 * Logged from:
9272 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9273 */
9274message DocsUIFileOperationCopyMoveModeReported {
9275    optional android.stats.docsui.FileOperation file_op = 1;
9276    optional android.stats.docsui.CopyMoveOpMode mode = 2;
9277}
9278
9279
9280/**
9281 * Logs file sub operation stats. Call this when a file operation has failed.
9282 *
9283 * Logged from:
9284 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9285 */
9286message DocsUIFileOperationFailureReported {
9287    optional android.stats.docsui.Authority authority = 1;
9288    optional android.stats.docsui.SubFileOperation sub_op = 2;
9289}
9290
9291/**
9292* Logs the cancellation of a file operation. Call this when a job is canceled
9293*
9294* Logged from:
9295*     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9296*/
9297message DocsUIFileOperationCanceledReported {
9298    optional android.stats.docsui.FileOperation file_op = 1;
9299}
9300
9301/**
9302 * Logs startup time in milliseconds.
9303 *
9304 * Logged from:
9305 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9306 */
9307message DocsUIStartupMsReported {
9308    optional int32 startup_millis = 1;
9309}
9310
9311/**
9312 * Logs the action that was started by user.
9313 *
9314 * Logged from:
9315 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9316 */
9317message DocsUIUserActionReported {
9318    optional android.stats.docsui.UserAction action = 1;
9319}
9320
9321/**
9322 * Logs the invalid type when invalid scoped access is requested.
9323 *
9324 * Logged from:
9325 *     package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
9326 */
9327message DocsUIInvalidScopedAccessRequestReported {
9328    optional android.stats.docsui.InvalidScopedAccess type = 1;
9329}
9330
9331/**
9332 * Logs the package name that launches docsui picker mode.
9333 *
9334 * Logged from:
9335 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9336 */
9337message DocsUIPickerLaunchedFromReported {
9338    optional string package_name = 1;
9339}
9340
9341/**
9342 * Logs the search type.
9343 *
9344 * Logged from:
9345 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9346 */
9347message DocsUISearchTypeReported {
9348    optional android.stats.docsui.SearchType search_type = 1;
9349}
9350
9351/**
9352 * Logs the search mode.
9353 *
9354 * Logged from:
9355 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9356 */
9357message DocsUISearchModeReported {
9358    optional android.stats.docsui.SearchMode search_mode = 1;
9359}
9360
9361/**
9362 * Logs the pick result information.
9363 *
9364 * Logged from:
9365 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9366 */
9367message DocsUIPickResultReported {
9368    optional int32 total_action_count = 1;
9369    optional int64 duration_millis = 2;
9370    optional int32 file_count= 3;
9371    optional bool is_searching = 4;
9372    optional android.stats.docsui.Root picked_from = 5;
9373    optional android.stats.docsui.MimeType mime_type = 6;
9374    optional int32 repeatedly_pick_times = 7;
9375}
9376
9377/** Logs the drag and drop of files.
9378
9379 * Logged from:
9380 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
9381 */
9382message DocsUIDragAndDropReported {
9383    optional bool drag_initiated_from_docsui = 1;
9384}
9385
9386/**
9387 * Logs when an app's memory is compacted.
9388 *
9389 * Logged from:
9390 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9391 */
9392message AppCompacted {
9393  // The pid of the process being compacted.
9394  optional int32 pid = 1;
9395
9396  // The name of the process being compacted.
9397  optional string process_name = 2;
9398
9399  // The type of compaction.
9400  enum Action {
9401    UNKNOWN = 0;
9402    SOME = 1;
9403    FULL = 2;
9404    PERSISTENT = 3;
9405    BFGS = 4;
9406  }
9407  optional Action action = 3;
9408
9409  // Total RSS in kilobytes consumed by the process prior to compaction.
9410  optional int64 before_rss_total_kilobytes = 4;
9411
9412  // File RSS in kilobytes consumed by the process prior to compaction.
9413  optional int64 before_rss_file_kilobytes = 5;
9414
9415  // Anonymous RSS in kilobytes consumed by the process prior to compaction.
9416  optional int64 before_rss_anon_kilobytes = 6;
9417
9418  // Swap in kilobytes consumed by the process prior to compaction.
9419  optional int64 before_swap_kilobytes = 7;
9420
9421  // Total RSS in kilobytes consumed by the process after compaction.
9422  optional int64 after_rss_total_kilobytes = 8;
9423
9424  // File RSS in kilobytes consumed by the process after compaction.
9425  optional int64 after_rss_file_kilobytes = 9;
9426
9427  // Anonymous RSS in kilobytes consumed by the process after compaction.
9428  optional int64 after_rss_anon_kilobytes = 10;
9429
9430  // Swap in kilobytes consumed by the process after compaction.
9431  optional int64 after_swap_kilobytes = 11;
9432
9433  // The time taken to perform compaction in milliseconds.
9434  optional int64 time_to_compact_millis = 12;
9435
9436  // The last compaction action performed for this app.
9437  optional Action last_action = 13;
9438
9439  // The last time that compaction was attempted on this process in milliseconds
9440  // since boot, not including sleep (see SystemClock.uptimeMillis()).
9441  optional int64 last_compact_timestamp_ms_since_boot = 14;
9442
9443  // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
9444  optional int32 oom_score_adj = 15;
9445
9446  // The process state at the time of compaction.
9447  optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
9448
9449  // Free ZRAM in kilobytes before compaction.
9450  optional int64 before_zram_free_kilobytes = 17;
9451
9452  // Free ZRAM in kilobytes after compaction.
9453  optional int64 after_zram_free_kilobytes = 18;
9454}
9455
9456/**
9457 * Logs when a Tethering event occurs.
9458 *
9459 */
9460message NetworkTetheringReported {
9461  // tethering error code
9462  optional android.stats.connectivity.ErrorCode error_code = 1;
9463
9464  // tethering downstream type
9465  optional android.stats.connectivity.DownstreamType downstream_type = 2;
9466
9467  // transport type of upstream network
9468  optional android.stats.connectivity.UpstreamType upstream_type = 3;
9469
9470  // The user type of Tethering
9471  optional android.stats.connectivity.UserType user_type= 4;
9472}
9473
9474/**
9475 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
9476 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
9477 *
9478 * The NetworkDnsEventReported message represents the entire lookup operation, which may
9479 * result one or more queries to the recursive DNS resolvers. Those are individually logged
9480 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
9481 * broken up by query type, transport, network interface, etc.
9482 */
9483message NetworkDnsEventReported {
9484    optional android.stats.dnsresolver.EventType event_type = 1;
9485
9486    optional android.stats.dnsresolver.ReturnCode return_code = 2;
9487
9488    // The latency in microseconds of the entire DNS lookup operation.
9489    optional int32 latency_micros = 3;
9490
9491    // Only valid for event_type = EVENT_GETADDRINFO.
9492    optional int32 hints_ai_flags = 4;
9493
9494    // Flags passed to android_res_nsend() defined in multinetwork.h
9495    // Only valid for event_type = EVENT_RESNSEND.
9496    optional int32 res_nsend_flags = 5;
9497
9498    optional android.stats.dnsresolver.NetworkType network_type = 6;
9499
9500    // The DNS over TLS mode on a specific netId.
9501    optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
9502
9503    // Additional pass-through fields opaque to statsd.
9504    // The DNS resolver Mainline module can add new fields here without requiring an OS update.
9505    optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
9506
9507    // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
9508    optional int32 sampling_rate_denom = 9;
9509}
9510
9511/**
9512 * The NetworkDnsHandshakeReported message describes a DoT or DoH handshake operation along with
9513 * its result, cause, network latency, TLS version, etc.
9514 *
9515 */
9516message NetworkDnsHandshakeReported {
9517  optional android.stats.dnsresolver.Protocol protocol = 1;
9518
9519  optional android.stats.dnsresolver.HandshakeResult result = 2;
9520
9521  optional android.stats.dnsresolver.HandshakeCause cause = 3;
9522
9523  optional android.stats.dnsresolver.NetworkType network_type = 4;
9524
9525  optional android.stats.dnsresolver.PrivateDnsModes private_dns_mode = 5;
9526
9527  // The latency in microseconds of the entire handshake operation.
9528  optional int32 latency_micros = 6;
9529
9530  // Sent packets in bytes.
9531  optional int32 bytes_sent = 7;
9532
9533  // Received packets in bytes.
9534  optional int32 bytes_received = 8;
9535
9536  // Number of round-trips.
9537  optional int32 round_trips = 9;
9538
9539  // True if TLS session cache hit.
9540  optional bool tls_session_cache_hit = 10;
9541
9542  // 2 = TLS 1.2, 3 = TLS 1.3
9543  optional int32 tls_version = 11;
9544
9545  // True if the handshake requires verifying the private DNS provider hostname.
9546  optional bool hostname_verification = 12;
9547
9548  // Only present when protocol = PROTO_DOH.
9549  optional int32 quic_version = 13;
9550
9551  optional int32 server_index = 14;
9552
9553  // The sampling-rate of this event is 1/sampling_rate_denom.
9554  optional int32 sampling_rate_denom = 15;
9555}
9556
9557/**
9558 * logs the CapportApiData info
9559 * Logged from:
9560 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
9561 */
9562message CapportApiData {
9563    // The TTL of the network connection provided by captive portal
9564    optional int32 remaining_ttl_secs = 1;
9565
9566    // The limit traffic data of the network connection provided by captive portal
9567    optional int32 remaining_bytes = 2;
9568
9569    // Is portal url option included in the DHCP packet (Yes, No)
9570    optional bool has_portal_url = 3;
9571
9572    // Is venue info (e.g. store info, maps, flight status) included (Yes, No)
9573    optional bool has_venue_info = 4;
9574}
9575
9576/**
9577 * logs a network Probe Event
9578 * Logged from:
9579 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
9580 */
9581message ProbeEvent {
9582    // The probe type (http or https, or captive portal API...)
9583    optional android.stats.connectivity.ProbeType probe_type = 1;
9584
9585    // The latency in microseconds of the probe event
9586    optional int32 latency_micros = 2;
9587
9588    // The result of the probe event
9589    optional android.stats.connectivity.ProbeResult probe_result = 3;
9590
9591    // The CaptivePortal API info
9592    optional CapportApiData capport_api_data = 4;
9593}
9594
9595/**
9596 * log each ProbeEvent in ProbeEvents
9597 * Logged from:
9598 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
9599 */
9600message ProbeEvents {
9601    // Record probe event during the validation
9602    repeated ProbeEvent probe_event = 1;
9603}
9604
9605/**
9606 * The DHCP (Dynamic Host Configuration Protocol) session info
9607 * Logged from:
9608 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
9609 */
9610message DhcpSession {
9611    // The DHCP Feature(s) enabled in this session
9612    repeated android.stats.connectivity.DhcpFeature used_features = 1;
9613
9614    // The discover packet (re)transmit count
9615    optional int32 discover_count = 2;
9616
9617    // The request packet (re)transmit count
9618    optional int32 request_count = 3;
9619
9620    // The IPv4 address conflict count
9621    // (only be meaningful when duplicate address detection is enabled)
9622    optional int32 conflict_count = 4;
9623
9624    // The DHCP packet parsing error code in this session
9625    // (defined in android.net.metrics.DhcpErrorEvent)
9626    repeated android.stats.connectivity.DhcpErrorCode error_code = 5;
9627
9628    // The result of DHCP hostname transliteration
9629    optional android.stats.connectivity.HostnameTransResult ht_result = 6;
9630}
9631
9632/**
9633 * Logs Network IP provisioning event
9634 * Logged from:
9635 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpProvisioningMetrics.java
9636 */
9637message NetworkIpProvisioningReported {
9638    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
9639    optional android.stats.connectivity.TransportType transport_type = 1;
9640
9641    // The latency in microseconds of IP Provisioning over IPV4
9642    optional int32 ipv4_latency_micros = 2;
9643
9644    // The latency in microseconds of IP Provisioning over IPV6
9645    optional int32 ipv6_latency_micros = 3;
9646
9647    // The time duration between provisioning start and end (success or failure)
9648    optional int64 provisioning_duration_micros = 4;
9649
9650    // The specific disconnect reason for this IP provisioning
9651    optional android.stats.connectivity.DisconnectCode disconnect_code = 5;
9652
9653    // Log DHCP session info (Only valid for IPv4)
9654    optional DhcpSession dhcp_session = 6 [(log_mode) = MODE_BYTES];
9655
9656    // The random number between 0 ~ 999 for sampling
9657    optional int32 random_number = 7;
9658}
9659
9660/**
9661 * Logs Network DHCP Renew event
9662 * Logged from:
9663 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
9664 */
9665message NetworkDhcpRenewReported {
9666    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
9667    optional android.stats.connectivity.TransportType transport_type = 1;
9668
9669    // The request packet (re)transmit count
9670    optional int32 request_count = 2;
9671
9672    // The latency in microseconds of DHCP Renew
9673    optional int32 latency_micros = 3;
9674
9675    // The DHCP error code is defined in android.net.metrics.DhcpErrorEvent
9676    optional android.stats.connectivity.DhcpErrorCode error_code = 4;
9677
9678    // The result of DHCP renew
9679    optional android.stats.connectivity.DhcpRenewResult renew_result = 5;
9680
9681    // The random number between 0 ~ 999 for sampling
9682    optional int32 random_number = 6;
9683}
9684
9685/**
9686 * Logs Network Validation event
9687 * Logged from:
9688 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
9689 */
9690message NetworkValidationReported {
9691    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
9692    optional android.stats.connectivity.TransportType transport_type = 1;
9693
9694    // Record each probe event
9695    optional ProbeEvents probe_events = 2 [(log_mode) = MODE_BYTES];
9696
9697    // The result of the network validation
9698    optional android.stats.connectivity.ValidationResult validation_result = 3;
9699
9700    // The latency in microseconds of network validation
9701    optional int32 latency_micros = 4;
9702
9703    // The validation index (the first validation attempt or second, third...)
9704    optional int32 validation_index = 5;
9705
9706    // The random number between 0 ~ 999 for sampling
9707    optional int32 random_number = 6;
9708}
9709
9710/**
9711 * Logs NetworkStack Quirk event
9712 * Logged from:
9713 * packages/modules/NetworkStack/src/com/android/networkstack/
9714 */
9715message NetworkStackQuirkReported {
9716    // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
9717    optional android.stats.connectivity.TransportType transport_type = 1;
9718
9719    // Record each Quirk event
9720    optional android.stats.connectivity.NetworkQuirkEvent event = 2;
9721}
9722
9723/**
9724 * Logs Neighbor Unreachability Detection event
9725 * Logged from:
9726 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpReachabilityMonitorMetrics.java
9727 */
9728message NetworkIpReachabilityMonitorReported {
9729    // Neighbor Unreachability Detection event.
9730    optional android.stats.connectivity.NudEventType event_type = 1;
9731
9732    // NUD probe based on IPv4 ARP or IPv6 ND packet.
9733    optional android.stats.connectivity.IpType ip_type = 2;
9734
9735    // NUD neighbor type, default gateway, DNS server or both.
9736    optional android.stats.connectivity.NudNeighborType neighbor_type = 3;
9737}
9738
9739/**
9740 * Logs when a data stall event occurs.
9741 *
9742 * Log from:
9743 *     packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
9744 */
9745message DataStallEvent {
9746    // Data stall evaluation type.
9747    // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
9748    // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
9749    optional int32 evaluation_type = 1;
9750    // See definition in data_stall_event.proto.
9751    optional com.android.server.connectivity.ProbeResult validation_result = 2;
9752    // See definition in data_stall_event.proto.
9753    optional android.net.Transport network_type = 3;
9754    // See definition in data_stall_event.proto.
9755    optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
9756    // See definition in data_stall_event.proto.
9757    optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
9758    // See definition in data_stall_event.proto.
9759    optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
9760    // The tcp packets fail rate from the latest tcp polling.
9761    optional int32 tcp_fail_rate = 7;
9762    // Number of packets sent since the last received packet.
9763    optional int32 tcp_sent_since_last_recv = 8;
9764}
9765
9766/*
9767 * Logs when RescueParty resets some set of experiment flags.
9768 *
9769 * Logged from:
9770 *     frameworks/base/services/core/java/com/android/server/RescueParty.java
9771 */
9772message RescuePartyResetReported {
9773    // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
9774    optional int32 rescue_level = 1;
9775}
9776
9777/**
9778 * Logs when signed config is received from an APK, and if that config was applied successfully.
9779 * Logged from:
9780 *   frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
9781 */
9782message SignedConfigReported {
9783    enum Type {
9784        UNKNOWN_TYPE = 0;
9785        GLOBAL_SETTINGS = 1;
9786    }
9787    optional Type type = 1;
9788
9789    // The final status of the signed config received.
9790    enum Status {
9791        UNKNOWN_STATUS = 0;
9792        APPLIED = 1;
9793        BASE64_FAILURE_CONFIG = 2;
9794        BASE64_FAILURE_SIGNATURE = 3;
9795        SECURITY_EXCEPTION = 4;
9796        INVALID_CONFIG = 5;
9797        OLD_CONFIG = 6;
9798        SIGNATURE_CHECK_FAILED = 7;
9799        NOT_APPLICABLE = 8;
9800        SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
9801    }
9802    optional Status status = 2;
9803
9804    // The version of the signed config processed.
9805    optional int32 version = 3;
9806
9807    // The package name that the config was extracted from.
9808    optional string from_package = 4;
9809
9810    enum Key {
9811        NO_KEY = 0;
9812        DEBUG = 1;
9813        PRODUCTION = 2;
9814    }
9815    // Which key was used to verify the config.
9816    optional Key verified_with = 5;
9817}
9818
9819/*
9820 * Logs GNSS Network-Initiated (NI) location events.
9821 *
9822 * Logged from:
9823 *   frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
9824 */
9825message GnssNiEventReported {
9826    // The type of GnssNiEvent.
9827    enum EventType {
9828        UNKNOWN = 0;
9829        NI_REQUEST = 1;
9830        NI_RESPONSE = 2;
9831    }
9832    optional EventType event_type = 1;
9833
9834    // An ID generated by HAL to associate NI notifications and UI responses.
9835    optional int32 notification_id = 2;
9836
9837    // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
9838    optional android.server.location.GnssNiType ni_type = 3;
9839
9840    // NI requires notification.
9841    optional bool need_notify = 4;
9842
9843    // NI requires verification.
9844    optional bool need_verify = 5;
9845
9846    // NI requires privacy override, no notification/minimal trace.
9847    optional bool privacy_override = 6;
9848
9849    // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
9850    // seconds.
9851    optional int32 timeout = 7;
9852
9853    // Default response when timeout.
9854    optional android.server.location.GnssUserResponseType default_response = 8;
9855
9856    // String representing the requester of the network inititated location request.
9857    optional string requestor_id = 9;
9858
9859    // Notification message text string representing the service(for eg. SUPL-service) who sent the
9860    // network initiated location request.
9861    optional string text = 10;
9862
9863    // requestorId decoding scheme.
9864    optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
9865
9866    // Notification message text decoding scheme.
9867    optional android.server.location.GnssNiEncodingType text_encoding = 12;
9868
9869    // True if SUPL ES is enabled.
9870    optional bool is_supl_es_enabled = 13;
9871
9872    // True if GNSS location is enabled.
9873    optional bool is_location_enabled = 14;
9874
9875    // GNSS NI responses which define the response in NI structures.
9876    optional android.server.location.GnssUserResponseType user_response = 15;
9877}
9878
9879/**
9880 * Logs GNSS non-framework (NFW) location notification.
9881 *
9882 * Logged from:
9883 *   frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
9884 */
9885message GnssNfwNotificationReported {
9886    // Package name of the Android proxy application representing the non-framework entity that
9887    // requested location. Set to empty string if unknown.
9888    optional string proxy_app_package_name = 1;
9889
9890    // Protocol stack that initiated the non-framework location request.
9891    optional android.server.location.NfwProtocolStack protocol_stack = 2;
9892
9893    // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
9894    // set to empty string. This field is opaque to the framework and used for logging purposes.
9895    optional string other_protocol_stack_name = 3;
9896
9897    // Source initiating/receiving the location information.
9898    optional android.server.location.NfwRequestor requestor = 4;
9899
9900    // Identity of the endpoint receiving the location information. For example, carrier name, OEM
9901    // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
9902    // and used for logging purposes.
9903    optional string requestor_id = 5;
9904
9905    // Indicates whether location information was provided for this request.
9906    optional android.server.location.NfwResponseType response_type = 6;
9907
9908    // True if the device is in user initiated emergency session.
9909    optional bool in_emergency_mode = 7;
9910
9911    // True if cached location is provided.
9912    optional bool is_cached_location = 8;
9913
9914    // True if proxy app permission mismatch between framework and GNSS HAL.
9915    optional bool is_permission_mismatched = 9;
9916}
9917
9918/**
9919 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
9920 *
9921 * Logged from:
9922 *   frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
9923 */
9924message GnssConfigurationReported {
9925    // SUPL host name.
9926    optional string supl_host = 1;
9927
9928    // SUPL port number.
9929    optional int32 supl_port = 2;
9930
9931    // C2K host name.
9932    optional string c2k_host = 3;
9933
9934    // C2K port number.
9935    optional int32 c2k_port = 4;
9936
9937    // The SUPL version requested by Carrier.
9938    optional int32 supl_ver = 5;
9939
9940    // The SUPL mode.
9941    optional android.server.location.SuplMode supl_mode = 6;
9942
9943    // True if NI emergency SUPL restrictions is enabled.
9944    optional bool supl_es = 7;
9945
9946    // LTE Positioning Profile settings
9947    optional android.server.location.LppProfile lpp_profile = 8;
9948
9949    // Positioning protocol on A-Glonass system.
9950    optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
9951
9952    // True if emergency PDN is used. Otherwise, regular PDN is used.
9953    optional bool use_emergency_pdn_for_emergency_supl= 10;
9954
9955    // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
9956    optional android.server.location.GpsLock gps_lock = 11;
9957
9958    // Number of seconds to extend the emergency session duration post emergency call.
9959    optional int32 es_extension_sec = 12;
9960
9961    // The full list of package names of proxy Android applications representing the non-framework
9962    // location access entities (on/off the device) for which the framework user has granted
9963    // non-framework location access permission. The package names are concatenated in one string
9964    // with spaces as separators.
9965    optional string enabled_proxy_app_package_name_list = 13;
9966}
9967
9968/**
9969 * Logs GNSS PSDS downloads as defined in IGnssPsds.aidl.
9970 *
9971 * Logged from:
9972 *   frameworks/base/services/core/java/com/android/server/location/gnss/GnssPsdsDownloader.java
9973 */
9974message GnssPsdsDownloadReported {
9975    // PSDS type as defined in PsdsType.aidl
9976    optional int32 psds_type = 1;
9977}
9978
9979/**
9980 * Logs when a NFC device's error occurred.
9981 * Logged from:
9982 *     system/nfc/src/nfc/nfc/nfc_ncif.cc
9983 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
9984 */
9985message NfcErrorOccurred {
9986    enum Type {
9987        UNKNOWN = 0;
9988        CMD_TIMEOUT = 1;
9989        ERROR_NOTIFICATION = 2;
9990        AID_OVERFLOW = 3;
9991    }
9992    optional Type type = 1;
9993    // If it's nci cmd timeout, log the timeout command.
9994    optional uint32 nci_cmd = 2;
9995
9996    optional uint32 error_ntf_status_code = 3;
9997}
9998
9999/**
10000 * Logs when a NFC device's state changed event
10001 * Logged from:
10002 *     packages/apps/Nfc/src/com/android/nfc/NfcService.java
10003 */
10004message NfcStateChanged {
10005    enum State {
10006        UNKNOWN = 0;
10007        OFF = 1;
10008        ON = 2;
10009        ON_LOCKED = 3; // Secure Nfc enabled.
10010        CRASH_RESTART = 4; // NfcService watchdog timeout restart.
10011    }
10012    optional State state = 1 [
10013        (state_field_option).exclusive_state = true,
10014        (state_field_option).nested = false
10015    ];
10016}
10017
10018/**
10019 * Logs when a NFC Beam Transaction occurred.
10020 * Logged from:
10021 *     packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
10022 */
10023message NfcBeamOccurred {
10024    enum Operation {
10025        UNKNOWN = 0;
10026        SEND = 1;
10027        RECEIVE = 2;
10028    }
10029    optional Operation operation = 1;
10030}
10031
10032/**
10033 * Logs when a NFC Card Emulation Transaction occurred.
10034 * Logged from:
10035 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
10036 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
10037 */
10038message NfcCardemulationOccurred {
10039    enum Category {
10040        UNKNOWN = 0;
10041        HCE_PAYMENT = 1;
10042        HCE_OTHER = 2;
10043        OFFHOST = 3;
10044    }
10045    // Transaction belongs to HCE payment or HCE other category, or offhost.
10046    optional Category category = 1;
10047    // SeName from transaction: SIMx, eSEx, HCE, HCEF.
10048    optional string se_name = 2;
10049}
10050
10051/**
10052 * Logs when a NFC Tag event occurred.
10053 * Logged from:
10054 *     packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
10055 */
10056message NfcTagOccurred {
10057    enum Type {
10058        UNKNOWN = 0;
10059        URL = 1;
10060        BT_PAIRING = 2;
10061        PROVISION = 3;
10062        WIFI_CONNECT = 4;
10063        APP_LAUNCH = 5;
10064        OTHERS = 6;
10065    }
10066    optional Type type = 1;
10067}
10068
10069/**
10070 * Logs when Hce transaction triggered
10071 * Logged from:
10072 *     system/nfc/src/nfc/nfc/nfc_ncif.cc
10073 */
10074message NfcHceTransactionOccurred {
10075    // The latency period(in microseconds) it took for the first HCE data
10076    // exchange.
10077    optional uint32 latency_micros = 1;
10078}
10079
10080/**
10081 * Logs when SecureElement state event changed
10082 * Logged from:
10083 *     packages/apps/SecureElement/src/com/android/se/Terminal.java
10084 */
10085message SeStateChanged {
10086    enum State {
10087        UNKNOWN = 0;
10088        INITIALIZED = 1;
10089        DISCONNECTED = 2;
10090        CONNECTED = 3;
10091        HALCRASH = 4;
10092    }
10093    optional State state = 1;
10094
10095    optional string state_change_reason = 2;
10096    // SIMx or eSEx.
10097    optional string terminal = 3;
10098}
10099
10100/**
10101 * Information about a permission grant request
10102 */
10103message PermissionGrantRequestResultReported {
10104    // unique value identifying an API call. A API call might result in multiple of these atoms
10105    optional int64 request_id = 1;
10106
10107    // UID of package requesting the permission grant
10108    optional int32 uid = 2 [(is_uid) = true];
10109
10110    // Name of package requesting the permission grant
10111    optional string package_name = 3;
10112
10113    // The permission to be granted
10114    optional string permission_name = 4;
10115
10116    // If the permission was explicitly requested via the API or added by the system
10117    optional bool is_implicit = 5;
10118
10119    enum Result {
10120        UNDEFINED = 0;
10121        // permission request was ignored
10122        IGNORED = 1;
10123        // permission request was ignored because it was user fixed
10124        IGNORED_USER_FIXED = 2;
10125        // permission request was ignored because it was policy fixed
10126        IGNORED_POLICY_FIXED = 3;
10127        // permission was granted by user action
10128        USER_GRANTED = 4;
10129        // permission was automatically granted
10130        AUTO_GRANTED = 5;
10131        // permission was denied by user action
10132        USER_DENIED = 6;
10133        // permission was denied with prejudice by the user
10134        USER_DENIED_WITH_PREJUDICE = 7;
10135        // permission was automatically denied
10136        AUTO_DENIED = 8;
10137        // permission request was ignored because permission is restricted
10138        IGNORED_RESTRICTED_PERMISSION = 9;
10139        // one time permission was granted by user action
10140        USER_GRANTED_ONE_TIME = 10;
10141        // user ignored request by leaving the request screen without choosing any option
10142        USER_IGNORED = 11;
10143        // user granted the permission after being linked to settings
10144        USER_GRANTED_IN_SETTINGS = 12;
10145        // user denied the permission after being linked to settings
10146        USER_DENIED_IN_SETTINGS = 13;
10147        // user denied the permission with prejudice after being linked to settings
10148        USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
10149        // permission was automatically revoked after one-time permission expired
10150        AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
10151        // permission was automatically revoked for unused app
10152        AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
10153    }
10154    // The result of the permission grant
10155    optional Result result = 6;
10156}
10157
10158/**
10159 * Logs when Omapi API used
10160 * Logged from:
10161 *     packages/apps/SecureElement/src/com/android/se/Terminal.java
10162 */
10163message SeOmapiReported {
10164    enum Operation {
10165        UNKNOWN = 0;
10166        OPEN_CHANNEL = 1;
10167    }
10168    optional Operation operation = 1;
10169    // SIMx or eSEx.
10170    optional string terminal = 2;
10171
10172    optional string package_name = 3;
10173}
10174
10175/**
10176  * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
10177  * The dispatch latency is the dispatchClockTime - enqueueClockTime.
10178  * Logged from:
10179  *   frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
10180  */
10181message BroadcastDispatchLatencyReported {
10182    optional int64 dispatch_latency_millis = 1;
10183}
10184
10185/**
10186   * Logs AttentionManagerService attention check result.
10187   *
10188   * Logged from:
10189   *   frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
10190   */
10191message AttentionManagerServiceResultReported {
10192    // See core/java/android/service/attention/AttentionService.java
10193    enum AttentionCheckResult {
10194        UNKNOWN = 20;
10195        ATTENTION_SUCCESS_ABSENT = 0;
10196        ATTENTION_SUCCESS_PRESENT = 1;
10197        ATTENTION_FAILURE_UNKNOWN = 2;
10198        ATTENTION_FAILURE_CANCELLED = 3;
10199        ATTENTION_FAILURE_PREEMPTED = 4;
10200        ATTENTION_FAILURE_TIMED_OUT = 5;
10201        ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
10202    }
10203    optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
10204}
10205
10206/**
10207 * Logs when an adb connection changes state.
10208 *
10209 * Logged from:
10210 *     frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
10211 */
10212message AdbConnectionChanged {
10213    // The last time this system connected via adb, or 0 if the 'always allow' option was not
10214    // previously selected for this system.
10215    optional int64 last_connection_time_millis = 1;
10216
10217    // The time in ms within which a subsequent connection from an 'always allow' system is allowed
10218    // to reconnect via adb without user interaction.
10219    optional int64 auth_window_millis = 2;
10220
10221    // The state of the adb connection from frameworks/proto_logging/stats/enums/debug/enums.proto.
10222    optional android.debug.AdbConnectionStateEnum state = 3;
10223
10224    // True if the 'always allow' option was selected for this system.
10225    optional bool always_allow = 4;
10226}
10227
10228/*
10229 * Logs the reported speech DSP status.
10230 *
10231 * Logged from:
10232 *  Vendor audio implementation.
10233 */
10234message SpeechDspStatReported {
10235    // The total Speech DSP uptime in milliseconds.
10236    optional int32 total_uptime_millis = 1;
10237    // The total Speech DSP downtime in milliseconds.
10238    optional int32 total_downtime_millis = 2;
10239    optional int32 total_crash_count = 3;
10240    optional int32 total_recover_count = 4;
10241}
10242
10243/**
10244 * Logs USB connector contaminant status.
10245 *
10246 * Logged from: USB Service.
10247 */
10248message UsbContaminantReported {
10249    optional string id = 1;
10250    optional android.service.ContaminantPresenceStatus status = 2;
10251}
10252
10253/**
10254 * This atom is for debugging purpose.
10255 */
10256message DebugElapsedClock {
10257    // Monotically increasing value for each pull.
10258    optional int64 pull_count = 1;
10259    // Time from System.elapsedRealtime.
10260    optional int64 elapsed_clock_millis = 2;
10261    // Time from System.elapsedRealtime.
10262    optional int64 same_elapsed_clock_millis = 3;
10263    // Diff between current elapsed time and elapsed time from previous pull.
10264    optional int64 elapsed_clock_diff_millis = 4;
10265
10266    enum Type {
10267      TYPE_UNKNOWN = 0;
10268      ALWAYS_PRESENT = 1;
10269      PRESENT_ON_ODD_PULLS = 2;
10270    }
10271    // Type of behavior for the pulled data.
10272    optional Type type = 5;
10273}
10274
10275/**
10276 * This atom is for debugging purpose.
10277 */
10278message DebugFailingElapsedClock {
10279    // Monotically increasing value for each pull.
10280    optional int64 pull_count = 1;
10281    // Time from System.elapsedRealtime.
10282    optional int64 elapsed_clock_millis = 2;
10283    // Time from System.elapsedRealtime.
10284    optional int64 same_elapsed_clock_millis = 3;
10285    // Diff between current elapsed time and elapsed time from previous pull.
10286    optional int64 elapsed_clock_diff_millis = 4;
10287}
10288
10289/** Logs System UI bubbles event changed.
10290 *
10291 * Logged from:
10292 *     frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen
10293 */
10294message SplitscreenUIChanged {
10295    // User interactions with splitscreen
10296    enum Action {
10297        UNKNOWN_ACTION = 0;
10298        ENTER = 1;
10299        EXIT = 2;
10300        APP_CHANGE = 3;
10301        RESIZE = 4;
10302        SWAP = 5;
10303    }
10304
10305    // The physical side on the device of the split
10306    enum Position {
10307        UNKNOWN_POSITION = 0;
10308        LEFT = 1;
10309        RIGHT = 2;
10310        TOP = 3;
10311        BOTTOM = 4;
10312    }
10313
10314    // The reason for entering splitscreen
10315    enum EnterReason {
10316        UNKNOWN_ENTER = 0;
10317        OVERVIEW = 1; // Deprecated, use LAUNCHER
10318        DRAG_LEFT = 2;
10319        DRAG_TOP = 3;
10320        DRAG_RIGHT = 4;
10321        DRAG_BOTTOM = 5;
10322        LAUNCHER = 6;
10323        MULTI_INSTANCE = 7;
10324        NOTIFICATIONS = 8;
10325    }
10326
10327    // The reason for exiting splitscreen
10328    enum ExitReason {
10329        UNKNOWN_EXIT = 0;
10330        DRAG_DIVIDER = 1;
10331        RETURN_HOME = 2;
10332        SCREEN_LOCKED = 3;
10333        SCREEN_LOCKED_SHOW_ON_TOP = 4;
10334        DEVICE_FOLDED = 5;
10335        ROOT_TASK_VANISHED = 6;
10336        APP_FINISHED = 7;
10337        APP_DOES_NOT_SUPPORT_MULTIWINDOW = 8;
10338        CHILD_TASK_ENTER_PIP = 9;
10339        RECREATE_SPLIT = 10;
10340        FULLSCREEN_SHORTCUT = 11;
10341    }
10342
10343    // The event action
10344    optional Action action = 1;
10345    // What triggered splitscreen (if the action is ENTER)
10346    optional EnterReason enter_reason = 2;
10347    // What triggered leaving splitscreen (if the action is EXIT)
10348    optional ExitReason exit_reason = 3;
10349    // The ratio of split between the main/side stages
10350    optional float split_ratio = 4;
10351    // Data about the main stage in split
10352    optional Position main_stage_position = 5;
10353    optional int32 main_stage_uid = 6 [(is_uid) = true];
10354    // Data about the side stage in split
10355    optional Position side_stage_position = 7;
10356    optional int32 side_stage_uid = 8 [(is_uid) = true];
10357    // The drag session id (if the enter_trigger was DRAG)
10358    optional int32 drag_instance_id = 9;
10359    // An identifier used to identify a splitscreen session
10360    optional int32 instance_id = 10;
10361}
10362
10363/** Logs System UI bubbles event changed.
10364 *
10365 * Logged from:
10366 *     frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles
10367 */
10368message BubbleUIChanged {
10369
10370    // The app package that is posting the bubble.
10371    optional string package_name = 1;
10372
10373    // The notification channel that is posting the bubble.
10374    optional string notification_channel = 2;
10375
10376    // The notification id associated with the posted bubble.
10377    optional int32 notification_id = 3;
10378
10379    // The position of the bubble within the bubble stack.
10380    optional int32 position = 4;
10381
10382    // The total number of bubbles within the bubble stack.
10383    optional int32 total_number = 5;
10384
10385    // User interactions with the bubble.
10386    enum Action {
10387        UNKNOWN = 0;
10388        POSTED = 1;
10389        UPDATED = 2;
10390        EXPANDED = 3;
10391        COLLAPSED = 4;
10392        DISMISSED = 5;
10393        STACK_DISMISSED = 6;
10394        STACK_MOVED = 7;
10395        HEADER_GO_TO_APP = 8;
10396        HEADER_GO_TO_SETTINGS = 9;
10397        PERMISSION_OPT_IN = 10;
10398        PERMISSION_OPT_OUT = 11;
10399        PERMISSION_DIALOG_SHOWN = 12;
10400        SWIPE_LEFT = 13;
10401        SWIPE_RIGHT = 14;
10402        STACK_EXPANDED = 15;
10403        FLYOUT = 16;
10404    }
10405    optional Action action = 6;
10406
10407    // Normalized screen position of the bubble stack. The range is between 0 and 1.
10408    optional float normalized_x_position = 7;
10409    optional float normalized_y_position = 8;
10410
10411    // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
10412    optional bool is_unread = 9;
10413
10414    // Whether the bubble is an on-going one.
10415    optional bool is_ongoing = 10;
10416
10417    // Whether the bubble is produced by an app running in foreground.
10418    // This is deprecated and the value should be ignored.
10419    optional bool is_foreground = 11 [deprecated = true];
10420}
10421
10422/**
10423  * Logs System UI bubbles developer errors.
10424  *
10425  * Logged from:
10426  *   frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
10427  */
10428message BubbleDeveloperErrorReported {
10429
10430    // The app package that is posting the bubble.
10431    optional string package_name = 1;
10432
10433    // Bubble developer error type enums.
10434    enum Error {
10435        UNKNOWN = 0;
10436        ACTIVITY_INFO_MISSING = 1;
10437        ACTIVITY_INFO_NOT_RESIZABLE = 2;
10438        DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
10439    }
10440    optional Error error = 2 [default = UNKNOWN];
10441}
10442
10443/**
10444 * Logs that a job-specific constraint for a scheduled job has changed.
10445 * DeviceWideJobConstraintChanged will cover constraints that are normally the same for all jobs.
10446 *
10447 * Logged from:
10448 *     frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
10449 */
10450message ScheduledJobConstraintChanged {
10451    repeated AttributionNode attribution_node = 1;
10452
10453    // Name of the job.
10454    optional string job_name = 2;
10455
10456    optional com.android.server.job.ConstraintEnum constraint = 3;
10457
10458    enum State {
10459        UNKNOWN = 0;
10460        UNSATISFIED = 1;
10461        SATISFIED = 2;
10462    }
10463    optional State state = 4;
10464}
10465
10466/**
10467 * Logs that a device-state-level JobScheduler constraint has changed. This doesn't take individual
10468 * job or app characteristics into account. Individual jobs may have a different satisfaction value
10469 * based on special policies. Individual job constraints (eg. connectivity or prefetch) are not
10470 * logged in this atom.
10471 *
10472 * Logged from:
10473 *     frameworks/base/services/core/java/com/android/server/job/controllers/<*>.java
10474 */
10475message DeviceWideJobConstraintChanged {
10476    optional com.android.server.job.ConstraintEnum constraint = 1;
10477
10478    enum State {
10479        UNKNOWN = 0;
10480        UNSATISFIED = 1;
10481        SATISFIED = 2;
10482    }
10483    optional State state = 2 [
10484        (state_field_option).exclusive_state = true,
10485        (state_field_option).nested = false
10486    ];
10487}
10488
10489/**
10490 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
10491 * returns true.
10492 *
10493 * Logged from:
10494 *   frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
10495 */
10496message ScreenTimeoutExtensionReported {
10497    // Describes how many times in a row did the power manager reset the screen off timeout.
10498    optional uint32 consecutive_timeout_extended_count = 1;
10499}
10500
10501/*
10502* Logs number of milliseconds it takes to start a process.
10503* The definition of app process start time is from the app launch time to
10504* the time that Zygote finished forking the app process and loaded the
10505* application package's java classes.
10506
10507* This metric is different from AppStartOccurred which is for foreground
10508* activity only.
10509
10510* ProcessStartTime can report all processes (both foreground and background)
10511* start time.
10512*
10513* Logged from:
10514*   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
10515*/
10516message ProcessStartTime {
10517    // The uid of the ProcessRecord.
10518    optional int32 uid = 1 [(is_uid) = true];
10519
10520    // The process pid.
10521    optional int32 pid = 2;
10522
10523    // The process name.
10524    // Usually package name, "system" for system server.
10525    // Provided by ActivityManagerService.
10526    // Do not fetch this field from device to save storage space, use uid field induced
10527    // package name as process name.
10528    optional string process_name = 3;
10529
10530    enum StartType {
10531        UNKNOWN = 0;
10532        WARM = 1;
10533        HOT = 2;
10534        COLD = 3;
10535    }
10536
10537    // The start type.
10538    optional StartType type = 4;
10539
10540    // The elapsed realtime at the start of the process.
10541    optional int64 process_start_time_millis = 5;
10542
10543    // Number of milliseconds it takes to reach bind application.
10544    optional int32 bind_application_delay_millis = 6;
10545
10546    // Number of milliseconds it takes to finish start of the process.
10547    optional int32 process_start_delay_millis = 7;
10548
10549    // hostingType field in ProcessRecord, the component type such as "activity",
10550    // "service", "content provider", "broadcast" or other strings.
10551    // deprecatd by enum type field hosting_type_id to reduce storage space usage by
10552    // string type.
10553    // Do not fetch this field from device to save storage space.
10554    optional string hosting_type = 8 [deprecated = true];
10555
10556    // hostingNameStr field in ProcessRecord. The component class name that runs
10557    // in this process.
10558    // Do not fetch this field from device to save storage space.
10559    optional string hosting_name = 9;
10560
10561    // Broadcast action name.
10562    optional string broadcast_action_name = 10;
10563
10564    enum HostingTypeId {
10565        HOSTING_TYPE_UNKNOWN = 0;
10566        HOSTING_TYPE_ACTIVITY = 1;
10567        HOSTING_TYPE_ADDED_APPLICATION = 2;
10568        HOSTING_TYPE_BACKUP = 3;
10569        HOSTING_TYPE_BROADCAST = 4;
10570        HOSTING_TYPE_CONTENT_PROVIDER = 5;
10571        HOSTING_TYPE_LINK_FAIL = 6;
10572        HOSTING_TYPE_ON_HOLD = 7;
10573        HOSTING_TYPE_NEXT_ACTIVITY = 8;
10574        HOSTING_TYPE_NEXT_TOP_ACTIVITY = 9;
10575        HOSTING_TYPE_RESTART = 10;
10576        HOSTING_TYPE_SERVICE = 11;
10577        HOSTING_TYPE_SYSTEM = 12;
10578        HOSTING_TYPE_TOP_ACTIVITY = 13;
10579        HOSTING_TYPE_EMPTY = 14;
10580    }
10581
10582    optional HostingTypeId hosting_type_id = 11;
10583
10584    enum TriggerType {
10585        TRIGGER_TYPE_UNKNOWN = 0;
10586        TRIGGER_TYPE_ALARM = 1;
10587        TRIGGER_TYPE_PUSH_MESSAGE = 2;
10588        TRIGGER_TYPE_PUSH_MESSAGE_OVER_QUOTA = 3;
10589        TRIGGER_TYPE_JOB = 4;
10590    }
10591
10592    optional TriggerType trigger_type = 12;
10593}
10594
10595/**
10596 * Track Media Codec usage (nested proto version)
10597 *   This atom is being deprecated in favor of MediaCodecReported which has a
10598 *   flattened CodecData to enable field filtering. The data is identical
10599 *   except MediaCodecReported also has the playback_duration field.
10600 * Logged from:
10601 *   frameworks/av/media/libstagefright/MediaCodec.cpp
10602 *   frameworks/av/services/mediaanalytics/statsd_codec.cpp
10603 */
10604message MediametricsCodecReported {
10605    optional int64 timestamp_nanos = 1;
10606    optional string package_name = 2;
10607    optional int64 package_version_code = 3;
10608    optional int64 media_apex_version = 4;
10609
10610    optional android.stats.mediametrics_message.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
10611}
10612
10613/**
10614 * Track Media Codec usage
10615 *   This atom is the new version of MediametricsCodecReported and has a
10616 *   flattened CodecData to enable field filtering. The data is identical
10617 *   except for the addition of the playback_duration field.
10618 * Logged from:
10619 *   frameworks/av/media/libstagefright/MediaCodec.cpp
10620 *   frameworks/av/services/mediaanalytics/statsd_codec.cpp
10621 */
10622message MediaCodecReported {
10623    optional int64 timestamp_nanos = 1;
10624    // The inclusion of package name in a metric should be carefully analyzed to
10625    // determine if it is absolutely necessary for system health. It is strongly
10626    // discouraged to collect the package name along with other metrics (e.g.
10627    // playback duration).
10628    optional string package_name = 2;
10629    optional int64 package_version_code = 3;
10630    optional int64 media_apex_version = 4;
10631    // The name of the codec.
10632    // eg. `OMX.google.aac.decoder`
10633    optional string codec = 5;
10634    // The mime type. e.g. "audio/vorbis"
10635    optional string mime = 6;
10636    // The codec mode. i.e. video or audio.
10637    optional string mode = 7;
10638    // 1 if this is an encoder, 0 if this is a decoder.
10639    optional int32 encoder = 8;
10640    // 0, 1
10641    optional int32 secure = 9;
10642    // The video width in pixels.
10643    optional int32 width = 10;
10644    // The video height in pixels.
10645    optional int32 height = 11;
10646    // The rotation of the video in degrees
10647    // 0, 90, 180, 270
10648    optional int32 rotation = 12;
10649    // 1 if the codec uses crypto/drm, 0 otherwise.
10650    optional int32 crypto = 13;
10651    // The codec profile. The values are dependent on the codec type.
10652    // 0..n
10653    optional int32 profile = 14;
10654    // The coding level. The values are dependent on the codec type.
10655    // 0..n
10656    optional int32 level = 15;
10657    // The maximum allowed width during a particular codec session.
10658    // 0..n
10659    optional int32 max_width = 16;
10660    // The maximum allowed height during a particular codec session.
10661    // 0..n
10662    optional int32 max_height = 17;
10663    // Indicating which error condition caused the codec to reset to an
10664    // uninitialized state.
10665    optional int32 error_code = 18;
10666    // The error state.
10667    // The emitted values are descriptive:  UNINITIALIZED, INITIALIZING,
10668    // INITIALIZED, CONFIGURING, CONFIGURED, STARTING, STARTED, FLUSHING, FLUSHED,
10669    // STOPPING, and RELEASING.
10670    // In the event of an internal codec error setting the state outside of these
10671    // values, the invalid value will be encoded as a string (e.g., “17”).
10672    optional string error_state = 19;
10673    // The max latency in us.
10674    // The latency is from the time when the MediaCodec sends the ‘raw’ frame to
10675    // the media codec service to when the decoded frame arrives back in
10676    // MediaCodec’s possession.
10677    optional int64 latency_max = 20;
10678    // The min latency in us.
10679    optional int64 latency_min = 21;
10680    // The average latency in us.
10681    optional int64 latency_avg = 22;
10682    // The number of buffers included in the avg/min/max calculation above.
10683    optional int64 latency_count = 23;
10684    // The number of packets received back from the code where a latency could not
10685    // be determined, and therefore they aren't included in the avg/min/max
10686    // calculations above.
10687    optional int64 latency_unknown = 24;
10688    // Error returned by queueInputBuffer.
10689    optional int32 queue_input_buffer_error = 25;
10690    // Error returned by queueSecureInputBuffer.
10691    optional int32 queue_secure_input_buffer_error = 26;
10692    // These modes are primarily for videos.
10693    // CQ = constant quality
10694    // CBR = constant bit rate
10695    // VBR = variable bitrate
10696    optional string bitrate_mode = 27;
10697    optional int32 bitrate = 28;
10698    // 0..n
10699    optional int64 lifetime_millis = 29;
10700    optional int64 playback_duration_seconds = 30;
10701    optional string log_session_id = 31;
10702    optional int32 channel_count = 32;
10703    optional int32 sample_rate = 33;
10704    optional int64 video_encode_bytes = 34;
10705    optional int64 video_encode_frames = 35;
10706    optional int64 video_input_bytes = 36;
10707    optional int64 video_input_frames = 37;
10708    optional int64 video_encode_duration_us = 38;
10709    optional int32 color_format = 39;
10710    optional float frame_rate = 40;
10711    optional float capture_rate = 41;
10712    optional float operating_rate = 42;
10713    optional int32 priority = 43;
10714    optional int32 video_qp_i_min = 44;
10715    optional int32 video_qp_i_max = 45;
10716    optional int32 video_qp_p_min = 46;
10717    optional int32 video_qp_p_max = 47;
10718    optional int32 video_qp_b_min = 48;
10719    optional int32 video_qp_b_max = 49;
10720    optional int32 original_bitrate = 50;
10721    optional int32 shaping_enhanced = 51;
10722    optional int32 original_video_qp_i_min = 52;
10723    optional int32 original_video_qp_i_max = 53;
10724    optional int32 original_video_qp_p_min = 54;
10725    optional int32 original_video_qp_p_max = 55;
10726    optional int32 original_video_qp_b_min = 56;
10727    optional int32 original_video_qp_b_max = 57;
10728    optional int32 config_color_standard = 58;
10729    optional int32 config_color_range = 59;
10730    optional int32 config_color_transfer = 60;
10731    optional int32 parsed_color_standard = 61;
10732    optional int32 parsed_color_range = 62;
10733    optional int32 parsed_color_transfer = 63;
10734    optional int32 hdr_static_info = 64;
10735    optional int32 hdr_10_plus_info = 65;
10736    optional int32 hdr_format = 66;
10737    // !!! WARNING
10738    // Keep synchronized with MediametricsCodecReported.CodecData in
10739    // mediametrics_message.proto.
10740    // Also keep AStatsEvent serialization synchronized in statsd_codec.cpp
10741    // !!! WARNING
10742}
10743
10744/**
10745 * Track Media Extractor (pulling video/audio streams out of containers) usage
10746 * Logged from:
10747 *   frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
10748 *   frameworks/av/services/mediaanalytics/statsd_extractor.cpp
10749 */
10750message MediametricsExtractorReported {
10751    optional int64 timestamp_nanos = 1;
10752    optional string package_name = 2;
10753    optional int64 package_version_code = 3;
10754    optional int64 media_apex_version = 4;
10755
10756    optional android.stats.mediametrics_message.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
10757}
10758
10759/**
10760 * Track MediaParser (parsing video/audio streams from containers) usage
10761 * Logged from:
10762 *
10763 *   frameworks/av/services/mediametrics/statsd_mediaparser.cpp
10764 *   frameworks/base/apex/media/framework/jni/android_media_MediaParserJNI.cpp
10765 */
10766message MediametricsMediaParserReported {
10767    optional int64 timestamp_nanos = 1;
10768    optional string package_name = 2;
10769    optional int64 package_version_code = 3;
10770
10771    // MediaParser specific data.
10772    /**
10773     * The name of the parser selected for parsing the media, or an empty string
10774     * if no parser was selected.
10775     */
10776    optional string parser_name = 4;
10777    /**
10778     * Whether the parser was created by name. 1 represents true, and 0
10779     * represents false.
10780     */
10781    optional int32 created_by_name = 5;
10782    /**
10783     * The parser names in the sniffing pool separated by "|".
10784     */
10785    optional string parser_pool = 6;
10786    /**
10787     * The fully qualified name of the last encountered exception, or an empty
10788     * string if no exception was encountered.
10789     */
10790    optional string last_exception = 7;
10791    /**
10792     * The size of the parsed media in bytes, or -1 if unknown. Note this value
10793     * contains intentional random error to prevent media content
10794     * identification.
10795     */
10796    optional int64 resource_byte_count = 8;
10797    /**
10798     * The duration of the media in milliseconds, or -1 if unknown. Note this
10799     * value contains intentional random error to prevent media content
10800     * identification.
10801     */
10802    optional int64 duration_millis = 9;
10803    /**
10804     * The MIME types of the tracks separated by "|".
10805     */
10806    optional string track_mime_types = 10;
10807    /**
10808     * The tracks' RFC 6381 codec strings separated by "|".
10809     */
10810    optional string track_codecs = 11;
10811    /**
10812     * Concatenation of the parameters altered by the client, separated by "|".
10813     */
10814    optional string altered_parameters = 12;
10815    /**
10816     * The video width in pixels, or -1 if unknown or not applicable.
10817     */
10818    optional int32 video_width = 13;
10819    /**
10820     * The video height in pixels, or -1 if unknown or not applicable.
10821     */
10822    optional int32 video_height = 14;
10823    /**
10824     * Session id for correlating playback metrics.
10825     */
10826    optional string log_session_id = 15;
10827}
10828
10829/**
10830 * Track how we arbitrate between microphone/input requests.
10831 * Logged from
10832 *   frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
10833 *   frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
10834 */
10835message MediametricsAudiopolicyReported {
10836    optional int64 timestamp_nanos = 1;
10837    optional string package_name = 2;
10838    optional int64 package_version_code = 3;
10839    optional int64 media_apex_version = 4;
10840
10841    optional android.stats.mediametrics_message.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
10842}
10843
10844/**
10845 * Track how we arbitrate between microphone requests.
10846 * Logged from
10847 *   frameworks/av/media/libaudioclient/AudioRecord.cpp
10848 *   frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
10849 */
10850message MediametricsAudiorecordReported {
10851    optional int64 timestamp_nanos = 1;
10852    optional string package_name = 2;
10853    optional int64 package_version_code = 3;
10854    optional int64 media_apex_version = 4;
10855
10856    optional android.stats.mediametrics_message.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
10857
10858    // Android S
10859    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
10860    // An empty string means no session id is set.
10861    optional string log_session_id = 6;
10862}
10863
10864/**
10865 * Track how we arbitrate between microphone/input requests.
10866 * Logged from
10867 *   frameworks/av/media/libnblog/ReportPerformance.cpp
10868 *   frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
10869 */
10870message MediametricsAudiothreadReported {
10871    optional int64 timestamp_nanos = 1;
10872    optional string package_name = 2;
10873    optional int64 package_version_code = 3;
10874    optional int64 media_apex_version = 4;
10875
10876    optional android.stats.mediametrics_message.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
10877}
10878
10879/**
10880 * Track how we arbitrate between microphone/input requests.
10881 * Logged from
10882 *   frameworks/av/media/libaudioclient/AudioTrack.cpp
10883 *   frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
10884 */
10885message MediametricsAudiotrackReported {
10886    optional int64 timestamp_nanos = 1;
10887    optional string package_name = 2;
10888    optional int64 package_version_code = 3;
10889    optional int64 media_apex_version = 4;
10890
10891    optional android.stats.mediametrics_message.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
10892
10893    // Android S
10894    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
10895    // An empty string means no session id is set.
10896    optional string log_session_id = 6;
10897}
10898
10899/**
10900 * Track information about DRM framework performance
10901 * Logged from
10902 *   frameworks/av/drm/libmediadrm/DrmHal.cpp
10903 *   frameworks/av/services/mediaanalytics/statsd_drm.cpp
10904 */
10905message MediametricsMediadrmReported {
10906    optional int64 timestamp_nanos = 1;
10907    optional string package_name = 2;
10908    optional int64 package_version_code = 3;
10909    optional int64 media_apex_version = 4;
10910
10911    // vendor+description tell about which DRM plugin is in use on this device
10912    optional string vendor = 5;
10913    optional string description = 6;
10914    // from frameworks/av/drm/libmediadrm/protos/metrics.proto
10915    optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
10916}
10917
10918/**
10919 * Track information about the widevine DRM plugin performance
10920 * Logged from
10921 *   vendor/widevine/libwvdrmengine/cdm/metrics
10922 *   frameworks/av/services/mediaanalytics/statsd_drm.cpp
10923 *
10924 * TODO b/182382094 -remove after migrated mediadrm metrics
10925 * reporting to statsd.
10926 */
10927message MediametricsDrmWidevineReported {
10928    optional int64 timestamp_nanos = 1;
10929    optional string package_name = 2;
10930    optional int64 package_version_code = 3;
10931    optional int64 media_apex_version = 4;
10932
10933    optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
10934}
10935
10936/**
10937 * Track information about recordings (e.g. camcorder)
10938 * Logged from
10939 *   frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
10940 *   frameworks/av/services/mediaanalytics/statsd_recorder.cpp
10941 */
10942message MediametricsRecorderReported {
10943    optional int64 timestamp_nanos = 1;
10944    optional string package_name = 2;
10945    optional int64 package_version_code = 3;
10946    optional int64 media_apex_version = 4;
10947
10948    optional android.stats.mediametrics_message.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
10949}
10950
10951/**
10952 * Track Media Player usage
10953 * Logged from:
10954 *   frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
10955 *   frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
10956 */
10957message MediametricsNuPlayerReported {
10958    optional int64 timestamp_nanos = 1;
10959    optional string package_name = 2;
10960    optional int64 package_version_code = 3;
10961    optional int64 media_apex_version = 4;
10962
10963    optional android.stats.mediametrics_message.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
10964}
10965
10966/**
10967 * Track Legacy DRM usage
10968 * Logged from
10969 *   frameworks/av/drm/drmserver/DrmManager.cpp
10970 */
10971message MediametricsDrmManagerReported {
10972    optional int64 timestamp_nanos = 1;
10973    optional string package_name = 2;
10974    optional int64 package_version_code = 3;
10975    optional int64 media_apex_version = 4;
10976
10977    enum Method {
10978        METHOD_NOT_FOUND       = -1;
10979        GET_CONSTRAINTS        =  0;
10980        GET_METADATA           =  1;
10981        CAN_HANDLE             =  2;
10982        PROCESS_DRM_INFO       =  3;
10983        ACQUIRE_DRM_INFO       =  4;
10984        SAVE_RIGHTS            =  5;
10985        GET_ORIGINAL_MIME_TYPE =  6;
10986        GET_DRM_OBJECT_TYPE    =  7;
10987        CHECK_RIGHTS_STATUS    =  8;
10988        REMOVE_RIGHTS          =  9;
10989        REMOVE_ALL_RIGHTS      = 10;
10990        OPEN_CONVERT_SESSION   = 11;
10991        OPEN_DECRYPT_SESSION   = 12;
10992    }
10993
10994    // plugin_id+description inform which Legacy DRM plugins are still in use on device
10995    optional string plugin_id = 5;
10996    optional string description = 6;
10997    optional Method method = 7;
10998    optional string mime_types = 8;
10999
11000    optional int64 get_constraints_count =  9;
11001    optional int64 get_metadata_count = 10;
11002    optional int64 can_handle_count = 11;
11003    optional int64 process_drm_info_count = 12;
11004    optional int64 acquire_drm_info_count = 13;
11005    optional int64 save_rights_count = 14;
11006    optional int64 get_original_mime_type_count = 15;
11007    optional int64 get_drm_object_type_count = 16;
11008    optional int64 check_rights_status_count = 17;
11009    optional int64 remove_rights_count = 18;
11010    optional int64 remove_all_rights_count = 19;
11011    optional int64 open_convert_session_count = 20;
11012    optional int64 open_decrypt_session_count = 21;
11013}
11014
11015/**
11016 * State of a all permission requested by a all package
11017 * Pulled from: StatsCompanionService
11018*/
11019message DangerousPermissionState {
11020    // Name of the permission
11021    optional string permission_name = 1;
11022
11023    // Uid of the package
11024    optional int32 uid = 2 [(is_uid) = true];
11025
11026    // Package requesting the permission
11027    optional string package_name = 3;
11028
11029    // If the permission is granted to the uid
11030    optional bool is_granted = 4;
11031
11032    // Permission flags as per android.content.pm.PermissionFlags
11033    optional int32 permission_flags = 5;
11034
11035    // Permission protection flags as per android.content.pm.PermissionInfo.ProtectionFlags
11036    optional int32 protection_flags = 6;
11037}
11038
11039/**
11040 * Logs when a package is denied access to a device identifier based on the new access requirements.
11041 *
11042 * Logged from:
11043 *     frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
11044 */
11045message DeviceIdentifierAccessDenied {
11046    // The name of the package denied access to the requested device identifier.
11047    optional string package_name = 1;
11048
11049    // The name of the device identifier method the package attempted to invoke.
11050    optional string method_name = 2;
11051
11052    // True if the package is preinstalled.
11053    // Starting from Android 11, this boolean is not set and will always be false.
11054    optional bool is_preinstalled = 3 [deprecated = true];
11055
11056    // True if the package is privileged.
11057    // Starting from Android 11, this boolean is not set and will always be false.
11058    optional bool is_priv_app = 4 [deprecated = true];
11059}
11060
11061/**
11062 * Pulls the ongoing mainline install train version code.
11063 * Pulled from StatsCompanionService
11064 */
11065message TrainInfo {
11066    optional int64 train_version_code = 1;
11067
11068    optional TrainExperimentIds train_experiment_id = 2 [(log_mode) = MODE_BYTES];
11069
11070    optional string train_name = 3;
11071
11072    enum Status {
11073        UNKNOWN = 0;
11074        INSTALL_REQUESTED = 1;
11075        INSTALL_STARTED = 2;
11076        INSTALL_STAGED_NOT_READY = 3;
11077        INSTALL_STAGED_READY = 4;
11078        INSTALL_SUCCESS = 5;
11079        // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
11080        // and INSTALL_FAILURE_COMMIT.
11081        INSTALL_FAILURE = 6  [deprecated = true];
11082        // This enum is for installs that are manually cancelled via the Manual Update UI.
11083        INSTALL_CANCELLED = 7;
11084        INSTALLER_ROLLBACK_REQUESTED = 8;
11085        INSTALLER_ROLLBACK_INITIATED = 9;
11086        INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
11087        INSTALLER_ROLLBACK_STAGED = 11;
11088        INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
11089        INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
11090        INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
11091        INSTALLER_ROLLBACK_SUCCESS = 15;
11092        INSTALLER_ROLLBACK_FAILURE = 16;
11093        INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
11094        INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
11095        INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
11096        INSTALL_STAGED_CANCEL_REQUESTED = 20;
11097        INSTALL_STAGED_CANCEL_SUCCESS = 21;
11098        INSTALL_STAGED_CANCEL_FAILURE = 22;
11099        INSTALL_FAILURE_DOWNLOAD = 23;
11100        INSTALL_FAILURE_STATE_MISMATCH = 24;
11101        INSTALL_FAILURE_COMMIT = 25;
11102        REBOOT_TRIGGERED = 26;
11103    }
11104    optional Status status = 4;
11105}
11106
11107/**
11108 * Logs the gesture stage changed event.
11109 *
11110 * Logged from:
11111 *   frameworks/base/packages/SystemUI/
11112 */
11113message AssistGestureStageReported {
11114    optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
11115}
11116
11117/**
11118 * Logs the feedback type.
11119 *
11120 * Logged from:
11121 *   frameworks/base/packages/SystemUI/
11122 */
11123message AssistGestureFeedbackReported {
11124    // Whether or not the gesture was used.
11125    optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
11126}
11127
11128/**
11129 * Logs the progress.
11130 *
11131 * Logged from:
11132 *   frameworks/base/packages/SystemUI/
11133 */
11134message AssistGestureProgressReported {
11135    // [0,100] progress for the assist gesture.
11136    optional int32 progress = 1;
11137}
11138
11139/*
11140 * Information about the time zone data on a device.
11141 */
11142message TimeZoneDataInfo {
11143    // A version identifier for the data set on device. e.g. "2018i"
11144    optional string tzdb_version = 1;
11145}
11146
11147/**
11148 * Logs the GPU stats global health information.
11149 *
11150 * Logged from:
11151 *   frameworks/native/services/gpuservice/gpustats/
11152 */
11153message GpuStatsGlobalInfo {
11154    // Package name of the gpu driver.
11155    optional string driver_package_name = 1;
11156
11157    // Version name of the gpu driver.
11158    optional string driver_version_name = 2;
11159
11160    // Version code of the gpu driver.
11161    optional int64 driver_version_code = 3;
11162
11163    // Build time of the gpu driver in UTC as seconds since January 1, 1970.
11164    optional int64 driver_build_time = 4;
11165
11166    // Total count of the gl driver gets loaded.
11167    optional int64 gl_loading_count = 5;
11168
11169    // Total count of the gl driver fails to be loaded.
11170    optional int64 gl_loading_failure_count = 6;
11171
11172    // Total count of the Vulkan driver gets loaded.
11173    optional int64 vk_loading_count = 7;
11174
11175    // Total count of the Vulkan driver fails to be loaded.
11176    optional int64 vk_loading_failure_count = 8;
11177
11178    // Api version of the system Vulkan driver.
11179    optional int32 vulkan_version = 9;
11180
11181    // Api version of the system CPU Vulkan driver.
11182    optional int32 cpu_vulkan_version = 10;
11183
11184    // Api version of the system GLES driver.
11185    optional int32 gles_version = 11;
11186
11187    // Total count of the angle driver gets loaded.
11188    optional int64 angle_loading_count = 12;
11189
11190    // Total count of the angle driver fails to be loaded.
11191    optional int64 angle_loading_failure_count = 13;
11192}
11193
11194/**
11195 * GPU driver loading time info.
11196 */
11197message GpuDriverLoadingTime {
11198    // List of all the driver loading times for this app. The list size is
11199    // capped at 50.
11200    repeated int64 driver_loading_time = 1;
11201}
11202
11203/**
11204 * Logs the GPU stats per app health information.
11205 *
11206 * Logged from:
11207 *   frameworks/native/services/gpuservice/gpustats/
11208 */
11209message GpuStatsAppInfo {
11210    // Package name of the application that loads the gpu driver. Total number
11211    // of different packages is capped at 100.
11212    optional string app_package_name = 1;
11213
11214    // Version code of the gpu driver this app loads.
11215    optional int64 driver_version_code = 2;
11216
11217    // gl driver loading time info.
11218    optional GpuDriverLoadingTime gl_driver_loading_time = 3
11219            [(android.os.statsd.log_mode) = MODE_BYTES];
11220
11221    // Vulkan driver loading time info.
11222    optional GpuDriverLoadingTime vk_driver_loading_time = 4
11223            [(android.os.statsd.log_mode) = MODE_BYTES];
11224
11225    // Angle driver loading time info.
11226    optional GpuDriverLoadingTime angle_driver_loading_time = 5
11227            [(android.os.statsd.log_mode) = MODE_BYTES];
11228
11229    // CPU Vulkan implementation is in use.
11230    optional bool cpu_vulkan_in_use = 6;
11231
11232    // App is not doing pre-rotation correctly.
11233    optional bool false_prerotation = 7;
11234
11235    // App creates GLESv1 context.
11236    optional bool gles_1_in_use = 8;
11237
11238    // ANGLE in use for the app.
11239    optional bool angle_in_use = 9;
11240}
11241
11242/*
11243 * Logs the size of the system ion heap.
11244 *
11245 * Pulled from StatsCompanionService.
11246 */
11247message SystemIonHeapSize {
11248    // Deprecated due to limited support of ion stats in debugfs.
11249    // Use `IonHeapSize` instead.
11250    option deprecated = true;
11251
11252    // Size of the system ion heap in bytes.
11253    // Read from debugfs.
11254    optional int64 size_in_bytes = 1;
11255}
11256
11257/*
11258 * Logs the total size of the ion heap.
11259 *
11260 * Pulled from StatsCompanionService.
11261 */
11262message IonHeapSize {
11263    // Total size of all ion heaps in kilobytes.
11264    // Read from: /sys/kernel/ion/total_heaps_kb.
11265    optional int32 total_size_kb = 1;
11266}
11267
11268/*
11269 * Logs the per-process size of the system ion heap.
11270 *
11271 * Pulled from StatsCompanionService.
11272 */
11273message ProcessSystemIonHeapSize {
11274    // The uid if available. -1 means not available.
11275    optional int32 uid = 1 [(is_uid) = true];
11276
11277    // The process name (from /proc/PID/cmdline).
11278    optional string process_name = 2;
11279
11280    // Sum of sizes of all allocations.
11281    optional int32 total_size_in_kilobytes = 3;
11282
11283    // Number of allocations.
11284    optional int32 allocation_count = 4;
11285
11286    // Size of the largest allocation.
11287    optional int32 max_size_in_kilobytes = 5;
11288}
11289
11290/*
11291 * Logs system-wide (primarily kernel) memory stats. Sourced from
11292 * /proc/meminfo unless explicitly stated otherwise.
11293 *
11294 * Pulled from StatsCompanionService.
11295 */
11296message SystemMemory {
11297    // /proc/meminfo SUnreclaim
11298    optional int32 unreclaimable_slab_kb = 1;
11299
11300    // /proc/meminfo VmallocUsed
11301    optional int32 vmalloc_used_kb = 2;
11302
11303    // /proc/meminfo PageTables
11304    optional int32 page_tables_kb = 3;
11305
11306    // /proc/meminfo KernelStack
11307    optional int32 kernel_stack_kb = 4;
11308
11309    // Total unreclaimable ion.
11310    // Reported from os.Debug.getIonHeapsSizeKb (R+)
11311    optional int32 total_ion_kb = 5;
11312
11313    // Measures for the amount of memory we could not account for.
11314    // Essentially points to kernel allocations (as all userspace allocs are
11315    // already tracked).
11316    // Device-specific.
11317    optional int32 unaccounted_kb = 6;
11318
11319    // GPU kernel driver allocations.
11320    // Can overlap with ion memory.
11321    // Reported from os.Debug.getGpuTotalUsageKb (S+)
11322    optional int32 gpu_total_usage_kb = 7;
11323
11324    // GPU kernel driver private allocations.
11325    // Does not overlap with ion memory
11326    // Computed as total usage - Debug.getGpuDmaBufUsageKb()
11327    // Only available on supported kernel versions (5.4+)
11328    optional int32 gpu_private_usage_kb = 8;
11329
11330    // Total DMABUF memory allocations
11331    // Reported from os.Debug.getDmabufTotalExportedKb (S+)
11332    optional int32 dmabuf_total_exported_kb = 9;
11333
11334    // Total shmem allocations
11335    optional int32 shmem_kb = 10;
11336}
11337
11338/*
11339 * Log dmabuf memory retained by userspace processes.
11340 * Pulled from StatsPullAtomService.
11341 */
11342 message ProcessDmabufMemory {
11343  // The uid if available. -1 means not available.
11344  optional int32 uid = 1 [(is_uid) = true];
11345
11346  // The process name (from ActivityManager).
11347  optional string process_name = 2;
11348
11349  // OOM adj score.
11350  optional int32 oom_adj_score = 3;
11351
11352  // Size of dmabufs retained by the process. The buffers are either mapped,
11353  // retained via an fd, or both.
11354  // Only available on supported kernel versions (5.4+). When unavailable, set
11355  // to -1.
11356  optional int32 retained_dmabuf_kb = 4;
11357
11358  // Number of buffers retained by the process (mapped / fd).
11359  // Only available on supported kernel versions (5.4+). When unavailable, set
11360  // to -1.
11361  optional int32 retained_dmabuf_count = 5;
11362
11363  // Size of dmabufs mapped to the process address space.
11364  optional int32 mapped_dmabuf_kb = 6 [deprecated = true];
11365
11366  // Number of dmabufs mapped to the process address space.
11367  optional int32 mapped_dmabuf_count = 7 [deprecated = true];
11368
11369  // Size of dmabufs mapped to the process address space that are also
11370  // mapped to the SurfaceFlinger address space. This indicates memory
11371  // being used by graphics compositing layers. If this data row pertains
11372  // to SurfaceFlinger itself, then the below field holds the size of all
11373  // dmabuifs that are shared with any other process. The delta between
11374  // this field and retained_dmabuf_kb, above, is private dmabufs that
11375  // SurfaceFlinger is holding but are not shared with other processes.
11376  optional int32 surfaceflinger_shared_dmabuf_kb = 8;
11377  // As above, but total number of all dmabufs shared with SurfaceFlinger.
11378  optional int32 surfaceflinger_shared_dmabuf_count = 9;
11379}
11380
11381/**
11382 * Push network stack events.
11383 *
11384 * Log from:
11385 *     frameworks/base/packages/NetworkStack/
11386 */
11387message NetworkStackReported {
11388    // The id that indicates the event reported from NetworkStack.
11389    optional int32 event_id = 1;
11390    // The data for the reported events.
11391    optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
11392}
11393
11394/**
11395 * Logs the apps that are installed on the external storage.
11396 * Pulled from:
11397 *   StatsCompanionService
11398 */
11399message AppsOnExternalStorageInfo {
11400    // The type of the external storage.
11401    optional android.stats.storage.ExternalStorageType external_storage_type = 1;
11402    // The name of the package that is installed on the external storage.
11403    optional string package_name = 2;
11404}
11405
11406/**
11407 * Logs the settings related to Face.
11408 * Logged from:
11409 *   frameworks/base/services/core/java/com/android/server/stats
11410 */
11411message FaceSettings {
11412    // Whether or not face unlock is allowed on Keyguard.
11413    optional bool unlock_keyguard_enabled = 1;
11414    // Whether or not face unlock dismisses the Keyguard.
11415    optional bool unlock_dismisses_keyguard = 2;
11416    // Whether or not face unlock requires attention.
11417    optional bool unlock_attention_required = 3;
11418    // Whether or not face unlock is allowed for apps (through BiometricPrompt).
11419    optional bool unlock_app_enabled = 4;
11420    // Whether or not face unlock always requires user confirmation.
11421    optional bool unlock_always_require_confirmation = 5;
11422    // Whether or not a diverse set of poses are required during enrollment.
11423    optional bool unlock_diversity_required = 6;
11424}
11425
11426/**
11427 * Logs cooling devices maintained by the kernel.
11428 *
11429 * Pulled from StatsCompanionService.java
11430 */
11431message CoolingDevice {
11432    // The type of cooling device being reported. Eg. CPU, GPU...
11433    optional android.os.CoolingTypeEnum device_location = 1;
11434    // The name of the cooling device source. Eg. CPU0
11435    optional string device_name = 2;
11436    // Current throttle state of the cooling device. The value can any unsigned
11437    // integer between 0 and max_state defined in its driver. 0 means device is
11438    // not in throttling, higher value means deeper throttling.
11439    optional int32 state = 3;
11440}
11441
11442/**
11443 * Intelligence has several counter-type events that don't warrant a
11444 * full separate atom. These are primarily API call counters but also include
11445 * counters for feature usage and specific failure modes.
11446 *
11447 * Logged from the Intelligence mainline module.
11448 */
11449message IntelligenceEventReported {
11450  // The event type.
11451  optional android.stats.intelligence.EventType event_id = 1;
11452  // Success, failure.
11453  optional android.stats.intelligence.Status status = 2;
11454  // How many times the event occured (to report a batch of high frequency events).
11455  optional int32 count = 3;
11456  // How long the event took (sum of durations if count > 1)
11457  optional int64 duration_millis = 4;
11458}
11459
11460/**
11461 * Logs when Car Power state changed.
11462 *
11463 * Logged from:
11464 *   packages/services/Car/service/src/com/android/car/CarStatsLog.java
11465 */
11466message CarPowerStateChanged {
11467    // States come from CpmsState in CarPowerManagementService.java.
11468    enum State {
11469       WAIT_FOR_VHAL = 0;
11470       ON = 1;
11471       SHUTDOWN_PREPARE = 2;
11472       WAIT_FOR_FINISH = 3;
11473       SUSPEND = 4;
11474       SIMULATE_SLEEP = 5;
11475    }
11476    optional State state = 1;
11477}
11478
11479/**
11480 * Logs when Car User Hal is requested to switch/create/remove user.
11481 *
11482 * Logged from:
11483 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
11484 */
11485message CarUserHalModifyUserRequestReported {
11486    // Request id for the request.
11487    optional int32 request_id = 1;
11488    // Request type.
11489    enum RequestType {
11490        UNKNOWN = 0;
11491        // Car user manager requested user switch.
11492        SWITCH_REQUEST_ANDROID = 1;
11493        // OEM requested User switch.
11494        SWITCH_REQUEST_OEM = 2;
11495        // Hal switch requested after android switch using activity manager.
11496        SWITCH_REQUEST_LEGACY = 3;
11497        // Create User
11498        CREATE_REQUEST = 4;
11499        // Remove User
11500        REMOVE_REQUEST = 5;
11501    }
11502    optional RequestType request_type = 2;
11503    // Android User id of the current user which can only be 0, 10, 11 and so on.
11504    // -1 if not available.
11505    optional int32 user_id = 3;
11506    // VHAL flags of the current user. (-1 if not available)
11507    optional int32 user_flags = 4;
11508    // Android User id of the target user for switch/create/remove. It can only
11509    // be 0, 10, 11 and so on. -1 if not available.
11510    optional int32 target_user_id = 5;
11511    // VHAL flags of the target user for switch/create/remove. (-1 if not available)
11512    optional int32 target_user_flags = 6;
11513    // Request timeout Milliseconds (-1 if not available)
11514    optional int32 timeout_millis = 7;
11515}
11516
11517/**
11518 * Logs when Car User Hal responds to switch/create user request.
11519 *
11520 * Logged from:
11521 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
11522 */
11523message CarUserHalModifyUserResponseReported {
11524    // Request id of the request associated with the response.
11525    optional int32 request_id = 1;
11526    // Car user hal callback status.
11527    enum CallbackStatus {
11528        UNKNOWN = 0;
11529        // Hal response was invalid.
11530        INVALID = 1;
11531        // Hal response was ok.
11532        OK = 2;
11533        // Hal timeout during set call.
11534        HAL_SET_TIMEOUT = 3;
11535        // Hal response timeout.
11536        HAL_RESPONSE_TIMEOUT = 4;
11537        // Hal responded with wrong info.
11538        WRONG_HAL_RESPONSE = 5;
11539        // Hal is processing multiple requests simultaneously.
11540        CONCURRENT_OPERATION = 6;
11541    }
11542    optional CallbackStatus callback_status = 2;
11543
11544    // Hal request status for user switch/create/remove.
11545    enum HalRequestStatus {
11546        UNSPECIFIED = 0;
11547        // Hal request for user switch/create is successful.
11548        SUCCESS = 1;
11549        // Hal request for user switch/create failed.
11550        FAILURE = 2;
11551    }
11552    optional HalRequestStatus request_status = 3;
11553}
11554
11555/**
11556 * Logs when post switch response is posted to Car User Hal.
11557 *
11558 * Logged from:
11559 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
11560 */
11561message CarUserHalPostSwitchResponseReported {
11562    // Request id.
11563    optional int32 request_id = 1;
11564
11565    // Android user switch status.
11566    enum UserSwitchStatus {
11567        UNKNOWN = 0;
11568        // Android user switch is successful.
11569        SUCCESS = 1;
11570        // Android user switch failed.
11571        FAILURE = 2;
11572    }
11573    optional UserSwitchStatus switch_status = 2;
11574}
11575
11576/**
11577 * Logs when initial user information is requested from Car User Hal.
11578 *
11579 * Logged from:
11580 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
11581 */
11582message CarUserHalInitialUserInfoRequestReported {
11583    // Request id for the request.
11584    optional int32 request_id = 1;
11585
11586    // Request type for initial user information.
11587    enum InitialUserInfoRequestType {
11588        UNKNOWN = 0;
11589        // At the first time Android was booted (or after a factory reset).
11590        FIRST_BOOT = 1;
11591        // At the first time Android was booted after the system was updated.
11592        FIRST_BOOT_AFTER_OTA = 2;
11593        // When Android was booted "from scratch".
11594        COLD_BOOT = 3;
11595        // When Android was resumed after the system was suspended to memory.
11596        RESUME = 4;
11597    }
11598    optional InitialUserInfoRequestType request_type = 2;
11599    // Request timeout Milliseconds (-1 if not available)
11600    optional int32 timeout_millis = 3;
11601}
11602
11603/**
11604 * Logs when Car User Hal responds to initial user information requests.
11605 *
11606 * Logged from:
11607 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
11608 */
11609message CarUserHalInitialUserInfoResponseReported {
11610    // Request id of the request associated with the response.
11611    optional int32 request_id = 1;
11612    // Car user hal callback status.
11613    enum CallbackStatus {
11614        UNKNOWN = 0;
11615        // Hal response was invalid.
11616        INVALID = 1;
11617        // Hal response was ok.
11618        OK = 2;
11619        // Hal timeout during set call.
11620        HAL_SET_TIMEOUT = 3;
11621        // Hal response timeout.
11622        HAL_RESPONSE_TIMEOUT = 4;
11623        // Hal responded with wrong info.
11624        WRONG_HAL_RESPONSE = 5;
11625        // Hal is processing multiple requests simultaneously.
11626        CONCURRENT_OPERATION = 6;
11627    }
11628    optional CallbackStatus callback_status = 2;
11629    // Response for initial user information request.
11630    enum InitialUserInfoResponseAction {
11631        UNSPECIFIED = 0;
11632        // Let the Android System decide what to do.
11633        DEFAULT = 1;
11634        // Switch to an existing Android user.
11635        SWITCH = 2;
11636        // Create a new Android user (and switch to it).
11637        CREATE = 3;
11638    }
11639    optional InitialUserInfoResponseAction response_action = 3;
11640    // Android User id of the target user which can only be 0, 10, 11 and so on.
11641    // -1 if not available.
11642    optional int32 target_user = 4;
11643    // VHAL flags of the current user. (-1 if not available)
11644    optional int32 target_user_flags = 5;
11645    // User locales
11646    optional string user_locales = 6;
11647}
11648
11649/**
11650 * Logs when set user association is requested from Car User Hal.
11651 *
11652 * Logged from:
11653 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
11654 */
11655message CarUserHalUserAssociationRequestReported {
11656    // Request id for the request.
11657    optional int32 request_id = 1;
11658    // Request type.
11659    enum RequestType {
11660        UNKNOWN = 0;
11661        // For setting user association information.
11662        SET = 1;
11663        // For getting user association information.
11664        GET = 2;
11665    }
11666    optional RequestType request_type = 2;
11667    // Android User id of the current user which can only be 0, 10, 11 and so on.
11668    // -1 if not available.
11669    optional int32 current_user_id = 3;
11670    // VHAL flags of the current user. (-1 if not available)
11671    optional int32 current_user_flags = 4;
11672    // Number of the set associations requested.
11673    optional int32 number_associations = 5;
11674    // Concatenated string for the types from set associations request.
11675    // This is a string converted from an array of integers.
11676    optional string user_identification_association_types = 6;
11677    // Concatenated string for the values from set associations request.
11678    // This is a string converted from an array of integers.
11679    optional string user_identification_association_values = 7;
11680}
11681
11682/**
11683 * Logs when Car User Hal responds to set user association requests.
11684 *
11685 * Logged from:
11686 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
11687 */
11688message CarUserHalSetUserAssociationResponseReported {
11689    // Request id of the request associated with the response.
11690    optional int32 request_id = 1;
11691    // Car user hal callback status.
11692    enum CallbackStatus {
11693        UNKNOWN = 0;
11694        // Hal response was invalid.
11695        INVALID = 1;
11696        // Hal response was ok.
11697        OK = 2;
11698        // Hal timeout during set call.
11699        HAL_SET_TIMEOUT = 3;
11700        // Hal response timeout.
11701        HAL_RESPONSE_TIMEOUT = 4;
11702        // Hal responded with wrong info.
11703        WRONG_HAL_RESPONSE = 5;
11704        // Hal is processing multiple requests simultaneously.
11705        CONCURRENT_OPERATION = 6;
11706    }
11707    optional CallbackStatus callback_status = 2;
11708    // Number of the set associations in the response.
11709    optional int32 number_associations = 3;
11710    // Concatenated string for the types from set associations request.
11711    // This is a string converted from an array of integers.
11712    optional string user_identification_association_types = 4;
11713    // Concatenated string for the values from set associations request.
11714    // This is a string converted from an array of integers.
11715    optional string user_identification_association_values = 5;
11716}
11717
11718/**
11719 * Logs whether GarageMode is entered.
11720 *
11721 * Logged from:
11722 *   packages/services/Car/service/src/com/android/car/CarStatsLog.java
11723 */
11724message GarageModeInfo {
11725    // Whether GarageMode is entered.
11726    optional bool is_garage_mode = 1;
11727}
11728
11729/**
11730 * Historical app ops data per package.
11731 */
11732message AppOps {
11733    // Uid of the package requesting the op
11734    optional int32 uid = 1 [(is_uid) = true];
11735
11736    // Name of the package performing the op
11737    optional string package_name = 2;
11738
11739    // operation id
11740    optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
11741
11742    // The number of times the op was granted while the app was in the
11743    // foreground (only for trusted requests)
11744    optional int64 trusted_foreground_granted_count = 4;
11745
11746    // The number of times the op was granted while the app was in the
11747    // background (only for trusted requests)
11748    optional int64 trusted_background_granted_count = 5;
11749
11750    // The number of times the op was rejected while the app was in the
11751    // foreground (only for trusted requests)
11752    optional int64 trusted_foreground_rejected_count = 6;
11753
11754    // The number of times the op was rejected while the app was in the
11755    // background (only for trusted requests)
11756    optional int64 trusted_background_rejected_count = 7;
11757
11758    // For long-running operations, total duration of the operation
11759    // while the app was in the foreground (only for trusted requests)
11760    optional int64 trusted_foreground_duration_millis = 8;
11761
11762    // For long-running operations, total duration of the operation
11763    // while the app was in the background (only for trusted requests)
11764    optional int64 trusted_background_duration_millis = 9;
11765
11766    // Whether AppOps is guarded by Runtime permission
11767    optional bool is_runtime_permission = 10;
11768}
11769
11770/**
11771 * Historical app ops data per package and attribution tag.
11772 */
11773message AttributedAppOps {
11774    // Uid of the package requesting the op
11775    optional int32 uid = 1 [(is_uid) = true];
11776
11777    // Name of the package performing the op
11778    optional string package_name = 2;
11779
11780    // tag; provided by developer when accessing related API, limited at 50 chars by API.
11781    // Attributions must be provided through manifest using <attribution> tag available in R and
11782    // above.
11783    optional string tag = 3;
11784
11785    // operation id
11786    optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
11787
11788    // The number of times the op was granted while the app was in the
11789    // foreground (only for trusted requests)
11790    optional int64 trusted_foreground_granted_count = 5;
11791
11792    // The number of times the op was granted while the app was in the
11793    // background (only for trusted requests)
11794    optional int64 trusted_background_granted_count = 6;
11795
11796    // The number of times the op was rejected while the app was in the
11797    // foreground (only for trusted requests)
11798    optional int64 trusted_foreground_rejected_count = 7;
11799
11800    // The number of times the op was rejected while the app was in the
11801    // background (only for trusted requests)
11802    optional int64 trusted_background_rejected_count = 8;
11803
11804    // For long-running operations, total duration of the operation
11805    // while the app was in the foreground (only for trusted requests)
11806    optional int64 trusted_foreground_duration_millis = 9;
11807
11808    // For long-running operations, total duration of the operation
11809    // while the app was in the background (only for trusted requests)
11810    optional int64 trusted_background_duration_millis = 10;
11811
11812    // Whether AppOps is guarded by Runtime permission
11813    optional bool is_runtime_permission = 11;
11814
11815    // Sampling rate used on device, from 0 to 100
11816    optional int32 sampling_rate = 12;
11817}
11818
11819/**
11820 * Location Manager API Usage information(e.g. API under usage,
11821 * API call's parameters).
11822 * Logged from:
11823 *  frameworks/base/services/core/java/com/android/server/LocationManagerService.java
11824 */
11825message LocationManagerApiUsageReported {
11826
11827    // Indicating if usage starts or usage ends.
11828    optional android.stats.location.UsageState state = 1;
11829
11830    // LocationManagerService's API in use.
11831    // We can identify which API from LocationManager is
11832    // invoking current LMS API by the combination of
11833    // API parameter(e.g. is_listener_null, is_intent_null,
11834    // is_location_request_null)
11835    optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
11836
11837    // Name of the package calling the API.
11838    optional string calling_package_name = 3;
11839
11840    // Type of the location provider.
11841    optional android.stats.location.ProviderType provider = 4;
11842
11843    // Quality of the location request
11844    optional android.stats.location.LocationRequestQuality quality = 5;
11845
11846    // The desired interval for active location updates, in milliseconds.
11847    // Bucketized to reduce cardinality.
11848    optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
11849
11850    // Minimum distance between location updates, in meters.
11851    // Bucketized to reduce cardinality.
11852    optional android.stats.location.SmallestDisplacementBucket
11853            bucketized_smallest_displacement = 7;
11854
11855    // The number of location updates.
11856    optional int64 num_updates = 8;
11857
11858    // The request expiration time, in millisecond since boot.
11859    // Bucketized to reduce cardinality.
11860    optional android.stats.location.ExpirationBucket
11861            bucketized_expire_in = 9;
11862
11863    // Type of Callback passed in for this API.
11864    optional android.stats.location.CallbackType callback_type = 10;
11865
11866    // The radius of the central point of the alert
11867    // region, in meters. Only for API REQUEST_GEOFENCE.
11868    // Bucketized to reduce cardinality.
11869    optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
11870
11871    // Activity Importance of API caller.
11872    // Categorized to 3 types that are interesting from location's perspective.
11873    optional android.stats.location.ActivityImportance activiy_importance = 12;
11874
11875    // Attribution tag passed to this API.
11876    optional string attribution_tag = 13;
11877}
11878
11879/**
11880 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
11881 */
11882message ReviewPermissionsFragmentResultReported {
11883    // unique value identifying a permission group change. A permission group change might result
11884    // in multiple of these atoms
11885    optional int64 change_id = 1;
11886
11887    // UID of package the permission belongs to
11888    optional int32 uid = 2 [(is_uid) = true];
11889
11890    // Name of package the permission belongs to
11891    optional string package_name = 3;
11892
11893    // The permission to be granted
11894    optional string permission_name = 4;
11895
11896    // The result of the permission grant
11897    optional bool permission_granted = 5;
11898}
11899
11900/**
11901* Information about results of permission upgrade by RuntimePermissionsUpgradeController
11902* Logged from: RuntimePermissionUpdgradeController
11903*/
11904message RuntimePermissionsUpgradeResult {
11905    // Permission granted as result of upgrade
11906    optional string permission_name = 1;
11907
11908    // UID of package granted permission
11909    optional int32 uid = 2 [(is_uid) = true];
11910
11911    // Name of package granted permission
11912    optional string package_name = 3;
11913}
11914
11915/**
11916* Information about a buttons presented in GrantPermissionsActivty and choice made by user
11917*/
11918message GrantPermissionsActivityButtonActions {
11919    // Permission granted as result of upgrade
11920    optional string permission_group_name = 1;
11921
11922    // UID of package granted permission
11923    optional int32 uid = 2 [(is_uid) = true];
11924
11925    // Name of package requesting permission
11926    optional string package_name = 3;
11927
11928    // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
11929    // LABEL_ constants in GrantPermissionActivity.java
11930    optional int32 buttons_presented = 4;
11931
11932    // Button clicked by user - same as bit flags in buttons_presented with only single bit set
11933    optional int32 button_clicked = 5;
11934
11935    // id which identifies single session of user interacting with permission controller
11936    optional int64 session_id = 6;
11937
11938    // Target SDK of the package
11939    optional int32 target_sdk = 7;
11940
11941    // Selected precision of the location permission - bit flags indicate which
11942    // locations were chosen
11943    optional int32 selected_precision = 8;
11944}
11945
11946/**
11947 * Information about LocationAccessCheck notification presented to user
11948 */
11949message LocationAccessCheckNotificationAction {
11950
11951    // id which identifies single session of user interacting with permission controller
11952    optional int64 session_id = 1;
11953
11954    // Uid of package for which location access check is presented
11955    optional int32 package_uid = 2;
11956
11957    // Name of package for which location access check is presented
11958    optional string package_name = 3;
11959
11960    enum Result {
11961        UNDEFINED = 0;
11962        // notification was presented to the user
11963        NOTIFICATION_PRESENTED = 1;
11964        // notification was declined by the user
11965        NOTIFICATION_DECLINED = 2;
11966        // notification was clicked by the user
11967        NOTIFICATION_CLICKED = 3;
11968    }
11969
11970    // View / interaction recorded
11971    optional Result result = 4;
11972}
11973
11974/**
11975 * Information about a permission grant or revoke made by user inside AppPermissionFragment
11976 */
11977message AppPermissionFragmentActionReported {
11978    // id which identifies single session of user interacting with permission controller
11979    optional int64 session_id = 1;
11980
11981    // unique value identifying a permission group change. A permission group change might result
11982    // in multiple of these atoms
11983    optional int64 change_id = 2;
11984
11985    // UID of package the permission belongs to
11986    optional int32 uid = 3 [(is_uid) = true];
11987
11988    // Name of package the permission belongs to
11989    optional string package_name = 4;
11990
11991    // The permission to be granted
11992    optional string permission_name = 5;
11993
11994    // The result of the permission grant
11995    optional bool permission_granted = 6;
11996
11997    // State of Permission Flags after grant as per android.content.pm.PermissionFlags
11998    optional int32 permission_flags = 7;
11999
12000    enum Button {
12001        UNDEFINED = 0;
12002        // Allow button
12003        ALLOW = 1;
12004        // Deny button
12005        DENY = 2;
12006        // Ask every time button
12007        ASK_EVERY_TIME = 3;
12008        // Allow all the time button
12009        ALLOW_ALWAYS = 4;
12010        // Allow only while using the app button
12011        ALLOW_FOREGROUND = 5;
12012        // Same is Deny button but shown in while in use dialog
12013        DENY_FOREGROUND = 6;
12014        // Switch button set to ON for location accuracy
12015        GRANT_FINE_LOCATION = 7;
12016        // Switch button set to OFF for location accuracy
12017        REVOKE_FINE_LOCATION = 8;
12018    }
12019
12020    // Button pressed in the dialog
12021    optional Button button_pressed = 8;
12022}
12023
12024/**
12025* Information about a AppPermissionFragment viewed by user
12026*/
12027message AppPermissionFragmentViewed {
12028    // id which identifies single session of user interacting with permission controller
12029    optional int64 session_id = 1;
12030
12031    // UID of package for which permissions are viewed
12032    optional int32 uid = 2 [(is_uid) = true];
12033
12034    // Name of package for which permissions are viewed
12035    optional string package_name = 3;
12036
12037    // Permission group viewed
12038    optional string permission_group_name = 4;
12039}
12040
12041/**
12042* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
12043* the log retains the old fragment name.
12044*/
12045message AppPermissionsFragmentViewed {
12046    // id which identifies single session of user interacting with permission controller
12047    optional int64 session_id = 1;
12048
12049    // id which identifies single view as every view might have several logging records
12050    // with different package information attached
12051    optional int64 view_id = 2;
12052
12053    // Permission group viewed
12054    optional string permission_group_name = 3;
12055
12056    // UID of package for which permissions are viewed
12057    optional int32 uid = 4 [(is_uid) = true];
12058
12059    // Name of package for which permissions are viewed
12060    optional string package_name = 5;
12061
12062    // Category in which permission is included
12063    enum Category {
12064      UNDEFINED = 0;
12065      ALLOWED = 1;
12066      ALLOWED_FOREGROUND = 2;
12067      DENIED = 3;
12068    }
12069    optional Category category = 6;
12070}
12071/**
12072* Information about a PermissionAppsFragment viewed by user.
12073* Logged from ui/handheld/PermissionAppsFragment.java
12074*/
12075message PermissionAppsFragmentViewed {
12076    // id which identifies single session of user interacting with permission controller
12077    optional int64 session_id = 1;
12078
12079    // id which identifies single view as every view might have several logging records
12080    // with different package information attached
12081    optional int64 view_id = 2;
12082
12083    // Permission group viewed
12084    optional string permission_group_name = 3;
12085
12086    // UID of package for which permissions are viewed
12087    optional int32 uid = 4 [(is_uid) = true];
12088
12089    // Name of package for which permissions are viewed
12090    optional string package_name = 5;
12091
12092    // Category in which app is included
12093    enum Category {
12094        UNDEFINED = 0;
12095        ALLOWED = 1;
12096        ALLOWED_FOREGROUND = 2;
12097        DENIED = 3;
12098    }
12099    optional Category category = 6;
12100}
12101
12102/**
12103* Log that the Auto Revoke notification has been clicked
12104* Logged from ui/ManagePermissionsActivity
12105*/
12106message AutoRevokeNotificationClicked {
12107    // id which identifies single session of user interacting with permission controller
12108    optional int64 session_id = 1;
12109}
12110
12111/**
12112* Log that an app has been displayed on the auto revoke page, and lists one permission that was
12113* auto revoked for it.
12114* Logged from ui/handheld/AutoRevokeFragment
12115*/
12116message AutoRevokeFragmentAppViewed {
12117    // id which identifies single session of user interacting with permission controller
12118    optional int64 session_id = 1;
12119
12120    // UID of package for which permissions are viewed
12121    optional int32 uid = 2 [(is_uid) = true];
12122
12123    // Name of package for which permissions are viewed
12124    optional string package_name = 3;
12125
12126    // The name of a permission group that has been revoked
12127    optional string permission_group_name = 4;
12128
12129    // The age of the app- more than three months old, or more than six months
12130    enum Age {
12131        UNDEFINED = 0;
12132        NEWER_BUCKET = 1;
12133        OLDER_BUCKET = 2;
12134    }
12135
12136    // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
12137    optional Age age = 5;
12138}
12139
12140/**
12141* Log that the user has interacted with an app on the auto revoke fragment
12142* Logged from ui/handheld/AutoRevokeFragment
12143*/
12144message AutoRevokedAppInteraction {
12145    // id which identifies single session of user interacting with permission controller
12146    optional int64 session_id = 1;
12147
12148    // UID of package for which permissions are viewed
12149    optional int32 uid = 2 [(is_uid) = true];
12150
12151    // Name of package for which permissions are viewed
12152    optional string package_name = 3;
12153
12154    enum Action {
12155        UNDEFINED = 0;
12156        REMOVE = 1;
12157        OPEN = 2;
12158        APP_INFO = 3;
12159        PERMISSIONS = 4;
12160        REMOVE_IN_SETTINGS = 5;
12161        OPEN_IN_SETTINGS = 6;
12162    }
12163
12164    // The action the user took to interact with the app
12165    optional Action action = 4;
12166}
12167
12168/**
12169* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
12170* auto revoke, or that the auto revoke switch has been changed
12171* Logged from ui/handheld/AppPermissionGroupsFragment
12172 */
12173message AppPermissionGroupsFragmentAutoRevokeAction {
12174    // id which identifies single session of user interacting with permission controller
12175    optional int64 session_id = 1;
12176
12177    // UID of package for which permissions are viewed
12178    optional int32 uid = 2 [(is_uid) = true];
12179
12180    // Name of package for which permissions are viewed
12181    optional string package_name = 3;
12182
12183    enum Action {
12184        UNDEFINED = 0;
12185        OPENED_FOR_AUTO_REVOKE = 1;
12186        OPENED_FROM_INTENT = 2;
12187        SWITCH_ENABLED = 3;
12188        SWITCH_DISABLED = 4;
12189    }
12190
12191    // The action the user took to interact with the fragment
12192    optional Action action = 4;
12193}
12194
12195/**
12196 * Logs when there is a smart selection related event.
12197 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
12198 * Logged from: TextClassifierEventLogger.java
12199 */
12200message TextSelectionEvent {
12201    // A session ID.
12202    optional string session_id = 1;
12203
12204    // Event type of this event.
12205    optional android.stats.textclassifier.EventType event_type = 2;
12206
12207    // Name of the annotator model that is involved in this event.
12208    optional string model_name = 3;
12209
12210    // Type of widget that was involved in triggering this event.
12211    optional android.stats.textclassifier.WidgetType widget_type = 4;
12212
12213    // Index of this event in a session.
12214    optional int32 event_index = 5;
12215
12216    // Entity type that is involved.
12217    optional string entity_type = 6;
12218
12219    // Relative word index of the start of the selection.
12220    optional int32 relative_word_start_index = 7;
12221
12222    // Relative word (exclusive) index of the end of the selection.
12223    optional int32 relative_word_end_index = 8;
12224
12225    // Relative word index of the start of the smart selection.
12226    optional int32 relative_suggested_word_start_index = 9;
12227
12228    // Relative word (exclusive) index of the end of the smart selection.
12229    optional int32 relative_suggested_word_end_index = 10;
12230
12231    // Name of source package.
12232    optional string package_name = 11;
12233
12234    // Name of the LangID model that is involved in this event.
12235    optional string langid_model_name = 12;
12236}
12237
12238/**
12239 * Logs when there is a smart linkify related event.
12240 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
12241 * Logged from: TextClassifierEventLogger.java
12242 */
12243message TextLinkifyEvent {
12244    // A session ID.
12245    optional string session_id = 1;
12246
12247    // Event type of this event.
12248    optional android.stats.textclassifier.EventType event_type = 2;
12249
12250    // Name of the annotator model that is involved in this event.
12251    optional string model_name = 3;
12252
12253    // Type of widget that was involved in triggering this event.
12254    optional android.stats.textclassifier.WidgetType widget_type = 4;
12255
12256    // Index of this event in a session.
12257    optional int32 event_index = 5;
12258
12259    // Entity type that is involved.
12260    optional string entity_type = 6;
12261
12262    // Number of links detected.
12263    optional int32 num_links = 7;
12264
12265    // The total length of all links.
12266    optional int32 linked_text_length = 8;
12267
12268    // Length of input text.
12269    optional int32 text_length = 9;
12270
12271    // Time spent on generating links in ms.
12272    optional int64 latency_millis = 10;
12273
12274    // Name of source package.
12275    optional string package_name = 11;
12276
12277    // Name of the LangID model that is involved in this event.
12278    optional string langid_model_name = 12;
12279}
12280
12281/**
12282 * Logs when there is a conversation actions related event.
12283 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
12284 * Logged from: TextClassifierEventLogger.java
12285 */
12286message ConversationActionsEvent {
12287    // A session ID.
12288    optional string session_id = 1;
12289
12290    // Event type of this event.
12291    optional android.stats.textclassifier.EventType event_type = 2;
12292
12293    // Name of the actions model that is involved in this event.
12294    optional string model_name = 3;
12295
12296    // Type of widget that was involved in triggering this event.
12297    optional android.stats.textclassifier.WidgetType widget_type = 4;
12298
12299    // The first entity type that is involved.
12300    optional string first_entity_type = 5;
12301
12302    // The second entity type that is involved.
12303    optional string second_entity_type = 6;
12304
12305    // The third entity type that is involved.
12306    optional string third_entity_type = 7;
12307
12308    // The score of the first entity type.
12309    optional float score = 8;
12310
12311    // Name of source package.
12312    optional string package_name = 9;
12313
12314    // Name of the annotator model that is involved in this event.
12315    optional string annotator_model_name = 10;
12316
12317    // Name of the LangID model that is involved in this event.
12318    optional string langid_model_name = 11;
12319}
12320
12321/**
12322 * Logs when there is a language detection related event.
12323 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
12324 * Logged from: TextClassifierEventLogger.java
12325 */
12326message LanguageDetectionEvent {
12327    // A session ID.
12328    optional string session_id = 1;
12329
12330    // Event type of this event.
12331    optional android.stats.textclassifier.EventType event_type = 2;
12332
12333    // Name of the language detection model that is involved in this event.
12334    optional string model_name = 3;
12335
12336    // Type of widget that was involved in triggering this event.
12337    optional android.stats.textclassifier.WidgetType widget_type = 4;
12338
12339    // Detected language.
12340    optional string language_tag = 5;
12341
12342    // Score of the detected language.
12343    optional float score = 6;
12344
12345    // Position of this action.
12346    optional int32 action_index = 7;
12347
12348    // Name of source package.
12349    optional string package_name = 8;
12350}
12351
12352/**
12353 * Information about an OTA update attempt by update_engine.
12354 * Logged from platform/system/update_engine/metrics_reporter_android.cc
12355 */
12356message UpdateEngineUpdateAttemptReported {
12357    // The number of attempts for the update engine to apply a given payload.
12358    optional int32 attempt_number = 1;
12359
12360    optional android.stats.otaupdate.PayloadType payload_type = 2;
12361
12362    // The total time in minutes for the update engine to apply a given payload.
12363    // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
12364    // it's increased when the system is sleeping.
12365    optional int32 duration_boottime_in_minutes = 3;
12366
12367    // The total time in minutes for the update engine to apply a given payload.
12368    // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
12369    // and it's not increased when the system is sleeping.
12370    optional int32 duration_monotonic_in_minutes = 4;
12371
12372    // The size of the payload in MiBs.
12373    optional int32 payload_size_mib = 5;
12374
12375    // The attempt result reported by the update engine for an OTA update.
12376    optional android.stats.otaupdate.AttemptResult attempt_result = 6;
12377
12378    // The error code reported by the update engine after an OTA update attempt
12379    // on A/B devices.
12380    optional android.stats.otaupdate.ErrorCode error_code = 7;
12381
12382    // The build fingerprint of the source system. The value is read from a
12383    // system property when the device takes the update. e.g.
12384    // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
12385    optional string source_fingerprint = 8;
12386
12387    // Size of super partition.
12388    optional int64 super_partition_size_bytes = 9;
12389
12390    // Size of current slot within the super partition.
12391    optional int64 slot_size_bytes = 10;
12392
12393    // Free space available in the super partition.
12394    optional int64 super_free_space_bytes = 11;
12395
12396    // Whether the device enables Virtual A/B compression.
12397    optional bool vab_compression_enabled = 12;
12398
12399    // Whether this update attempt uses Virtual A/B compression.
12400    optional bool vab_compression_used = 13;
12401}
12402
12403/**
12404 * Information about all the attempts the device make before finishing the
12405 * successful update.
12406 * Logged from platform/system/update_engine/metrics_reporter_android.cc
12407 */
12408message UpdateEngineSuccessfulUpdateReported {
12409    // The number of attempts for the update engine to apply the payload for a
12410    // successful update.
12411    optional int32 attempt_count = 1;
12412
12413    optional android.stats.otaupdate.PayloadType payload_type = 2;
12414
12415    optional int32 payload_size_mib = 3;
12416
12417    // The total number of bytes downloaded by update_engine since the last
12418    // successful update.
12419    optional int32 total_bytes_downloaded_mib = 4;
12420
12421    // The ratio in percentage of the over-downloaded bytes compared to the
12422    // total bytes needed to successfully install the update. e.g. 200 if we
12423    // download 200MiB in total for a 100MiB package.
12424    optional int32 download_overhead_percentage = 5;
12425
12426    // The total time in minutes for the update engine to apply the payload for a
12427    // successful update.
12428    optional int32 total_duration_minutes = 6;
12429
12430    // The number of reboot of the device during a successful update.
12431    optional int32 reboot_count = 7;
12432
12433    // Whether on device verity computation is enabled
12434    optional bool fec_enabled = 8;
12435
12436    // Whether on device hash tree computation is enabled
12437    optional bool hash_tree_enabled = 9;
12438
12439}
12440
12441/**
12442 * Reported when a client requests to prepare for resume on reboot.
12443 *
12444 * Logged from:
12445 *   frameworks/base/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
12446 */
12447message RebootEscrowPreparationReported {
12448  enum Result {
12449    ROR_NEED_PREPARATION = 0;
12450    ROR_SKIP_PREPARATION_AND_NOTIFY = 1;
12451    ROR_SKIP_PREPARATION_NOT_NOTIFY = 2;
12452  }
12453
12454  // The uid of the client who requests ror.
12455  optional int32 requesting_uid = 1 [(is_uid) = true];
12456
12457  optional Result result = 2;
12458
12459  // The number of clients who has requested ror, including the current caller.
12460  optional int32 requested_client_count = 3;
12461}
12462
12463/**
12464 * Reported when the lock screen knowledge factor is captured, while there are clients of
12465 * resume on reboot to notify.
12466 *
12467 * Logged from:
12468 *   frameworks/base/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
12469 */
12470message RebootEscrowLskfCaptureReported {
12471  // The uid of the client to notify about the Lskf capture.
12472  optional int32 uid_to_notify = 1 [(is_uid) = true];
12473
12474  // The total number of clients who have requested ror.
12475  optional int32 requested_client_count = 2;
12476
12477  // The duration between RoR request - current LSKF capture event.
12478  optional int32 duration_ror_requested_to_lskf_captured_seconds = 3;
12479}
12480
12481/* Reported when a client (e.g. gmscore) requests to reboot with Resume on Reboot.
12482 *
12483 * Logged from:
12484 *   frameworks/base/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
12485 */
12486message RebootEscrowRebootReported {
12487  optional int32 error_code = 1;
12488
12489  // The uid of clients who requested the reboot
12490  optional int32 request_uid = 2 [(is_uid) = true];
12491
12492  // All clients that have prepared for RoR before this reboot
12493  optional int32 prepared_clients_count = 3;
12494
12495  // The RoR request count for the client who requests reboot.
12496  optional int32 request_count = 4;
12497
12498  // Whether the reboot request assumes a slot switch on a/b devices.
12499  optional bool slot_switch = 5;
12500
12501  // True if the DeviceConfig shows the device is using server based RoR.
12502  optional bool server_based = 6;
12503
12504  // The duration between last LSKF captured - reboot requests
12505  optional int32 duration_lskf_captured_to_reboot_seconds = 7;
12506
12507  // The count of LSKF captured since preparation
12508  optional int32 lskf_captured_counts = 8;
12509}
12510
12511/**
12512 * Logs stats for AppSearch function calls
12513 */
12514message AppSearchCallStatsReported {
12515    // The sampling interval for this specific type of stats
12516    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
12517    optional int32 sampling_interval = 1;
12518
12519    // # of previous skipped sample for this specific type of stats
12520    // We can't push atoms too closely, so some samples might be skipped
12521    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
12522    // For example, the true count of an event could be estimated as:
12523    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
12524    optional int32 num_skipped_sample = 2;
12525
12526    // Package UID of the application.
12527    optional int32 uid = 3 [(is_uid) = true];
12528
12529    // Hash of the database name within AppSearch
12530    optional int32 database = 4;
12531
12532    // The status code for the call or internal state.
12533    // Needs to be sync with AppSearchResult#ResultCode in
12534    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
12535    optional int32 status_code = 5;
12536
12537    // Overall time used for the end-to-end function call in AppSearch.
12538    // It doesn't include binder latency
12539    optional int32 total_latency_millis = 6;
12540
12541    // Type of the function call value is in sync with
12542    // frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/stats/CallStats.java
12543    optional int32 call_type = 7;
12544
12545    // Estimated binder latency (estimated as single-trip time * 2)
12546    optional int32 estimated_binder_latency_millis = 8;
12547
12548    // Number of operations succeeded for batch operations.
12549    optional int32 num_operations_succeeded = 9;
12550
12551    // Number of operations failed for batch operations.
12552    optional int32 num_operations_failed = 10;
12553
12554    // Number of actual API calls reported in this atom.
12555    optional int32 num_reported_calls = 11;
12556}
12557
12558/**
12559 * Logs detailed stats for putting a single document in AppSearch
12560 */
12561message AppSearchPutDocumentStatsReported {
12562    // The sampling interval for this specific type of stats
12563    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
12564    optional int32 sampling_interval = 1;
12565
12566    // # of previous skipped sample for this specific type of stats
12567    // We can't push atoms too closely, so some samples might be skipped
12568    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
12569    // For example, the true count of an event could be estimated as:
12570    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
12571    optional int32 num_skipped_sample = 2;
12572
12573    // Package UID of the application.
12574    optional int32 uid = 3 [(is_uid) = true];
12575
12576    // Hash of the database name within AppSearch
12577    optional int32 database = 4;
12578
12579    // Needs to be sync with AppSearchResult#ResultCode in
12580    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
12581    optional int32 status_code = 5;
12582
12583    // Overall time used for a put_document
12584    optional int32 total_latency_millis = 6;
12585
12586    // Time used to generate a document proto from a Bundle.
12587    optional int32 generate_document_proto_latency_millis = 7;
12588
12589    // Time used to rewrite types and namespaces in the document.
12590    optional int32 rewrite_document_types_latency_millis = 8;
12591
12592    // Overall time used for the native function call.
12593    optional int32 native_latency_millis = 9;
12594
12595    // Time used to store the document.
12596    optional int32 native_document_store_latency_millis = 10;
12597
12598    // Time used to index the document. It doesn't include the time to
12599    // merge indices.
12600    optional int32 native_index_latency_millis = 11;
12601
12602    // Time used to merge the indices.
12603    optional int32 native_index_merge_latency_millis = 12;
12604
12605    // Document size in bytes.
12606    optional int32 native_document_size_bytes = 13;
12607
12608    // Number of tokens added to the index.
12609    optional int32 native_num_tokens_indexed = 14;
12610
12611    // Whether the max number of tokens exceeded.
12612    optional bool native_exceeded_max_num_tokens = 15;
12613}
12614
12615/**
12616 * Logs detailed stats for AppSearch Initialize
12617 */
12618message AppSearchInitializeStatsReported {
12619    // The sampling interval for this specific type of stats
12620    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
12621    optional int32 sampling_interval = 1;
12622
12623    // # of previous skipped sample for this specific type of stats
12624    // We can't push atoms too closely, so some samples might be skipped
12625    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
12626    // For example, the true count of an event could be estimated as:
12627    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
12628    optional int32 num_skipped_sample = 2;
12629
12630    // Package UID of the application.
12631    optional int32 uid = 3 [(is_uid) = true];
12632
12633    // Initialize status code
12634    // Needs to be sync with AppSearchResult#ResultCode in
12635    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
12636    optional int32 status_code = 4;
12637
12638    // Overall time used for initialization, not including binder latency.
12639    optional int32 total_latency_millis = 5;
12640
12641    // Whether the initialize() detects desyncs.
12642    // Desync happens if we lose the visibility doc.
12643    optional bool has_desync = 6;
12644
12645    // Time used to read and process the schema and namespaces.
12646    optional int32 prepare_schema_and_namespaces_latency_millis = 7;
12647
12648    // Time used to read and process the visibility file.
12649    optional int32 prepare_visibility_file_latency_millis = 8;
12650
12651    // Overall time used for the native function call.
12652    optional int32 native_latency_millis = 9;
12653
12654    // Needs to be sync with RecoveryCause in google3/third_party/icing/proto/logging.proto
12655    optional int32 native_document_store_recovery_cause = 10;
12656
12657    // Needs to be sync with RecoveryCause in google3/third_party/icing/proto/logging.proto
12658    optional int32 native_index_restoration_cause = 11;
12659
12660    // Needs to be sync with RecoveryCause in google3/third_party/icing/proto/logging.proto
12661    optional int32 native_schema_store_recovery_cause = 12;
12662
12663    // Time used to recover the document store.
12664    optional int32 native_document_store_recovery_latency_millis = 13;
12665
12666    // Time used to restore the index.
12667    optional int32 native_index_restoration_latency_millis = 14;
12668
12669    // Time used to recover the schema store.
12670    optional int32 native_schema_store_recovery_latency_millis = 15;
12671
12672    // Needs to be sync with DocumentStoreDataStatus in google3/third_party/icing/proto/logging.proto
12673    optional int32 native_document_store_data_status = 16;
12674
12675    // Number of documents currently in document store. Those may
12676    // include alive, deleted, and expired documents.
12677    optional int32 native_num_documents = 17;
12678
12679    // Number of schema types currently in the schema store.
12680    optional int32 native_num_schema_types = 18;
12681
12682    // Whether we had to reset the index, losing all data, during initialization.
12683    optional bool has_reset = 19;
12684
12685    // The status code of the reset operation if has_reset is true.
12686    // Needs to be sync with AppSearchResult#ResultCode in
12687    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
12688    optional int32 reset_status_code = 20;
12689}
12690
12691/**
12692 * Logs detailed stats for querying in AppSearch
12693 */
12694message AppSearchQueryStatsReported {
12695    // The sampling interval for this specific type of stats
12696    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
12697    optional int32 sampling_interval = 1;
12698
12699    // # of previous skipped sample for this specific type of stats
12700    // We can't push atoms too closely, so some samples might be skipped
12701    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
12702    // For example, the true count of an event could be estimated as:
12703    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
12704    optional int32 num_skipped_sample = 2;
12705
12706    // Package UID of the application.
12707    optional int32 uid = 3 [(is_uid) = true];
12708
12709    // Hash of the database name within AppSearch
12710    optional int32 database = 4;
12711
12712    // Needs to be sync with AppSearchResult#ResultCode in
12713    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
12714    optional int32 status_code = 5;
12715
12716    // Overall time used for query including estimated binder latency
12717    optional int32 total_latency_millis = 6;
12718
12719    // Time used to rewrite the search spec.
12720    optional int32 rewrite_search_spec_latency_millis = 7;
12721
12722    // Time used to rewrite the search results.
12723    optional int32 rewrite_search_result_latency_millis = 8;
12724
12725    // Whether it is a global query.
12726    // Needs to be sync with QueryStats#VisibilityScope in
12727    // frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/stats/QueryStats.java
12728    optional int32 visibility_scope = 9;
12729
12730    // Overall time used for the native function call.
12731    optional int32 native_latency_millis = 10;
12732
12733    // Number of terms in the query string.
12734    optional int32 native_num_terms = 11;
12735
12736    // Length of the query string.
12737    optional int32 native_query_length = 12;
12738
12739    // Number of namespaces filtered.
12740    optional int32 native_num_namespaces_filtered = 13;
12741
12742    // Number of schema types filtered.
12743    optional int32 native_num_schema_types_filtered = 14;
12744
12745    // The requested number of results in one page.
12746    optional int32 native_requested_page_size = 15;
12747
12748    // The actual number of results returned in the current page.
12749    optional int32 native_num_results_returned_current_page = 16;
12750
12751    // Whether the function call is querying the first page. If it's
12752    // not, Icing will fetch the results from cache so that some steps
12753    // may be skipped.
12754    optional bool native_is_first_page = 17;
12755
12756    // Time used to parse the query, including 2 parts: tokenizing and
12757    // transforming tokens into an iterator tree.
12758    optional int32 native_parse_query_latency_millis = 18;
12759
12760    // Strategy of scoring and ranking.
12761    // Needs to be sync with RankingStrategy.Code in google3/third_party/icing/proto/scoring.proto
12762    optional int32 native_ranking_strategy = 19;
12763
12764    // Number of documents scored.
12765    optional int32 native_num_documents_scored = 20;
12766
12767    // Time used to score the raw results.
12768    optional int32 native_scoring_latency_millis = 21;
12769
12770    // Time used to rank the scored results.
12771    optional int32 native_ranking_latency_millis = 22;
12772
12773    // Time used to fetch the document protos. Note that it includes the
12774    // time to snippet if "native_num_results_with_snippets" is NOT zero.
12775    optional int32 native_document_retrieval_latency_millis = 23;
12776
12777    // How many snippets are calculated.
12778    optional int32 native_num_results_with_snippets = 24;
12779}
12780
12781/**
12782 * Logs detailed stats for remove in AppSearch
12783 */
12784message AppSearchRemoveStatsReported {
12785    // The sampling interval for this specific type of stats
12786    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
12787    optional int32 sampling_interval = 1;
12788
12789    // # of previous skipped sample for this specific type of stats
12790    // We can't push atoms too closely, so some samples might be skipped
12791    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
12792    // For example, the true count of an event could be estimated as:
12793    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
12794    optional int32 num_previous_skipped_sample = 2;
12795
12796    // Package UID of the application.
12797    optional int32 uid = 3 [(is_uid) = true];
12798
12799    // Hash of the database name within AppSearch
12800    optional int32 database = 4;
12801
12802    // Needs to be sync with AppSearchResult#ResultCode in
12803    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
12804    optional int32 status_code = 5;
12805
12806    // Overall time used for remove including the binder latency
12807    optional int32 total_latency_millis = 6;
12808
12809    // Overall time used for the native function call.
12810    optional int32 native_latency_millis = 7;
12811
12812    // Used to indicate what kind of delete(namespace, schemaType etc) calls deleteByQuery here.
12813    // Needs to be sync with external/icing/proto/icing/proto/logging.proto#DeleteStatsProto
12814    optional int32 native_delete_type = 8;
12815
12816    // Number of documents deleted by this call.
12817    optional int32 native_num_documents_deleted = 9;
12818}
12819
12820/**
12821 * Logs detailed stats for optimization in AppSearch.
12822 *
12823 * stats pushed from:
12824 *   frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
12825 *
12826 * Next tag: 14
12827 */
12828message AppSearchOptimizeStatsReported {
12829    // The sampling interval for this specific type of stats
12830    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
12831    optional int32 sampling_interval = 1;
12832
12833    // # of previous skipped sample for this specific type of stats
12834    // We can't push atoms too closely, so some samples might be skipped
12835    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
12836    // For example, the true count of an event could be estimated as:
12837    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
12838    optional int32 num_previous_skipped_sample = 2;
12839
12840    // Needs to be sync with AppSearchResult#ResultCode in
12841    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
12842    optional int32 status_code = 3;
12843
12844    // Overall time used for remove including the binder latency
12845    optional int32 total_latency_millis = 4;
12846
12847    // Overall time used for the native function call.
12848    optional int32 native_latency_millis = 5;
12849
12850    // Time used to optimize the document store in millis.
12851    optional int32 native_document_store_optimize_latency_millis = 6;
12852
12853    // Time used to restore the index in millis.
12854    optional int32 native_index_restoration_latency_millis = 7;
12855
12856    // Number of documents before the optimization.
12857    optional int32 native_num_original_documents = 8;
12858
12859    // Number of documents deleted during the optimization.
12860    optional int32 native_num_deleted_documents = 9;
12861
12862    // Number of documents expired during the optimization.
12863    optional int32 native_num_expired_documents = 10;
12864
12865    // Size of storage in bytes before the optimization.
12866    optional int64 native_storage_size_before_bytes = 11;
12867
12868    // Size of storage in bytes after the optimization.
12869    optional int64 native_storage_size_after_bytes = 12;
12870
12871    // The amount of time in millis since the last optimization ran.
12872    optional int64 native_time_since_last_optimize_millis = 13;
12873}
12874
12875/**
12876 * Logs detailed stats for setting schema in AppSearch.
12877 *
12878 * stats pushed from:
12879 *   frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
12880 *
12881 * Next tag: 20
12882 */
12883message AppSearchSetSchemaStatsReported {
12884    // The sampling interval for this specific type of stats
12885    // For example, sampling_interval=10 means that one out of every 10 stats was logged.
12886    optional int32 sampling_interval = 1;
12887
12888    // # of previous skipped sample for this specific type of stats
12889    // We can't push atoms too closely, so some samples might be skipped
12890    // In order to extrapolate the counts, we need to save the number of skipped stats and add it back
12891    // For example, the true count of an event could be estimated as:
12892    //   SUM(sampling_interval * (num_skipped_sample + 1)) as est_count
12893    optional int32 num_skipped_sample = 2;
12894
12895    // Package UID of the application.
12896    optional int32 uid = 3 [(is_uid) = true];
12897
12898    // Hash of the database name within AppSearch
12899    optional int32 database = 4;
12900
12901    // Needs to be sync with AppSearchResult#ResultCode in
12902    // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
12903    optional int32 status_code = 5;
12904
12905    // Overall time used for setting schema including the binder latency
12906    optional int32 total_latency_millis = 6;
12907
12908    // Number of newly added schema types
12909    optional int32 new_type_count = 7;
12910
12911    // Number of deleted schema types
12912    optional int32 deleted_type_count = 8;
12913
12914    // Number of compatible schema type changes
12915    optional int32 compatible_type_change_count = 9;
12916
12917    // Number of index-incompatible schema type changes
12918    optional int32 index_incompatible_type_change_count = 10;
12919
12920    // Number of backwards-incompatible schema type changes
12921    optional int32 backwards_incompatible_type_change_count = 11;
12922
12923    // Whether schema migration is executed during setting schema
12924    optional bool has_schema_migration = 12;
12925
12926    // Overall time used for getting schema during schema migration
12927    optional int32 schema_migration_get_schema_latency_millis = 13;
12928
12929    // Overall time used for querying and transforming documents during schema migration
12930    optional int32 schema_migration_query_and_transform_latency_millis = 14;
12931
12932    // Overall time used for first setSchema during schema migration
12933    optional int32 schema_migration_first_set_schema_latency_millis = 15;
12934
12935    // Overall time used for second setSchema during schema migration
12936    optional int32 schema_migration_second_set_schema_latency_millis = 16;
12937
12938    // Overall time used for saving documents during schema migration
12939    optional int32 schema_migration_save_document_latency_millis = 17;
12940
12941    // Number of migrated documents during schema migration
12942    optional int32 schema_migration_migrated_document_count = 18;
12943
12944    // Number of saved documents during schema migration
12945    optional int32 schema_migration_saved_document_count = 19;
12946}
12947
12948// Reports information in external/icing/proto/icing/proto/storage.proto#DocumentStorageInfoProto
12949// Next tag: 15
12950message AppSearchDocumentStorageInfo {
12951    // Total number of alive documents.
12952    optional int32 num_alive_documents = 1;
12953
12954    // Total number of deleted documents.
12955    optional int32 num_deleted_documents = 2;
12956
12957    // Total number of expired documents.
12958    optional int32 num_expired_documents = 3;
12959
12960    // Total size of the document store in bytes. Will be set to -1 if an IO error
12961    // is encountered while calculating this field.
12962    optional int64 document_store_size_bytes = 4;
12963
12964    // Total size of the ground truth in bytes. The ground truth may
12965    // include deleted or expired documents. Will be set to -1 if an IO error is
12966    // encountered while calculating this field.
12967    optional int64 document_log_size_bytes = 5;
12968
12969    // Size of the key mapper in bytes. Will be set to -1 if an IO error is
12970    // encountered while calculating this field.
12971    optional int64 key_mapper_size_bytes = 6;
12972
12973    // Size of the document id mapper in bytes. Will be set to -1 if an IO error
12974    // is encountered while calculating this field.
12975    optional int64 document_id_mapper_size_bytes = 7;
12976
12977    // Size of the score cache in bytes. Will be set to -1 if an IO error is
12978    // encountered while calculating this field.
12979    optional int64 score_cache_size_bytes = 8;
12980
12981    // Size of the filter cache in bytes. Will be set to -1 if an IO error is
12982    // encountered while calculating this field.
12983    optional int64 filter_cache_size_bytes = 9;
12984
12985    // Size of the corpus mapper in bytes. Will be set to -1 if an IO error is
12986    // encountered while calculating this field.
12987    optional int64 corpus_mapper_size_bytes = 10;
12988
12989    // Size of the corpus score cache in bytes. Will be set to -1 if an IO error
12990    // is encountered while calculating this field.
12991    optional int64 corpus_score_cache_size_bytes = 11;
12992
12993    // Size of the namespace id mapper in bytes. Will be set to -1 if an IO error
12994    // is encountered while calculating this field.
12995    optional int64 namespace_id_mapper_size_bytes = 12;
12996
12997    // Number of namespaces seen from the current documents.
12998    optional int32 num_namespaces = 13;
12999
13000    // Storage information of each namespace is not included due to that it has string field.
13001
13002    reserved 14;
13003}
13004
13005// Reports information in external/icing/proto/icing/proto/storage.proto#SchemaStoreStorageInfoProto
13006// Next tag: 5
13007message AppSearchSchemaStoreStorageInfo {
13008    // Size of the schema store in bytes. Will be set to -1 if an IO error is
13009    // encountered while calculating this field.
13010    optional int64 schema_store_size_bytes = 1;
13011
13012    // Total number of schema types.
13013    optional int32 num_schema_types = 2;
13014
13015    // Total number of all sections across all types
13016    optional int32 num_total_sections = 3;
13017
13018    // Total number of types at the current section limit.
13019    optional int32 num_schema_types_sections_exhausted = 4;
13020}
13021
13022// Reports information in external/icing/proto/icing/proto/storage.proto#IndexStorageInfoProto
13023// Next tag: 9
13024message AppSearchIndexStorageInfo {
13025    // Total size of the index in bytes. Will be set to -1 if an IO error is
13026    // encountered while calculating this field.
13027    optional int64 index_size_bytes = 1;
13028
13029    // Size of the lite index lexicon in bytes. Will be set to -1 if an IO error
13030    // is encountered while calculating this field.
13031    optional int64 lite_index_lexicon_size_bytes = 2;
13032
13033    // Size of the lite index hit buffer in bytes. Will be set to -1 if an IO
13034    // error is encountered while calculating this field.
13035    optional int64 lite_index_hit_buffer_size_bytes = 3;
13036
13037    // Size of the main index lexicon in bytes. Will be set to -1 if an IO error
13038    // is encountered while calculating this field.
13039    optional int64 main_index_lexicon_size_bytes = 4;
13040
13041    // Size of the main index storage in bytes. Will be set to -1 if an IO error
13042    // is encountered while calculating this field.
13043    optional int64 main_index_storage_size_bytes = 5;
13044
13045    // Size of one main index block in bytes.
13046    optional int64 main_index_block_size_bytes = 6;
13047
13048    // Number of main index blocks.
13049    optional int32 num_blocks = 7;
13050
13051    // Percentage of the main index blocks that are free, assuming
13052    // allocated blocks are fully used.
13053    optional float min_free_fraction = 8;
13054}
13055
13056/**
13057 * Pulls information about storage information per user from AppSearch
13058 *
13059 * Pulled from:
13060 *   frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
13061 *
13062 * Next tag: 6
13063 */
13064message AppSearchStorageInfo {
13065    // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
13066    // This is mainly used as a dimension for the metric, but it can also tell us if
13067    // the StorageInfo is for a primary user or secondary user.
13068    optional int32 user = 1;
13069
13070    // Total size of Icing’s storage in bytes. Will be set to -1 if an IO error is
13071    // encountered while calculating this field.
13072    optional int64 total_storage_size_bytes = 2;
13073
13074    // Storage information of the document store.
13075    optional AppSearchDocumentStorageInfo document_storage_info = 3
13076        [(android.os.statsd.log_mode) = MODE_BYTES];
13077
13078    // Storage information of the schema store.
13079    optional AppSearchSchemaStoreStorageInfo schema_store_storage_info = 4
13080        [(android.os.statsd.log_mode) = MODE_BYTES];
13081
13082    // Storage information of the index.
13083    optional AppSearchIndexStorageInfo index_storage_info = 5
13084        [(android.os.statsd.log_mode) = MODE_BYTES];
13085}
13086
13087
13088/**
13089 * Reported when AppSearch Contacts Indexer syncs the contacts data from CP2 to AppSearch
13090 *
13091 * Reported from:
13092 *   packages/modules/AppSearch/service/java/com/android/server/appsearch/contactsindexer/ContactsIndexerManagerService.java
13093 *
13094 * Next tag: 11
13095 */
13096message ContactsIndexerUpdateStatsReported {
13097    enum UpdateType {
13098      UNKNOWN = 0;
13099      DELTA = 1;
13100      FULL = 2;
13101    }
13102
13103    // Type of the update
13104    optional UpdateType update_type = 1;
13105
13106    // Latency for the update in millis
13107    optional int32 total_latency_millis = 2;
13108
13109    // Status code to indicate whether the insert new contacts, or update
13110    // existing contacts succeeds, or fails and why
13111    // In case of success, it only contains OK.
13112    // In case of failures, it contains all the possible errors we get.
13113    repeated int32 update_status_codes = 3;
13114
13115    // Status code to indicate whether the delete succeeds, or fails and why
13116    // In case of success, it only contains OK.
13117    // In case of failures, it contains all the possible errors we get.
13118    repeated int32 delete_status_codes = 4;
13119
13120    // Number of new contacts to be updated.
13121    optional int32 number_of_new_contacts_to_be_updated = 5;
13122
13123    // Number of old and new contacts has been successfully updated.
13124    optional int32 number_of_contacts_update_succeeded = 6;
13125
13126    // Number of old contacts has been successfully deleted.
13127    optional int32 number_of_contacts_delete_succeeded = 7;
13128
13129    // Number of old contacts skipped during this update due to no
13130    // significant change.
13131    optional int32 number_of_contacts_update_skipped = 8;
13132
13133    // Number of old and new contacts failed to be updated
13134    optional int32 number_of_contacts_update_failed = 9;
13135
13136    // Number of old contacts failed to be deleted
13137    optional int32 number_of_contacts_delete_failed = 10;
13138}
13139
13140/**
13141 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
13142 * key to indicate whether it was successful or not.
13143 *
13144 * Logged from:
13145 *   frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
13146 */
13147message RebootEscrowRecoveryReported {
13148    // Type of the resume on reboot backend provider.
13149    enum ServiceType {
13150        UNKNOWN = 0;
13151        HAL = 1;
13152        SERVER_BASED = 2;
13153    }
13154
13155    // Whether the vbmeta digest of the current slot matches a precomputed value before reboot.
13156    enum VbmetaDigestStatus {
13157        MATCH_EXPECTED_SLOT = 0;
13158        MATCH_FALLBACK_SLOT = 1;
13159        MISMATCH = 2;
13160    }
13161
13162    optional bool successful = 1;
13163    // The error code for escrow data recovery failure
13164    optional int32 error_code = 2;
13165
13166    optional ServiceType type = 3;
13167
13168    // Number of retries to unwrap the escrow key asynchronously.
13169    optional int32 get_escrow_key_retry_count = 4;
13170
13171    // The duration between storing of reboot escrow key ->
13172    // use of reboot escrow key to unlock CE after reboot
13173    optional int32 duration_escrow_key_storage_to_unlock_seconds = 5;
13174
13175    optional VbmetaDigestStatus vbmeta_digest_status = 6;
13176
13177    // The duration between boot complete -> CE unlock
13178    optional int32 duration_boot_complete_to_unlock_seconds = 7;
13179}
13180
13181/**
13182 * Global display pipeline metrics reported by SurfaceFlinger.
13183 * Metrics exist beginning in Android 11.
13184 * There is a copy of this proto in timestats_atoms.proto in SurfaceFlinger.
13185 * That proto must be updated if this atom is updated.
13186 *
13187 * Pulled from:
13188 *    frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
13189 */
13190message SurfaceflingerStatsGlobalInfo {
13191    // Aggregated refresh rate buckets that layers were presenting at. Buckets
13192    // are defined in SurfaceFlinger and are tracked per device.
13193    // Introduced in Android 12.
13194    // This is intended to be used as a dimenstion in collecting per-refresh rate
13195    // jank statistics.
13196    optional int32 display_refresh_rate_bucket = 18;
13197    // Aggregated render rate buckets that layers were overridden to run at.
13198    // Buckets are defined in SurfaceFlinger and are tracked per device.
13199    // Introduced in Android 12.
13200    // This is intended to be used as a dimension in collecting per-render rate
13201    // jank statistics.
13202    optional int32 render_rate_bucket = 21;
13203    // Total number of frames presented during the tracing period
13204    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13205    // using render_rate_bucket as a dimension.
13206    optional int64 total_frames = 1;
13207    // Total number of frames missed
13208    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13209    // using render_rate_bucket as a dimension.
13210    optional int64 missed_frames = 2;
13211    // Total number of frames that fell back to client composition
13212    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13213    // using render_rate_bucket as a dimension.
13214    optional int64 client_composition_frames = 3;
13215    // Total time the display was turned on
13216    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13217    // using render_rate_bucket as a dimension.
13218    optional int64 display_on_millis = 4;
13219    // Total time that was spent performing animations.
13220    // This is derived from the present-to-present layer histogram.
13221    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13222    // using render_rate_bucket as a dimension.
13223    optional int64 animation_millis = 5;
13224    // Total number of event connections tracked by SurfaceFlinger at the time
13225    // of this pull. If this number grows prohibitively large, then this can
13226    // cause jank due to resource contention.
13227    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13228    // using render_rate_bucket as a dimension.
13229    optional int32 event_connection_count = 6;
13230    // Set of timings measured from when SurfaceFlinger began compositing a
13231    // frame, until the frame was requested to be presented to the display. This
13232    // measures SurfaceFlinger's total CPU walltime on the critical path per
13233    // frame.
13234    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13235    // using render_rate_bucket as a dimension.
13236    optional FrameTimingHistogram frame_duration = 7
13237        [(android.os.statsd.log_mode) = MODE_BYTES];
13238    // Set of timings measured from when SurfaceFlinger first began using the
13239    // GPU to composite a frame, until the GPU has finished compositing that
13240    // frame. This measures the total additional time SurfaceFlinger needed to
13241    // perform due to falling back into GPU composition.
13242    // Note: This stat is not sliced by dimension. It will be duplicated for metrics
13243    // using render_rate_bucket as a dimension.
13244    optional FrameTimingHistogram render_engine_timing = 8
13245        [(android.os.statsd.log_mode) = MODE_BYTES];
13246    // Number of frames where SF saw a frame, based on its frame timeline.
13247    // Frame timelines may include transactions without updating buffer contents.
13248    // Introduced in Android 12.
13249    optional int32 total_timeline_frames = 9;
13250    // Number of frames where SF saw a janky frame.
13251    // Introduced in Android 12.
13252    optional int32 total_janky_frames = 10;
13253    // Number of janky frames where SF spent a long time on the CPU.
13254    // Introduced in Android 12.
13255    optional int32 total_janky_frames_with_long_cpu = 11;
13256    // Number of janky frames where SF spent a long time on the GPU.
13257    // Introduced in Android 12.
13258    optional int32 total_janky_frames_with_long_gpu = 12;
13259    // Number of janky frames where SF missed the frame deadline, but there
13260    // was not an attributed reason (e.g., maybe HWC missed?)
13261    // Introduced in Android 12.
13262    optional int32 total_janky_frames_sf_unattributed = 13;
13263    // Number of janky frames where the app missed the frame deadline, but
13264    // there was not an attributed reason
13265    // Introduced in Android 12.
13266    optional int32 total_janky_frames_app_unattributed = 14;
13267    // Number of janky frames that were caused because of scheduling errors in
13268    // SF that resulted in early present (e.g., SF sending a buffer to the
13269    // composition engine earlier than expected, resulting in a present that is
13270    // one vsync early)
13271    // Introduced in Android 12.
13272    optional int32 total_janky_frames_sf_scheduling = 15;
13273    // Number of frames that were classified as jank because of possible drift in
13274    // vsync predictions.
13275    // Introduced in Android 12.
13276    optional int32 total_jank_frames_sf_prediction_error = 16;
13277    // Number of janky frames where the app was in a buffer stuffed state (more
13278    // than one buffer ready to be presented at the same vsync). Usually caused
13279    // when the first frame is unusually long, the following frames enter into a
13280    // stuffed state.
13281    // Introduced in Android 12.
13282    optional int32 total_jank_frames_app_buffer_stuffing = 17;
13283    // Buckets of timings in ms by which SurfaceFlinger's deadline was missed
13284    // while latching and presenting frames.
13285    // Introduced in Android 12.
13286    optional FrameTimingHistogram sf_deadline_misses = 19
13287        [(android.os.statsd.log_mode) = MODE_BYTES];
13288    // Buckets of timings in ms by which the Vsync prediction drifted, when
13289    // compared to the actual hardware vsync.
13290    // Introduced in Android 12.
13291    optional FrameTimingHistogram sf_prediction_errors = 20
13292        [(android.os.statsd.log_mode) = MODE_BYTES];
13293
13294    // Next ID: 22
13295}
13296
13297/**
13298 * Per-layer display pipeline metrics reported by SurfaceFlinger.
13299 * Metrics exist beginning in Android 11.
13300 * The number of layers uploaded may be restricted due to size limitations.
13301 * There is a copy of this proto in timestats_atoms.proto in SurfaceFlinger.
13302 * That proto must be updated if this atom is updated.
13303 *
13304 * Pulled from:
13305 *    frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
13306 */
13307message SurfaceflingerStatsLayerInfo {
13308    // UID of the application who submitted this layer for presentation
13309    // This is intended to be used as a dimension for surfacing rendering
13310    // statistics to applications.
13311    // Introduced in Android 12.
13312    optional int32 uid = 12 [(is_uid) = true];
13313    // Refresh rate bucket that the layer was presenting at. Buckets are
13314    // defined in SurfaceFlinger and are tracked per device.
13315    // Introduced in Android 12.
13316    // This is intended to be used as a dimension in collecting per-refresh rate
13317    // jank statistics
13318    optional int32 display_refresh_rate_bucket = 22;
13319    // Render rate bucket that the layer was submitting frames at. Buckets are
13320    // defined in SurfaceFlinger and are tracked per device.
13321    // Introduced in Android 12.
13322    // This is intended to be used as a dimension in collecting per-render rate
13323    // jank statistics.
13324    optional int32 render_rate_bucket = 23;
13325
13326    // Game modes are used only for integrating with GameManager.
13327    enum GameMode {
13328         GAME_MODE_UNSPECIFIED = 0;
13329         GAME_MODE_UNSUPPORTED = 1;
13330         GAME_MODE_STANDARD = 2;
13331         GAME_MODE_PERFORMANCE = 3;
13332         GAME_MODE_BATTERY = 4;
13333    }
13334
13335    // Game mode that the layer was running at. Used to track user engagement
13336    // in different modes. The modes are defined in GameManager.java
13337    // All non-game layers will have this field set to UNSUPPORTED.
13338    // Introduced in Android 12
13339    // This is intended to be used as a dimension in collecting per-game mode
13340    // fps and frame related metrics.
13341    optional GameMode game_mode = 26;
13342    // The layer for this set of metrics
13343    // In many scenarios the package name is included in the layer name, e.g.,
13344    // layers created by Window Manager. But this is not a guarantee - in the
13345    // general case layer names are arbitrary debug names.
13346    optional string layer_name = 1;
13347    // Total number of frames presented
13348    optional int64 total_frames = 2;
13349    // Total number of dropped frames while latching a buffer for this layer.
13350    optional int64 dropped_frames = 3;
13351    // Set of timings measured between successive presentation timestamps.
13352    optional FrameTimingHistogram present_to_present = 4
13353        [(android.os.statsd.log_mode) = MODE_BYTES];
13354    // Set of timings measured from when an app queued a buffer for
13355    // presentation, until the buffer was actually presented to the
13356    // display.
13357    optional FrameTimingHistogram post_to_present = 5
13358        [(android.os.statsd.log_mode) = MODE_BYTES];
13359    // Set of timings measured from when a buffer is ready to be presented,
13360    // until the buffer was actually presented to the display.
13361    optional FrameTimingHistogram acquire_to_present = 6
13362        [(android.os.statsd.log_mode) = MODE_BYTES];
13363    // Set of timings measured from when a buffer was latched by
13364    // SurfaceFlinger, until the buffer was presented to the display
13365    optional FrameTimingHistogram latch_to_present = 7
13366        [(android.os.statsd.log_mode) = MODE_BYTES];
13367    // Set of timings measured from the desired presentation to the actual
13368    // presentation time
13369    optional FrameTimingHistogram desired_to_present = 8
13370        [(android.os.statsd.log_mode) = MODE_BYTES];
13371    // Set of timings measured from when an app queued a buffer for
13372    // presentation, until the buffer was ready to be presented.
13373    optional FrameTimingHistogram post_to_acquire = 9
13374        [(android.os.statsd.log_mode) = MODE_BYTES];
13375    // Frames missed latch because the acquire fence didn't fire
13376    optional int64 late_acquire_frames = 10;
13377    // Frames latched early because the desired present time was bad
13378    optional int64 bad_desired_present_frames = 11;
13379    // Number of frames where SF saw a frame, based on its frame timeline.
13380    // Frame timelines may include transactions without updating buffer contents.
13381    // Introduced in Android 12.
13382    optional int32 total_timeline_frames = 13;
13383    // Number of frames where SF saw a janky frame.
13384    // Introduced in Android 12.
13385    optional int32 total_janky_frames = 14;
13386    // Number of janky frames where SF spent a long time on the CPU.
13387    // Introduced in Android 12.
13388    optional int32 total_janky_frames_with_long_cpu = 15;
13389    // Number of janky frames where SF spent a long time on the GPU.
13390    // Introduced in Android 12.
13391    optional int32 total_janky_frames_with_long_gpu = 16;
13392    // Number of janky frames where SF missed the frame deadline, but there
13393    // was not an attributed reason (e.g., maybe HWC missed?)
13394    // Introduced in Android 12.
13395    optional int32 total_janky_frames_sf_unattributed = 17;
13396    // Number of janky frames where the app missed the frame deadline, but
13397    // there was not an attributed reason
13398    // Introduced in Android 12.
13399    optional int32 total_janky_frames_app_unattributed = 18;
13400    // Number of janky frames that were caused because of scheduling errors in
13401    // SF that resulted in early present (e.g., SF sending a buffer to the
13402    // composition engine earlier than expected, resulting in a present that is
13403    // one vsync early)
13404    // Introduced in Android 12.
13405    optional int32 total_janky_frames_sf_scheduling = 19;
13406    // Number of frames that were classified as jank because of possible drift in
13407    // vsync predictions.
13408    // Introduced in Android 12.
13409    optional int32 total_jank_frames_sf_prediction_error = 20;
13410    // Number of janky frames where the app was in a buffer stuffed state (more
13411    // than one buffer ready to be presented at the same vsync). Usually caused
13412    // when the first frame is unusually long, the following frames enter into a
13413    // stuffed state.
13414    // Introduced in Android 12.
13415    optional int32 total_jank_frames_app_buffer_stuffing = 21;
13416
13417    /**
13418     * Encapsulates the FrameRateVote information sent by the application while
13419     * calling setFrameRate.
13420     * Metrics exist beginning in Android 12.
13421     */
13422    message SetFrameRateVote {
13423        // The desired frame rate the application wishes to run on.
13424        optional float frame_rate = 1;
13425
13426        enum FrameRateCompatibility {
13427            FRAME_RATE_UNDEFINED = 0;
13428            FRAME_RATE_DEFAULT = 1;
13429            FRAME_RATE_EXACT_OR_MULTIPLE = 2;
13430        }
13431
13432        // Specifies how to interpret the frame rate associated with the layer.
13433        // Defined in Layer.h
13434        optional FrameRateCompatibility frame_rate_compatibility = 2;
13435
13436        enum Seamlessness {
13437            SEAMLESS_UNDEFINED = 0;
13438            SEAMLESS_SHOULD_BE_SEAMLESS = 1;
13439            SEAMLESS_NOT_REQUIRED = 2;
13440        }
13441        // Indicates whether seamless refresh rate switch is required or not.
13442        optional Seamlessness seamlessness = 3;
13443    }
13444
13445    // The last frame rate vote set by the application.
13446    // Introduced in Android 12.
13447    optional SetFrameRateVote set_frame_rate_vote = 24
13448        [(android.os.statsd.log_mode) = MODE_BYTES];
13449    // Buckets of timings in ms by which the app deadline was missed while
13450    // submitting work for a frame.
13451    // Introduced in Android 12.
13452    optional FrameTimingHistogram app_deadline_misses = 25
13453        [(android.os.statsd.log_mode) = MODE_BYTES];
13454
13455    // Next ID: 27
13456}
13457
13458/**
13459 * Histogram of frame counts bucketed by time in milliseconds.
13460 * Because of size limitations, we hard-cap the number of buckets, with
13461 * buckets for corresponding to larger milliseconds being less precise.
13462 */
13463message FrameTimingHistogram {
13464    // Timings in milliseconds that describes a set of histogram buckets
13465    repeated int32 time_millis_buckets = 1;
13466    // Number of frames that match to each time_millis, i.e. the bucket
13467    // contents
13468    // It's required that len(time_millis) == len(frame_count)
13469    repeated int64 frame_counts = 2;
13470}
13471
13472/**
13473 * Janky event as reported by SurfaceFlinger.
13474 * This event is intended to be consumed by a Perfetto subscriber for
13475 * automated trace collection.
13476 *
13477 * Logged from:
13478 *    frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
13479 */
13480message DisplayJankReported {
13481    // Informational field for how long the janky event lasted in milliseconds
13482    optional int64 event_duration_millis = 1;
13483    // Number of frame deadlines missed, where SurfaceFlinger failed to update
13484    // the display on time.
13485    optional int32 present_deadlines_missed = 2;
13486}
13487
13488message CameraStreamProto {
13489    // The stream width (in pixels)
13490    optional int32 width = 1;
13491    // The stream height (in pixels)
13492    optional int32 height = 2;
13493    // The format of the stream
13494    optional int32 format = 3;
13495    // The dataspace of the stream
13496    optional int32 data_space = 4;
13497    // The usage flag of the stream
13498    optional int64 usage = 5;
13499
13500    // The number of requests for this stream
13501    optional int64 request_count = 6;
13502    // The number of buffer error for this stream
13503    optional int64 error_count = 7;
13504    // The capture latency of first request for this stream
13505    optional int32 first_capture_latency_millis = 8;
13506
13507    // The maximum number of hal buffers
13508    optional int32 max_hal_buffers = 9;
13509    // The maximum number of app buffers
13510    optional int32 max_app_buffers = 10;
13511
13512    // Type of stream histogram
13513    // 1: Capture latency: bin size in milliseconds
13514    enum HistogramType {
13515        UNKNOWN = 0;
13516        CAPTURE_LATENCY = 1;
13517    }
13518    optional HistogramType histogram_type = 11;
13519    // The boundary values between histogram bins
13520    // Expected number of fields: 9
13521    repeated float histogram_bins = 12;
13522    // The frame counts for each histogram bins
13523    // Expected number of fields: 10
13524    repeated int64 histogram_counts = 13;
13525    // The dynamic range profile of the stream
13526    optional int64 dynamic_range_profile = 14;
13527    // The stream use case
13528    optional int64 stream_use_case = 15;
13529}
13530
13531/**
13532 * Information about camera facing and API level usage.
13533 * Logged from:
13534 *   frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
13535 */
13536message CameraActionEvent {
13537    // Camera session duration in milliseconds if action is SESSION.
13538    // 0 if action is OPEN or CLOSE.
13539    optional int64 duration_millis = 1;
13540
13541    // Camera API level used.
13542    // 1 for camera1 API, and 2 for camera2 API.
13543    optional int32 api_level = 2;
13544
13545    // Name of client package
13546    optional string package_name = 3;
13547
13548    // Camera facing
13549    enum Facing {
13550        UNKNOWN = 0;
13551        BACK = 1;
13552        FRONT = 2;
13553        EXTERNAL = 3;
13554    }
13555    optional Facing facing = 4;
13556
13557    // Camera ID
13558    optional string camera_id = 5;
13559
13560    // Camera action type
13561    enum Action {
13562        UNKNOWN_ACTION = 0;
13563        OPEN = 1;
13564        CLOSE = 2;
13565        SESSION = 3;
13566    }
13567    optional Action action = 6;
13568
13569    // Whether the client is accessing camera using ndk
13570    optional bool is_ndk = 7;
13571
13572    // Action OPEN: Open latency
13573    // Action CLOSE: Close latency
13574    // Action SESSION: Camera session creation duration.
13575    //                 If this entry is reusing an existing session, the value is -1.
13576    optional int32 latency_millis = 8;
13577
13578    // session type: 0 for normal mode, 1 for constrained high speed mode
13579    optional int32 operating_mode = 9;
13580
13581    // If actioh is SESSION: number of internal reconfigurations
13582    // Else: 0
13583    optional int32 internal_reconfig = 10;
13584
13585    // Number of requests for this capture session. Only applicable to SESSION
13586    // action.
13587    optional int64 request_count = 11;
13588    // Number of result errors. Only applicable to SESSION action.
13589    optional int64 result_error_count = 12;
13590    // Whether the device runs into error state.
13591    optional bool device_error = 13;
13592
13593    // If action is SESSION: Stream states
13594    // Else: stream_count = 0
13595    optional int32 stream_count = 14;
13596    optional CameraStreamProto stream_1 = 15 [(log_mode) = MODE_BYTES];
13597    optional CameraStreamProto stream_2 = 16 [(log_mode) = MODE_BYTES];
13598    optional CameraStreamProto stream_3 = 17 [(log_mode) = MODE_BYTES];
13599    optional CameraStreamProto stream_4 = 18 [(log_mode) = MODE_BYTES];
13600    optional CameraStreamProto stream_5 = 19 [(log_mode) = MODE_BYTES];
13601
13602    // User tag string for this session
13603    optional string user_tag = 20;
13604
13605    // Video stabilization mode
13606    // Original type: uint8_t
13607    optional int32 video_stabilization_mode = 21 [default = -1];
13608}
13609
13610/**
13611 * Logs when a compatibility change is affecting an app.
13612 *
13613 * Logged from:
13614 *   frameworks/base/core/java/android/app/AppCompatCallbacks.java and
13615 *   frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
13616 */
13617message AppCompatibilityChangeReported {
13618    // The UID of the app being affected by the compatibilty change.
13619    optional int32 uid = 1 [(is_uid) = true];
13620
13621    // The ID of the change affecting the app.
13622    optional int64 change_id = 2;
13623
13624    enum State {
13625        UNKNOWN_STATE = 0;
13626        ENABLED = 1;
13627        DISABLED = 2;
13628        LOGGED = 3;
13629    }
13630
13631    // The state of the change - if logged from gating whether it was enabled or disabled, or just
13632    // logged otherwise.
13633    optional State state = 3;
13634
13635    enum Source {
13636        UNKNOWN_SOURCE = 0;
13637        APP_PROCESS = 1;
13638        SYSTEM_SERVER = 2;
13639    }
13640
13641    // Where it was logged from.
13642    optional Source source = 4;
13643
13644}
13645
13646/**
13647 * Logged from
13648 *     external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
13649 *     external/perfetto/src/tracing/service/tracing_service_impl.cc
13650 */
13651message PerfettoUploaded {
13652    // TODO(lalitm): many of the atoms below should be renamed to have a
13653    // "PERFETTO_CMD" prefix to make clear they are specific to perfetto_cmd.
13654    // This state exists because of legacy reasons (i.e. these values existed
13655    // before go/perfetto-monitoring was a thing).
13656    // Next id: 52.
13657    enum Event {
13658        PERFETTO_UNDEFINED = 0;
13659
13660        // Checkpoints inside perfetto_cmd before tracing is finished.
13661        PERFETTO_TRACE_BEGIN = 1;
13662        PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
13663        PERFETTO_ON_CONNECT = 3;
13664
13665        // Guardrails inside perfetto_cmd before tracing is finished.
13666        PERFETTO_ON_TIMEOUT = 16;
13667        PERFETTO_CMD_USER_BUILD_TRACING_NOT_ALLOWED = 43;
13668        PERFETTO_CMD_FAILED_TO_INIT_GUARDRAIL_STATE = 44;
13669        PERFETTO_CMD_INVALID_GUARDRAIL_STATE = 45;
13670        PERFETTO_CMD_HIT_UPLOAD_LIMIT = 46;
13671
13672        // Checkpoints inside traced.
13673        PERFETTO_TRACED_ENABLE_TRACING = 37;
13674        PERFETTO_TRACED_START_TRACING = 38;
13675        PERFETTO_TRACED_DISABLE_TRACING = 39;
13676        PERFETTO_TRACED_NOTIFY_TRACING_DISABLED = 40;
13677
13678        // Trigger checkpoints inside traced.
13679        // These atoms are special because, along with the UUID,
13680        // they log the trigger name.
13681        PERFETTO_TRACED_TRIGGER_START_TRACING = 41;
13682        PERFETTO_TRACED_TRIGGER_STOP_TRACING = 42;
13683
13684        // Guardrails inside traced.
13685        PERFETTO_TRACED_ENABLE_TRACING_EXISTING_TRACE_SESSION = 18;
13686        PERFETTO_TRACED_ENABLE_TRACING_TOO_LONG_TRACE = 19;
13687        PERFETTO_TRACED_ENABLE_TRACING_INVALID_TRIGGER_TIMEOUT = 20;
13688        PERFETTO_TRACED_ENABLE_TRACING_DURATION_WITH_TRIGGER = 21;
13689        PERFETTO_TRACED_ENABLE_TRACING_STOP_TRACING_WRITE_INTO_FILE = 22;
13690        PERFETTO_TRACED_ENABLE_TRACING_DUPLICATE_TRIGGER_NAME = 23;
13691        PERFETTO_TRACED_ENABLE_TRACING_INVALID_DEFERRED_START = 24;
13692        PERFETTO_TRACED_ENABLE_TRACING_INVALID_BUFFER_SIZE = 25;
13693        PERFETTO_TRACED_ENABLE_TRACING_BUFFER_SIZE_TOO_LARGE = 26;
13694        PERFETTO_TRACED_ENABLE_TRACING_TOO_MANY_BUFFERS = 27;
13695        PERFETTO_TRACED_ENABLE_TRACING_DUPLICATE_SESSION_NAME = 28;
13696        PERFETTO_TRACED_ENABLE_TRACING_SESSION_NAME_TOO_RECENT = 29;
13697        PERFETTO_TRACED_ENABLE_TRACING_TOO_MANY_SESSIONS_FOR_UID = 30;
13698        PERFETTO_TRACED_ENABLE_TRACING_TOO_MANY_CONCURRENT_SESSIONS = 31;
13699        PERFETTO_TRACED_ENABLE_TRACING_INVALID_FD_OUTPUT_FILE = 32;
13700        PERFETTO_TRACED_ENABLE_TRACING_FAILED_TO_CREATE_FILE = 33;
13701        PERFETTO_TRACED_ENABLE_TRACING_OOM = 34;
13702        PERFETTO_TRACED_ENABLE_TRACING_UNKNOWN_ERROR = 35;
13703        PERFETTO_TRACED_START_TRACING_INVALID_SESSION_STATE = 36;
13704        PERFETTO_TRACED_ENABLE_TRACING_INVALID_FILTER = 47;
13705        PERFETTO_TRACED_ENABLE_TRACING_OOB_TARGET_BUFFER = 48;
13706
13707        // Checkpoints inside perfetto_cmd after tracing has finished.
13708        PERFETTO_ON_TRACING_DISABLED = 4;
13709        PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
13710        PERFETTO_CMD_FW_REPORT_BEGIN = 49;
13711        // Will be removed once incidentd is no longer used.
13712        PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
13713
13714        // Guardrails inside perfetto_cmd after tracing has finished.
13715        PERFETTO_CMD_FW_REPORT_EMPTY_TRACE = 50;
13716        // Will be removed once incidentd is no longer used.
13717        PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
13718        PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
13719
13720        // "Successful" terminal states inside perfetto_cmd.
13721        PERFETTO_CMD_FW_REPORT_HANDOFF = 51;
13722
13723        // Deprecated as "success" is misleading; it simply means we were
13724        // able to communicate with incidentd. Will be removed once
13725        // incidentd is no longer used.
13726        PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9 [deprecated = true];
13727
13728        // Contained trigger begin/success/failure. Replaced by
13729        // |PerfettoTriggerAtom| to allow aggregation using a count metric
13730        // and reduce spam.
13731        reserved 12, 13, 14;
13732
13733        // Contained that a guardrail in perfetto_cmd was hit. Replaced with
13734        // kCmd* guardrails.
13735        reserved 15;
13736
13737        // Contained status of Dropbox uploads. Removed as Perfetto no
13738        // longer supports uploading traces using Dropbox.
13739        reserved 5, 6, 7;
13740    }
13741
13742    // Which stage of the pipeline we are reporting from.
13743    optional Event event = 1;
13744
13745    // UUID matching the one set inside the SystemInfo trace packet.
13746    optional int64 trace_uuid_lsb = 2;
13747    optional int64 trace_uuid_msb = 3;
13748
13749    // For trigger checkpoints inside traced, contains the trigger name
13750    // associated with this trace UUID.
13751    optional string trigger_name = 4;
13752}
13753
13754/**
13755 * Logged from
13756 *     external/perfetto/src/tracing/service/tracing_service_impl.cc
13757 */
13758message PerfettoTrigger {
13759    enum Event {
13760        PERFETTO_UNDEFINED = 0;
13761
13762        PERFETTO_CMD_TRIGGER = 1;
13763        PERFETTO_CMD_TRIGGER_FAIL = 2;
13764
13765        PERFETTO_TRIGGER_PERFETTO_TRIGGER = 3;
13766        PERFETTO_TRIGGER_PERFETTO_TRIGGER_FAIL = 4;
13767
13768        PERFETTO_TRACED_LIMIT_PROBABILITY = 5;
13769        PERFETTO_TRACED_LIMIT_MAX_PER_24_H = 6;
13770
13771        PERFETTO_PROBES_PRODUCER_TRIGGER = 7;
13772        PERFETTO_PROBES_PRODUCER_TRIGGER_FAIL = 8;
13773    }
13774
13775    // The event which fired.
13776    optional Event event = 1;
13777
13778    // The name of the trigger which fired.
13779    optional string trigger_name = 2;
13780}
13781
13782/**
13783 * Pulls client metrics on data transferred via Vehicle Maps Service.
13784 * Metrics are keyed by uid + layer.
13785 *
13786 * Pulled from:
13787 *   packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
13788 */
13789message VmsClientStats {
13790    // UID of the VMS client app
13791    optional int32 uid = 1 [(is_uid) = true];
13792
13793    // VMS layer definition
13794    optional int32 layer_type = 2;
13795    optional int32 layer_channel = 3;
13796    optional int32 layer_version = 4;
13797
13798    // Bytes and packets sent by the client for the layer
13799    optional int64 tx_bytes = 5;
13800    optional int64 tx_packets = 6;
13801
13802    // Bytes and packets received by the client for the layer
13803    optional int64 rx_bytes = 7;
13804    optional int64 rx_packets = 8;
13805
13806    // Bytes and packets dropped due to client error
13807    optional int64 dropped_bytes = 9;
13808    optional int64 dropped_packets = 10;
13809}
13810
13811/**
13812 * State of a all permission requested by a package - sampled
13813 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
13814*/
13815message DangerousPermissionStateSampled {
13816    // Name of the permission
13817    optional string permission_name = 1;
13818
13819    // Uid of the package
13820    optional int32 uid = 2 [(is_uid) = true];
13821
13822    // If the permission is granted to the uid
13823    optional bool is_granted = 3;
13824
13825    // Permission flags as per android.content.pm.PermissionFlags
13826    optional int32 permission_flags = 4;
13827
13828    // Permission protection flags as per android.content.pm.PermissionInfo.ProtectionFlags
13829    optional int32 protection_flags = 5;
13830}
13831
13832/**
13833 * HWUI stats for a given app.
13834 */
13835message GraphicsStats {
13836    // The package name of the app
13837    optional string package_name = 1;
13838
13839    // The version code of the app
13840    optional int64 version_code = 2;
13841
13842    // The start & end timestamps in UTC as
13843    // milliseconds since January 1, 1970
13844    // Compatible with java.util.Date#setTime()
13845    optional int64 start_millis = 3;
13846
13847    optional int64 end_millis = 4;
13848
13849    // HWUI renders pipeline type: GL (1) or Vulkan (2).
13850    enum PipelineType {
13851        UNKNOWN = 0;
13852        GL = 1;
13853        VULKAN = 2;
13854    }
13855
13856    // HWUI renders pipeline type: GL or Vulkan.
13857    optional PipelineType pipeline = 5;
13858
13859    // Distinct frame count.
13860    optional int32 total_frames = 6;
13861
13862    // Number of "missed vsync" events.
13863    optional int32 missed_vsync_count = 7;
13864
13865    // Number of frames in triple-buffering scenario (high input latency)
13866    optional int32 high_input_latency_count = 8;
13867
13868    // Number of "slow UI thread" events.
13869    optional int32 slow_ui_thread_count = 9;
13870
13871    // Number of "slow bitmap upload" events.
13872    optional int32 slow_bitmap_upload_count = 10;
13873
13874    // Number of "slow draw" events.
13875    optional int32 slow_draw_count = 11;
13876
13877    // Number of frames that missed their deadline (aka, visibly janked)
13878    optional int32 missed_deadline_count = 12;
13879
13880    // The frame time histogram for the package
13881    optional FrameTimingHistogram cpu_histogram = 13
13882    [(android.os.statsd.log_mode) = MODE_BYTES];
13883
13884    // The gpu frame time histogram for the package
13885    optional FrameTimingHistogram gpu_histogram = 14
13886    [(android.os.statsd.log_mode) = MODE_BYTES];
13887
13888    // UI mainline module version.
13889    optional int64 version_ui_module = 15;
13890
13891    // If true, these are HWUI stats for up to a 24h period for a given app from today.
13892    // If false, these are HWUI stats for a 24h period for a given app from the last complete
13893    // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
13894    // more apps are running / rendering.
13895    optional bool is_today = 16;
13896}
13897
13898/**
13899 * Message related to dangerous (runtime) app ops access
13900 */
13901message RuntimeAppOpAccess {
13902    // Uid of the package accessing app op
13903    optional int32 uid = 1 [(is_uid) = true];
13904
13905    // Name of the package accessing app op
13906    optional string package_name = 2;
13907
13908    // deprecated - set to empty string
13909    optional string op_deprecated = 3 [deprecated = true];
13910
13911    // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
13912    // API. Attributions must be provided through manifest using <attribution> tag available in R
13913    // and above.
13914    optional string attribution_tag = 4;
13915
13916    // message related to app op access, limited to 600 chars by API
13917    optional string message = 5;
13918
13919    enum SamplingStrategy {
13920        DEFAULT = 0;
13921        UNIFORM = 1;
13922        RARELY_USED = 2;
13923        BOOT_TIME_SAMPLING = 3;
13924        UNIFORM_OPS = 4;
13925    }
13926
13927    // sampling strategy used to collect this message
13928    optional SamplingStrategy sampling_strategy = 6;
13929
13930    // operation id
13931    optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
13932}
13933
13934/*
13935 * Logs userspace reboot outcome and duration.
13936 *
13937 * Logged from:
13938 *   frameworks/base/core/java/com/android/server/BootReceiver.java
13939 */
13940message UserspaceRebootReported {
13941    // Possible outcomes of userspace reboot.
13942    enum Outcome {
13943        // Default value in case platform failed to determine the outcome.
13944        OUTCOME_UNKNOWN = 0;
13945        // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
13946        SUCCESS = 1;
13947        // Userspace reboot shutdown sequence was aborted.
13948        FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
13949        // Remounting userdata into checkpointing mode failed.
13950        FAILED_USERDATA_REMOUNT = 3;
13951        // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
13952        // reboot.
13953        FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
13954    }
13955    // Outcome of userspace reboot. Always set.
13956    optional Outcome outcome = 1;
13957    // Duration of userspace reboot in case it has a successful outcome.
13958    // Duration is measured as time between userspace reboot was initiated and until boot completed
13959    // (e.g. sys.boot_completed=1).
13960    optional int64 duration_millis = 2;
13961    // State of primary user's (user0) credential encryption storage.
13962    enum UserEncryptionState {
13963        // Default value.
13964        USER_ENCRYPTION_STATE_UNKNOWN = 0;
13965        // Credential encrypted storage is unlocked.
13966        UNLOCKED = 1;
13967        // Credential encrypted storage is locked.
13968        LOCKED = 2;
13969    }
13970    // State of primary user's encryption storage at the moment boot completed. Always set.
13971    optional UserEncryptionState user_encryption_state = 3;
13972}
13973
13974/*
13975 * Logs integrity check information during each install.
13976 *
13977 * Logged from:
13978 *   frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
13979 */
13980message IntegrityCheckResultReported {
13981    optional string package_name = 1;
13982    optional string app_certificate_hash = 2;
13983    optional int64 version_code = 3;
13984    optional string installer_package_name = 4;
13985    enum Response {
13986        UNKNOWN = 0;
13987        ALLOWED = 1;
13988        REJECTED = 2;
13989        FORCE_ALLOWED = 3;
13990    }
13991    optional Response response = 5;
13992    // An estimate on the cause of the response. This will only be populated for
13993    // REJECTED and FORCE_ALLOWED
13994    optional bool caused_by_app_cert_rule = 6;
13995    optional bool caused_by_installer_rule = 7;
13996}
13997
13998/**
13999 * Logs the information about the rules and the provider whenever rules are
14000 * pushed into AppIntegrityManager.
14001 *
14002 * Logged from:
14003 *   frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
14004 */
14005message IntegrityRulesPushed {
14006    optional bool success = 1;
14007    // Package name of the app that pushed the rules.
14008    optional string rule_provider = 2;
14009    // Version string of arbitrary format provided by the rule provider to
14010    // identify the rules.
14011    optional string rule_version = 3;
14012}
14013
14014/**
14015 * Logs when a cell broadcast message is received on the device.
14016 *
14017 * Logged from Cell Broadcast module and platform:
14018 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
14019 *   packages/apps/CellBroadcastReceiver/
14020 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
14021 */
14022message CellBroadcastMessageReported {
14023    // The type of Cell Broadcast message
14024    enum CbType {
14025        UNKNOWN_TYPE = 0;
14026        GSM = 1;
14027        CDMA = 2;
14028        CDMA_SPC = 3;
14029    }
14030
14031    // The parts of the cell broadcast message pipeline
14032    enum ReportSource {
14033        UNKNOWN_SOURCE = 0;
14034        FRAMEWORK = 1;
14035        CB_SERVICE = 2;
14036        CB_RECEIVER_APP = 3;
14037    }
14038
14039    // GSM, CDMA, CDMA-SCP
14040    optional CbType type = 1;
14041
14042    // The source of the report
14043    optional ReportSource source = 2;
14044}
14045
14046/**
14047 * Logs when a cell broadcast message is filtered out, or otherwise intentionally not sent to CBR.
14048 *
14049 * Logged from CellBroadcastService module:
14050 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
14051 */
14052message CellBroadcastMessageFiltered {
14053    enum FilterReason {
14054        NOT_FILTERED = 0;
14055        DUPLICATE_MESSAGE = 1;
14056        GEOFENCED_MESSAGE = 2;
14057        AREA_INFO_MESSAGE = 3;
14058        DISABLED_BY_OEM = 4;
14059    }
14060
14061    // GSM, CDMA, CDMA-SCP
14062    optional CellBroadcastMessageReported.CbType type = 1;
14063
14064    // The source of the report
14065    optional FilterReason filter = 2;
14066}
14067
14068/**
14069 * Logs when an error occurs while handling a cell broadcast message;
14070 *
14071 * Logged from CellBroadcastService module:
14072 *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
14073 */
14074message CellBroadcastMessageError {
14075    // The type of error raised when trying to handle a cell broadcast message
14076    enum ErrorType {
14077        UNKNOWN_TYPE = 0;
14078        CDMA_DECODING_ERROR = 1;
14079        CDMA_SCP_EMPTY = 2;
14080        CDMA_SCP_HANDLING_ERROR = 3;
14081        GSM_INVALID_HEADER_LENGTH = 4;
14082        GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
14083        GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
14084        GSM_INVALID_PDU = 7;
14085        GSM_INVALID_GEO_FENCING_DATA = 8;
14086        GSM_UMTS_INVALID_WAC = 9;
14087        FAILED_TO_INSERT_TO_DB = 10;
14088        UNEXPECTED_GEOMETRY_FROM_FWK = 11;
14089        UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
14090        UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
14091        UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
14092        NO_CONNECTION_TO_CB_SERVICE = 15;
14093    }
14094
14095    // What kind of error occurred
14096    optional ErrorType type = 1;
14097
14098    // Exception message (or log message) associated with the error (max 1000 chars)
14099    optional string exception_message = 2;
14100}
14101
14102/**
14103 * Logs when a TV Input Service Session changes tune state
14104 * This is atom ID 327.
14105 *
14106 * Logged from:
14107 *   frameworks/base/services/core/java/com/android/server/tv/TvInputManagerService.java
14108 */
14109message TifTuneStateChanged {
14110
14111    // Tv Input Service uid, TV Player uid
14112    repeated AttributionNode attribution_node = 1 [
14113        (state_field_option).primary_field_first_uid = true
14114    ];
14115    optional android.stats.tv.TifTuneState state = 2 [
14116        (state_field_option).exclusive_state = true,
14117        (state_field_option).default_state_value = 0,
14118        (state_field_option).nested = false
14119    ];
14120    // This a globally unique 128 bit random number created by TvInputManagerService when
14121    // android.media.tv.TvInputManager#createSession is called.
14122    // It is has no device or user association.
14123    // See android.media.tv.TvInputService.onCreateSession(java.lang.String, java.lang.String)
14124    // WARNING: Any changes to this field should be carefully reviewed for privacy.
14125    //          Inspect the code at
14126    //          framework/base/cmds/statsd/src/atoms.proto
14127    //               TifTuneState
14128    //          frameworks/base/services/core/java/com/android/server/tv/TvInputManagerService.java
14129    //              logTuneStateChanged
14130    //              BinderService.createSession
14131    //              SessionState.sessionId
14132    optional string tif_session_id = 3 [(state_field_option).primary_field = true];
14133    optional android.stats.tv.TifInputType type = 4;
14134    // The id of this TV Input, only unique to a given TV Input Service.
14135    // This is specifically NOT android.media.tv.TvInputInfo.getId()
14136    // which is a string that contains the package name of its TvInputService.
14137    optional int32 input_id = 5  [(state_field_option).primary_field = true];
14138    // The HDMI port id
14139    // Only valid when type == HDMI
14140    optional int32 hdmi_port = 6  [(state_field_option).primary_field = true];
14141}
14142
14143/**
14144 * Logs when a tune occurs through device's Frontend.
14145 * This is atom ID 276.
14146 *
14147 * Logged from:
14148 *   frameworks/base/media/java/android/media/tv/tuner/Tuner.java
14149 */
14150message TvTunerStateChanged {
14151    enum State {
14152        UNKNOWN = 0;
14153        TUNING = 1; // Signal is tuned
14154        LOCKED = 2;    // the signal is locked
14155        NOT_LOCKED = 3; // the signal isn’t locked.
14156        SIGNAL_LOST = 4; // the signal was locked, but is lost now.
14157        SCANNING = 5; // the signal is scanned
14158        SCAN_STOPPED = 6; // the scan is stopped.
14159    }
14160    // The uid of the application that sent this custom atom.
14161    optional int32 uid = 1 [(is_uid) = true];
14162    //  new state
14163    optional State state = 2;
14164}
14165
14166/**
14167 * Logs the status of a dvr playback or record.
14168 * This is atom ID 279.
14169 *
14170 * Logged from:
14171 *   frameworks/base/media/java/android/media/tv/tuner/dvr
14172 */
14173message TvTunerDvrStatus {
14174    enum Type {
14175        UNKNOWN_TYPE = 0;
14176        PLAYBACK = 1; // is a playback
14177        RECORD = 2; // is a record
14178    }
14179    enum State {
14180        UNKNOWN_STATE = 0;
14181        STARTED = 1; // DVR is started
14182        STOPPED = 2; // DVR is stopped
14183    }
14184    // The uid of the application that sent this custom atom.
14185    optional int32 uid = 1 [(is_uid) = true];
14186    // DVR type
14187    optional Type type = 2;
14188    //  DVR state
14189    optional State state = 3;
14190    //  Identify the segment of a record or playback
14191    optional int32 segment_id = 4;
14192    // indicate how many overflow or underflow happened between started to stopped
14193    optional int32 overflow_underflow_count = 5;
14194}
14195
14196/**
14197 * Logs when a cas session opened through MediaCas.
14198 * This is atom ID 280.
14199 *
14200 * Logged from:
14201 *   frameworks/base/media/java/android/media/MediaCas.java
14202 */
14203message TvCasSessionOpenStatus {
14204    enum State {
14205        UNKNOWN = 0;
14206        SUCCEEDED = 1; // indicate that the session is opened successfully.
14207        FAILED = 2; // indicate that the session isn’t opened successfully.
14208    }
14209    // The uid of the application that sent this custom atom.
14210    optional int32 uid = 1 [(is_uid) = true];
14211    //  Cas system Id
14212    optional int32 cas_system_id = 2;
14213    // State of the session
14214    optional State state = 3;
14215}
14216
14217/**
14218 * Logs for ContactsProvider general usage.
14219 * This is atom ID 301.
14220 *
14221 * Logged from:
14222 *   packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
14223 */
14224message ContactsProviderStatusReported {
14225    enum ApiType {
14226        UNKNOWN_API = 0;
14227        QUERY = 1;
14228        // INSERT includes insert and bulkInsert, and inserts triggered by applyBatch.
14229        INSERT = 2;
14230        // UPDATE and DELETE includes update/delete and the ones triggered by applyBatch.
14231        UPDATE = 3;
14232        DELETE = 4;
14233        CALL = 5;
14234    }
14235
14236    // Method called for ApiType.CALL
14237    enum MethodCall {
14238        UNKNOWN_METHOD = 0;
14239        ADD_SIM_ACCOUNTS = 1;
14240        REMOVE_SIM_ACCOUNTS = 2;
14241        GET_SIM_ACCOUNTS = 3;
14242    }
14243
14244    enum ResultType {
14245        UNKNOWN_RESULT = 0;
14246        SUCCESS = 1;
14247        FAIL = 2;
14248        ILLEGAL_ARGUMENT = 3;
14249        UNSUPPORTED_OPERATION = 4;
14250    }
14251
14252    enum CallerType {
14253        UNSPECIFIED_CALLER_TYPE = 0;
14254        CALLER_IS_SYNC_ADAPTER = 1;
14255        CALLER_IS_NOT_SYNC_ADAPTER = 2;
14256    }
14257
14258    enum TaskType {
14259        UNKNOWN_TASK = 0;
14260        DANGLING_CONTACTS_CLEANUP_TASK = 1;
14261    }
14262
14263    optional ApiType api_type = 1;
14264    // Defined in
14265    // packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
14266    optional int32 uri_type = 2;
14267    optional CallerType caller_type = 3;
14268    optional ResultType result_type = 4;
14269    optional int32 result_count = 5;
14270    optional int64 latency_micros = 6;
14271    optional TaskType task_type = 7;
14272    // Set when api_type == CALL
14273    optional MethodCall method_called = 8;
14274}
14275
14276/**
14277 * Logs when an app is frozen or unfrozen.
14278 *
14279 * Logged from:
14280 *   frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
14281 */
14282message AppFreezeChanged {
14283    // The type of event.
14284    enum Action {
14285        UNKNOWN = 0;
14286        FREEZE_APP = 1;
14287        UNFREEZE_APP = 2;
14288    }
14289    optional Action action = 1;
14290
14291    // Pid of the process being frozen.
14292    optional int32 pid = 2;
14293
14294    // Name of the process being frozen.
14295    optional string process_name = 3;
14296
14297    // Time since last unfrozen.
14298    optional int64 time_unfrozen_millis = 4;
14299
14300    // The list of reason should be kept in sync with @OomAdjReason in OomAdjuster.java.
14301    enum OomAdjReason {
14302        NONE = 0;
14303        ACTIVITY = 1;
14304        FINISH_RECEIVER = 2;
14305        START_RECEIVER = 3;
14306        BIND_SERVICE = 4;
14307        UNBIND_SERVICE = 5;
14308        START_SERVICE = 6;
14309        GET_PROVIDER = 7;
14310        REMOVE_PROVIDER = 8;
14311        UI_VISIBILITY = 9;
14312        ALLOWLIST = 10;
14313        PROCESS_BEGIN = 11;
14314        PROCESS_END = 12;
14315    }
14316
14317    optional OomAdjReason unfreeze_reason = 5;
14318}
14319
14320/**
14321 * Pulls information for a single voice call.
14322 *
14323 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
14324 *
14325 * Pulled from:
14326 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14327 */
14328message VoiceCallSession {
14329    // Bearer (IMS or CS) when the call started.
14330    optional android.telephony.CallBearerEnum bearer_at_start = 1;
14331
14332    // Bearer (IMS or CS) when the call ended.
14333    // The bearer may change during the call, e.g. due to SRVCC.
14334    optional android.telephony.CallBearerEnum bearer_at_end = 2;
14335
14336    // Direction of the call (incoming or outgoing).
14337    optional android.telephony.CallDirectionEnum direction = 3;
14338
14339    // Time spent setting up the call.
14340    optional android.telephony.CallSetupDurationEnum setup_duration = 4;
14341
14342    // Whether the call ended before the setup was completed.
14343    optional bool setup_failed = 5;
14344
14345    // IMS reason code or CS disconnect cause.
14346    // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
14347    // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
14348    optional int32 disconnect_reason_code = 6;
14349
14350    // IMS extra code or CS precise disconnect cause.
14351    // For IMS, this code is vendor-specific
14352    // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
14353    optional int32 disconnect_extra_code = 7;
14354
14355    // IMS extra message or CS vendor cause.
14356    optional string disconnect_extra_message = 8;
14357
14358    // Radio access technology (RAT) used when call started.
14359    optional android.telephony.NetworkTypeEnum rat_at_start = 9;
14360
14361    // Radio access technology (RAT) used when call terminated.
14362    optional android.telephony.NetworkTypeEnum rat_at_end = 10;
14363
14364    // Number of times RAT changed during the call.
14365    optional int64 rat_switch_count = 11;
14366
14367    // A bitmask of all codecs used during the call.
14368    // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
14369    optional int64 codec_bitmask = 12;
14370
14371    // Number of other calls going on during call setup, for the same SIM slot.
14372    optional int32 concurrent_call_count_at_start = 13;
14373
14374    // Number of other calls going on during call termination, for the same SIM slot.
14375    optional int32 concurrent_call_count_at_end = 14;
14376
14377    // Index of the SIM used, 0 for single-SIM devices.
14378    optional int32 sim_slot_index = 15;
14379
14380    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
14381    optional bool is_multi_sim = 16;
14382
14383    // Whether the call was made with an eSIM profile.
14384    optional bool is_esim = 17;
14385
14386    // Carrier ID of the SIM card.
14387    // See https://source.android.com/devices/tech/config/carrierid.
14388    optional int32 carrier_id = 18;
14389
14390    // Whether an SRVCC has been completed successfully for this call.
14391    optional bool srvcc_completed = 19;
14392
14393    // Number of SRVCC failures.
14394    optional int64 srvcc_failure_count = 20;
14395
14396    // Number of SRVCC cancellations.
14397    optional int64 srvcc_cancellation_count = 21;
14398
14399    // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
14400    // enabled in the dialer's settings).
14401    optional bool rtt_enabled = 22;
14402
14403    // Whether this was an emergency call.
14404    optional bool is_emergency = 23;
14405
14406    // Whether the call was performed while roaming.
14407    optional bool is_roaming = 24;
14408
14409    // A random number used as the dimension field to pull multiple atoms.
14410    optional int32 dimension = 25;
14411
14412    // Signal strength at the end of the call. This value is applicable to both cellular and WiFi.
14413    optional android.telephony.SignalStrengthEnum signal_strength_at_end = 26;
14414
14415    // Band at the end of the call. Value 0 is used if the band is unknown.
14416    // See GeranBands, UtranBands and EutranBands in IRadio interface, depending on the RAT at
14417    // the end of the call.
14418    optional int32 band_at_end = 27;
14419
14420    // Time spent setting up the call in milliseconds.
14421    // The time is measured from dial to ringing for outgoing calls, and from answer to connected
14422    // for incoming calls.
14423    optional int32 setup_duration_millis = 28;
14424
14425    // Main codec quality. The codec quality was equal to or greater than this value for at least
14426    // 70% of the call.
14427    optional android.telephony.CodecQuality main_codec_quality = 29;
14428
14429    // Whether video was enabled at any point during the call.
14430    optional bool video_enabled = 30;
14431
14432    // Radio access technology (RAT) used when call is connected.
14433    optional android.telephony.NetworkTypeEnum rat_at_connected = 31;
14434
14435    // Whether the call was a conference call (applicable only for calls over IMS).
14436    optional bool is_multiparty = 32;
14437
14438    // Duration after the call was connected.
14439    optional android.telephony.CallDuration call_duration = 33;
14440
14441    // Last known Radio access technology (RAT).
14442    optional android.telephony.NetworkTypeEnum last_known_rat = 34;
14443}
14444
14445/**
14446 * Pulls voice call radio access technology (RAT) usage.
14447 *
14448 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
14449 * time. The atom will be skipped if not enough data is available.
14450 *
14451 * Pulled from:
14452 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14453 */
14454message VoiceCallRatUsage {
14455    // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
14456    optional int32 carrier_id = 1;
14457
14458    // Radio access technology.
14459    optional android.telephony.NetworkTypeEnum rat = 2;
14460
14461    // Total duration that voice calls spent on this carrier and RAT, rounded to 5 minutes.
14462    optional int64 total_duration_seconds = 3;
14463
14464    // Total number of calls using this carrier and RAT.
14465    // A call is counted once even if it used the RAT multiple times.
14466    optional int64 call_count = 4;
14467}
14468
14469/**
14470 * Pulls amount of time spend in each cellular service state.
14471 *
14472 * Each pull creates multiple atoms, one for each SIM slot/carrier/RAT(including ENDC), the order of
14473 * which is irrelevant to time. If multi SIM settings changes during the period, durations will be
14474 * counted separately before and after the change. Airplane mode does not count towards durations.
14475 *
14476 * Pulled from:
14477 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14478 */
14479message CellularServiceState {
14480    // Radio access technology (RAT) for voice.
14481    // NETWORK_TYPE_UNKNOWN when the device is not in-service.
14482    // NETWORK_TYPE_IWLAN when the device is using VoWiFi.
14483    optional android.telephony.NetworkTypeEnum voice_rat = 1;
14484
14485    // Radio access technology (RAT) for data.
14486    // NETWORK_TYPE_UNKNOWN when the device is not in-service.
14487    // Only cellular RATs are valid and show where the device is camped.
14488    optional android.telephony.NetworkTypeEnum data_rat = 2;
14489
14490    // Whether the device was in roaming (domestic or international) for voice.
14491    optional android.telephony.RoamingTypeEnum voice_roaming_type = 3;
14492
14493    // Whether the device was in roaming (domestic or international) for data.
14494    optional android.telephony.RoamingTypeEnum data_roaming_type = 4;
14495
14496    // Whether the device is on LTE and has access to NR NSA, i.e. cell supports 5G (ENDC) and UE
14497    // registration (attach/TAU) indicates ENDC is not restricted.
14498    optional bool is_endc = 5;
14499
14500    // Index of the SIM used, 0 for single-SIM devices.
14501    optional int32 sim_slot_index = 6;
14502
14503    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
14504    optional bool is_multi_sim = 7;
14505
14506    // Carrier ID of the SIM card.
14507    // See https://source.android.com/devices/tech/config/carrierid.
14508    optional int32 carrier_id = 8;
14509
14510    // Total time spent in this service state, rounded to 5 minutes.
14511    optional int32 total_time_seconds = 9;
14512
14513    // Whether the device is in limited service (only emergency voice
14514    // call available). Voice and data RAT will be recorded as
14515    // NETWORK_TYPE_UNKNOWN in this case.
14516    optional bool is_emergency_only = 10;
14517}
14518
14519/**
14520 * Pulls the number of times cellular data service state switches.
14521 *
14522 * Each pull creates multiple atoms, one for each RAT combination, the order of which is irrelevant
14523 * to time. Switches for different SIM slots, carrier IDs, or multi-SIM settings are counted
14524 * separately.
14525 *
14526 * Pulled from:
14527 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14528 */
14529message CellularDataServiceSwitch {
14530    // Cellular RAT of the DATA domain from where the switch occurred.
14531    optional android.telephony.NetworkTypeEnum rat_from = 1;
14532
14533    // Cellular RAT of the DATA domain to where the switch occurred.
14534    optional android.telephony.NetworkTypeEnum rat_to = 2;
14535
14536    // Index of the SIM used, 0 for single-SIM devices.
14537    optional int32 sim_slot_index = 3;
14538
14539    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
14540    optional bool is_multi_sim = 4;
14541
14542    // Carrier ID of the SIM card.
14543    // See https://source.android.com/devices/tech/config/carrierid.
14544    optional int32 carrier_id = 5;
14545
14546    // Number of switches from rat_from to rat_to.
14547    optional int32 switch_count = 6;
14548}
14549
14550/**
14551 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
14552 *
14553 * Pulled from:
14554 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14555 */
14556message SimSlotState {
14557    // Number of active SIM slots (both physical and eSIM profiles) in the device.
14558    optional int32 active_slot_count = 1;
14559
14560    // Number of SIM cards (both physical and active eSIM profiles).
14561    // This number may be greater than the number of active SIM slots, if multiple profiles are
14562    // enabled on the same eUICC.
14563    optional int32 sim_count = 2;
14564
14565    // Number of active eSIM profiles.
14566    // This number is always equal to or less than the number of SIMs.
14567    optional int32 esim_count = 3;
14568}
14569
14570/**
14571 * Pulls supported cellular radio access technologies.
14572 *
14573 * This atom reports the capabilities of the device, rather than the network it has access to.
14574 *
14575 * Pulled from:
14576 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14577 */
14578message SupportedRadioAccessFamily {
14579    // A bitmask of supported radio technologies.
14580    // See android.telephony.TelephonyManager.NetworkTypeBitMask.
14581    optional int64 network_type_bitmask = 1;
14582}
14583
14584/**
14585 * Pulls the status of device-level telephony properties.
14586 *
14587 * Pulled from:
14588 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14589 */
14590message DeviceTelephonyProperties {
14591    // True if the device adopts the data stack came out in T
14592    optional bool using_t_data_stack = 1;
14593}
14594
14595/**
14596 * This atom is deprecated starting in T, use TelephonyNetworkRequestsV2 instead.
14597 *
14598 * Pulls information about network requests.
14599 *
14600 * Pulled from:
14601 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14602 */
14603message TelephonyNetworkRequests {
14604    // Carrier ID of the SIM card.
14605    // See https://source.android.com/devices/tech/config/carrierid.
14606    optional int32 carrier_id = 1;
14607    // Number of times the enterprise capability was requested.
14608    optional int32 enterprise_request_count = 2;
14609    // Number of times the enterprise capability was released.
14610    optional int32 enterprise_release_count = 3;
14611}
14612
14613/**
14614 * Pulls information about network requests.
14615 *
14616 * Pulled from:
14617 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14618 */
14619message TelephonyNetworkRequestsV2 {
14620    enum NetworkCapability {
14621        // Unknown capability was requested.
14622        UNKNOWN = 0;
14623        // Low latency capability (URLLC) was requested.
14624        PRIORITIZE_LATENCY = 1;
14625        // High bandwidth capability (EMBB) was requested.
14626        PRIORITIZE_BANDWIDTH = 2;
14627        // CBS (Carrier Branded Services) capability was requested.
14628        CBS = 3;
14629        // Enterprise capability was requested.
14630        ENTERPRISE = 4;
14631    }
14632    // Carrier ID of the SIM card.
14633    // See https://source.android.com/devices/tech/config/carrierid.
14634    optional int32 carrier_id = 1;
14635    // The capability that was requested.
14636    optional NetworkCapability capability = 2;
14637    // Number of times the capability was requested.
14638    optional int32 request_count = 3;
14639}
14640
14641/**
14642 * Pulls information for a single incoming SMS.
14643 *
14644 * Each pull creates multiple atoms, one for each SMS. The sequence is randomized when pulled.
14645 *
14646 * Pulled from:
14647 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14648 */
14649message IncomingSms {
14650    // Format of the SMS (3GPP or 3GPP2).
14651    optional android.telephony.SmsFormatEnum sms_format = 1;
14652
14653    // Technology of the SMS (CS or IMS).
14654    optional android.telephony.SmsTechEnum sms_tech = 2;
14655
14656    // Radio access technology (RAT) used for the SMS. It can be IWLAN in case of IMS.
14657    optional android.telephony.NetworkTypeEnum rat = 3;
14658
14659    // Type the SMS.
14660    optional android.telephony.SmsTypeEnum sms_type = 4;
14661
14662    // Number of total parts.
14663    optional int32 total_parts = 5;
14664
14665    // Number of received parts (if smaller than total parts, the SMS was dropped).
14666    optional int32 received_parts = 6;
14667
14668    // Indicates if the incoming SMS was blocked.
14669    optional bool blocked = 7;
14670
14671    // Indicate a specific error handling the SMS
14672    optional android.telephony.SmsIncomingErrorEnum error = 8;
14673
14674    // Whether the SMS was received while roaming.
14675    optional bool is_roaming = 9;
14676
14677    // Index of the SIM used, 0 for single-SIM devices.
14678    optional int32 sim_slot_index = 10;
14679
14680    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
14681    optional bool is_multi_sim = 11;
14682
14683    // Whether the message was received with an eSIM profile.
14684    optional bool is_esim = 12;
14685
14686    // Carrier ID of the SIM card used for the SMS.
14687    // See https://source.android.com/devices/tech/config/carrierid.
14688    optional int32 carrier_id = 13;
14689
14690    // Random message ID.
14691    // If the value of count is greater than 1, the message_id represents only one of the messages.
14692    optional int64 message_id = 14;
14693
14694    // Number of messages with the same properties (see message_id for exception)
14695    optional int32 count = 15;
14696}
14697
14698/**
14699 * Pulls information for a single outgoing SMS.
14700 *
14701 * Each pull creates multiple atoms, one for each SMS. The sequence is randomized when pulled.
14702 *
14703 * Pulled from:
14704 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14705 */
14706message OutgoingSms {
14707    // Format of the SMS (3GPP or 3GPP2).
14708    optional android.telephony.SmsFormatEnum sms_format = 1;
14709
14710    // Technology of the SMS (CS or IMS).
14711    optional android.telephony.SmsTechEnum sms_tech = 2;
14712
14713    // Radio access technology (RAT) used for the SMS. It can be IWLAN in case of IMS.
14714    optional android.telephony.NetworkTypeEnum rat = 3;
14715
14716    // Result of the SMS sending.
14717    optional android.telephony.SmsSendResultEnum send_result = 4;
14718
14719    // Error code
14720    // For IMS technology, see @SmsManager.Result in
14721    // http://cs/android/frameworks/base/telephony/java/android/telephony/SmsManager.java
14722    // For CS technology:
14723    //  - GSM format: see GsmSmsErrorCode (3GPP 27.005 clause 3.2.5)
14724    //  - CDMA format: see CdmaSmsErrorCode (3GPP2 N.S0005 (IS-41-C) Table 171)
14725    optional int32 error_code = 5;
14726
14727    // Whether the SMS was sent while roaming.
14728    optional bool is_roaming = 6;
14729
14730    // Whether the default SMS application generated the SMS (regardless of which application).
14731    optional bool is_from_default_app = 7;
14732
14733    // Index of the SIM used, 0 for single-SIM devices.
14734    optional int32 sim_slot_index = 8;
14735
14736    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
14737    optional bool is_multi_sim = 9;
14738
14739    // Whether the message was sent with an eSIM profile.
14740    optional bool is_esim = 10;
14741
14742    // Carrier ID of the SIM card used for the SMS.
14743    // See https://source.android.com/devices/tech/config/carrierid.
14744    optional int32 carrier_id = 11;
14745
14746    // Random message ID.
14747    // If the value of count is greater than 1, the message_id represents only one of the messages.
14748    optional int64 message_id = 12;
14749
14750    // Retry count: 0 for the first attempt and then increasing for each attempt.
14751    // If the value of count is greater than 1, the retry_id represents the value associated with
14752    // the message defined by message_id.
14753    optional int32 retry_id = 13;
14754
14755    // Time in milliseconds to complete the SMS send to the network.
14756    // If the value of count is greater than 1, this field measures the average time interval.
14757    optional int64 interval_millis = 14;
14758
14759    // Number of messages with the same properties (see message_id, retry_id and latency_millis for
14760    // exceptions)
14761    optional int32 count = 15;
14762}
14763
14764/**
14765 * Logs information about usage of airplane mode.
14766 *
14767 * Logged from:
14768 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/AirplaneModeStats.java
14769 */
14770message AirplaneMode {
14771    // Status of airplane mode
14772    optional bool is_enabled = 1;
14773
14774    // When is_enabled is false, indicates if this was a very short airplane mode toggle
14775    // (i.e. airplane mode was disabled after less than 10 seconds from enablement).
14776    optional bool short_toggle = 2;
14777
14778    // Carrier ID of the SIM card.
14779    // See https://source.android.com/devices/tech/config/carrierid.
14780    optional int32 carrier_id = 3;
14781}
14782
14783/**
14784 * Logs information about modem restarts.
14785 *
14786 * Logged from:
14787 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/ModemRestartStats.java
14788 */
14789message ModemRestart {
14790    // Software version of the modem, as provided by android.os.Build.getRadioVersion().
14791    optional string baseband_version = 1;
14792
14793    // Reason of the modem restart, as provided in the modemReset indication of IRadio HAL.
14794    optional string reason = 2;
14795
14796    // Carrier ID of the first SIM card.
14797    // See https://source.android.com/devices/tech/config/carrierid.
14798    optional int32 carrier_id = 3;
14799}
14800
14801/**
14802 * Logs the SIM card details when the carrier ID match is not complete.
14803 *
14804 * The atom is pushed when a SIM card is initialized and the MCC/MNC is not present in the
14805 * carrier ID table, or the SIM card contains a GID1 value that is not present in the carrier ID
14806 * table. This atom is pushed only once for each type of SIM card.
14807 *
14808 * Logged from:
14809 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/CarrierIdMatchStats.java
14810 */
14811message CarrierIdMismatchReported {
14812    // Matched carrier ID. The value -1 is used if no match is found.
14813    optional int32 carrier_id = 1;
14814
14815    // MCC/MNC of the SIM card.
14816    optional string mcc_mnc = 2;
14817
14818    // Group identifier (level 1) of the SIM card.
14819    optional string gid1 = 3;
14820
14821    // SPN value of the SIM card.
14822    optional string spn = 4;
14823
14824    // First record of the PNN in the SIM card. This field is populated only if the SPN is missing
14825    // or empty.
14826    optional string pnn = 5;
14827}
14828
14829/**
14830 * Logs the version of the carrier ID matching table at first power up and when it is updated.
14831 *
14832 * Logged from:
14833 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/CarrierIdMatchStats.java
14834 */
14835message CarrierIdTableUpdated {
14836    // Version of the CarrierId matching table.
14837    optional int32 table_version = 1;
14838}
14839
14840/**
14841 * Pulls the version of the carrier ID matching table.
14842 *
14843 * Logged from:
14844 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14845 */
14846message CarrierIdTableVersion {
14847    // Version of the CarrierId matching table.
14848    optional int32 table_version = 1;
14849}
14850
14851/**
14852 * Pulls information for a single data call session
14853 *
14854 * Each pull creates multiple atoms, one for each data call session.
14855 * The sequence is randomized when pulled.
14856 *
14857 * Pulled from:
14858 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
14859 */
14860message DataCallSession {
14861    // A random number to be used as dimension to capture multiple atoms
14862    optional int32 dimension = 1;
14863
14864    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
14865    optional bool is_multi_sim = 2;
14866
14867    // Whether the call was made with an eSIM profile.
14868    optional bool is_esim = 3;
14869
14870    // Data profile of this call (for what purpose this call was made)
14871    optional android.telephony.DataProfileEnum profile = 4 [deprecated = true];
14872
14873    // APN type bitmask of the APN used:
14874    // @ApnType in frameworks/base/telephony/java/android/telephony/Annotation.java.
14875    optional int32 apn_type_bitmask = 5;
14876
14877    // Carrier ID of the SIM
14878    // See https://source.android.com/devices/tech/config/carrierid.
14879    optional int32 carrier_id = 6;
14880
14881    // Whether the subscription is roaming
14882    optional bool is_roaming = 7;
14883
14884    // Data RAT when the call ended, can be IWLAN for IMS/MMS, otherwise should be WWAN PS RAT.
14885    // In the case that the connection hasn't ended yet, this field holds the current RAT.
14886    // In the case the call ended due to Out Of Service (OOS),
14887    // this field should be the last known RAT.
14888    optional android.telephony.NetworkTypeEnum rat_at_end = 8;
14889
14890    // Was the data call ended due to OOS
14891    optional bool oos_at_end = 9;
14892
14893    // Number of RAT switches during the data call
14894    optional int64 rat_switch_count = 10;
14895
14896    // Whether the call is on an opportunistic subscription
14897    optional bool is_opportunistic = 11;
14898
14899    // Packet data protocol used
14900    optional android.telephony.ApnProtocolEnum ip_type = 12;
14901
14902    // Whether the data call terminated before being established
14903    optional bool setup_failed = 13;
14904
14905    // Reason why the data call terminated, as in RIL_DataCallFailCause from ril.h
14906    optional int32 failure_cause = 14;
14907
14908    // Suggested retry back-off timer value from RIL
14909    optional int32 suggested_retry_millis = 15;
14910
14911    // Why the data call was deactivated
14912    // Set by telephony for MO deactivations (unrelated to failure_cause)
14913    optional android.telephony.DataDeactivateReasonEnum deactivate_reason = 16;
14914
14915    // Duration of the data call, rounded into the closest 5 minutes.
14916    optional int64 duration_minutes = 17;
14917
14918    // Whether the data call is still connected when the atom is collected.
14919    optional bool ongoing = 18;
14920
14921    // Band at the end of the data call. Value 0 is used if the band is unknown.
14922    // See GeranBands, UtranBands and EutranBands in IRadio interface, depending
14923    // on the RAT at the end of the data call.
14924    optional int32 band_at_end = 19;
14925
14926    // Reason why the data call handover failed, as in RIL_DataCallFailCause from ril.h
14927    repeated int32 handover_failure_causes = 20;
14928
14929    // For each int32, the lower 16 bits represent the source RAT while the upper 16 bits indicate
14930    // the target RAT of the failed handover.
14931    repeated int32 handover_failure_rat = 21;
14932}
14933
14934/**
14935 * Logs data stall recovery event
14936 *
14937 * Logged from:
14938 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/data/
14939 *   DataStallRecoveryManager.java
14940 */
14941message DataStallRecoveryReported {
14942    // Carrier ID of the SIM
14943    // See https://source.android.com/devices/tech/config/carrierid.
14944    optional int32 carrier_id = 1;
14945
14946    // Data RAT when the stall happened
14947    optional android.telephony.NetworkTypeEnum rat = 2;
14948
14949    // Signal strength when stall happened
14950    optional android.telephony.SignalStrengthEnum signal_strength = 3;
14951
14952    // Action taken to recover
14953    optional android.telephony.DataStallRecoveryActionEnum action = 4;
14954
14955    // Whether the subscription is opportunistic
14956    optional bool is_opportunistic = 5;
14957
14958    // Whether the device is in multi-SIM mode
14959    optional bool is_multi_sim = 6;
14960
14961    // Band used when the stall/recovery took place.
14962    // Value 0 is used if the band is unknown.
14963    // See GeranBands, UtranBands and EutranBands in IRadio interface, depending
14964    // on the RAT used at the time.
14965    optional int32 band = 7;
14966
14967    // Whether the data stall is recovered.
14968    optional bool recovered = 8;
14969
14970    // The elapsed time between start of the data stall and result of current action.
14971    optional int32 duration_millis = 9;
14972
14973    // The data stall recovered reason. Available from Android T.
14974    optional android.telephony.DataStallRecoveredReason reason = 10;
14975
14976    // Signal strength of the other phone if DSDS when stall happened.
14977    // SIGNAL_STRENGTH_NONE_OR_UNKNOWN(0) if single SIM.
14978    optional android.telephony.SignalStrengthEnum other_phone_signal_strength = 11;
14979
14980    // PS WWAN Network Registration state of the other phone if DSDS when stall happened.
14981    // REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING(0) if single SIM.
14982    optional android.telephony.NetworkRegistrationState other_phone_reg_state = 12;
14983
14984    // PS WWAN Network Registration state of the default phone when data stall.
14985    optional android.telephony.NetworkRegistrationState phone_reg_state = 13;
14986
14987    // collect the first validation after recovery when data stall occurs.
14988    optional bool is_first_validation_after_recovery = 14;
14989
14990    // The phone id when doing the recovery action.
14991    optional int32 phone_id = 15;
14992
14993    // The elapsed time of current action.
14994    optional int32 duration_millis_of_current_action = 16;
14995}
14996
14997/**
14998 * Pulls IMS registration terminations.
14999 *
15000 * Each pull generates multiple atoms, one for each termination condition happened during the day.
15001 *
15002 * Pulled from:
15003 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15004 */
15005message ImsRegistrationTermination {
15006    // Carrier ID of the SIM used for IMS registration.
15007    // See https://source.android.com/devices/tech/config/carrierid.
15008    optional int32 carrier_id = 1;
15009
15010    // Whether the device is in multi-SIM mode when the registration terminated.
15011    optional bool is_multi_sim = 2;
15012
15013    // Radio access technology (RAT) used by the registration when it terminated.
15014    // This can be IWLAN if IMS was registered over Wifi.
15015    optional android.telephony.NetworkTypeEnum rat_at_end = 3;
15016
15017    // Whether the IMS registration failed before it was established.
15018    optional bool setup_failed = 4;
15019
15020    // IMS reason code indicating the termination reason.
15021    // See: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
15022    optional int32 reason_code = 5;
15023
15024    // IMS extra code indicating the termination reason.
15025    optional int32 extra_code = 6;
15026
15027    // IMS extra message indicating the termination reason.
15028    // This string is truncated to 128 characters if its length exceeds the limit.
15029    optional string extra_message = 7;
15030
15031    // Total number of instances of registration termination that matches the above conditions.
15032    optional int32 count = 8;
15033}
15034
15035/**
15036 * Pulls IMS registration statistics.
15037 *
15038 * Each pull generates multiple atoms, one for each carrier, SIM slot, and radio access technology
15039 * (RAT) combination. Durations are aggregated from all registrations with matching criteria,
15040 * including ones that are currently active.
15041 *
15042 * Pulled from:
15043 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
15044 */
15045message ImsRegistrationStats {
15046    // Carrier ID of the SIM used for IMS registration.
15047    // See https://source.android.com/devices/tech/config/carrierid.
15048    optional int32 carrier_id = 1;
15049
15050    // Index of the SIM used, 0 for single-SIM devices.
15051    optional int32 sim_slot_index = 2;
15052
15053    // Radio access technology (RAT) used by the registration.
15054    // This can be IWLAN if IMS was registered over Wifi.
15055    optional android.telephony.NetworkTypeEnum rat = 3;
15056
15057    // Total time IMS was registered (connected time), rounded to 5 minutes.
15058    optional int32 registered_seconds = 4;
15059
15060    // Durations that each feature (Voice, Video, UT, SMS) is capable (supported/enabled by the
15061    // network/device) and available (registered and ready to use).
15062    // All durations are rounded to 5 minutes and should be equal to or shorter than
15063    // registered_seconds.
15064    optional int32 voice_capable_seconds = 5;
15065    optional int32 voice_available_seconds = 6;
15066    optional int32 sms_capable_seconds = 7;
15067    optional int32 sms_available_seconds = 8;
15068    optional int32 video_capable_seconds = 9;
15069    optional int32 video_available_seconds = 10;
15070    optional int32 ut_capable_seconds = 11;
15071    optional int32 ut_available_seconds = 12;
15072}
15073
15074/*
15075 * Logs information related to PIN storage and automatic PIN operations.
15076 *
15077 * Logged from:
15078 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/uicc/PinStorage.java
15079 */
15080message PinStorageEvent {
15081    // The type of event.
15082    enum Event {
15083        UNKNOWN = 0;
15084        // The PIN was verified automatically successfully.
15085        PIN_VERIFICATION_SUCCESS = 1;
15086        // The PIN was verified automatically unsuccessfully.
15087        PIN_VERIFICATION_FAILURE = 2;
15088        // The PIN(s) was cached, but discarded after reboot (e.g. SIM not present after reboot).
15089        CACHED_PIN_DISCARDED = 3;
15090        // The PIN(s) was stored to be used after unattended reboot.
15091        PIN_STORED_FOR_VERIFICATION = 4;
15092        // The PIN(s) is not available for storage and will be required after unattended reboot.
15093        PIN_REQUIRED_AFTER_REBOOT = 5;
15094        // The PIN was not verified automatically because the SIM card did not match.
15095        PIN_VERIFICATION_SKIPPED_SIM_CARD_MISMATCH = 6;
15096        // The available PINs after reboot does not match the number of stored PINs before reboot.
15097        PIN_COUNT_NOT_MATCHING_AFTER_REBOOT = 7;
15098        // Error while decrypting the PIN
15099        PIN_DECRYPTION_ERROR = 8;
15100        // Error while encrypting the PIN
15101        PIN_ENCRYPTION_ERROR = 9;
15102    }
15103    optional Event event = 1;
15104
15105    // Number of PINs stored or discarded.
15106    optional int32 number_of_pins = 2;
15107
15108    // The caller package name
15109    optional string package_name = 3;
15110}
15111
15112/**
15113 * Logs flip to screen off events.
15114 *
15115 * Logged from:
15116 *   frameworks/opt/telephony/src/java/com/android/server/power/FaceDownDetector.java
15117 */
15118message FaceDownReported {
15119    enum Response{
15120        UNKNOWN = 1;
15121        // The phone was flipped before the screen turns off.
15122        UNFLIP = 2;
15123        // User interacts with the screen after a face down is detected.
15124        USER_INTERACTION = 3;
15125        // A flip leads to screen turning off. This is the expected outcome.
15126        SCREEN_OFF = 4;
15127    }
15128
15129    // Logs the action that occurs from a flip event, whether by user or system
15130    // action.
15131    optional Response face_down_response = 1;
15132
15133    // After a flip is detected, how long until a system or user action occurs.
15134    optional int64 millis_since_flip = 2;
15135
15136    // Difference between the flip time and when the timeout would otherwise
15137    // occur.
15138    optional int64 millis_until_normal_timeout = 3;
15139
15140    // How quickly the user turns the screen back on after a flip event.
15141    // A low value may indicate a false negative. Logged only when Response is
15142    // SCREEN_OFF.
15143    optional int64 millis_until_next_screen_on = 4;
15144}
15145
15146/**
15147 * Logs timeout extended events which occur from consecutive undims.
15148 *
15149 * Logged from:
15150 *   frameworks/opt/telephony/src/java/com/android/server/power/ScreenUndimDetector.java
15151 */
15152message TimeoutAutoExtendedReported {
15153    enum Outcome {
15154        UNKNOWN = 0;
15155        POWER_BUTTON = 1;
15156        TIMEOUT = 2;
15157    }
15158
15159    // Logs the action that occurs after timeout is extended from undim.
15160    optional Outcome outcome = 1;
15161    // Time from timeout extension to the outcome.
15162    optional int64 time_to_outcome_millis = 2;
15163    // Time of first interaction after undim if an interaction occurs.
15164    // -1 if no interaction occurs before screen turns off.
15165    optional int64 time_to_first_interaction_millis = 3;
15166}
15167
15168/**
15169 * Logs gnss stats from location service provider
15170 *
15171 * Pulled from:
15172 *  frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
15173 */
15174message GnssStats {
15175    // Number of location reports since boot
15176    optional int64 location_reports = 1;
15177
15178    // Total pulled reports of Location failures since boot
15179    optional int64 location_failure_reports = 2;
15180
15181    // Number of time to first fix reports since boot
15182    optional int64 time_to_first_fix_reports = 3;
15183
15184    // Total pulled reported time to first fix (in milli-seconds) since boot
15185    optional int64 time_to_first_fix_millis = 4;
15186
15187    // Number of position accuracy reports since boot
15188    optional int64 position_accuracy_reports = 5;
15189
15190    // Total pulled reported position accuracy (in meters) since boot
15191    optional int64 position_accuracy_meters = 6;
15192
15193    // Number of top 4 average CN0 reports since boot
15194    optional int64 top_four_average_cn0_reports = 7;
15195
15196    // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
15197    optional int64 top_four_average_cn0_db_mhz = 8;
15198
15199    // Number of l5 top 4 average CN0 reports since boot
15200    optional int64 l5_top_four_average_cn0_reports = 9;
15201
15202    // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
15203    optional int64 l5_top_four_average_cn0_db_mhz = 10;
15204
15205    // Total number of sv status messages reports since boot
15206    optional int64 sv_status_reports = 11;
15207
15208    // Total number of sv status messages reports, where sv is used in fix since boot
15209    optional int64 sv_status_reports_used_in_fix = 12;
15210
15211    // Total number of L5 sv status messages reports since boot
15212    optional int64 l5_sv_status_reports = 13;
15213
15214    // Total number of L5 sv status messages reports, where sv is used in fix since boot
15215    optional int64 l5_sv_status_reports_used_in_fix = 14;
15216}
15217
15218/**
15219 * Logs power usage data from GNSS subsystem.
15220 *
15221 * Logged from:
15222 *   /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
15223 */
15224message GnssPowerStats {
15225    // Relative precision of the alignment of the reported power stats measurement.
15226    optional int64 elapsed_realtime_uncertainty_nanos = 1;
15227
15228    // Total GNSS energy consumption in micro-joules (or micro Watt-seconds).
15229    optional int64 total_energy_micro_joule = 2;
15230
15231    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
15232    // tracking signals of a single frequency band.
15233    optional int64 singleband_tracking_mode_energy_micro_joule = 3;
15234
15235    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
15236    // tracking signals of multiple frequency bands.
15237    optional int64 multiband_tracking_mode_energy_micro_joule = 4;
15238
15239    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
15240    // acquiring signals of a single frequency band.
15241    optional int64 singleband_acquisition_mode_energy_micro_joule = 5;
15242
15243    // Total energy consumption in micro-joules (or micro Watt-seconds) for which the GNSS engine is
15244    // acquiring signals of multiple frequency bands.
15245    optional int64 multiband_acquisition_mode_energy_micro_joule = 6;
15246
15247    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
15248    // operating in each of the vendor-specific power modes. (Index 0)
15249    optional int64 vendor_specific_power_modes_energy_micro_joule_0 = 7;
15250
15251    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
15252    // operating in each of the vendor-specific power modes. (Index 1)
15253    optional int64 vendor_specific_power_modes_energy_micro_joule_1 = 8;
15254
15255    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
15256    // operating in each of the vendor-specific power modes. (Index 2)
15257    optional int64 vendor_specific_power_modes_energy_micro_joule_2 = 9;
15258
15259    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
15260    // operating in each of the vendor-specific power modes. (Index 3)
15261    optional int64 vendor_specific_power_modes_energy_micro_joule_3 = 10;
15262
15263    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
15264    // operating in each of the vendor-specific power modes. (Index 4)
15265    optional int64 vendor_specific_power_modes_energy_micro_joule_4 = 11;
15266
15267    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
15268    // operating in each of the vendor-specific power modes. (Index 5)
15269    optional int64 vendor_specific_power_modes_energy_micro_joule_5 = 12;
15270
15271    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
15272    // operating in each of the vendor-specific power modes. (Index 6)
15273    optional int64 vendor_specific_power_modes_energy_micro_joule_6 = 13;
15274
15275    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
15276    // operating in each of the vendor-specific power modes. (Index 7)
15277    optional int64 vendor_specific_power_modes_energy_micro_joule_7 = 14;
15278
15279    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
15280    // operating in each of the vendor-specific power modes. (Index 8)
15281    optional int64 vendor_specific_power_modes_energy_micro_joule_8 = 15;
15282
15283    // Total energy consumption in micro-joules (microWatt-seconds) for which the GNSS engine is
15284    // operating in each of the vendor-specific power modes. (Index 9)
15285    optional int64 vendor_specific_power_modes_energy_micro_joule_9 = 16;
15286}
15287
15288/**
15289 * Logs when an app is moved to a different standby bucket.
15290 *
15291 * Logged from:
15292 *   frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
15293 */
15294message AppStandbyBucketChanged {
15295    optional string package_name = 1;
15296
15297    // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
15298    optional int32 user_id = 2;
15299
15300    // These enum values match the constants defined in UsageStatsManager.java.
15301    enum Bucket {
15302        BUCKET_UNKNOWN = 0;
15303        BUCKET_EXEMPTED = 5;
15304        BUCKET_ACTIVE = 10;
15305        BUCKET_WORKING_SET = 20;
15306        BUCKET_FREQUENT = 30;
15307        BUCKET_RARE = 40;
15308        BUCKET_RESTRICTED = 45;
15309        BUCKET_NEVER = 50;
15310    }
15311    optional Bucket bucket = 3;
15312
15313    enum MainReason {
15314        MAIN_UNKNOWN = 0;
15315        MAIN_DEFAULT = 0x0100;
15316        MAIN_TIMEOUT = 0x0200;
15317        MAIN_USAGE = 0x0300;
15318        MAIN_FORCED_BY_USER = 0x0400;
15319        MAIN_PREDICTED = 0x0500;
15320        MAIN_FORCED_BY_SYSTEM = 0x0600;
15321    }
15322    optional MainReason main_reason = 4;
15323
15324    // A more detailed reason for the standby bucket change. The sub reason name is dependent on
15325    // the main reason. Values are one of the REASON_SUB_XXX constants defined in
15326    // UsageStatsManager.java.
15327    optional int32 sub_reason = 5;
15328}
15329
15330/**
15331* Reports a started sharesheet transaction.
15332*
15333* Logged from:
15334*   frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
15335*   packages/modules/IntentResolver/java/src/com/android/intentresolver/ChooserActivity.java
15336*/
15337message SharesheetStarted {
15338    // The event_id (as for UiEventReported).
15339    optional int32 event_id = 1;
15340    // The calling app's package name.
15341    optional string package_name = 2;
15342    // An identifier to tie together multiple logs relating to the same share event
15343    optional int32 instance_id = 3;
15344    // The mime type of the share
15345    optional string mime_type = 4;
15346    // The number of direct targets the calling app is providing that will be shown.
15347    optional int32 num_app_provided_direct_targets = 5;
15348    // The number of app targets the calling app is providing that will be shown.
15349    optional int32 num_app_provided_app_targets = 6;
15350    // True if the share originates from the workprofile
15351    optional bool is_workprofile = 7;
15352
15353    enum SharesheetPreviewType {  // Constants from ChooserActivity.java
15354        CONTENT_PREVIEW_TYPE_UNKNOWN = 0;  // Default for proto 2 / 3 compatibility.
15355        CONTENT_PREVIEW_IMAGE = 1;  // The preview shown in the sharesheet is an image.
15356        CONTENT_PREVIEW_FILE = 2;  // The preview shown in the sharesheet is a file.
15357        CONTENT_PREVIEW_TEXT = 3;  // The preview shown in the sharesheet is text.
15358    }
15359    // How the sharesheet preview is presented.
15360    optional SharesheetPreviewType preview_type = 8;
15361
15362    enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
15363        INTENT_DEFAULT = 0;
15364        INTENT_ACTION_VIEW = 1;
15365        INTENT_ACTION_EDIT = 2;
15366        INTENT_ACTION_SEND = 3;
15367        INTENT_ACTION_SENDTO = 4;
15368        INTENT_ACTION_SEND_MULTIPLE = 5;
15369        INTENT_ACTION_IMAGE_CAPTURE = 6;
15370        INTENT_ACTION_MAIN = 7;
15371    }
15372    // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
15373    optional ResolverActivityIntent intent_type = 9;
15374    // The number of custom actions that the calling app has provided.
15375    optional int32 num_provided_custom_actions = 10;
15376    // True if the calling app has provided an action for share modification.
15377    optional bool modify_share_action_provided = 11;
15378}
15379
15380/**
15381 * Reports a ranking selection event.
15382 *
15383 * Logged from:
15384 *   frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
15385 *   packages/modules/IntentResolver/java/src/com/android/intentresolver/ChooserActivity.java
15386 */
15387message RankingSelected {
15388    // The event_id (as for UiEventReported).
15389    optional int32 event_id = 1;
15390    // The relevant app's package name (can be source or picked package).
15391    optional string package_name = 2;
15392    // An identifier to tie together multiple logs relating to the same share event.
15393    optional int32 instance_id = 3;
15394    // Which of the ranked targets got picked, default starting position 0.
15395    optional int32 position_picked = 4;
15396    // Whether the selected target is pinned.
15397    optional bool is_pinned = 5;
15398}
15399
15400/**
15401 * Logs when TvSettings UI is interacted at.
15402 *
15403 * Logged from: packages/apps/TvSettings
15404 */
15405message TvSettingsUIInteracted {
15406
15407    /** The UI action category */
15408    optional android.app.tvsettings.Action action = 1;
15409
15410    /** The ID of the entry that the users actioned on */
15411    optional android.app.tvsettings.ItemId item_id = 2;
15412}
15413
15414/**
15415 * Logs information about a package installation using package installer V2 APIs.
15416 *
15417 * Logged from:
15418 *      frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
15419 */
15420message PackageInstallerV2Reported {
15421    // Whether this installation uses Incremental File System
15422    optional bool is_incremental = 1;
15423    // Name of the package that is intended to be installed
15424    optional string package_name = 2;
15425    // The duration between when the install was requested to when the install has completed
15426    optional int64 duration_millis = 3;
15427    // Installation result in final integer, which are SystemApi's.
15428    // Return_code 1 indicates success.
15429    // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
15430    optional int32 return_code  = 4;
15431    // Total size of the APKs installed for this package
15432    optional int64 apks_size_bytes = 5;
15433    // UID of the package. -1 if the installation failed.
15434    optional int32 uid = 6 [(is_uid) = true];
15435}
15436
15437/**
15438 * Logs settings provider values.
15439 *
15440 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
15441 * then write the value to proto.
15442 *
15443 */
15444message SettingSnapshot {
15445
15446    // Setting key
15447    optional string name = 1;
15448
15449    enum SettingsValueType {
15450        NOTASSIGNED = 0;
15451        ASSIGNED_BOOL_TYPE = 1;
15452        ASSIGNED_INT_TYPE = 2;
15453        ASSIGNED_FLOAT_TYPE = 3;
15454        ASSIGNED_STRING_TYPE = 4;
15455    };
15456    // Setting value type
15457    optional SettingsValueType type = 2;
15458
15459    optional bool bool_value = 3;
15460
15461    optional int32 int_value = 4;
15462
15463    optional float float_value = 5;
15464
15465    optional string str_value = 6;
15466
15467    // Android user index. 0 for primary user, 10, 11 for secondary or profile user
15468    optional int32 user_id = 7;
15469}
15470
15471/**
15472 * An event logged to indicate that a user journey is about to be performed. This atom includes
15473 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
15474 * will immediately follow this atom which will describe the event(s) and its state.
15475 *
15476 * Logged from:
15477 *   frameworks/base/services/core/java/com/android/server/am/UserController.java
15478 *   frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
15479 */
15480message UserLifecycleJourneyReported {
15481    // An identifier to track a chain of user lifecycle events occurring (referenced in the
15482    // UserLifecycleEventOccurred atom)
15483    optional int64 session_id = 1;
15484
15485    // Indicates what type of user journey this session is related to
15486    enum Journey {
15487        UNKNOWN = 0; // Undefined user lifecycle journey
15488        USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
15489        USER_SWITCH_FG = 2; // A user switch journey without a UI shown
15490        USER_START = 3; // A user start journey
15491        USER_CREATE = 4; // A user creation journey
15492        USER_STOP = 5; // A user stop journey
15493        USER_REMOVE = 6; // A user removal journey
15494    }
15495    optional Journey journey = 2;
15496    // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
15497    // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
15498    optional int32 origin_user = 3;
15499    // Which user the journey is targeting
15500    // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
15501    optional int32 target_user = 4;
15502
15503    // What is the user type of the target user
15504    // These should be in sync with USER_TYPE_* flags defined in UserManager.java
15505    enum UserType {
15506        TYPE_UNKNOWN = 0;
15507        FULL_SYSTEM = 1;
15508        FULL_SECONDARY = 2;
15509        FULL_GUEST = 3;
15510        FULL_DEMO = 4;
15511        FULL_RESTRICTED = 5;
15512        PROFILE_MANAGED = 6;
15513        SYSTEM_HEADLESS = 7;
15514        PROFILE_CLONE = 8;
15515    }
15516    optional UserType user_type = 5;
15517    // What are the flags attached to the target user
15518    optional int32 user_flags = 6;
15519}
15520
15521/**
15522 * An event logged when a specific user lifecycle event is performed. These events should be
15523 * correlated with a UserLifecycleJourneyReported atom via the session_id.
15524 * Note: journeys can span over multiple events, hence some events may share a single session id.
15525 *
15526 * Logged from:
15527 *   frameworks/base/services/core/java/com/android/server/am/UserController.java
15528 *   frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
15529 */
15530message UserLifecycleEventOccurred {
15531    // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
15532    optional int64 session_id = 1;
15533    // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
15534    // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
15535    optional int32 user_id = 2;
15536
15537    enum Event {
15538        UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
15539        SWITCH_USER = 1; // Indicates that this is a user switch event
15540        START_USER = 2; // Indicates that this is a user start event
15541        CREATE_USER = 3; // Indicates that this is a user create event
15542        USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
15543        UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
15544        UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
15545        STOP_USER = 7; // Indicates that this is a user stop event
15546        REMOVE_USER = 8; // Indicates that this is a user removal event
15547    }
15548    optional Event event = 3;
15549
15550    enum State {
15551        NONE = 0; // Indicates the associated event has no start/end defined
15552        BEGIN = 1;
15553        FINISH = 2;
15554    }
15555    optional State state = 4; // Represents the state of an event (beginning/ending)
15556}
15557
15558/**
15559 * The UserInfo information about an Android user (as used in UserManager multiuser).
15560 *
15561 * This will be pulled from
15562 *     frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
15563 */
15564message UserInfo {
15565    // The @UserIdInt userId of the user
15566    optional int32 user_id = 1;
15567
15568    // The type of user, if AOSP-defined, such as {@link UserManager#USER_TYPE_PROFILE_MANAGED}
15569    optional UserLifecycleJourneyReported.UserType user_type = 2;
15570
15571    // The type of user if not AOSP-defined. Will be empty if user_type is not TYPE_UNKNOWN.
15572    optional string user_type_custom = 3;
15573
15574    // The @UserInfoFlag UserInfo flags of user.
15575    optional int32 user_flags = 4;
15576
15577    // Wall-clock time in milliseconds when user was created, according to System.currentTimeMillis
15578    optional int64 creation_time_millis = 5;
15579
15580    // Wall-clock time in milliseconds when user last entered the state of STATE_RUNNING_UNLOCKED,
15581    // according to System.currentTimeMillis
15582    optional int64 last_logged_in_time_millis = 6;
15583
15584    // True if user is currently running and unlocked
15585    optional bool is_user_running_unlocked = 7;
15586}
15587
15588
15589/**
15590 * The MultiUserInfo information about maximum supported users on the device.
15591 *
15592 * This will be pulled from
15593 *     frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
15594 */
15595message MultiUserInfo {
15596    // Maximum users supported on the device
15597    optional int32 max_supported_users = 1;
15598    // Whether multi user setting is on.
15599    optional bool multi_user_setting_on = 2;
15600}
15601
15602/**
15603 * Logs when accessibility shortcut clicked.
15604 *
15605 * Logged from:
15606 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
15607 */
15608message AccessibilityShortcutReported {
15609    // The accessibility feature(including installed a11y service, framework a11y feature,
15610    // and installed a11y activity) package name that is assigned to the accessibility shortcut.
15611    optional string package_name = 1;
15612
15613    // The definition of the accessibility shortcut.
15614    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
15615    optional android.stats.accessibility.ShortcutType shortcut_type = 2;
15616
15617    // The definition of the service status.
15618    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
15619    optional android.stats.accessibility.ServiceStatus service_status = 3;
15620}
15621
15622/**
15623 * Logs when accessibility service status changed.
15624 *
15625 * Logged from:
15626 *   packages/apps/Settings/src/com/android/settings/accessibility
15627 */
15628message AccessibilityServiceReported {
15629    // The accessibility service package name.
15630    optional string package_name = 1;
15631
15632    // The definition of the service status.
15633    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
15634    optional android.stats.accessibility.ServiceStatus service_status = 2;
15635}
15636
15637/**
15638 * Logs when accessibility floating menu changed its position by user.
15639 *
15640 * Logged from:
15641 *   frameworks/base/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu
15642 */
15643message AccessibilityFloatingMenuUIChanged {
15644    // Normalized screen position of the accessibility floating menu. The range is between 0 and 1.
15645    optional float normalized_x_position = 1;
15646    optional float normalized_y_position = 2;
15647
15648    enum Orientation {
15649        UNKNOWN = 0;
15650        PORTRAIT = 1;
15651        LANDSCAPE = 2;
15652    }
15653    // Orientation of the device when accessibility floating menu changed.
15654    optional Orientation orientation = 3;
15655}
15656
15657/**
15658 * Pulls accessibility shortcuts status.
15659 *
15660 * Pulled from:
15661 *   StatsPullAtomService
15662 */
15663message AccessibilityShortcutStats {
15664    // The definition of the accessibility software shortcut.
15665    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
15666    optional android.stats.accessibility.ShortcutType software_shortcut_type = 1;
15667    // Number of accessibility services in accessibility software shortcut.
15668    optional int32 software_shortcut_service_num = 2;
15669
15670    // The definition of the accessibility hardware shortcut.
15671    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
15672    optional android.stats.accessibility.ShortcutType hardware_shortcut_type = 3;
15673    // Number of accessibility services in accessibility hardware shortcut.
15674    optional int32 hardware_shortcut_service_num = 4;
15675
15676    // The definition of the accessibility gesture shortcut.
15677    // From frameworks/proto_logging/stats/enums/stats/accessibility/accessibility_enums.proto.
15678    optional android.stats.accessibility.ShortcutType gesture_shortcut_type = 5;
15679    // Number of accessibility services in accessibility gesture shortcut.
15680    optional int32 gesture_shortcut_service_num = 6;
15681}
15682
15683/**
15684 * Pulls accessibility floating menu status.
15685 *
15686 * Pulled from:
15687 *   StatsPullAtomService
15688 */
15689message AccessibilityFloatingMenuStats {
15690    // Size of the accessibility floating menu.
15691    optional int32 size = 1;
15692    // Icon shape of the accessibility floating menu.
15693    optional int32 icon_type = 2;
15694    // Whether the accessibility floating menu is enable auto fade ability.
15695    optional bool fade_enabled = 3;
15696    // Opacity of the accessibility floating menu. The range is between 0 and 1.
15697    optional float opacity = 4;
15698}
15699
15700/**
15701 * Logs when display wake up.
15702 *
15703 * Logged from:
15704 *   services/core/java/com/android/server/power/Notifier.java
15705 */
15706
15707message DisplayWakeReported {
15708    // Wake_up_reason code
15709    // If LOWORD(wake_up_reason) = 0
15710    //     reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
15711    //     else reference wake_up_reason to
15712    //     services/core/java/com/android/server/power/Notifier.java#onWakeUp
15713    optional int32 wake_up_reason = 1;
15714}
15715
15716/**
15717 * Logs app usage events.
15718 */
15719message AppUsageEventOccurred {
15720    optional int32 uid = 1 [(is_uid) = true];
15721    optional string package_name = 2;
15722    optional string class_name = 3;
15723
15724    enum EventType {
15725        NONE = 0;
15726        MOVE_TO_FOREGROUND = 1;
15727        MOVE_TO_BACKGROUND = 2;
15728    }
15729    optional EventType event_type = 4;
15730}
15731
15732/*
15733 * Quality metrics logged when EVS cameras are active.
15734 *
15735 * Logged from:
15736 *  packages/services/Car/evs/manager/1.1/Enumerator.cpp
15737 */
15738message EvsUsageStatsReported {
15739
15740    // Camera identifier to distinguish the source camera device.  This is not
15741    // globally unique and therefore cannot be used to identify the user and/or
15742    // the device.
15743    optional int32 device_id = 1;
15744
15745    // Peak number of clients during the service
15746    optional int32 peak_num_clients = 2;
15747
15748    // Number of erroneous events during the service
15749    optional int32 num_errors = 3;
15750
15751    // Round trip latency of the very first frame
15752    optional int64 first_latency_millis = 4;
15753
15754    // Average frame round trip latency
15755    optional float avg_latency_millis = 5;
15756
15757    // Peak frame round trip latency
15758    optional int64 peak_latency_millis = 6;
15759
15760    // Total number of frames received
15761    optional int64 total_frames = 7;
15762
15763    // Number of frames ignored
15764    optional int64 ignored_frames = 8;
15765
15766    // Number of dropped frames to synchronize camera devices
15767    optional int64 dropped_frames_to_sync = 9;
15768
15769    // The duration of the service
15770    optional int64 duration_millis = 10;
15771}
15772
15773/**
15774 * Logs audio power usage stats.
15775 *
15776 * Pushed from:
15777 *  frameworks/av/services/mediametrics/AudioPowerUsage.cpp
15778 */
15779message AudioPowerUsageDataReported {
15780    /**
15781     * Device used for input/output
15782     *
15783     * All audio devices please refer to below file:
15784     * system/media/audio/include/system/audio-base.h
15785     *
15786     * Define our own enum values because we don't report all audio devices.
15787     * Currently, we only report built-in audio devices such as handset, speaker,
15788     * built-in mics, common audio devices such as wired headset, usb headset
15789     * and bluetooth devices.
15790     */
15791    enum AudioDevice {
15792        OUTPUT_EARPIECE         = 0x1; // handset
15793        OUTPUT_SPEAKER          = 0x2; // dual speaker
15794        OUTPUT_WIRED_HEADSET    = 0x4; // 3.5mm headset
15795        OUTPUT_USB_HEADSET      = 0x8; // usb headset
15796        OUTPUT_BLUETOOTH_SCO    = 0x10; // bluetooth sco
15797        OUTPUT_BLUETOOTH_A2DP   = 0x20; // a2dp
15798        OUTPUT_SPEAKER_SAFE     = 0x40; // bottom speaker
15799
15800        INPUT_DEVICE_BIT        = 0x40000000; // non-negative positive int32.
15801        INPUT_BUILTIN_MIC       = 0x40000001; // buildin mic
15802        INPUT_BUILTIN_BACK_MIC  = 0x40000002; // buildin back mic
15803        INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
15804        INPUT_USB_HEADSET_MIC   = 0x40000008; // usb headset mic
15805        INPUT_BLUETOOTH_SCO     = 0x40000010; // bluetooth sco mic
15806    }
15807    optional AudioDevice audio_device = 1;
15808
15809    // Duration of the audio in seconds
15810    optional int32 duration_secs = 2;
15811
15812    // Average volume (0 ... 1.0)
15813    optional float average_volume = 3;
15814
15815    enum AudioType {
15816        UNKNOWN_TYPE = 0;
15817        VOICE_CALL_TYPE = 1; // voice call
15818        VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
15819        MEDIA_TYPE = 3; // music and system sound
15820        RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
15821        ALARM_TYPE = 5; // alarm type
15822        // record type
15823        CAMCORDER_TYPE = 6; // camcorder
15824        RECORD_TYPE = 7;  // other recording
15825    }
15826    optional AudioType type = 4;
15827
15828    // Minimum volume duration of the audio in seconds
15829    optional int32 minimum_volume_duration_secs = 5;
15830
15831    // Minimum volume (0 ... 1.0)
15832    optional float minimum_volume = 6;
15833
15834    // Maximum volume duration of the audio in seconds
15835    optional int32 maximum_volume_duration_secs = 7;
15836
15837    // Maximum volume (0 ... 1.0)
15838    optional float maximum_volume = 8;
15839}
15840
15841/**
15842 * Logs the Spatializer capability when the Spatializer is created.
15843 *
15844 * We expect this to occur only once on a healthy system,
15845 * when audioserver is initialized.
15846 *
15847 * On devices that do not support spatialization,
15848 * SpatializerLevel returns SPATIALIZER_LEVEL_NONE only.
15849 *
15850 * Logged from:
15851 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
15852 */
15853message MediametricsSpatializerCapabilitiesReported {
15854    // Available head tracking modes
15855    repeated android.media.audio.HeadTrackingMode head_tracking_modes = 1;
15856
15857    // Available spatializer levels
15858    repeated android.media.audio.SpatializerLevel spatializer_levels = 2;
15859
15860    // Available spatializer modes
15861    repeated android.media.audio.SpatializerMode spatializer_modes = 3;
15862
15863    // Available channel masks, with each channel position bitwise ORed.
15864    // One or more bits from
15865    // system/media/audio/include/system/audio-hal-enums.h
15866    // audio_channel_mask_t, representing the channel configuration
15867    // of AudioTrack data.
15868    //
15869    // Generally the most populated channel_mask is selected for use.
15870    repeated int64 channel_masks = 4;
15871}
15872
15873/**
15874 * Logs when Spatializer is enabled or disabled for a device.
15875 *
15876 * The event field indicates the reason for enabling or disabling:
15877 * through the Settings UI, startup/boot, or new device detection.
15878 *
15879 * The presence of this message indicates that the audio device type
15880 * supports Spatialization; this is generally a fixed
15881 * property of the platform and depends if the device type is considered
15882 * BINAURAL or TRANSAURAL, and the Spatializer support for it.
15883 *
15884 * This logs existing saved state on BOOT and changes afterwards.
15885 * Due to rpc to the MediaMetrics service which generates the atom,
15886 * the timestamp of the atom may have a slight delay.
15887 *
15888 * Logged from:
15889 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
15890 */
15891message MediametricsSpatializerDeviceEnabledReported {
15892    // Device type enumeration, e.g. BUILTIN_SPEAKER, BT_A2DP, etc.
15893    optional android.media.audio.AudioDeviceInfoType type = 1;
15894
15895    // The event field indicates the reason for enabling or disabling:
15896    // NORMAL: from Settings UI.
15897    // BOOT: on startup/boot.
15898    // FIRST: on new device detection.
15899    optional android.media.audio.SpatializerSettingEvent event = 2;
15900
15901    // Whether the spatializer is enabled on that device.
15902    // This triggers only on a change of state.
15903    // If multiple devices share the same type (e.g. bluetooth headsets),
15904    // they will register separate messages.
15905    optional bool enabled = 3;
15906}
15907
15908/**
15909 * Logs whether the HeadTracker is enabled for a device.
15910 *
15911 * This only changes if there is a HeadTracker associated with the device.
15912 *
15913 * This logs existing saved state on BOOT and changes afterwards.
15914 * Due to rpc to the MediaMetrics service which generates the atom,
15915 * the timestamp of the atom may have a slight delay.
15916 *
15917 * Logged from:
15918 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
15919 */
15920message MediametricsHeadTrackerDeviceEnabledReported {
15921    // Device type enumeration, e.g. BUILTIN_SPEAKER, BT_A2DP, etc.
15922    optional android.media.audio.AudioDeviceInfoType type = 1;
15923
15924    // The event field indicates the reason for enabling or disabling:
15925    // NORMAL: from Settings UI.
15926    // BOOT: on startup/boot.
15927    // FIRST: on new device detection.
15928    optional android.media.audio.SpatializerSettingEvent event = 2;
15929
15930    // Whether the head tracker was enabled or disabled on that device.
15931    // This triggers only on a change of state.
15932    // If multiple devices share the same type (e.g. bluetooth headsets),
15933    // they will register separate messages.
15934    optional bool enabled = 3;
15935}
15936
15937/**
15938 * Logs whether the HeadTracker is supported for a device.
15939 *
15940 * Generally a fixed property of the device, but it is possible
15941 * that the HeadTracker sensor might be turned off
15942 * or be temporarily unavailable.
15943 *
15944 * This logs existing saved state on BOOT and changes afterwards.
15945 * Due to rpc to the MediaMetrics service which generates the atom,
15946 * the timestamp of the atom may have a slight delay.
15947 *
15948 * Logged from:
15949 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
15950 */
15951message MediametricsHeadTrackerDeviceSupportedReported {
15952    // Device type enumeration, e.g. BUILTIN_SPEAKER, BT_A2DP, etc.
15953    optional android.media.audio.AudioDeviceInfoType type = 1;
15954
15955    // The event field indicates the reason for enabling or disabling:
15956    // NORMAL: on sensor change.
15957    // BOOT: on startup/boot.
15958    // FIRST: on new device detection.
15959    optional android.media.audio.SpatializerSettingEvent event = 2;
15960
15961    // Whether the head tracker is supported on that device.
15962    // This triggers only on a change of state.
15963    // If multiple devices share the same type (e.g. bluetooth headsets),
15964    // they will register separate messages.
15965    optional bool supported = 3;
15966}
15967
15968/**
15969  * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
15970  *
15971  * Pulled from:
15972  *   StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
15973  */
15974message BytesTransferByTagAndMetered {
15975    optional int32 uid = 1 [(is_uid) = true];
15976
15977    optional bool is_metered = 2;
15978
15979    optional int32 tag = 3;
15980
15981    optional int64 rx_bytes = 4;
15982
15983    optional int64 rx_packets = 5;
15984
15985    optional int64 tx_bytes = 6;
15986
15987    optional int64 tx_packets = 7;
15988}
15989
15990/*
15991 * Logs when the Media Output Switcher finishes a media switch operation.
15992 *
15993 * Logged from:
15994 *  packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java
15995 */
15996message MediaOutputOpSwitchReported {
15997    // Source medium type before switching.
15998    optional android.app.settings.mediaoutput.MediumType source = 1;
15999
16000    // Target medium type after switching.
16001    optional android.app.settings.mediaoutput.MediumType target = 2;
16002
16003    // The result of switching.
16004    optional android.app.settings.mediaoutput.SwitchResult result = 3;
16005
16006    // The detail code of a switching result.
16007    optional android.app.settings.mediaoutput.SubResult subresult = 4;
16008
16009    /*
16010     * The package name of a pre-installed app, whose media session is being switched.
16011     */
16012    optional string media_session_package_name = 5;
16013
16014    // The amount of available wired devices when a switching is being performed.
16015    optional int32 available_wired_device_count = 6;
16016
16017    // The amount of available Bluetooth devices a switching is being performed.
16018    optional int32 available_bt_device_count = 7;
16019
16020    // The amount of available remote devices when a switching is being performed.
16021    optional int32 available_remote_device_count = 8;
16022
16023    // The amount of applied devices within a remote dynamic group after a switching is done.
16024    optional int32 applied_device_count_within_remote_group = 9;
16025}
16026
16027/*
16028 * Logs when the user interact with Media Output Switcher.
16029 *
16030 * Logged from:
16031 *  packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java
16032 */
16033message MediaOutputOpInteractionReported {
16034    /** * The type of interaction with the output switch dialog. */
16035    enum InteractionType {
16036        EXPANSION = 0;
16037        ADJUST_VOLUME = 1;
16038        STOP_CASTING = 2;
16039    }
16040
16041    // Type of interaction.
16042    optional InteractionType interaction_type = 1;
16043
16044    // Type of device that interaction with.
16045    optional android.app.settings.mediaoutput.MediumType target = 2;
16046
16047    // The package name of an application whose media session is being switched.
16048    optional string media_session_package_name= 3;
16049}
16050
16051/**
16052 * Logs when the Assistant is invoked.
16053 *
16054 * Logged from:
16055 *   frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
16056 */
16057message AssistantInvocationReported {
16058
16059    // The event_id (as for UiEventReported).
16060    optional int32 event_id = 1;
16061
16062    // The registered Assistant's uid and package (as for UiEventReported).
16063    optional int32 uid = 2 [(is_uid) = true];
16064    optional string package_name = 3;
16065
16066    // An identifier used to disambiguate which logs refer to a particular invocation of the
16067    // Assistant  (as for UiEventReported).
16068    optional int32 instance_id = 4;
16069
16070    // The state of the device at the time of invocation.
16071    enum DeviceState {
16072        UNKNOWN_DEVICE_STATE = 0;
16073        AOD1 = 1;
16074        AOD2 = 2;
16075        BOUNCER = 3;
16076        UNLOCKED_LOCKSCREEN = 4;
16077        LAUNCHER_HOME = 5;
16078        LAUNCHER_OVERVIEW = 6;
16079        LAUNCHER_ALL_APPS = 7;
16080        APP_DEFAULT = 8;
16081        APP_IMMERSIVE = 9;
16082        APP_FULLSCREEN = 10;
16083    }
16084    optional DeviceState device_state = 5;
16085
16086    // Whether the Assistant handles were showing at the time of invocation.
16087    optional bool assistant_handles_showing = 6;
16088}
16089
16090/**
16091 * Logs when an AudioRecord finishes running on an audio device
16092 *
16093 * Logged from:
16094 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16095 */
16096message MediametricsAudioRecordDeviceUsageReported {
16097    // The devices connected to this AudioRecord.
16098    // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
16099    // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
16100    // See audio_device_t in system/media/audio/include/system/audio-base.h
16101    optional string devices = 1;
16102
16103    // The name of the remote device attached to the device, typically available for USB or BT.
16104    // This may be empty for a fixed device, or separated by "|" if more than one.
16105    optional string device_names = 2;
16106
16107    // The amount of time spent in the device as measured by the active track in AudioFlinger.
16108    optional int64 device_time_nanos = 3;
16109
16110    // The audio data format used for encoding.
16111    // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
16112    optional string encoding = 4;
16113
16114    // The client-server buffer framecount.
16115    // The framecount is generally between 960 - 48000 for PCM encoding.
16116    // The framecount represents raw buffer size in bytes for non-PCM encoding.
16117    optional int32 frame_count = 5;
16118
16119    // The number of audio intervals (contiguous, continuous playbacks).
16120    optional int32 interval_count = 6;
16121
16122    // The sample rate of the AudioRecord.
16123    // A number generally between 8000-96000 (frames per second).
16124    optional int32 sample_rate = 7;
16125
16126    // The audio input flags used to construct the AudioRecord.
16127    // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
16128    optional string flags = 8;
16129
16130    // The santized package name of the audio client associated with the AudioRecord.
16131    // See getSanitizedPackageNameAndVersionCode() in
16132    // frameworks/av/services/mediametrics/MediaMetricsService.cpp
16133    optional string package_name = 9;
16134
16135    // The selected device id (nonzero if a non-default device is selected)
16136    optional int32 selected_device_id = 10;
16137
16138    // The caller of the AudioRecord.
16139    // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
16140    optional string caller = 11;
16141
16142    // The audio source for AudioRecord.
16143    // An enumeration from system/media/audio/include/system/audio-base.h audio_source_t
16144    optional string source = 12;
16145
16146    // Android S
16147    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
16148    // An empty string means no session id is set.
16149    optional string log_session_id = 13;
16150}
16151
16152/**
16153 * Logs when an AudioThread finishes running on an audio device
16154 *
16155 * Logged from:
16156 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16157 */
16158message MediametricsAudioThreadDeviceUsageReported {
16159    // The devices connected to this audio thread.
16160    // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
16161    // (for record threads):
16162    // See lookup<INPUT_DEVICE> in frameworks/av/services/mediametrics/AudioTypes.cpp
16163    // (for playback threads):
16164    // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
16165    // See audio_device_t in system/media/audio/include/system/audio-base.h
16166    optional string devices = 1;
16167
16168    // The name of the remote device attached to the device, typically available for USB or BT.
16169    // This may be empty for a fixed device, or separated by "|" if more than one.
16170    optional string device_names = 2;
16171
16172    // The amount of time spent in the device as measured by the active track in AudioFlinger.
16173    optional int64 device_time_nanos = 3;
16174
16175    // The audio data format used for encoding.
16176    // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
16177    optional string encoding = 4;
16178
16179    // The framecount of the buffer delivered to (or from) the HAL.
16180    // The framecount is generally ~960 for PCM encoding.
16181    // The framecount represents raw buffer size in bytes for non-PCM encoding.
16182    optional int32 frame_count = 5;
16183
16184    // The number of audio intervals (contiguous, continuous playbacks).
16185    optional int32 interval_count = 6;
16186
16187    // The sample rate of the audio thread.
16188    // A number generally between 8000-96000 (frames per second).
16189    optional int32 sample_rate = 7;
16190
16191    // The audio flags used to construct the thread
16192    // (for record threads):
16193    // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
16194    // (for playback threads):
16195    // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
16196    optional string flags = 8;
16197
16198    // The number of underruns encountered for a playback thread or the
16199    // number of overruns encountered for a capture thread.
16200    optional int32 xruns = 9;
16201
16202    // The type of thread
16203    // A thread type enumeration from
16204    // frameworks/av/mediametrics/services/Translate.h
16205    optional string type = 10;
16206}
16207
16208/**
16209 * Logs when an AudioTrack finishes running on an audio device
16210 *
16211 * Logged from:
16212 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16213 */
16214message MediametricsAudioTrackDeviceUsageReported {
16215    // The output devices connected to this AudioTrack.
16216    // A string OR of various output device categories, e.g. "DEVICE1|DEVICE2".
16217    // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
16218    // See audio_device_t in system/media/audio/include/system/audio-base.h
16219    optional string devices = 1;
16220
16221    // The name of the remote device attached to the device, typically available for USB or BT.
16222    // This may be empty for a fixed device, or separated by "|" if more than one.
16223    optional string device_names = 2;
16224
16225    // The amount of time spent in the device as measured by the active track in AudioFlinger.
16226    optional int64 device_time_nanos = 3;
16227
16228    // The audio data format used for encoding.
16229    // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
16230    optional string encoding = 4;
16231
16232    // The client-server buffer framecount.
16233    // The framecount is generally between 960 - 48000 for PCM encoding.
16234    // The framecount represents raw buffer size in bytes for non-PCM encoding.
16235    // A static track (see traits) may have a very large framecount.
16236    optional int32 frame_count = 5;
16237
16238    // The number of audio intervals (contiguous, continuous playbacks).
16239    optional int32 interval_count = 6;
16240
16241    // The sample rate of the AudioTrack.
16242    // A number generally between 8000-96000 (frames per second).
16243    optional int32 sample_rate = 7;
16244
16245    // The audio flags used to construct the AudioTrack.
16246    // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
16247    optional string flags = 8;
16248
16249    // The number of underruns encountered.
16250    optional int32 xruns = 9;
16251
16252    // The santized package name of the audio client associated with the AudioTrack.
16253    // See getSanitizedPackageNameAndVersionCode() in
16254    // frameworks/av/services/mediametrics/MediaMetricsService.cpp
16255    optional string package_name = 10;
16256
16257    // The latency of the last sample in the buffer in milliseconds.
16258    optional float device_latency_millis = 11;
16259
16260    // The startup time in milliseconds from start() to sample played.
16261    optional float device_startup_millis = 12;
16262
16263    // The average volume of the track on the device [ 0.f - 1.f ]
16264    optional float device_volume = 13;
16265
16266    // The selected device id (nonzero if a non-default device is selected)
16267    optional int32 selected_device_id = 14;
16268
16269    // The stream_type category for the AudioTrack.
16270    // An enumeration from system/media/audio/include/system/audio-base.h audio_stream_type_t
16271    optional string stream_type = 15;
16272
16273    // The usage for the AudioTrack.
16274    // An enumeration from system/media/audio/include/system/audio-base.h audio_usage_t
16275    optional string usage = 16;
16276
16277    // The content type of the AudioTrack.
16278    // An enumeration from system/media/audio/include/system/audio-base.h audio_content_type_t
16279    optional string content_type = 17;
16280
16281    // The caller of the AudioTrack.
16282    // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
16283    optional string caller = 18;
16284
16285    // The traits of the AudioTrack.
16286    // A string OR of different traits, may be empty string.
16287    // Only "static" is supported for R.
16288    // See lookup<TRACK_TRAITS>() in frameworks/av/services/mediametrics/AudioTypes.cpp
16289    optional string traits = 19;
16290
16291    // Android S
16292    // Metric log session id, a Base64Url encoded string of a randomly generated 128-bit integer.
16293    // An empty string means no session id is set.
16294    optional string log_session_id = 20;
16295}
16296
16297/**
16298 * Logs the status of an audio device connection attempt.
16299 *
16300 * Logged from:
16301 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16302 */
16303message MediametricsAudioDeviceConnectionReported {
16304    // The input devices represented by this report.
16305    // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
16306    // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
16307    // See audio_device_t in system/media/audio/include/system/audio-base.h
16308    optional string input_devices = 1;
16309
16310    // The output devices represented by this report.
16311    // A string OR of various output device categories.
16312    // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
16313    // See audio_device_t in system/media/audio/include/system/audio-base.h
16314    optional string output_devices = 2;
16315
16316    // The name of the remote device attached to the device, typically available for USB or BT.
16317    // This may be empty for a fixed device, or separated by "|" if more than one.
16318    optional string device_names = 3;
16319
16320    // The result of the audio device connection.
16321    // 0 indicates success: connection verified.
16322    // 1 indicates unknown: connection not verified or not known if diverted properly.
16323    // Other values indicate specific status.
16324    // See DeviceConnectionResult in frameworks/av/services/mediametrics/AudioTypes.h
16325    optional int32 result = 4;
16326
16327    // Average milliseconds of time to connect
16328    optional float time_to_connect_millis = 5;
16329
16330    // Number of connections if aggregated statistics, otherwise 1.
16331    optional int32 connection_count = 6;
16332}
16333
16334/**
16335 * Logs the status of an AudioRecord operation.
16336 *
16337 * Logged from:
16338 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16339 */
16340message MediametricsAudioRecordStatusReported {
16341    // General status code for categorization of status.
16342    optional android.media.Status status = 1;
16343
16344    // Status or error message, e.g. logcat.
16345    optional string debug_message = 2;
16346
16347    // Supplemental status subcode for AudioRecord.
16348    optional int32 status_subcode = 3;
16349
16350    // Uid associated with the AudioRecord.
16351    optional int32 uid = 4 [(is_uid) = true];
16352
16353    // The AudioRecord event.
16354    optional android.media.audio.AudioRecordEvent event = 5;
16355
16356    // Requested AudioRecord flags, with each flag bitwise ORed.
16357    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
16358    // audio_input_flags_t
16359    optional int32 input_flags = 6;
16360
16361    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
16362    // audio_source_t, representing the input source for the AudioRecord.
16363    optional android.media.audio.Source source = 7;
16364
16365    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
16366    // audio_format_t, representing the encoding of the AudioRecord data.
16367    optional android.media.audio.Encoding encoding = 8;
16368
16369    // Channel mask, with each channel position bitwise ORed.
16370    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
16371    // audio_channel_mask_t, representing the input channel configuration
16372    // of AudioRecord data.
16373    optional int64 channel_mask = 9;
16374
16375    // The size of the AudioRecord buffer in frames.
16376    // If an error occurs during creation, this may be a small integer requested size
16377    // as AudioFlinger is entitled to increase this as required.
16378    optional int32 buffer_frame_count = 10;
16379
16380    // Sample rate in Hz.
16381    optional int32 sample_rate = 11;
16382}
16383
16384/**
16385 * Logs the status of an AudioTrack operation.
16386 *
16387 * Logged from:
16388 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
16389 */
16390message MediametricsAudioTrackStatusReported {
16391    // General status code for categorization of status.
16392    optional android.media.Status status = 1;
16393
16394    // Status or error message, e.g. logcat.
16395    optional string debug_message = 2;
16396
16397    // Supplemental status subcode for AudioTrack.
16398    optional int32 status_subcode = 3;
16399
16400    // Uid associated with track
16401    optional int32 uid = 4 [(is_uid) = true];
16402
16403    // The AudioTrack event.
16404    optional android.media.audio.AudioTrackEvent event = 5;
16405
16406    // Requested AudioTrack flags, with each flag bitwise ORed.
16407    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
16408    // audio_output_flags_t
16409    optional int32 output_flags = 6;
16410
16411    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
16412    // audio_content_type_t, representing the content type of the AudioTrack.
16413    optional android.media.audio.ContentType content_type = 7;
16414
16415    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
16416    // audio_usage_t, representing the use case for the AudioTrack.
16417    optional android.media.audio.Usage usage = 8;
16418
16419    // An enumeration from system/media/audio/include/system/audio-hal-enums.h
16420    // audio_format_t, representing the encoding of the AudioTrack data.
16421    optional android.media.audio.Encoding encoding = 9;
16422
16423    // Channel mask, with each channel position bitwise ORed.
16424    // One or more bits from system/media/audio/include/system/audio-hal-enums.h
16425    // audio_channel_mask_t, representing the channel configuration of AudioTrack data.
16426    optional int64 channel_mask = 10;
16427
16428    // The size of the AudioTrack buffer in frames.
16429    // If an error occurs during creation, this may be a small integer requested size
16430    // as AudioFlinger is entitled to increase this as required.
16431    optional int32 buffer_frame_count = 11;
16432
16433    // Sample rate in Hz.
16434    optional int32 sample_rate = 12;
16435
16436    // Playback speed, nominal 1.f representing 1x.
16437    optional float speed = 13;
16438
16439    // Playback pitch, nominal 1.f representing 1x.
16440    optional float pitch = 14;
16441}
16442
16443/**
16444 * Logs: i) creation of different types of cryptographic keys in the keystore,
16445 * ii) operations performed using the keys,
16446 * iii) attestation of the keys
16447 * Logged from: system/security/keystore/key_event_log_handler.cpp
16448 */
16449message KeystoreKeyEventReported {
16450
16451    enum Algorithm {
16452        /** Asymmetric algorithms. */
16453        RSA = 1;
16454        // 2 removed, do not reuse.
16455        EC = 3;
16456        /** Block cipher algorithms */
16457        AES = 32;
16458        TRIPLE_DES = 33;
16459        /** MAC algorithms */
16460        HMAC = 128;
16461    };
16462    /** Algorithm associated with the key */
16463    optional Algorithm algorithm = 1;
16464
16465    /** Size of the key */
16466    optional int32 key_size = 2;
16467
16468    enum KeyOrigin {
16469        /** Generated in keymaster.  Should not exist outside the TEE. */
16470        GENERATED = 0;
16471        /** Derived inside keymaster.  Likely exists off-device. */
16472        DERIVED = 1;
16473        /** Imported into keymaster.  Existed as cleartext in Android. */
16474        IMPORTED = 2;
16475        /** Keymaster did not record origin. */
16476        UNKNOWN = 3;
16477        /** Securely imported into Keymaster. */
16478        SECURELY_IMPORTED = 4;
16479    };
16480    /* Logs whether the key was generated, imported, securely imported, or derived.*/
16481    optional KeyOrigin key_origin = 3;
16482
16483    enum HardwareAuthenticatorType {
16484        NONE = 0;
16485        PASSWORD = 1;
16486        FINGERPRINT = 2;
16487        // Additional entries must be powers of 2.
16488    };
16489    /**
16490     * What auth types does this key require? If none,
16491     * then no auth required.
16492     */
16493    optional HardwareAuthenticatorType user_auth_type = 4;
16494
16495    /**
16496     * If user authentication is required, is the requirement time based? If it
16497     * is not time based then this field will not be used and the key is per
16498     * operation. Per operation keys must be user authenticated on each usage.
16499     */
16500    optional int32 user_auth_key_timeout_secs = 5;
16501
16502    /**
16503     * padding mode, digest, block_mode and purpose should ideally be repeated
16504     * fields. However, since statsd does not support repeated fields in
16505     * pushed atoms, they are represented using bitmaps.
16506     */
16507
16508    /** Track which padding mode is being used.*/
16509    optional int32 padding_mode_bitmap = 6;
16510
16511    /** Track which digest is being used. */
16512    optional int32 digest_bitmap = 7;
16513
16514    /** Track what block mode is being used (for encryption). */
16515    optional int32 block_mode_bitmap = 8;
16516
16517    /** Track what purpose is this key serving. */
16518    optional int32 purpose_bitmap = 9;
16519
16520    enum EcCurve {
16521        P_224 = 0;
16522        P_256 = 1;
16523        P_384 = 2;
16524        P_521 = 3;
16525    };
16526    /** Which ec curve was selected if elliptic curve cryptography is in use **/
16527    optional EcCurve ec_curve = 10;
16528
16529    enum KeyBlobUsageRequirements {
16530        STANDALONE = 0;
16531        REQUIRES_FILE_SYSTEM = 1;
16532    };
16533    /** Standalone or is a file system required */
16534    optional KeyBlobUsageRequirements key_blob_usage_reqs = 11;
16535
16536    enum Type {
16537        key_operation = 0;
16538        key_creation = 1;
16539        key_attestation = 2;
16540    }
16541    /** Key creation event, operation event or attestation event? */
16542    optional Type type = 12;
16543
16544    /** Was the key creation, operation, or attestation successful? */
16545    optional bool was_successful = 13;
16546
16547    /** Response code or error code */
16548    optional int32 error_code = 14;
16549}
16550
16551/**
16552 * Logs: key creation events with Algorithm, Origin, Error and Attestation info.
16553 * Logged from: system/security/keystore2/metrics.rs
16554 */
16555message Keystore2KeyCreationWithGeneralInfo {
16556
16557    // Algorithm associated with the key
16558    optional android.system.security.keystore2.Algorithm algorithm = 1;
16559
16560    // Size of the key, based on the algorithm used.
16561    optional int32 key_size = 2;
16562
16563    enum EcCurve {
16564        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
16565        EC_CURVE_UNSPECIFIED = 0;
16566        P_224 = 1;
16567        P_256 = 2;
16568        P_384 = 3;
16569        P_521 = 4;
16570        CURVE_25519 = 5;
16571    };
16572    // Which ec curve was selected if elliptic curve cryptography is in use
16573    optional EcCurve ec_curve = 3;
16574
16575    enum KeyOrigin {
16576        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
16577        ORIGIN_UNSPECIFIED = 0;
16578        // Generated in keymaster.  Should not exist outside the TEE.
16579        GENERATED = 1;
16580        // Derived inside keymaster.  Likely exists off-device.
16581        DERIVED = 2;
16582        // Imported into keymaster.  Existed as cleartext in Android.
16583        IMPORTED = 3;
16584        // Previously used for another purpose that is now obsolete.
16585        RESERVED = 4;
16586        // Securely imported into Keymaster.
16587        SECURELY_IMPORTED = 5;
16588    };
16589    // Logs whether the key was generated, imported, securely imported, or derived.
16590    optional KeyOrigin key_origin = 4;
16591
16592    /**
16593     * Response code (system/hardware/interfaces/keystore2/aidl/../ResponseCode.aidl)
16594     * or
16595     * error code (hardware/interfaces/security/keymint/aidl/../ErrorCode.aidl)
16596     */
16597    optional int32 error_code = 5;
16598
16599    // Indicates whether key attestation is requested in creation
16600    optional bool attestation_requested = 6;
16601
16602    // Count of a particular combination of field values of this atom
16603    optional int32 count = 7;
16604}
16605
16606/**
16607 * Logs: key creation events with authentication info.
16608 * Logged from: system/security/keystore2/metrics.rs
16609 */
16610message Keystore2KeyCreationWithAuthInfo {
16611
16612    enum HardwareAuthenticatorType {
16613        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
16614        AUTH_TYPE_UNSPECIFIED = 0;
16615        NONE = 1;
16616        PASSWORD = 2;
16617        FINGERPRINT = 3;
16618        ANY = 5;
16619    };
16620    /**
16621     * What auth types does this key require? If none,
16622     * then no auth required.
16623     */
16624    optional HardwareAuthenticatorType user_auth_type = 1;
16625
16626    /**
16627     * If user authentication is required, is the requirement time based? If it
16628     * is time based then this field indicates the base 10 logarithm of time out in seconds.
16629     * Logarithm is taken in order to reduce the cardinaltiy.
16630     */
16631    optional int32 log_auth_timeout_seconds = 2;
16632
16633    // Security level of the Keymint instance which creates the key.
16634    optional android.system.security.keystore2.SecurityLevelEnum security_level = 3;
16635
16636    // Count of a particular combination of field values of this atom
16637    optional int32 count = 4;
16638}
16639
16640/**
16641 * Logs: key creation events with purpose and modes info.
16642 * Logged from: system/security/keystore2/metrics.rs
16643 */
16644message Keystore2KeyCreationWithPurposeAndModesInfo {
16645    // Algorithm associated with the key
16646    optional android.system.security.keystore2.Algorithm algorithm = 1;
16647
16648	/**
16649     * Track which purpose is being used.
16650     * Bitmap composition is given by KeyPurposeBitPosition enum
16651     * defined in system/security/keystore2/metrics.rs.
16652     */
16653    optional int32 purpose_bitmap = 2;
16654
16655    /**
16656     * Track which padding mode is being used.
16657     * Bitmap composition is given by PaddingModeBitPosition enum
16658     * defined in system/security/keystore2/metrics.rs.
16659     */
16660    optional int32 padding_mode_bitmap = 3;
16661
16662    /**
16663     * Track which digest is being used.
16664     * Bitmap composition is given by DigestBitPosition enum
16665     * defined in system/security/keystore2/metrics.rs.
16666     */
16667    optional int32 digest_bitmap = 4;
16668
16669    /**
16670     * Track which block mode is being used.
16671     * Bitmap composition is given by BlockModeBitPosition enum
16672     * defined in system/security/keystore2/metrics.rs.
16673     */
16674    optional int32 block_mode_bitmap = 5;
16675
16676    // Count of a particular combination of field values of this atom
16677    optional int32 count = 6;
16678}
16679
16680/**
16681 * Logs the atom id of the atoms associated with key creation/operation events, that have reached
16682 * the maximum storage limit allocated for different atom objects of that atom,
16683 * in keystore in-memory store.
16684 *
16685 * Size of the storage bucket for each atom is limited considering their expected cardinaltity.
16686 * This limit may exceed if the dimensions of the atoms take a large number of unexpected
16687 * combinations. This atom is used to track such cases.
16688 */
16689message Keystore2AtomWithOverflow {
16690
16691    // Atom id as defined in atoms.proto
16692    optional int32 atom_id = 1;
16693
16694    // Count of the objects of this atom type that have overflowed.
16695    optional int32 count = 2;
16696}
16697
16698/**
16699 * Logs: key operations events with purpose and modes info.
16700 * Logged from: system/security/keystore2/metrics.rs
16701 */
16702message Keystore2KeyOperationWithPurposeAndModesInfo {
16703
16704    enum KeyPurpose {
16705        // Unspecified takes 0. Other values are incremented by 1 compared to keymint spec.
16706        KEY_PURPOSE_UNSPECIFIED = 0;
16707
16708        // Usable with RSA, 3DES and AES keys.
16709        ENCRYPT = 1;
16710
16711        // Usable with RSA, 3DES and AES keys.
16712        DECRYPT = 2;
16713
16714        // Usable with RSA, EC and HMAC keys.
16715        SIGN = 3;
16716
16717        // Usable with RSA, EC and HMAC keys.
16718        VERIFY = 4;
16719
16720        // 5 is reserved
16721        // Usable with RSA keys.
16722        WRAP_KEY = 6;
16723
16724        // Key Agreement, usable with EC keys.
16725        AGREE_KEY = 7;
16726
16727        // Usable as an attestation signing key.
16728        ATTEST_KEY = 8;
16729    }
16730    // Purpose of the key operation
16731    optional KeyPurpose purpose = 1;
16732
16733    /**
16734     * Track which padding mode is being used.
16735     * Bitmap composition is given by PaddingModeBitPosition enum
16736     * defined in system/security/keystore2/metrics.rs.
16737     */
16738    optional int32 padding_mode_bitmap = 2;
16739
16740    /**
16741     * Track which digest is being used.
16742     * Bitmap composition is given by DigestBitPosition enum
16743     * defined in system/security/keystore2/metrics.rs.
16744     */
16745    optional int32 digest_bitmap = 3;
16746
16747    /**
16748     * Track which block mode is being used.
16749     * Bitmap composition is given by BlockModeBitPosition enum
16750     * defined in system/security/keystore2/metrics.rs.
16751     */
16752    optional int32 block_mode_bitmap = 4;
16753
16754    // Count of a particular combination of field values of this atom
16755    optional int32 count = 5;
16756}
16757
16758/**
16759 * Logs key operations events with outcome, error_code, security level and whether the key is
16760 * upgraded during the operation.
16761 * Logged from: system/security/keystore2/metrics.rs
16762 */
16763message Keystore2KeyOperationWithGeneralInfo {
16764
16765    enum Outcome {
16766        OUTCOME_UNSPECIFIED = 0;
16767        DROPPED = 1;
16768        SUCCESS = 2;
16769        ABORT = 3;
16770        PRUNED = 4;
16771        ERROR = 5;
16772    }
16773    // Outcome of the operation
16774    optional Outcome outcome = 1;
16775
16776    // Response code or error code in case of error outcome
16777    optional int32 error_code = 2;
16778
16779    // Indicates whether the key was upgraded during the operation
16780    optional bool key_upgraded = 3;
16781
16782    // Security level of the Keymint instance which performs the operation.
16783    optional android.system.security.keystore2.SecurityLevelEnum security_level = 4;
16784
16785    // Count of a particular combination of field values of this atom
16786    optional int32 count = 5;
16787}
16788
16789/**
16790 * Logs: Keystore 2 storage statistics.
16791 * Logged from: system/security/keystore2
16792 */
16793message Keystore2StorageStats {
16794    enum Storage {
16795       STORAGE_UNSPECIFIED = 0;
16796       KEY_ENTRY = 1;
16797       KEY_ENTRY_ID_INDEX = 2;
16798       KEY_ENTRY_DOMAIN_NAMESPACE_INDEX = 3;
16799       BLOB_ENTRY = 4;
16800       BLOB_ENTRY_KEY_ENTRY_ID_INDEX = 5;
16801       KEY_PARAMETER = 6;
16802       KEY_PARAMETER_KEY_ENTRY_ID_INDEX = 7;
16803       KEY_METADATA = 8;
16804       KEY_METADATA_KEY_ENTRY_ID_INDEX = 9;
16805       GRANT = 10;
16806       AUTH_TOKEN = 11;
16807       BLOB_METADATA = 12;
16808       BLOB_METADATA_BLOB_ENTRY_ID_INDEX =13;
16809       METADATA = 14;
16810       DATABASE = 15;
16811       LEGACY_STORAGE = 16;
16812    }
16813    // Type of the storage (database table or legacy storage) of which the size is reported.
16814    optional Storage storage_type = 1;
16815    // Storage size in bytes
16816    optional int64 size = 2;
16817    // Unused space, in bytes. The total storage size may be larger, indicating
16818    // inefficiencies in the packing of data in the database.
16819    optional int64 unused_size = 3;
16820}
16821
16822/**
16823 * Logs Remote Key Provisioning (RKP) related error events.
16824 * Logged from: system/security/keystore2
16825 */
16826message RkpErrorStats {
16827
16828    enum RkpError {
16829        RKP_ERROR_UNSPECIFIED = 0;
16830        // The key pool is out of keys.
16831        OUT_OF_KEYS = 1;
16832        // Falling back to factory provisioned keys during hybrid mode.
16833        FALL_BACK_DURING_HYBRID = 2;
16834    }
16835    // Type of the error event
16836    optional RkpError rkp_error = 1;
16837
16838    // Count of a particular error occurred.
16839    optional int32 count = 2;
16840
16841    /**
16842     * Security level of the IRemotelyProvisionedComponent.
16843     */
16844    optional android.system.security.keystore2.SecurityLevelEnum security_level = 3;
16845}
16846
16847
16848/**
16849 * Logs: Status of the attestation key pool related to
16850 * Remote Key Provisioning (RKP).
16851 * Logged from: system/security/keystore2
16852 */
16853message RkpPoolStats {
16854    /**
16855     * Security level of the Keymint instance associated with the
16856     * attestation pool status.
16857     */
16858    optional android.system.security.keystore2.SecurityLevelEnum security_level = 1;
16859
16860    /**
16861     * The number of signed attestation certificate chains which are
16862     * expired.
16863     */
16864    optional int32 expiring = 2;
16865
16866    /**
16867     * The number of signed attestation certificate chains which have
16868     * not yet been assigned to an app.
16869     */
16870    optional int32 unassigned = 3;
16871
16872    /**
16873     * The number of signed attestation keys.
16874     */
16875    optional int32 attested = 4;
16876
16877    /**
16878     * The total number of attestation keys.
16879     */
16880    optional int32 total = 5;
16881
16882}
16883
16884/**
16885 * Logs: Number of keystore2 crashes per-boot cycle.
16886 * Logged from: system/security/keystore2
16887 */
16888message Keystore2CrashStats {
16889    optional int32 count_of_crash_events = 1;
16890}
16891
16892// Blob Committer stats
16893// Keep in sync between:
16894//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
16895//     frameworks/base/cmds/statsd/src/atoms.proto
16896message BlobCommitterProto {
16897    // Committer app's uid
16898    optional int32 uid = 1 [(is_uid) = true];
16899
16900    // Unix epoch timestamp of the commit in milliseconds
16901    optional int64 commit_timestamp_millis = 2;
16902
16903    // Flags of what access types the committer has set for the Blob
16904    optional int32 access_mode = 3;
16905
16906    // Number of packages that have been whitelisted for ACCESS_TYPE_WHITELIST
16907    optional int32 num_whitelisted_package = 4;
16908}
16909
16910// Blob Leasee stats
16911// Keep in sync between:
16912//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
16913//     frameworks/base/cmds/statsd/src/atoms.proto
16914message BlobLeaseeProto {
16915    // Leasee app's uid
16916    optional int32 uid = 1 [(is_uid) = true];
16917
16918    // Unix epoch timestamp for lease expiration in milliseconds
16919    optional int64 lease_expiry_timestamp_millis = 2;
16920}
16921
16922// List of Blob Committers
16923// Keep in sync between:
16924//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
16925//     frameworks/base/cmds/statsd/src/atoms.proto
16926message BlobCommitterListProto {
16927    repeated BlobCommitterProto committer = 1;
16928}
16929
16930// List of Blob Leasees
16931// Keep in sync between:
16932//     frameworks/proto_logging/stats/enums/server/blobstoremanagerservice.proto
16933//     frameworks/base/cmds/statsd/src/atoms.proto
16934message BlobLeaseeListProto {
16935    repeated BlobLeaseeProto leasee = 1;
16936}
16937
16938/**
16939 * Logs the current state of a Blob committed with BlobStoreManager
16940 *
16941 * Pulled from:
16942 *  frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
16943 */
16944message BlobInfo {
16945    // Id of the Blob
16946    optional int64 blob_id = 1;
16947
16948    // Size of the Blob data
16949    optional int64 size = 2;
16950
16951    // Unix epoch timestamp of the Blob's expiration in milliseconds
16952    optional int64 expiry_timestamp_millis = 3;
16953
16954    // List of committers of this Blob
16955    optional BlobCommitterListProto committers = 4 [(log_mode) = MODE_BYTES];
16956
16957    // List of leasees of this Blob
16958    optional BlobLeaseeListProto leasees = 5 [(log_mode) = MODE_BYTES];
16959}
16960
16961/**
16962 * Logs when the HDMI CEC active source changes.
16963 *
16964 * Logged from:
16965 *   frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecAtomWriter.java
16966 */
16967message HdmiCecActiveSourceChanged {
16968    // The logical address of the active source.
16969    optional android.stats.hdmi.LogicalAddress active_source_logical_address = 1;
16970
16971    // The physical address of the active source. Consists of four hexadecimal nibbles.
16972    // Examples: 0x1234, 0x0000 (root device). 0xFFFF represents an unknown or invalid address.
16973    // See section 8.7 in the HDMI 1.4b spec for details.
16974    optional int32 active_source_physical_address = 2;
16975
16976    // The relationship between this device and the active source.
16977    optional android.stats.hdmi.PathRelationship local_relationship = 3;
16978}
16979
16980/**
16981 * Logs when an HDMI CEC message is sent or received.
16982 *
16983 * Logged from:
16984 *   frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecAtomWriter.java
16985 */
16986message HdmiCecMessageReported {
16987    // The calling uid of the application that caused this atom to be written.
16988    optional int32 uid = 1 [(is_uid) = true];
16989
16990    // Whether a HDMI CEC message is sent from this device, to this device, or neither.
16991    optional android.stats.hdmi.MessageDirection direction = 2;
16992
16993    // The HDMI CEC logical address of the initiator.
16994    optional android.stats.hdmi.LogicalAddress initiator_logical_address = 3;
16995
16996    // The HDMI CEC logical address of the destination.
16997    optional android.stats.hdmi.LogicalAddress destination_logical_address = 4;
16998
16999    // The opcode of the message. Ranges from 0x00 to 0xFF.
17000    // For all values, see section "CEC 15 Message Descriptions" in the HDMI CEC 1.4b spec.
17001    optional int32 opcode = 5;
17002
17003    // The result of attempting to send the message on its final retransmission attempt.
17004    // Only applicable to outgoing messages; set to SEND_MESSAGE_RESULT_UNKNOWN otherwise.
17005    optional android.stats.hdmi.SendMessageResult send_message_result = 6;
17006
17007    // Fields specific to <User Control Pressed> messages
17008
17009    // The user control command that was received.
17010    optional android.stats.hdmi.UserControlPressedCommand user_control_pressed_command = 7;
17011
17012    // Fields specific to <Feature Abort> messages
17013
17014    // The opcode of the message that was feature aborted.
17015    // Set to 0x100 when unknown or not applicable.
17016    optional int32 feature_abort_opcode = 8;
17017
17018    // The reason for the feature abort.
17019    optional android.stats.hdmi.FeatureAbortReason feature_abort_reason = 9;
17020}
17021
17022/**
17023 * Logs when an auto rotate event occurs while smart auto rotate is enabled.
17024 */
17025message AutoRotateReported {
17026    enum Orientation {
17027        UNKNOWN = 0;
17028        DEPRECATED = 1;
17029        ROTATION_0 = 2;
17030        ROTATION_90 = 3;
17031        ROTATION_180 = 4;
17032        ROTATION_270 = 5;
17033        DISABLED = 6;
17034        UNAVAILABLE = 7;
17035        FAILURE = 8;
17036    }
17037
17038    // Orientation of the device when a rotation was detected.
17039    optional Orientation current_orientation = 1;
17040    // The orientation of the phone after rotation before going through the recommendation service.
17041    optional Orientation proposed_orientation = 2;
17042    // Orientation recommended by the smart autorotate service component outside of the platform. It
17043    // may or may not match the proposed_orientation. Can be disabled or unavailable if the
17044    // recommendation service is disabled or unavailable. Will be unknown if the service failed.
17045    optional Orientation recommended_orientation = 3;
17046    // Time taken to calculate the rotation recommendation.
17047    optional int64 recommendation_process_duration_millis = 4;
17048}
17049
17050/**
17051 * Logs when sensors only autorotate is triggered. Associated event can be a rotation preindication,
17052 * actual event or a "data ready to be pulled" indication. More info: go/autorotate-logging.
17053 *
17054 * Logged from:
17055 *    platform/vendor/unbundled_google/packages/SystemUIGoogle/src/com/google/android/systemui/autorotate/DataLogger.java
17056 */
17057
17058message DeviceRotated {
17059  // Timestamp of the event in millis. We log the timestamp explicitly since
17060  // data logging will follow the event logging and all these
17061  // will be joined with other logs such as rotation button clicked.
17062  optional int64 timestamp_millis = 1;
17063  // Device orientation
17064  optional android.stats.wm.Orientation proposed_orientation = 2;
17065
17066  enum RotationEventType{
17067    UNKNOWN = 0;
17068    // An early indication of device might be rotated.
17069    PREINDICATION = 1;
17070    // Device rotation is detected.
17071    ACTUAL_EVENT = 2;
17072    // Device rotated and the data associated with it is ready to be pulled.
17073    // This happens after the ACTUAL_EVENT since some data after the event is
17074    // also useful.
17075    DATA_READY = 3;
17076  }
17077  optional RotationEventType rotation_event_type = 3;
17078}
17079
17080/**
17081 * Records the raw sensor data published by the device orientation debug sensor. The pull will be
17082 * configured to be conditioned on the {@code DeviceRotated} atom.
17083 *
17084 * Logged from:
17085 *     platform/vendor/unbundled_google/packages/SystemUIGoogle/src/com/google/android/systemui/autorotate/DataLogger.java
17086 */
17087message DeviceRotatedData {
17088  // All the sensor data and timestamps used to calculate the orientation
17089  optional DeviceRotatedSensorData snapshot = 1 [(log_mode) = MODE_BYTES];
17090  // Resulting orientation
17091  optional android.stats.wm.Orientation proposed_orientation = 2;
17092}
17093
17094message DeviceRotatedSensorData {
17095  optional DeviceRotatedSensorHeader header = 1 [(log_mode) = MODE_BYTES];
17096  repeated DeviceRotatedSensorSample sample = 2 [(log_mode) = MODE_BYTES];
17097}
17098
17099message DeviceRotatedSensorHeader {
17100  optional int64 timestamp_base_millis = 1;
17101}
17102
17103message DeviceRotatedSensorSample{
17104  optional int32 timestamp_offset_millis = 1;
17105  enum SensorType {
17106    UNKNOWN = 0;
17107    ACCEL = 1;
17108    GYRO = 2;
17109  }
17110  optional SensorType sensor_type = 2;
17111  optional float x_value = 3;
17112  optional float y_value = 4;
17113  optional float z_value = 5;
17114}
17115
17116/**
17117  * Pushes TLS handshake counters from Conscrypt.
17118  * Pulled from:
17119  *   external/conscrypt/common/src/main/java/org/conscrypt/ConscryptEngineSocket.java
17120  *   external/conscrypt/common/src/main/java/org/conscrypt/ConscryptFileDescriptorSocket.java
17121  */
17122message TlsHandshakeReported {
17123    optional bool success = 1;
17124
17125    optional android.stats.tls.Protocol protocol = 2;
17126
17127    optional android.stats.tls.CipherSuite cipher_suite = 3;
17128
17129    optional int32 handshake_duration_millis = 4;
17130}
17131
17132/**
17133 * Logs when a TextClassifier API is invoked.
17134 *
17135 * See frameworks/base/core/java/android/view/textclassifier/TextClassifier.java
17136 * Logged from: external/libtextclassifier/java/
17137 */
17138message TextClassifierApiUsageReported {
17139    enum ApiType {
17140        UNKNOWN_API = 0;
17141        SUGGEST_SELECTION = 1;
17142        CLASSIFY_TEXT = 2;
17143        GENERATE_LINKS = 3;
17144        DETECT_LANGUAGES = 4;
17145        SUGGEST_CONVERSATION_ACTIONS = 5;
17146    }
17147    optional ApiType api_type = 1;
17148
17149    enum ResultType {
17150        UNKNOWN_RESULT = 0;
17151        SUCCESS = 1;
17152        FAIL = 2;
17153    }
17154    optional ResultType result_type = 2;
17155    optional int64 latency_millis = 3;
17156    optional string session_id = 4;
17157}
17158
17159/**
17160 * Logs when TextClassifier Model Downloader finishes a download task.
17161 *
17162 * Currently we create a downlaod task for each new manifest to download.
17163 *
17164 * Logged from: external/libtextclassifier/java/
17165 */
17166message TextClassifierDownloadReported {
17167    // The model type to download
17168    enum ModelType {
17169        UNKNOWN_MODEL_TYPE = 0;
17170        ANNOTATOR = 1;
17171        LANG_ID = 2;
17172        ACTIONS_SUGGESTIONS = 3;
17173    }
17174    optional ModelType model_type = 1;
17175    // The file type to download
17176    enum FileType {
17177        UNKNOWN_FILE_TYPE = 0;
17178        MANIFEST = 1;
17179        MODEL = 2;
17180    }
17181    // Deprecated: now manifest and model files are downloaded together.
17182    optional FileType file_type = 2;
17183    // The status of the download
17184    enum DownloadStatus {
17185        UNKNOWN_STATUS = 0;
17186        SCHEDULED = 1;
17187        SUCCEEDED = 2;
17188        FAILED_AND_RETRY = 3;
17189        FAILED_AND_ABORT = 4;
17190    }
17191    optional DownloadStatus download_status = 3;
17192    // The public GStatic url we used to download the model. Contains locale info.
17193    optional string url_suffix = 4;
17194    // Failure reason, only set if this is for a failure status
17195    enum FailureReason {
17196        reserved 1, 8, 9;
17197
17198        UNKNOWN_FAILURE_REASON = 0;
17199        FAILED_TO_DOWNLOAD_SERVICE_CONN_BROKEN = 2;
17200        FAILED_TO_DOWNLOAD_404_ERROR = 3;
17201        FAILED_TO_DOWNLOAD_OTHER = 4;
17202        DOWNLOADED_FILE_MISSING = 5;
17203        FAILED_TO_PARSE_MANIFEST = 6;
17204        FAILED_TO_VALIDATE_MODEL = 7;
17205    }
17206    optional FailureReason failure_reason = 5;
17207    // How many attempts we have tried for the same task at a terminal status (i.e. SUCCEEDED or
17208    // FAILED_AND_ABORT).
17209    optional int32 run_attempt_count = 6;
17210
17211    // Custom failure code for downloader lib internal failures (E.g. 404 error).
17212    optional int32 downloader_lib_failure_code = 7;
17213
17214    // Time elapsed for the whole download task
17215    optional int64 download_duration_millis = 8;
17216
17217    // The id of the WorkManager work that launched this download.
17218    optional int64 work_id = 9;
17219}
17220
17221/**
17222 * Logs when TextClassifier Model Downloader schedules a WorkManager work.
17223 *
17224 * Logged from: external/libtextclassifier/java/
17225 */
17226message TextClassifierDownloadWorkScheduled {
17227    optional int64 work_id = 1;
17228
17229    enum ReasonToSchedule {
17230        UNKNOWN_REASON_TO_SCHEDULE = 0;
17231        TCS_STARTED = 1;
17232        LOCALE_SETTINGS_CHANGED = 2;
17233        DEVICE_CONFIG_UPDATED = 3;
17234    }
17235    optional ReasonToSchedule reason_to_schedule = 2;
17236
17237    optional bool failed_to_schedule = 3;
17238}
17239
17240/**
17241 * Logs when TextClassifier Model Downloader finishes a WorkManager work.
17242 *
17243 * A WorkManager work includes one or more downlad tasks. We log this atom when
17244 * all tasks finished. The work_id can be used to join work log and task logs.
17245 *
17246 * Logged from: external/libtextclassifier/java/
17247 */
17248message TextClassifierDownloadWorkCompleted {
17249    optional int64 work_id = 1;
17250
17251    enum WorkResult {
17252        UNKNOWN_WORK_RESULT = 0;
17253        SUCCESS_MODEL_DOWNLOADED = 1;
17254        SUCCESS_NO_UPDATE_AVAILABLE = 2;
17255        FAILURE_MODEL_DOWNLOADER_DISABLED = 3;
17256        FAILURE_MAX_RUN_ATTEMPT_REACHED = 4;
17257        RETRY_MODEL_DOWNLOAD_FAILED = 5;
17258        RETRY_RUNTIME_EXCEPTION = 6;
17259        RETRY_STOPPED_BY_OS = 7;
17260    }
17261    optional WorkResult work_result = 2;
17262
17263    // How many attempts we have tried for this work.
17264    optional int32 run_attempt_count = 3;
17265
17266    optional int64 work_scheduled_to_started_duration_millis = 4;
17267    optional int64 work_started_to_ended_duration_millis = 5;
17268}
17269
17270/**
17271 * Logs telemetry for Android Virtualization framework
17272 *
17273 * On CreateVM requests, an atom is pushed that records what hypervisor is being used.
17274 * the protected status of the new VM, and if the VM creation succeeded
17275 * Logged from: packages/modules/Virtualization/
17276 */
17277message VmCreationRequested {
17278    enum Hypervisor {
17279        UNKNOWN = 0;
17280        PKVM = 1;
17281        OTHER = 2;
17282    }
17283    optional Hypervisor hypervisor = 1;
17284    // Is the VM started in protected mode?
17285    optional bool is_protected = 2;
17286    // Did the VM creation succeed
17287    optional bool creation_succeeded = 3;
17288    // Binder exception Code thrown by createVm request
17289    optional int32 binder_exception_code = 4;
17290}
17291
17292/**
17293 * Logs telemetry for Early boot CompOsArtifacts checks (done by odsign)
17294 *
17295 * odsign is a binary that runs during early boot. One of its responsibility is
17296 * to check if the device can use compOS and check if so, validate the compos
17297 * generated artifacts. An atom is pushed on each such check. Note: We only
17298 * push an atom from devices/configurations that can use compOs.
17299 */
17300message EarlyBootCompOsArtifactsCheckReported {
17301  // Are the current Artifacts okay (This check is done by odrefresh).
17302  // (current_artifacts_ok == true) => compilationRequired is false
17303  optional bool current_artifacts_ok = 1;
17304  // Has CompOs generated any Artifacts
17305  optional bool comp_os_pending_artifacts_exists = 2;
17306  // The device will be using CompOs generated artifacts. Note: the value of
17307  // this is meaningless if current_artifacts_ok = true
17308  optional bool use_comp_os_generated_artifacts = 3;
17309}
17310
17311/**
17312 * Logs telemetry when Isolation compilation job is scheduled.
17313 *
17314 * The atoms are sent by IsolatedCompilationService (fragment of system_server)
17315 * when apex are staged and need compilation.
17316 */
17317message IsolatedCompilationScheduled {
17318    enum Result {
17319        SCHEDULING_RESULT_UNKNOWN = 0;
17320        SCHEDULING_FAILURE = 1;
17321        SCHEDULING_SUCCESS = 2;
17322    }
17323    optional Result scheduling_result = 1;
17324}
17325
17326/**
17327 * Logs telemetry Isolation compilation completion.
17328 *
17329 * The atoms is sent by IsolatedCompilationService by compilation ends
17330 * and contain results/timings of compilation
17331 */
17332message IsolatedCompilationEnded {
17333    enum Result {
17334        RESULT_UNKNOWN = 0;
17335        RESULT_SUCCESS = 1;
17336        RESULT_UNKNOWN_FAILURE = 2;
17337        RESULT_FAILED_TO_START = 3;
17338        RESULT_JOB_CANCELED = 4;
17339        RESULT_COMPILATION_FAILED = 5;
17340        RESULT_UNEXPECTED_COMPILATION_RESULT = 6;
17341        RESULT_COMPOSD_DIED = 7;
17342    }
17343    // Time between compilation job starts to when it ends.
17344    // Note: this does not include the time between compilation job being scheduled (or when apex is staged)
17345    // and it actually starting
17346    optional int64 compilation_time_millis = 1;
17347    // Result of compilation
17348    optional Result compilation_result = 2;
17349}
17350
17351/**
17352 * Logs the current state of an application/process before it is killed.
17353 *
17354 * Keep in sync with proto file at
17355 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
17356 *
17357 * Pushed from:
17358 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
17359 */
17360message CarWatchdogKillStatsReported {
17361    // Linux process uid for the package.
17362    optional int32 uid = 1 [(is_uid) = true];
17363
17364    // State of the uid when it was killed.
17365    enum UidState {
17366        UNKNOWN_UID_STATE = 0;
17367        BACKGROUND_MODE = 1;
17368        FOREGROUND_MODE = 2;
17369    }
17370    optional UidState uid_state = 2;
17371
17372    // System state indicating whether the system was in normal mode or garage mode.
17373    enum SystemState {
17374        UNKNOWN_SYSTEM_STATE = 0;
17375        USER_INTERACTION_MODE = 1;
17376        USER_NO_INTERACTION_MODE = 2;
17377        GARAGE_MODE = 3;
17378    }
17379    optional SystemState system_state = 3;
17380
17381    // Reason for killing the application.
17382    // Keep in sync with proto file at packages/services/Car/cpp/watchdog/proto
17383    enum KillReason {
17384        UNKNOWN_KILL_REASON = 0;
17385        KILLED_ON_ANR = 1;
17386        KILLED_ON_IO_OVERUSE = 2;
17387        KILLED_ON_MEMORY_OVERUSE = 3;
17388    }
17389    optional KillReason kill_reason = 4;
17390
17391    // Stats of the processes owned by the application when the application was killed.
17392    // The process stack traces are not collected when the application was killed due to IO_OVERUSE.
17393    optional CarWatchdogProcessStats process_stats = 5 [(log_mode) = MODE_BYTES];
17394
17395    // The application's I/O overuse stats logged only when the kill reason is KILLED_ON_IO_OVERUSE.
17396    optional CarWatchdogIoOveruseStats io_overuse_stats = 6 [(log_mode) = MODE_BYTES];
17397}
17398
17399/**
17400 * Logs the I/O overuse stats for an application on detecting I/O overuse.
17401 *
17402 * Keep in sync with proto file at
17403 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
17404 *
17405 * Pushed from:
17406 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
17407 */
17408message CarWatchdogIoOveruseStatsReported {
17409    // Linux process uid for the package.
17410    optional int32 uid = 1 [(is_uid) = true];
17411
17412    // The application's I/O overuse stats.
17413    optional CarWatchdogIoOveruseStats io_overuse_stats = 2 [(log_mode) = MODE_BYTES];
17414}
17415
17416/**
17417 * Logs I/O overuse stats for a package.
17418 *
17419 * Keep in sync with proto file at
17420 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
17421 *
17422 * Logged from:
17423 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
17424 */
17425message CarWatchdogIoOveruseStats {
17426    enum Period {
17427        UNKNOWN_PERIOD = 0;
17428        DAILY = 1;
17429        WEEKLY = 2;
17430    }
17431
17432    // Threshold and usage stats period.
17433    optional Period period = 1;
17434
17435    // Threshold in-terms of write bytes defined for the package.
17436    optional CarWatchdogPerStateBytes threshold = 2;
17437
17438    // Number of write bytes in each state for the specified period.
17439    optional CarWatchdogPerStateBytes written_bytes = 3;
17440
17441    // Application or service uptime during the aforementioned period.
17442    optional uint64 uptime_millis = 4;
17443};
17444
17445/**
17446 * Logs bytes attributed to each application and system states.
17447 *
17448 * Keep in sync with proto file at
17449 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
17450 *
17451 * Logged from:
17452 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
17453 */
17454message CarWatchdogPerStateBytes {
17455    // Number of bytes attributed to the application foreground.
17456    optional int64 foreground_bytes = 1;
17457
17458    // Number of bytes attributed to the application background.
17459    optional int64 background_bytes = 2;
17460
17461    // Number of bytes attributed to the garage mode.
17462    optional int64 garage_mode_bytes = 3;
17463}
17464
17465/**
17466 * Logs each CarWatchdogProcessStat in CarWatchdogProcessStats.
17467 *
17468 * Keep in sync with proto file at
17469 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
17470 *
17471 * Logged from:
17472 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
17473 */
17474message CarWatchdogProcessStats {
17475    // Records the stats of the processes owned by an application.
17476    repeated CarWatchdogProcessStat process_stat = 1;
17477}
17478
17479/**
17480 * Logs a process's stats.
17481 *
17482 * Keep in sync with proto file at
17483 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
17484 *
17485 * Logged from:
17486 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
17487 */
17488message CarWatchdogProcessStat {
17489    // Command name of the process.
17490    optional string process_name = 1;
17491
17492    // Process uptime.
17493    optional uint64 uptime_millis = 2;
17494
17495    // Number of major page faults caused by the process and its children.
17496    optional uint64 major_page_faults = 3;
17497
17498    // Peak virtual memory size in kb.
17499    optional uint64 vm_peak_kb = 4;
17500
17501    // Virtual memory size in kb.
17502    optional uint64 vm_size_kb = 5;
17503
17504    // Peak resident set size (high water mark) in kb.
17505    optional uint64 vm_hwm_kb = 6;
17506
17507    // Resident set size in kb.
17508    optional uint64 vm_rss_kb = 7;
17509}
17510
17511/**
17512 * Logs total I/O usage summary for all applications and services running in the system.
17513 *
17514 * Keep in sync with proto file at
17515 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
17516 *
17517 * Pulled from:
17518 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
17519 */
17520message CarWatchdogSystemIoUsageSummary {
17521    // I/O usage summary for the system.
17522    optional CarWatchdogIoUsageSummary io_usage_summary = 1 [(log_mode) = MODE_BYTES];
17523
17524    // Start time of the event in milliseconds since epoch.
17525    // Note: This field must be a top-level field as it is used to slice the metrics.
17526    optional int64 start_time_millis = 2;
17527}
17528
17529/**
17530 * Logs I/O usage summary for an UID.
17531 *
17532 * Keep in sync with proto file at
17533 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
17534 *
17535 * Pulled from:
17536 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
17537 */
17538message CarWatchdogUidIoUsageSummary {
17539    // UID of the application/service whose usage summary are recorded.
17540    optional int32 uid = 1 [(is_uid) = true];
17541
17542    // I/O usage summary for the UID.
17543    optional CarWatchdogIoUsageSummary io_usage_summary = 2 [(log_mode) = MODE_BYTES];
17544
17545    // Start time of the event in milliseconds since epoch.
17546    // Note: This field must be a top-level field as it is used to slice the metrics.
17547    optional int64 start_time_millis = 3;
17548}
17549
17550/**
17551 * Logs I/O usage summary for a time period.
17552 *
17553 * Keep in sync with proto file at
17554 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
17555 *
17556 * Pulled from:
17557 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
17558 */
17559message CarWatchdogIoUsageSummary {
17560    // Summary event time period.
17561    optional CarWatchdogEventTimePeriod event_time_period = 1;
17562
17563    // Daily I/O usage summary for the period. Logs summary entries only for days with I/O usage.
17564    // The entries are ordered beginning from the event_time_period.start_time_millis.
17565    repeated CarWatchdogDailyIoUsageSummary daily_io_usage_summary = 2;
17566}
17567
17568/**
17569 * Logs a car watchdog event's time period.
17570 *
17571 * Keep in sync with proto file at
17572 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
17573 *
17574 * Pulled from:
17575 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
17576 */
17577message CarWatchdogEventTimePeriod {
17578    enum Period {
17579        UNKNOWN_PERIOD = 0;
17580        WEEKLY = 1;
17581        BIWEEKLY = 2;
17582        MONTHLY = 3;
17583    }
17584
17585    // Deprecated field - Start time of the event in milliseconds since epoch.
17586    optional uint64 start_time_millis = 1 [deprecated = true];
17587
17588    // Period for the event.
17589    optional Period period = 2;
17590}
17591
17592/**
17593 * Logs daily I/O usage summary.
17594 *
17595 * Keep in sync with proto file at
17596 * packages/services/Car/service/src/com/android/car/watchdog/proto/atoms.proto
17597 *
17598 * Pulled from:
17599 *  packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java
17600 */
17601message CarWatchdogDailyIoUsageSummary {
17602    // Total bytes written to disk during a day.
17603    optional CarWatchdogPerStateBytes written_bytes = 1;
17604
17605    // Total uptime for the system or service or application during a day.
17606    optional uint64 uptime_millis = 2;
17607
17608    // Total disk I/O overuses during a day.
17609    optional int32 overuse_count = 3;
17610}
17611
17612/*
17613 * pushes Media playback information.
17614 * Logged from
17615 *  frameworks/base/services/core/java/com/android/server/media/metrics/
17616 *      MediaMetricsManagerService.java
17617 */
17618message MediametricsPlaybackReported {
17619    optional int32 uid = 1 [(is_uid) = true];
17620
17621    // Randomly generated log session ID. A Base64 encoded hex string representing a
17622    // 128-bit integer.
17623    optional string log_session_id = 2;
17624    // The total length of the media in milliseconds. 0 for live contents.
17625    optional int64 media_duration_millis = 3;
17626    // Network, device, or mixed.
17627    optional android.stats.mediametrics.StreamSourceType stream_source = 4;
17628    // Stream type. DASH, HLS, etc
17629    optional android.stats.mediametrics.StreamType stream_type = 5;
17630    // Live, VOD, others
17631    optional android.stats.mediametrics.PlaybackType playback_type = 6;
17632    // DRM type
17633    optional android.stats.mediametrics.DrmType drm_type = 7;
17634    // Main, AD, others
17635    optional android.stats.mediametrics.ContentType content_type = 8;
17636    // Player name. E.g. ExoPlayer
17637    optional string player_name = 9;
17638    // Player version. E.g. 1.10.3e
17639    optional string player_version = 10;
17640    // Player related experiment IDs
17641    optional Experiments experiment_ids = 11 [(log_mode) = MODE_BYTES];
17642    // Number of frames played. Dropped frames included. -1 means unknown.
17643    optional int32 video_frames_played = 12;
17644    // Number of frames dropped. -1 means unknown.
17645    optional int32 video_frames_dropped = 13;
17646    // Number of audio underruns. -1 means unknown.
17647    optional int32 audio_underrun_count = 14;
17648    // Total number of bytes read from the network
17649    optional int64 network_bytes_read = 15;
17650    // Total number of bytes read from on-device sources
17651    optional int64 local_bytes_read = 16;
17652    // Total transfer spent reading from the network in ms.
17653    // For parallel requests, the overlapping time intervals are counted only once.
17654    optional int64 network_transfer_duration_millis = 17;
17655    // A session ID generated from DRM to distinguish different DRM sessions.
17656    optional string drm_session_id = 18;
17657}
17658
17659message MediaNetworkInfoChanged {
17660    // Randomly generated log session ID. A Base64 encoded hex string representing a
17661    // 128-bit integer.
17662    optional string log_session_id = 1;
17663    //  New network type
17664    optional android.stats.mediametrics.NetworkType type = 2;
17665    // When the network info change occurred relative to playback creation
17666    // time in milliseconds.
17667    // It is in absolute time (e.g. always ticks even if the playback is paused).
17668    optional int64 time_since_playback_created_millis = 3;
17669}
17670
17671message MediaPlaybackStateChanged {
17672    // Randomly generated log session ID. A Base64 encoded hex string representing a
17673    // 128-bit integer.
17674    optional string log_session_id = 1;
17675    //  New playback state
17676    optional android.stats.mediametrics.PlaybackState playback_state = 2;
17677    // When the state change occurred relative to playback creation time in
17678    // milliseconds.
17679    // It is in absolute time (e.g. always ticks even if the playback is paused).
17680    optional int64 time_since_playback_created_millis = 3;
17681}
17682
17683message MediaPlaybackErrorReported {
17684    // Randomly generated log session ID. A Base64 encoded hex string representing a
17685    // 128-bit integer.
17686    optional string log_session_id = 1;
17687    //  A shortened call stack of the error
17688    optional string exception_stack = 2;
17689    //  Error code
17690    optional android.stats.mediametrics.PlaybackErrorCode error_code = 3;
17691    //  Sub-code of error type specified by the error code.
17692    optional int32 sub_error_code = 4;
17693    // When the error occurred relative to playback creation time in millisecond.
17694    // It is in absolute time (e.g. always ticks even if the playback is paused).
17695    optional int64 time_since_playback_created_millis = 5;
17696}
17697
17698message MediaPlaybackTrackChanged {
17699    // Randomly generated log session ID. A Base64 encoded hex string representing a
17700    // 128-bit integer.
17701    optional string log_session_id = 1;
17702    //  The track is on or off after the change
17703    optional android.stats.mediametrics.TrackState state = 2;
17704    //  The reason of the track change
17705    optional android.stats.mediametrics.TrackChangeReason reason = 3;
17706    //  The MIME type of the container. E.g. video/mp4
17707    optional string container_mime_type = 4;
17708    //  The sample MIME type of the track. E.g. video/avc
17709    optional string sample_mime_type = 5;
17710
17711    //  Codec name
17712    optional string codec_name = 6;
17713    //  Bits per second. 0 means unknown.
17714    optional int32 bitrate = 7;
17715
17716   // When the track change occurred, relative to playback creation time in
17717   // millisecond.
17718   // It is in absolute time (e.g. always ticks even if the playback is paused).
17719   optional int64 time_since_playback_created_millis = 8;
17720
17721    //  Track type. Audio, Video, Text
17722    optional android.stats.mediametrics.TrackType type = 9;
17723    //  2-letter ISO 639-1 language code.
17724    optional string language = 10;
17725    //  IETF BCP 47 optional language region subtag based on a two-letter country code
17726    optional string language_region = 11;
17727    //  Number of channels
17728    optional int32 channel_count = 12;
17729    //  Samples per second
17730    optional int32 sample_rate = 13;
17731    //  The width of the video in pixels.
17732    optional int32 width = 14;
17733    //  The height of the video in pixels.
17734    optional int32 height = 15;
17735    //  Video frame rate in frames per second.
17736    optional float video_frame_rate = 16;
17737}
17738
17739message Experiments {
17740    // Experiment IDs sent by the player.
17741    repeated int64 experiments = 1;
17742}
17743
17744/**
17745 * Logs when a Wifi network scan happens.
17746 *
17747 * Logged from:
17748 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
17749 */
17750message WifiScanReported {
17751    enum Type {
17752        TYPE_UNKNOWN = 0;
17753
17754        // Single scan.
17755        TYPE_SINGLE = 1;
17756
17757        // Background scan (deprecated, should not happen).
17758        TYPE_BACKGROUND = 2;
17759    }
17760
17761    enum Result {
17762        RESULT_UNKNOWN = 0;
17763
17764        // Failed to start scan.
17765        RESULT_FAILED_TO_START = 1;
17766
17767        // The HAL reported a scan failure after the scan was started.
17768        RESULT_FAILED_TO_SCAN = 2;
17769
17770        // Scan succeeded.
17771        RESULT_SUCCESS = 3;
17772    }
17773
17774    enum Source {
17775        SOURCE_UNKNOWN = 0;
17776
17777        // No work source set - not possible to determine the origin.
17778        SOURCE_NO_WORK_SOURCE = 1;
17779
17780        // The Wifi stack.
17781        SOURCE_WIFI_STACK = 2;
17782
17783        // GMS on behalf of some other app.
17784        SOURCE_GMS = 3;
17785
17786        // Settings app.
17787        SOURCE_SETTINGS_APP = 4;
17788
17789        // Other app directly.
17790        SOURCE_OTHER_APP = 5;
17791    }
17792
17793    enum Importance {
17794        IMPORTANCE_UNKNOWN = 0;
17795
17796        // Foreground app. Corresponds to the value of
17797        // ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND or less.
17798        IMPORTANCE_FOREGROUND = 1;
17799
17800        // Foreground service. Corresponds to the value of
17801        // ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE
17802        IMPORTANCE_FOREGROUND_SERVICE = 2;
17803
17804        // Everything else.
17805        IMPORTANCE_BACKGROUND = 3;
17806    }
17807
17808    // Scan type
17809    optional Type type = 1;
17810
17811    // Outcome: success/failure
17812    optional Result result = 2;
17813
17814    // What initiated a scan.
17815    optional Source source = 3;
17816
17817    // Process importance of the initiator.
17818    // This is only available for non-system calls.
17819    optional Importance importance = 4;
17820
17821    // Time taken for the scan.
17822    optional int32 scan_duration_millis = 5;
17823
17824    // Count of found networks.
17825    optional int32 count_networks_found = 6;
17826}
17827
17828/**
17829 * Logs when a Wifi PNO (Preferred Network Offload) scan happens.
17830 *
17831 * Logged from:
17832 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMetrics.java
17833 */
17834message WifiPnoScanReported {
17835    enum State {
17836        UNKNOWN = 0;
17837
17838        // Scan started.
17839        STARTED = 1;
17840
17841        // Scan failed to start (e.g. bad request, unsupported by hardware, etc).
17842        FAILED_TO_START = 2;
17843
17844        // Scan completed and a network was found.
17845        // Note - due to implementation constraints, nothing is reported when a scan completes but
17846        // doesn't find any networks.
17847        FINISHED_NETWORKS_FOUND = 3;
17848
17849        // Scan failed.
17850        FAILED = 4;
17851    }
17852
17853    optional State state = 1;
17854}
17855
17856/**
17857 * Logs when an airplane mode session happens.
17858 *
17859 * Logged from:
17860 *   packages/modules/Wifi/service/java/com/android/server/wifi/WifiMetrics.java
17861 *   packages/modules/Bluetooth/service/java/com/android/server/bluetooth/BluetoothAirplaneModeListener.java
17862 */
17863message AirplaneModeSessionReported {
17864    enum PackageName {
17865        WIFI = 0;
17866        BLUETOOTH = 1;
17867    }
17868    // Module recording the airplane mode session
17869    optional PackageName package_name = 1;
17870    // State of the module before entering airplane mode
17871    // False - module off
17872    // True - module on
17873    optional bool previous_state = 2;
17874    // State of the module at the beginning of airplane mode
17875    optional bool entering_state = 3;
17876    // State of the module at the end of airplane mode
17877    optional bool exiting_state = 4;
17878    // Whether the user has activated the feature by
17879    // toggling the module in airplane mode
17880    optional bool feature_active = 5;
17881    // Whether the user toggled the module during current airplane mode
17882    optional bool user_toggled = 6;
17883    // Whether the user toggled the module within one minute
17884    optional bool user_toggled_within_minute = 7;
17885    // Whether media profile was connected before entering airplane mode
17886    // Only applicable to the Bluetooth module
17887    optional bool media_profile_connected = 8;
17888}
17889
17890/**
17891 * Logs when the entitlement configuration of an IMS service is queried/updated.
17892 *
17893 * Logged from: ImsServiceEntitlement app
17894 */
17895message ImsServiceEntitlementUpdated {
17896    // The purpose of entitlement query/update
17897    enum Purpose {
17898        UNKNOWN_PURPOSE = 0;
17899
17900        // Initial service activation in foreground
17901        ACTIVATION = 1;
17902
17903        // Updating service configuration in foreground
17904        UPDATE = 2;
17905
17906        // Background polling for querying service entitlement
17907        POLLING = 3;
17908    }
17909
17910    // The IMS services
17911    enum ServiceType {
17912        UNKNOWN_SERVICE = 0;
17913        VOWIFI = 1;
17914        VOLTE = 2;
17915        SMSOIP = 3;
17916    }
17917
17918    // The result of activation
17919    enum AppResult {
17920        UNKNOWN_RESULT = 0;
17921        ENABLED = 1;
17922        DISABLED = 2;
17923        INCOMPATIBLE = 3;
17924        PROVISIONING = 4;
17925        SUCCESSFUL = 5;
17926        FAILED = 6;
17927        CANCELED = 7;
17928        TIMEOUT = 8;
17929        UNEXPECTED_RESULT = 9;
17930    }
17931
17932    // The Android carrier ID for the carrier providing the IMS service.
17933    // This may not be the actual carrier of the device, e.g. a MVNO
17934    // may use the IMS service of its MNO.
17935    optional int64 carrier_id = 1;
17936
17937    // The Android carrier ID of the actual carrier.
17938    // E.g. a MVNO may use its MNO's IMS service. In this case,
17939    // actual_carrier_id is the MVNO and carrier_id is the MNO.
17940    optional int64 actual_carrier_id = 2;
17941
17942    // The purpose of this query/update.
17943    optional Purpose purpose = 3;
17944
17945    // Which IMS service's entitlement status were queried/updated.
17946    optional ServiceType service_type = 4;
17947
17948    // Result of this query/update.
17949    optional AppResult app_result = 5;
17950
17951    // How long (in milliseconds) this query/update took.
17952    optional int64 duration_millis = 6;
17953}
17954
17955// Indicates which compile filter was used for the package being loaded in an ART session.
17956enum ArtCompileFilter {
17957    ART_COMPILATION_FILTER_UNSPECIFIED = 0;
17958    ART_COMPILATION_FILTER_ERROR = 1;
17959    ART_COMPILATION_FILTER_UNKNOWN = 2;
17960    ART_COMPILATION_FILTER_ASSUMED_VERIFIED = 3;
17961    ART_COMPILATION_FILTER_EXTRACT = 4;
17962    ART_COMPILATION_FILTER_VERIFY = 5;
17963    ART_COMPILATION_FILTER_QUICKEN = 6;
17964    ART_COMPILATION_FILTER_SPACE_PROFILE = 7;
17965    ART_COMPILATION_FILTER_SPACE = 8;
17966    ART_COMPILATION_FILTER_SPEED_PROFILE = 9;
17967    ART_COMPILATION_FILTER_SPEED = 10;
17968    ART_COMPILATION_FILTER_EVERYTHING_PROFILE = 11;
17969    ART_COMPILATION_FILTER_EVERYTHING = 12;
17970    ART_COMPILATION_FILTER_FAKE_RUN_FROM_APK = 13;
17971    ART_COMPILATION_FILTER_FAKE_RUN_FROM_APK_FALLBACK = 14;
17972    ART_COMPILATION_FILTER_FAKE_RUN_FROM_VDEX_FALLBACK = 15;
17973}
17974
17975enum ArtCompilationReason {
17976    ART_COMPILATION_REASON_UNSPECIFIED = 0;
17977    ART_COMPILATION_REASON_ERROR = 1;
17978    ART_COMPILATION_REASON_UNKNOWN = 2;
17979    ART_COMPILATION_REASON_FIRST_BOOT = 3;
17980    ART_COMPILATION_REASON_BOOT = 4;
17981    ART_COMPILATION_REASON_INSTALL = 5;
17982    ART_COMPILATION_REASON_BG_DEXOPT = 6;
17983    ART_COMPILATION_REASON_AB_OTA = 7;
17984    ART_COMPILATION_REASON_INACTIVE = 8;
17985    ART_COMPILATION_REASON_SHARED = 9;
17986    ART_COMPILATION_REASON_INSTALL_WITH_DEX_METADATA = 10;
17987    ART_COMPILATION_REASON_POST_BOOT = 11;
17988    ART_COMPILATION_REASON_INSTALL_FAST = 12;
17989    ART_COMPILATION_REASON_INSTALL_BULK = 13;
17990    ART_COMPILATION_REASON_INSTALL_BULK_SECONDARY = 14;
17991    ART_COMPILATION_REASON_INSTALL_BULK_DOWNGRADED = 15;
17992    ART_COMPILATION_REASON_INSTALL_BULK_SECONDARY_DOWNGRADED = 16;
17993    ART_COMPILATION_REASON_BOOT_AFTER_OTA = 17;
17994    ART_COMPILATION_REASON_PREBUILT = 18;
17995    ART_COMPILATION_REASON_CMDLINE = 19;
17996    ART_COMPILATION_REASON_VDEX = 20;
17997}
17998
17999// Indicates which kind of measurement ART is reporting.
18000//
18001// Where it makes sense, the datum ID ends with the type of datum (counter or histogram) and the
18002// units.
18003// Note: Histograms are not yet reported by statsd.
18004enum ArtDatumId {
18005    ART_DATUM_INVALID = 0;
18006    ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS = 1;
18007    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_TIME_HISTO_MILLIS = 2;
18008    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_COUNT = 3;
18009    ART_DATUM_GC_FULL_HEAP_COLLECTION_TIME_HISTO_MILLIS = 4;
18010    ART_DATUM_GC_FULL_HEAP_COLLECTION_COUNT = 5;
18011    ART_DATUM_JIT_METHOD_COMPILE_TIME_MICROS = 6;
18012    ART_DATUM_AOT_COMPILE_TIME = 7;
18013    ART_DATUM_CLASS_VERIFICATION_TIME_COUNTER_MICROS = 8;
18014    ART_DATUM_CLASS_LOADING_TIME_COUNTER_MICROS = 9;
18015
18016    // Metrics IDs for dex2oat.
18017    ART_DATUM_DEX2OAT_RESULT_CODE = 10;
18018    ART_DATUM_DEX2OAT_DEX_CODE_COUNTER_BYTES = 11;
18019    ART_DATUM_DEX2OAT_TOTAL_TIME_COUNTER_MILLIS = 12;
18020    ART_DATUM_DEX2OAT_VERIFY_DEX_FILE_TIME_COUNTER_MILLIS = 13;
18021    ART_DATUM_DEX2OAT_FAST_VERIFY_TIME_COUNTER_MILLIS = 14;
18022    ART_DATUM_DEX2OAT_RESOLVE_METHODS_AND_FIELDS_TIME_COUNTER_MILLIS = 15;
18023
18024    ART_DATUM_CLASS_VERIFICATION_COUNT = 16;
18025    ART_DATUM_GC_TOTAL_BYTES_ALLOCATED = 17;
18026    ART_DATUM_GC_TOTAL_METADATA_SIZE_BYTES = 18 [deprecated=true];
18027    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_HISTO_MB_PER_SEC = 19;
18028    ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_HISTO_MB_PER_SEC = 20;
18029    ART_DATUM_JIT_METHOD_COMPILE_COUNT = 21;
18030    ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_HISTO_MB_PER_SEC = 22;
18031    ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_HISTO_MB_PER_SEC = 23;
18032    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC = 24;
18033    ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC = 25;
18034    ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC = 26;
18035    ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC = 27;
18036    ART_DATUM_GC_TOTAL_COLLECTION_TIME_MS = 28;
18037}
18038
18039// Indicates what class of thread the reported values apply to.
18040enum ArtThreadType {
18041    ART_THREAD_UNKNOWN = 0;
18042    ART_THREAD_MAIN = 1;
18043    ART_THREAD_BACKGROUND = 2;
18044}
18045
18046// Indicates the type of dex metadata.
18047enum ArtDexMetadataType {
18048  ART_DEX_METADATA_TYPE_UNKNOWN = 0;
18049  ART_DEX_METADATA_TYPE_PROFILE = 1;
18050  ART_DEX_METADATA_TYPE_VDEX = 2;
18051  ART_DEX_METADATA_TYPE_PROFILE_AND_VDEX = 3;
18052  ART_DEX_METADATA_TYPE_NONE = 4;
18053  ART_DEX_METADATA_TYPE_ERROR = 5;
18054}
18055
18056// Indicates the type of the apk.
18057enum ArtApkType {
18058    ART_APK_TYPE_UNKNOWN = 0;
18059    ART_APK_TYPE_BASE = 1;
18060    ART_APK_TYPE_SPLIT = 2;
18061}
18062
18063// Indicates the ISA.
18064enum ArtIsa {
18065    ART_ISA_UNKNOWN = 0;
18066    ART_ISA_ARM = 1;
18067    ART_ISA_ARM64 = 2;
18068    ART_ISA_X86 = 3;
18069    ART_ISA_X86_64 = 4;
18070    ART_ISA_MIPS = 5;
18071    ART_ISA_MIPS64 = 6;
18072}
18073
18074message ArtDatumReported {
18075    // The session ID is used to correlate this report with others from the same ART instance.
18076    optional int64 session_id = 1;
18077
18078    // The UID of the app that ART is running on behalf of.
18079    optional int32 uid = 2 [(is_uid) = true];
18080
18081    // What compiler filter the APK or DEX file was compiled with.
18082    optional ArtCompileFilter compile_filter = 3;
18083
18084    // Why the package was compiled the way it was.
18085    optional ArtCompilationReason compilation_reason = 4;
18086
18087    // The number of milliseconds since the ART runtime instance was started.
18088    optional int64 timestamp_millis = 5;
18089
18090    // What kind of thread (UI or background) this metric corresponds to.
18091    optional ArtThreadType thread_type = 6;
18092
18093    // Which counter this is that is being reported.
18094    optional ArtDatumId kind = 7;
18095
18096    // The value of the counter.
18097    optional int64 value = 8;
18098
18099    // The type of dex metadata
18100    optional ArtDexMetadataType dex_metadata_type = 9;
18101
18102    // The type of the APK file.
18103    optional ArtApkType apk_type = 10;
18104
18105    // The ISA of the device.
18106    optional ArtIsa isa = 11;
18107}
18108
18109/**
18110 * Logged when a SIM-specific settings restore was attempted.
18111 *
18112 * Logged from:
18113 *    packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyProvider.java
18114 */
18115message SimSpecificSettingsRestored {
18116    optional android.telephony.SimSpecfifcSettingsRestoreResult result = 1;
18117
18118    // Indicates which restore flow was followed.
18119    optional android.telephony.SimSpecificSettingsRestoreCase restored_from_suw = 2;
18120
18121    // Indicates which criteria was used to match the inserted SIM to backed up
18122    // SIM. Only relevant when result is SUCCESS
18123    optional android.telephony.SimSpecificSettingsRestoreMatchingCriteria matching_criteria = 3;
18124}
18125
18126/**
18127 * The latency of Binder calls broken down by calling API and method name.
18128 * This is different from BinderCalls as it collects a histogram of the
18129 * latencies (to get more detailed data) not just the count, sum, and maximum.
18130 *
18131 * Logged from:
18132 * frameworks/base/core/java/com/android/internal/os/BinderLatencyObserver.java
18133 */
18134message BinderLatencyReported {
18135    message Dims {
18136        enum ProcessSource {
18137            UNKNOWN_PROCESS_SOURCE = 0;
18138            SYSTEM_SERVER = 1;
18139            TELEPHONY = 2;
18140            BLUETOOTH = 3;
18141            WIFI = 4;
18142        }
18143        enum ServiceClassName {
18144            UNKNOWN_CLASS = 0;
18145        }
18146        enum ServiceMethodName {
18147            UNKNOWN_METHOD = 0;
18148        }
18149
18150        // Required.
18151        optional ProcessSource process_source = 1;
18152
18153        // The class name of the API making the call to Binder. Enum value
18154        // is preferred as uses much less data to store.
18155        // This field does not contain PII.
18156        oneof service_class {
18157            ServiceClassName service_class_name_as_enum = 2;
18158            string service_class_name = 3;
18159        }
18160
18161        // Method name of the API call. It can also be a transaction code if we
18162        // cannot resolve it to a name. See Binder#getTransactionName. Enum value
18163        // is preferred as uses much less data to store.
18164        // This field does not contain PII.
18165        oneof service_method {
18166            ServiceMethodName service_method_name_as_enum = 4;
18167            string service_method_name = 5;
18168        }
18169    }
18170
18171    message ApiStats {
18172        // required.
18173        optional Dims dims = 1;
18174
18175        // Indicates the first bucket that had any data. Allows omitting any empty
18176        // buckets at the start of the bucket list and thus save on data size.
18177        optional int32 first_bucket_index = 2;
18178        // Stores the count of samples for each bucket. The number of buckets and
18179        // their sizes are controlled server side with a flag.
18180        repeated int32 buckets = 3;
18181    }
18182
18183    message RepeatedApiStats {
18184        repeated ApiStats api_stats = 1;
18185    }
18186
18187    // The binder latency data broken down by the dimensions specified above.
18188    // The message wrapper is used for the repeated field as top level repeated
18189    // fields are not allowed.
18190    // MODE_BYTES is used as nested messages are not allowed otherwise.
18191    // Required.
18192    optional RepeatedApiStats repeated_api_stats = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
18193
18194    // The fraction of samples that are recorded in the histogram.
18195    // Required.
18196    optional float sampling_rate = 2;
18197
18198    // Indicates how many shards the APIs are divided in - e.g. for 3 every
18199    // 3rd API will be included in the data for this shard.
18200    // Required.
18201    optional int32 sharding_modulo = 3;
18202
18203    // Params for histogram buckets.
18204    // The number of buckets the histogram should have.
18205    optional int32 bucket_count = 4;
18206
18207    // The size (upper bound) of the first bucket (used to avoid creating an
18208    // excessive amount of small buckets). E.g. for first_bucket_size of 5, the
18209    // first bucket will be [0, 5) and the second will be [5, 5 * scaleFactor).
18210    optional int32 first_bucket_size = 5;
18211
18212    // The rate in which each consecutive bucket increases (before rounding).
18213    // Implemented in: com.android.internal.os.BinderLatencyBuckets.
18214    optional float scale_factor = 6;
18215}
18216
18217/**
18218 * Log audio device types that are used for input/output.
18219 * Next Tag: 2
18220 */
18221message AudioDevice {
18222    // See audio_devices_t in system/media/audio/include/system/audio-hal-enums.h
18223    repeated int32 type = 1;
18224}
18225
18226/**
18227 * Track information about AAudio Stream
18228 * Logged from
18229 *   frameworks/av/services/mediametrics/AudioAnalytics.cpp
18230 */
18231message MediametricsAAudioStreamReported {
18232    // The implementation of aaudio.
18233    enum CallerPath {
18234        CALLER_PATH_UNKNOWN = 0;
18235        CALLER_PATH_LEGACY = 1;
18236        CALLER_PATH_MMAP = 2;
18237    }
18238    optional CallerPath path = 1;
18239
18240    // The direction of the stream.
18241    // See aaudio_direction_t in frameworks/av/media/libaaudio/include/aaudio/AAudio.h
18242    // The Direction values are different from aaudio_direction_t to avoid having 0 at the first
18243    // value since first value will be used as default value.
18244    // See lookup<AAUDIO_DIRECTION> in frameworks/av/services/mediametrics/AudioTypes.cpp
18245    // for conversion from aaudio_direction_t to Direction.
18246    enum Direction {
18247        // The direction is unknown.
18248        DIRECTION_UNKNOWN = 0;
18249        // Audio data will travel out of the device.
18250        DIRECTION_OUTPUT = 1;
18251        // Audio data will travel into the device.
18252        DIRECTION_INPUT = 2;
18253    }
18254    optional Direction direction = 2;
18255
18256    // The amount read or written in one shot by the Mixer or DSP.
18257    optional int32 frames_per_burst = 3;
18258    // The number of frames that the buffer is used.
18259    optional int32 buffer_size = 4;
18260    // The allocated number of frames for the buffer.
18261    optional int32 buffer_capacity = 5;
18262    // The channel count of the aaudio stream.
18263    optional int32 channel_count = 6;
18264    // Total frames transferred (written or read)
18265    optional int64 total_frames_transferred = 7;
18266
18267    // The performance mode.
18268    // See aaudio_performance_mode_t in frameworks/av/media/libaaudio/include/aaudio/AAudio.h
18269    enum PerformanceMode {
18270        // The performance mode is unknown.
18271        PERFORMANCE_MODE_UNKNOWN = 0;
18272        // No particular performance mode needs. Default.
18273        PERFORMANCE_MODE_NONE = 10;
18274        // Extending battery life is more important than low latency.
18275        PERFORMANCE_MODE_POWER_SAVING = 11;
18276        // Reducing latency is more important than battery life.
18277        PERFORMANCE_MODE_LOW_LATENCY = 12;
18278    }
18279    // The performance mode requested by the applications.
18280    optional PerformanceMode perf_mode_requested = 8;
18281    // The actual performance mode used by aaudio.
18282    optional PerformanceMode perf_mode_actual = 9;
18283
18284    // The mode requested for sharing the device
18285    // See aaudio_sharing_mode_t in frameworks/av/media/libaaudio/include/aaudio/AAudio.h
18286    // The SharingMode values are different from aaudio_direction_t to avoid having 0 at the first
18287    // value since first value will be used as default value.
18288    // See lookup<AAUDIO_SHARING_MODE> in frameworks/av/services/mediametrics/AudioTypes.cpp
18289    // for conversion from aaudio_sharing_mode_t to SharingMode.
18290    enum SharingMode {
18291        // The sharing mode is unknown
18292        SHARING_MODE_UNKNOWN = 0;
18293        // This will be the only stream using a particular source or sink.
18294        SHARING_MODE_EXCLUSIVE = 1;
18295        // Multiple application will be mixed by the AAudio server.
18296        SHARING_MODE_SHARED = 2;
18297    }
18298    optional SharingMode sharing = 10;
18299
18300    // Approximate number of glitches.
18301    // Underrun on output stream. Overrun on input stream.
18302    optional int32 xrun_count = 11;
18303    // Devices that are used by the aaudio stream.
18304    optional AudioDevice types = 12 [(log_mode) = MODE_BYTES];
18305
18306    // Format request by the applications
18307    optional int32 format_app = 13;
18308    // Format processed by the framework
18309    optional int32 format_device = 14;
18310
18311    // Android S metric log session id, a Base64Url encoded string representing a 128-bit integer.
18312    optional string log_session_id = 15;
18313
18314    // The sample rate of the aaudio stream.
18315    optional int32 sample_rate = 16;
18316
18317    // The content type of the aaudio stream.
18318    // An enumeration from system/media/audio/include/system/audio-hal-enums.h audio_content_type_t
18319    enum ContentType {
18320        CONTENT_TYPE_UNKNOWN = 0;
18321        CONTENT_TYPE_SPEECH = 1;
18322        CONTENT_TYPE_MUSIC = 2;
18323        CONTENT_TYPE_MOVIE = 3;
18324        CONTENT_TYPE_SONIFICATION = 4;
18325        CONTENT_TYPE_INVALID = -1;
18326    }
18327    optional ContentType content_type = 17;
18328
18329    // The mode of sharing the device requested by the client.
18330    optional SharingMode sharing_requested = 18;
18331}
18332
18333/**
18334 * Logs media transcoding session ended events.
18335 *
18336 * Logged from:
18337 *   frameworks/av/media/libmediatranscoding/TranscoderWrapper.cpp
18338 */
18339message MediaTranscodingSessionEnded {
18340
18341    enum Reason {
18342        UNKNOWN = 0;       // Unused.
18343        FINISHED = 1;      // Transcoding session finished successfully.
18344        ERROR = 2;         // Transcoding session returned error while running.
18345        PAUSED = 3;        // Transcoding session was paused, potentially failed.
18346        CANCELLED = 4;     // Transcoding session was cancelled.
18347        START_FAILED = 5;  // Transcoding session failed to start.
18348        RESUME_FAILED = 6; // Transcoding session failed to resume.
18349        CREATE_FAILED = 7; // Transcoder instance failed to crate.
18350        CONFIG_SRC_FAILED = 8;    // Configure source failed.
18351        CONFIG_DST_FAILED = 9;    // Configure destination failed.
18352        CONFIG_TRACK_FAILED = 10; // Configure track failed.
18353        OPEN_SRC_FD_FAILED = 11;  // Open source fd failed.
18354        OPEN_DST_FD_FAILED = 12;  // Open destination fd failed.
18355        NO_TRACKS = 13;  // No tracks in source file.
18356    }
18357
18358    // Reason for logging the atom.
18359    optional Reason reason = 1;
18360
18361    // UID of client connecting to media transcoding service.
18362    optional int32 calling_uid = 2 [(is_uid) = true];
18363
18364    // Transcode session status flag (media_status_t).
18365    optional int32 transcode_status = 3;
18366
18367    // Transcode speed as framerate, if status is success.
18368    optional int32 transcode_fps = 4;
18369
18370    // Source video dimensions.
18371    optional int32 src_width = 5;
18372    optional int32 src_height = 6;
18373
18374    // Source video codec information.
18375    optional string src_codec_type = 7;
18376    optional int32 src_profile = 8;
18377    optional int32 src_level = 9;
18378
18379    // Source video framerate.
18380    optional int32 src_fps = 10;
18381
18382    // Source video duration.
18383    optional int32 src_duration_millis = 11;
18384
18385    // Whether source video is HDR.
18386    optional bool src_is_hdr = 12;
18387
18388    // Destination video dimensions.
18389    optional int32 dst_width = 13;
18390    optional int32 dst_height = 14;
18391
18392    // Destination video codec information.
18393    optional string dst_codec_type = 15;
18394
18395    // Whether destination video is HDR.
18396    optional bool dst_is_hdr = 16;
18397}
18398
18399/** Logs information about an unattended reboot that took place. This is logged
18400 *  after the next boot, when the device is first unlocked.
18401 *
18402 * Logged from:
18403 *   packages/modules/Scheduling/service/java/com/android/server/RebootReadinessLogger.java
18404 */
18405message UnattendedRebootOccurred {
18406
18407    // Time between the reboot readiness state checks starting, and the device
18408    // becoming reboot-ready.
18409    optional int64 time_until_reboot_ready_millis= 1;
18410
18411    // Time taken for the device to be unlocked (i.e. for the keyguard to be
18412    // gone) after an unattended reboot took place.
18413    optional int64 time_until_first_unlock_millis = 2;
18414
18415    // Number of times the reboot was blocked by the device being interactive.
18416    optional int32 times_blocked_by_interactivity = 3;
18417
18418    // Number of times the reboot was blocked by a callback registered by a
18419    // subsystem or a privileged app.
18420    optional int32 times_blocked_by_subsystems = 4;
18421
18422    // Number of times the reboot was blocked by background app activity.
18423    optional int32 times_blocked_by_app_activity = 5;
18424
18425    // Time until next user interaction with the device.
18426    optional int64 time_until_next_interaction_ms = 6;
18427}
18428
18429
18430/**
18431 * Logs information about an app uid or registered system component that has
18432 * been blocking the device from being reboot-ready for a long time.
18433 *
18434 * Logged from:
18435 *   packages/modules/Scheduling/service/java/com/android/server/RebootReadinessLogger.java
18436 */
18437message LongRebootBlockingReported {
18438
18439    enum RebootBlockReason {
18440        SYSTEM_COMPONENT = 1;
18441        APP_UID = 2;
18442    }
18443
18444    // The reason why the reboot has been blocked. This is either a system
18445    // component that has registered a callback, or an app UID running in the
18446    // background.
18447    optional RebootBlockReason reboot_block_reason = 1;
18448
18449    // Only one of the following two fields should be set, depending on the
18450    // RebootBlockReason.
18451
18452    // The name supplied by a system component when it registered a callback
18453    // to block the reboot.
18454    optional string component_name = 2;
18455
18456    // The uid of an app that is running in the background.
18457    optional int32 uid = 3;
18458}
18459
18460/**
18461 * Logs the magnification activated mode and its duration of the usage
18462 * when the magnification is disabled.
18463 *
18464 * Logged from:
18465 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
18466 */
18467message MagnificationUsageReported {
18468    // The definition of the magnification mode.
18469    // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
18470    optional android.stats.accessibility.MagnificationMode activated_mode = 1;
18471
18472    // The duration of this magnification mode activation in milliseconds
18473    optional int64 duration_millis = 2;
18474}
18475
18476/**
18477 * Logs the magnification activated mode when IME dialog shows on the screen.
18478 *
18479 * Logged from:
18480 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
18481 */
18482message MagnificationModeWithImeOnReported {
18483    // The definition of the magnification mode.
18484    // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
18485    optional android.stats.accessibility.MagnificationMode activated_mode = 1;
18486}
18487
18488/**
18489 * Logs the duration for the magnification session which is activated by the triple tap and
18490 * hold gesture.
18491 *
18492 * Logged from:
18493 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
18494 */
18495message MagnificationTripleTapAndHoldActivatedSessionReported {
18496    // The duration of the triple tap and hold activated session in milliseconds
18497    optional int64 duration_millis = 1;
18498}
18499
18500/**
18501 * Logs the duration for the following typing focus activated session.
18502 *
18503 * Logged from:
18504 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
18505 */
18506message MagnificationFollowTypingFocusActivatedSessionReported {
18507    // The duration of the following typing focus activated session in milliseconds
18508    optional int64 duration_millis = 1;
18509}
18510
18511/*
18512 * Reports a device controls user interaction
18513 *
18514 * Logged from:
18515 *   frameworks/base/packages/SystemUI/src/com/android/systemui/controls/ControlsMetricsLoggerImpl.kt
18516 */
18517message DeviceControlChanged {
18518    // The event_id
18519    optional int32 event_id = 1;
18520    // An identifier to tie together multiple logs relating to the same controls session
18521    optional int32 instance_id = 2;
18522    // The type of device the user has interacted with (android.service.controls.DeviceTypes)
18523    optional int32 device_type = 3;
18524    // The service app uid.
18525    optional int32 uid = 4 [(is_uid) = true];
18526    // Is the device locked while the action started
18527    optional bool is_locked = 5;
18528}
18529
18530/*
18531 * Logged when hardware based user-configurable device state changes.
18532 *
18533 * Logged from:
18534 *     frameworks/base/services/core/java/com/android/server/devicestate/DeviceStateManagerService.java
18535 */
18536message DeviceStateChanged {
18537    optional int32 new_device_state = 1
18538            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
18539    optional bool boot_state = 2;
18540}
18541
18542/*
18543 * Logged when device folded state changes.
18544 *
18545 * Logged from:
18546 *     frameworks/base/packages/SystemUI/src/com/android/systemui/unfold/FoldStateLogger.kt
18547 */
18548message FoldStateDurationReported {
18549    enum State {
18550      UNKNOWN = 0;
18551      OPEN = 1;
18552      CLOSED = 2;
18553      HALF_OPEN = 3;
18554    }
18555
18556    optional State start_state = 1;
18557    optional State end_state = 2;
18558    optional int64 duration_millis = 3;
18559}
18560
18561/**
18562 * This metric is collected at the end of playback
18563 * as a pulled atom.
18564 *
18565 *   DrmHal::cleanup() {
18566 *     // ...
18567 *     reportFrameworkMetrics(reportPluginMetrics());
18568 *     // ...
18569 *   }
18570 * This proto should be kept in-sync with
18571 * frameworks/av/drm/libmediadrm/protos/metrics.proto.
18572 */
18573message DrmFrameworkMetrics {
18574
18575    // Attributes are associated with a recorded value. E.g. A counter may
18576    // represent a count of an operation returning a specific error code. The
18577    // error code will be an attribute.
18578    message Attributes {
18579        // Reserved for compatibility with logging proto.
18580        reserved 2 to 13;
18581
18582        // A general purpose error code where 0 means OK.
18583        optional int32 error_code = 1;
18584
18585        // Defined at ::android::hardware::drm::V1_0::KeyStatusType;
18586        optional uint32 key_status_type = 14;
18587
18588        // Defined at ::android::hardware::drm::V1_0::EventType;
18589        optional uint32 event_type = 15;
18590    }
18591
18592    // The Counter message is used to store a count value with an associated
18593    // Attribute.
18594    message Counter {
18595        optional uint64 count = 1;
18596        // Represents the attributes associated with this counter instance.
18597        optional Attributes attributes = 2;
18598    }
18599
18600    // The DistributionMetric is meant to capture the moments of a normally
18601    // distributed (or approximately normal) value.
18602    message DistributionMetric {
18603        optional float min = 1;
18604        optional float max = 2;
18605        optional float mean = 3;
18606        optional double variance = 4;
18607        optional uint64 operation_count = 5;
18608
18609        // Represents the attributes associated with this distribution metric
18610        // instance.
18611        optional Attributes attributes = 6;
18612    }
18613
18614    message SessionLifetime {
18615        // Start time of the session in milliseconds since epoch.
18616        optional uint64 start_time_millis = 1;
18617        // End time of the session in milliseconds since epoch.
18618        optional uint64 end_time_millis = 2;
18619    }
18620
18621    // The count of open session operations. Each instance has a specific error
18622    // code associated with it.
18623    repeated Counter open_session_counter = 1;
18624
18625    // The count of close session operations. Each instance has a specific error
18626    // code associated with it.
18627    repeated Counter close_session_counter = 2;
18628
18629    // Count and execution time of getKeyRequest calls.
18630    repeated DistributionMetric get_key_request_time_us = 3;
18631
18632    // Count and execution time of provideKeyResponse calls.
18633    repeated DistributionMetric provide_key_response_time_us = 4;
18634
18635    // Count of getProvisionRequest calls.
18636    repeated Counter get_provisioning_request_counter = 5;
18637
18638    // Count of provideProvisionResponse calls.
18639    repeated Counter provide_provisioning_response_counter = 6;
18640
18641    // Count of key status events broken out by status type.
18642    repeated Counter key_status_change_counter = 7;
18643
18644    // Count of events broken out by event type
18645    repeated Counter event_callback_counter = 8;
18646
18647    // Count getPropertyByteArray calls to retrieve the device unique id.
18648    repeated Counter get_device_unique_id_counter = 9;
18649
18650    message SessionLifetimeEntry {
18651        optional string session_id = 1;
18652        optional SessionLifetime session_lifetime = 2;
18653    }
18654    // Session ids to lifetime (start and end time) map.
18655    // Session ids are strings of hex-encoded byte arrays.
18656    // This field is equivalent to the map<string, SessionLifetime>
18657    // field in frameworks/av/drm/libmediadrm/protos/metrics.proto.
18658    repeated SessionLifetimeEntry session_lifetimes = 10;
18659}
18660
18661/**
18662 * The metric is collected at the end of playback
18663 * as a pulled atom MediaDrmActivityInfo.
18664 *
18665 * The framework_metrics is defined in
18666 * frameworks/av/drm/libmediadrm/protos/metrics.proto.
18667 *
18668 * The format of vendor_metrics is  MediaDrm plugin dependent.
18669 *
18670 *   DrmHal::cleanup() {
18671 *     // ...
18672 *     reportFrameworkMetrics(reportPluginMetrics());
18673 *     // ...
18674 *   }
18675 *
18676 * This pulled atom is then collected in
18677 * frameworks/av/services/mediametrics/MediaMetricsService.cpp.
18678 */
18679message MediaDrmActivityInfo {
18680    optional string package_name = 1;
18681    optional int64 package_version_code = 2;
18682
18683    // vendor+description tell about which DRM plugin is in use on this device
18684    optional string vendor = 3;
18685    optional string description = 4;
18686
18687    optional DrmFrameworkMetrics framework_metrics = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
18688    optional bytes vendor_metrics = 6 [(android.os.statsd.log_mode) = MODE_BYTES];
18689}
18690
18691/*
18692 * A canonical form time zone suggestion for metrics use.
18693 */
18694message MetricsTimeZoneSuggestion {
18695    enum Type {
18696        UNKNOWN = 0;
18697        CERTAIN = 1;
18698        UNCERTAIN = 2;
18699    }
18700    optional Type type = 1;
18701
18702    // The ordinals for time zone(s) in the suggestion. Always empty for
18703    // UNCERTAIN, and can be empty for CERTAIN, for example when the device is in
18704    // a disputed area / on an ocean.
18705    //
18706    // The suggestion's time zone IDs (which relate to location) are obfuscated by
18707    // mapping them to an ordinal. When the ordinal is assigned consistently across
18708    // several objects (i.e. so the same time zone ID is always mapped to the same
18709    // ordinal), this allows comparisons between those objects. For example, we can
18710    // answer "did these two suggestions agree?", "does the suggestion match the
18711    // device's current time zone?", without leaking knowledge of location. Ordinals
18712    // are also significantly more compact than full IANA TZDB IDs, albeit unstable
18713    // and of limited use.
18714    repeated int32 time_zone_ordinals = 2;
18715
18716    // The actual time zone ID(s) in the suggestion. Similar to time_zone_ordinals
18717    // but contains the actual string IDs.
18718    //
18719    // This information is only captured / reported for some devices based on the
18720    // value of a server side flag, i.e. it could be enabled for internal testers.
18721    // Therefore the list can be empty even when time_zone_ordinals is populated.
18722    //
18723    // When enabled, see time_zone_ordinals for the expected number of values.
18724    repeated string time_zone_ids = 3;
18725}
18726
18727/*
18728 * Logs a snapshot of time zone detector state.
18729 *
18730 * Logged from:
18731 * frameworks/base/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
18732 */
18733message TimeZoneDetectorState {
18734
18735    // True if telephony-based time zone detection is supported on the device.
18736    optional bool telephony_supported = 1;
18737
18738    // True if geo-based time zone detection is supported on the device.
18739    optional bool geo_supported = 2;
18740
18741    // The current user's master location setting value.
18742    optional bool location_enabled = 3;
18743
18744    // The current user's auto time zone detection enabled setting value.
18745    optional bool auto_detection_setting = 4;
18746
18747    // The current user's geo detection enabled setting.
18748    optional bool geo_detection_setting = 5;
18749
18750    enum DetectionMode {
18751        UNKNOWN = 0;
18752        MANUAL = 1;
18753        TELEPHONY = 2;
18754        GEO = 3;
18755    }
18756
18757    // The functional / behavioral state for how time zones are currently determined on the device.
18758    // Avoids needing to duplicate the logic used.
18759    optional DetectionMode detection_mode = 6;
18760
18761    // The device's current time zone ordinal (see MetricsTimeZoneSuggestion).
18762    optional int32 device_time_zone_ordinal = 7;
18763
18764    // The latest suggestion received from the user, e.g. via SettingsUI (non-persistent).
18765    optional MetricsTimeZoneSuggestion latest_manual_suggestion = 8
18766            [(log_mode) = MODE_BYTES];
18767
18768    // The latest telephony-derived suggestion (non-persistent).
18769    optional MetricsTimeZoneSuggestion latest_telephony_suggestion = 9
18770            [(log_mode) = MODE_BYTES];
18771
18772    // The latest geo-derived suggestion (non-persistent).
18773    optional MetricsTimeZoneSuggestion latest_geo_suggestion = 10
18774            [(log_mode) = MODE_BYTES];
18775
18776    // True if fallback to telephony time zone detection is supported on the device.
18777    optional bool telephony_time_zone_fallback_supported = 11;
18778
18779    // The device's current time zone ID (see MetricsTimeZoneSuggestion).
18780    optional string device_time_zone_id = 12;
18781
18782    // True if enhanced metrics collection is enabled.
18783    optional bool enhanced_metrics_collection_enabled = 13;
18784
18785    // True if the device may run geolocation time zone detection in the
18786    // background. This is the raw server flag value, not the value after
18787    // considering other state like the user's "use location" setting that also
18788    // affects runtime behavior. See LocationTimeZoneProviderController for
18789    // details.
18790    optional bool geo_detection_run_in_background_enabled = 14;
18791}
18792
18793/*
18794 * Logs information about an individual location time zone provider's state.
18795 *
18796 * Logged from:
18797 * frameworks/base/services/core/java/com/android/server/timezonedetector/location/RealProviderMetricsLogger.java
18798 */
18799message LocationTimeZoneProviderStateChanged {
18800    // The index of the provider (primary = 0, secondary = 1)
18801    optional int32 provider_index = 1 [(state_field_option).primary_field = true];
18802
18803    enum State {
18804        // A placeholder for unknown values.
18805        UNKNOWN = 0;
18806
18807        // The provider is initializing.
18808        INITIALIZING = 1;
18809
18810        // The provider is certain of the time zone.
18811        CERTAIN = 2;
18812
18813        // The provider is uncertain of the time zone.
18814        UNCERTAIN = 3;
18815
18816        // The provider has been stopped.
18817        STOPPED = 4;
18818
18819        // The provider has failed.
18820        PERM_FAILED = 5;
18821
18822        // The provider has been destroyed.
18823        DESTROYED = 6;
18824    }
18825
18826    // The state of the provider.
18827    optional State state = 2 [(state_field_option).exclusive_state = true];
18828}
18829
18830/*
18831 * Logs information about the location time zone provider controller's state.
18832 *
18833 * Logged from:
18834 * frameworks/base/services/core/java/com/android/server/timezonedetector/location/RealControllerMetricsLogger.java
18835 */
18836message LocationTimeZoneProviderControllerStateChanged {
18837
18838    enum State {
18839        // A placeholder for unknown values.
18840        UNKNOWN = 0;
18841
18842        // The providers are initializing.
18843        PROVIDERS_INITIALIZING = 1;
18844
18845        // The controller is / has been stopped.
18846        STOPPED = 2;
18847
18848        // The controller is started and is initializing.
18849        INITIALIZING = 3;
18850
18851        // The controller is started and is certain of the time zone.
18852        CERTAIN = 4;
18853
18854        // The controller is started and is uncertain of the time zone.
18855        UNCERTAIN = 5;
18856
18857        // The controller has been destroyed.
18858        DESTROYED = 6;
18859
18860        // The controller has failed.
18861        FAILED = 7;
18862    }
18863
18864    // The state of the provider.
18865    optional State state = 1;
18866}
18867
18868/*
18869 * Reports fdtrack state change.
18870 *
18871 * Logged from:
18872 *   frameworks/base/services/java/com/android/server/SystemServer.java
18873 */
18874message FdtrackEventOccurred {
18875    enum FdtrackEventType {
18876      DISABLED = 1;
18877      ENABLED = 2;
18878
18879      // Aborting because we're above the abort threshold.
18880      ABORTING = 3;
18881    }
18882
18883    optional FdtrackEventType event = 1;
18884    optional int32 fd_count = 2;
18885}
18886
18887/**
18888 * Pushed when delivering a batch of alarms.
18889 *
18890 * Logged from:
18891 * frameworks/base/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
18892 */
18893message AlarmBatchDelivered {
18894    // The total number of alarms delivered in the batch.
18895    optional int32 num_alarms = 1;
18896
18897    // The number of wakeup alarms delivered in the batch.
18898    optional int32 wakeups = 2;
18899
18900    // A list of uids receiving the alarm delivery.
18901    repeated int32 uids = 3 [(is_uid) = true];
18902
18903    // The number of alarms delivered to each of the {@link uids} above.
18904    repeated int32 num_alarms_per_uid = 4;
18905
18906    // The number of wakeup alarms delivered to each of the {@link uids} above.
18907    repeated int32 num_wakeups_per_uid = 5;
18908}
18909
18910/**
18911 * Pushed when an app schedules an alarm.
18912 *
18913 * Logged from:
18914 * frameworks/base/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
18915 */
18916message AlarmScheduled {
18917    optional int32 calling_uid = 1 [(is_uid) = true];
18918
18919    optional bool is_exact = 2;
18920    optional bool is_wakeup = 3;
18921    optional bool is_allow_while_idle = 4;
18922    optional bool is_alarm_clock = 5;
18923    optional bool is_repeating = 6;
18924
18925    enum ReasonCode {
18926        NOT_APPLICABLE = 0;
18927        PERMISSION = 1;
18928        ALLOW_LIST = 2;
18929        CHANGE_DISABLED = 3;
18930        POLICY_PERMISSION = 4;
18931    }
18932    optional ReasonCode exact_alarm_allowed_reason = 7;
18933    optional bool is_rtc = 8;
18934    // The state of the callingUid, from frameworks/proto_logging/stats/enums/app/enums.proto.
18935    optional android.app.ProcessStateEnum calling_process_state = 9;
18936}
18937
18938/**
18939 * Logs statistics about pending alarms.
18940 *
18941 * Pulled from:
18942 * frameworks/base/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
18943 */
18944message PendingAlarmInfo {
18945    optional int32 num_total = 1;
18946    optional int32 num_exact = 2;
18947    optional int32 num_wakeup = 3;
18948    optional int32 num_allow_while_idle = 4;
18949    optional int32 num_prioritized = 5;
18950    optional int32 num_foreground_service = 6;
18951    optional int32 num_activity = 7;
18952    optional int32 num_service = 8;
18953    optional int32 num_listener = 9;
18954    optional int32 num_indefinite_future = 10;
18955    optional int32 num_repeating = 11;
18956    optional int32 num_alarm_clock = 12;
18957    optional int32 num_rtc = 13;
18958}
18959
18960/*
18961 * Logs information about on-device refresh of ART AOT artifacts for boot classpath extensions
18962 * and system_server.
18963 *
18964 * Logged from:
18965 *   art/odrefresh/odrefresh.cc
18966 */
18967message OdrefreshReported {
18968    optional int64 art_apex_version = 1;
18969
18970    enum Trigger {
18971        // A placeholder for unknown values.
18972        TRIGGER_UNKNOWN = 0;
18973
18974        // ART apex version has changed since time artifacts were generated.
18975        TRIGGER_APEX_VERSION_MISMATCH = 1;
18976
18977        // Dex files on the boot classpath or system_server classpath have changed.
18978        TRIGGER_DEX_FILES_CHANGED = 2;
18979
18980        // Missing artifacts.
18981        TRIGGER_MISSING_ARTIFACTS = 3;
18982    }
18983
18984    optional Trigger trigger = 2;
18985
18986    enum Stage {
18987        // A placeholder for unknown values.
18988        STAGE_UNKNOWN = 0;
18989
18990        // Checking stage.
18991        STAGE_CHECK = 10;
18992
18993        // Preparation for compilation.
18994        STAGE_PREPARATION = 20;
18995
18996        // Compilation of primary boot classpath extensions.
18997        STAGE_PRIMARY_BOOT_CLASSPATH = 30;
18998
18999        // Compilation of secondary boot classpath extensions.
19000        STAGE_SECONDARY_BOOT_CLASSPATH = 40;
19001
19002        // Compilation of system_server classpath.
19003        STAGE_SYSTEM_SERVER_CLASSPATH = 50;
19004
19005        // All stages completed.
19006        STAGE_COMPLETE = 60;
19007    }
19008
19009    optional Stage stage_reached = 3;
19010
19011    enum Status {
19012        // A placeholder for unknown values.
19013        STATUS_UNKNOWN = 0;
19014
19015        // OK, no problems encountered.
19016        STATUS_OK = 1;
19017
19018        // Insufficient space.
19019        STATUS_NO_SPACE = 2;
19020
19021        // Storage operation failed.
19022        STATUS_IO_ERROR = 3;
19023
19024        // Dex2oat reported an error.
19025        STATUS_DEX2OAT_ERROR = 4;
19026
19027        // Time limit exceeded.
19028        STATUS_TIME_LIMIT_EXCEEDED = 5;
19029
19030        // Failure creating staging area.
19031        STATUS_STAGING_FAILED = 6;
19032
19033        // Installation of artifacts failed.
19034        STATUS_INSTALL_FAILED = 7;
19035    }
19036
19037    optional Status status = 4;
19038
19039    // Compilation time iof primary boot classpath extensions.
19040    optional int32 primary_bcp_compilation_seconds = 5;
19041
19042    // Compilation time of secondary boot classpath extensions.
19043    optional int32 secondary_bcp_compilation_seconds = 6;
19044
19045    // Compilation time of system_server classpath.
19046    optional int32 system_server_compilation_seconds = 7;
19047
19048    // Cache space at start of update.
19049    optional int32 cache_space_free_start_mib = 8;
19050
19051    // Cache space at end of update.
19052    optional int32 cache_space_free_end_mib = 9;
19053};
19054
19055/*
19056 * Logged when a package's user-level hibernation state changes.
19057 * Logged from:
19058 *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
19059 */
19060 message UserLevelHibernationStateChanged {
19061    // Name of the package that had its hibernation state change.
19062    optional string package_name = 1;
19063
19064    // Android user id to which this event belongs. This can only be 0, 10, 11 and so on.
19065    optional int32 user_id = 2;
19066
19067    // New hibernation state. True if hibernating, false otherwise
19068    optional bool is_hibernating = 3;
19069}
19070
19071/*
19072 * Pull atom for the number of hibernated packages on the device for the given user.
19073 * Logged from:
19074 *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
19075 */
19076message UserLevelHibernatedApps {
19077    // Total number of apps hibernated for the user
19078    optional int32 hibernated_app_count = 1;
19079
19080    // Android user id of the queried user which can only be 0, 10, 11 and so on.
19081    optional int32 user_id = 2;
19082}
19083
19084/**
19085 * Pull atom for total number of globally hibernated packages on the device and the storage savings
19086 * from these apps being hibernated.
19087 * Logged from:
19088 *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
19089 */
19090message GlobalHibernatedApps {
19091    // Total number of apps in global hibernation
19092    optional int32 hibernated_app_count = 1;
19093
19094    // Cumulative storage savings from apps being hibernated
19095    optional int64 storage_saved_mb = 2;
19096}
19097
19098/*
19099 * Report the event of app process kills.
19100 * Logged from:
19101 *   frameworks/base/services/core/java/com/android/server/am/AppExitInfoTracker.java
19102 */
19103message AppProcessDied {
19104    // Uid of the package of the dying process
19105    optional int32 uid = 1 [(is_uid) = true];
19106
19107    // Name of the dying process, it'll be omitted if the process name and package name are the same
19108    optional string process_name = 2;
19109
19110    // The reason code of why the process dies
19111    optional android.app.AppExitReasonCode reason = 3;
19112
19113    // The supplemental reason code of why the process dies
19114    optional android.app.AppExitSubReasonCode sub_reason = 4;
19115
19116    // The importance of the process when it dies
19117    optional android.app.Importance importance = 5;
19118
19119    // The last known PSS (in kB) of the process before it dies, could be 0.
19120    optional int32 pss = 6;
19121
19122    // The last known RSS (in kB) of the process before it dies, could be 0.
19123    optional int32 rss = 7;
19124
19125    // Whether or not this process is hosting one or more foregound services.
19126    optional bool has_foreground_services = 8;
19127}
19128
19129/**
19130 * Logs input event statistics.
19131 * Pulls the statistics.
19132 *
19133 * Logged from:
19134 *   frameworks/native/services/inputflinger
19135 */
19136message InputEventLatencySketch {
19137    /**
19138     * The 'bytes' field is the serialized KLL sketch. It is to be deserialized into an object of
19139     * KLL proto, which would then be converted into a KLL sketch. The KLL sketch is a histogram
19140     * of the data.
19141     *
19142     * The goal of this data is to identify the bottlenecks in processing of input events.
19143     * All sketches measure durations in a streaming fashion.
19144     * The units are "hundreds of microseconds", or 0.1 ms. They are chosen like this in order
19145     * to reduce the occupied space.
19146     * The start and end points for each value are described in the comments.
19147     *
19148     * We distinguish between 'DOWN' event latency (when the pointer first goes down), and 'MOVE'
19149     * event latency, which characterizes the scrolling experience.
19150     */
19151
19152    // -------------------------- DOWN event sketches ------ START ---------------------------------
19153    // Start: the input event was created (touch events: the touch interrupt received in the driver)
19154    // End: the event was read in userspace (in EventHub)
19155    optional bytes event_to_read_100micros_down_sketch = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
19156    // Start: the event was read in EventHub
19157    // End: the event was send to the app via the InputChannel (written to the socket)
19158    optional bytes read_to_deliver_100micros_down_sketch = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
19159    // Start: the input event was sent to the app
19160    // End: the app consumed the input event
19161    optional bytes deliver_to_consume_100micros_down_sketch = 3 [(android.os.statsd.log_mode) = MODE_BYTES];
19162    // Start: the app consumed the event
19163    // End: the app's 'finishInputEvent' call was received in inputflinger
19164    // The end point can also be called "the app finished processing input event"
19165    optional bytes consume_to_finish_100micros_down_sketch = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
19166    // Start: the app consumed the input event
19167    // End: the app produced a buffer
19168    optional bytes consume_to_gpu_complete_100micros_down_sketch = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
19169    // Start: the app produced a buffer
19170    // End: the frame was shown on the display
19171    optional bytes gpu_complete_to_present_100micros_down_sketch = 6 [(android.os.statsd.log_mode) = MODE_BYTES];
19172    // The end-to-end touch latency
19173    // Start: the input event was created (touch events: the touch interrupt received in the driver)
19174    // End: the frame was presented on the display
19175    optional bytes end_to_end_100micros_down_sketch = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
19176    // -------------------------- DOWN event sketches ------ END -----------------------------------
19177
19178    // -------------------------- MOVE event sketches ------ START ---------------------------------
19179    // Start: the input event was created (touch events: the touch interrupt received in the driver)
19180    // End: the event was read in userspace (in EventHub)
19181    optional bytes event_to_read_100micros_move_sketch = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
19182    // Start: the event was read in EventHub
19183    // End: the event was send to the app via the InputChannel (written to the socket)
19184    optional bytes read_to_deliver_100micros_move_sketch = 9 [(android.os.statsd.log_mode) = MODE_BYTES];
19185    // Start: the input event was sent to the app
19186    // End: the app consumed the input event
19187    optional bytes deliver_to_consume_100micros_move_sketch = 10 [(android.os.statsd.log_mode) = MODE_BYTES];
19188    // Start: the app consumed the event
19189    // End: the app's 'finishInputEvent' call was received in inputflinger
19190    // The end point can also be called "the app finished processing input event"
19191    optional bytes consume_to_finish_100micros_move_sketch = 11 [(android.os.statsd.log_mode) = MODE_BYTES];
19192    // Start: the app consumed the input event
19193    // End: the app produced a buffer
19194    optional bytes consume_to_gpu_complete_100micros_move_sketch = 12 [(android.os.statsd.log_mode) = MODE_BYTES];
19195    // Start: the app produced a buffer
19196    // End: the frame was shown on the display
19197    optional bytes gpu_complete_to_present_100micros_move_sketch = 13 [(android.os.statsd.log_mode) = MODE_BYTES];
19198    // The end-to-end touch latency
19199    // Start: the input event was created (touch events: the touch interrupt received in the driver)
19200    // End: the frame was presented on the display
19201    optional bytes end_to_end_100micros_move_sketch = 14 [(android.os.statsd.log_mode) = MODE_BYTES];
19202    // -------------------------- MOVE event sketches ------ END -----------------------------------
19203}
19204
19205// Each pull creates multiple atoms. One for each incremental package.
19206message InstalledIncrementalPackage {
19207    optional int32 uid = 1 [(is_uid) = true];
19208}
19209
19210/**
19211 * Memory management statistics pulled atom based on /proc/vmstat.
19212 * Logged from StatsPullAtomService.
19213 */
19214message VmStat {
19215    optional int32 oom_kill_count = 1;
19216}
19217
19218/**
19219* Log that the user has interacted with an app on the permission usage
19220* fragment.
19221* Logged from permission/debug/PermissionUsageV2Frament.kt
19222*/
19223message PermissionUsageFragmentInteraction {
19224    // id which identifies single session of user interacting with permission hub
19225    optional int64 session_id = 1;
19226
19227    enum Action {
19228        UNDEFINED = 0;
19229        OPEN = 1;
19230        LOCATION_ACCESS_TIMELINE_VIEWED = 2;
19231        CAMERA_ACCESS_TIMELINE_VIEWED = 3;
19232        MICROPHONE_ACCESS_TIMELINE_VIEWED = 4;
19233        SHOW_SYSTEM_CLICKED = 5;
19234        SEE_OTHER_PERMISSIONS_CLICKED = 6;
19235    }
19236
19237    // The action the user took to interact with the fragment
19238    optional Action action = 2;
19239}
19240
19241/**
19242* Log that the user has clicked on .
19243* Logged from permission/debug/PermissionDetailsFragment.kt
19244*/
19245message PermissionDetailsInteraction {
19246    // id which identifies single session of user interacting with permission details fragment.
19247    optional int64 session_id = 1;
19248
19249    // The name of a permission group whose details are viewed.
19250    optional string permission_group_name = 2;
19251
19252    enum Action {
19253        UNDEFINED = 0;
19254        SHOW_SYSTEM_CLICKED = 1;
19255        INFO_ICON_CLICKED = 2;
19256    }
19257
19258    // Package name for which the info icon was clicked.
19259    optional string package_name = 3;
19260
19261    // The action the user took to interact with the fragment
19262    optional Action action = 4;
19263}
19264
19265/**
19266* Log that the user has toggled the sensor privacy.
19267*/
19268message PrivacySensorToggleInteraction {
19269
19270    enum Sensor {
19271        SENSOR_UNKNOWN = 0;
19272        MICROPHONE = 1;
19273        CAMERA = 2;
19274    }
19275
19276    // Sensor for which sensor privacy was toggled.
19277    optional Sensor sensor = 1;
19278
19279    enum Action {
19280        ACTION_UNKNOWN = 0;
19281        TOGGLE_ON = 1;
19282        TOGGLE_OFF = 2;
19283    }
19284
19285    // Action taken on sensor.
19286    optional Action action = 2;
19287
19288    enum Source {
19289        SOURCE_UNKNOWN = 0;
19290        DIALOG = 1;
19291        SETTINGS = 2;
19292        QS_TILE = 3;
19293    }
19294
19295    // Source for the toggling.
19296    optional Source source = 3;
19297
19298    // Amount of time a user spent in the previous sensor privacy state in minutes.
19299    optional int64 time_in_previous_state_in_mins = 4;
19300}
19301
19302message PrivacyToggleDialogInteraction {
19303
19304    enum Action {
19305        ACTION_UNKNOWN = 0;
19306        ENABLE = 1;
19307        CANCEL = 2;
19308    }
19309
19310    // Action taken on the toggle dialog.
19311    optional Action action = 1;
19312
19313    // Name of the package for which the dialog was shown.
19314    optional string package_name = 2;
19315}
19316
19317message VendorApexInfo {
19318  optional string package_name = 1;
19319  optional string version_code = 2;
19320  optional string version_name = 3;
19321  optional string source_dir = 4;
19322  optional string signing_certs_hash = 5;
19323  optional string file_hash = 6;
19324}
19325
19326/**
19327 * Logs the non-a11yTool service warning status and its duration of the usage.
19328 *
19329 * Logged from:
19330 *   frameworks/base/services/accessibility/java/com/android/server/accessibility
19331 *   packages/apps/Settings
19332 */
19333message NonA11yToolServiceWarningReported {
19334    // Package name of the non-a11yTool service.
19335    optional string package_name = 1;
19336
19337    // Warning status of the non-a11yTool service.
19338    optional android.stats.accessibility.WarningStatus status = 2;
19339
19340    // Duration between status in milliseconds.
19341    optional int64 duration_millis = 3;
19342}
19343
19344message MediaCapabilities {
19345    message AudioEncodings {
19346        repeated android.stats.mediametrics.AudioEncoding audio_encodings = 1;
19347    }
19348
19349    message HdrFormats {
19350        repeated android.stats.mediametrics.HdrFormat hdr_formats = 1;
19351    }
19352
19353
19354    message DisplayMode {
19355        optional int32 height = 1;
19356        optional int32 width = 2;
19357        optional float refresh_rate = 3;
19358        optional int32 seamless_refresh_rates_group_id = 4;
19359    }
19360
19361    message DisplayModes {
19362        repeated DisplayMode display_modes = 1;
19363    }
19364
19365    // Surround sound capabilities
19366
19367    // List of surround sound encodings supported by this device
19368    optional AudioEncodings surround_encodings = 1 [(log_mode) = MODE_BYTES];
19369    // List of surround sound encodings supported by the sink device
19370    optional AudioEncodings sink_surround_encodings = 2 [(log_mode) = MODE_BYTES];
19371    // List of supported surround sound encodings disabled by user
19372    optional AudioEncodings user_disabled_surround_encodings = 3 [(log_mode) = MODE_BYTES];
19373    // List of unsupported surround sound encodings enabled by user
19374    optional AudioEncodings user_enabled_surround_encodings = 4 [(log_mode) = MODE_BYTES];
19375     // The surround sound output mode chosen by user
19376    optional android.stats.mediametrics.EncodedSurroundOutputMode surround_output_mode = 5;
19377
19378
19379    // Display capabilities
19380
19381    // List of HDR display formats supported by the sink device
19382    optional HdrFormats sink_hdr_formats = 6 [(log_mode) = MODE_BYTES];
19383    // List of modes supported by the sink device. Each mode has height, width, refresh rate and a list
19384    // of refresh-rates between which a seamless switch is possible.
19385    optional DisplayModes sink_display_modes = 7 [(log_mode) = MODE_BYTES];
19386    // The HDCP level with which the display is connected
19387    optional int32 hdcp_level = 8;
19388
19389    // Display settings
19390
19391    // The Match content refresh rate user preference
19392    optional android.stats.mediametrics.MatchContentFrameRatePreference
19393                match_content_refresh_rate_preference = 9;
19394    // List of HDR formats disabled by the user
19395    optional HdrFormats user_disabled_hdr_formats = 10 [(log_mode) = MODE_BYTES];
19396    // The resolution height selected by the user
19397    optional int32 user_preferred_resolution_height = 11;
19398    // The resolution width selected by the user
19399    optional int32 user_preferred_resolution_width = 12;
19400    // The refresh rate selected by the user
19401    optional float user_preferred_refresh_rate = 13;
19402    // Whether the user has disabled auto low latency mode
19403    optional bool has_user_disabled_allm = 14;
19404}
19405
19406/**
19407 * Logs when NNAPI model is compiled successfully
19408 * Logged from
19409 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
19410 */
19411message NeuralNetworksCompilationCompleted {
19412    // Linux process uid for the package.
19413    optional int32 uid = 1 [(is_uid) = true];
19414
19415    // id which identifies single session of client interacting with NNAPI runtime
19416    optional int32 session_id = 2;
19417
19418    // NNAPI mainline module version.
19419    optional int64 version_nnapi_module = 3;
19420
19421    // An identifier that can be used to match events for ML model architecture.
19422    // Hash is generated from model operations and operands definition, but not weights.
19423    // Hash algorithm: HMAC-SHA256
19424    // Size: 32 byte
19425    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];
19426
19427    // Device driver identifier used by this compilation.
19428    // NeuralNetworks models are compiled/prepared for one or more device drivers (e.g., DSP, GPU,
19429    // TPU, CPU). The device driver identifier is a concatenation of [device driver name, =, and
19430    // device driver version]. If multiple device drivers are used, all device driver identifiers
19431    // are sorted and concatenated with comma as a separator.
19432    optional string device_id = 5;
19433
19434    // Type of tensors used for inputs
19435    optional android.neuralnetworks.DataClass input_data_class = 6;
19436
19437    // Type of tensors used for outputs
19438    optional android.neuralnetworks.DataClass output_data_class = 7;
19439
19440    // Did the compilation had to fallback to cpu due to an error?
19441    optional bool fallback_to_cpu_from_error = 8;
19442
19443    // Did client name target devices explicitly?
19444    optional bool introspection_enabled = 9;
19445
19446    // Was cache enabled?
19447    optional bool cache_enabled = 10;
19448
19449    // Was control flow used in the model?
19450    optional bool has_control_flow = 11;
19451
19452    // Whether there exists a partition boundary in the compilation that has dynamic size
19453    optional bool has_dynamic_temporaries = 12;
19454
19455    // Time taken to compile a model
19456    optional int64 compilation_time_sum_millis = 13;
19457    optional int64 compilation_time_min_millis = 14;
19458    optional int64 compilation_time_max_millis = 15;
19459    optional int64 compilation_time_sum_squared_millis = 16;
19460    optional int32 compilation_time_count = 17;
19461
19462    // How many times this atom occurred locally before being pushed.
19463    optional int32 count = 18;
19464
19465    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
19466    optional int64 model_arch_hash_64 = 19;
19467}
19468
19469/**
19470 * Logs when NNAPI model fails compilation
19471 * Logged from
19472 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
19473 */
19474message NeuralNetworksCompilationFailed {
19475    // Linux process uid for the package.
19476    optional int32 uid = 1 [(is_uid) = true];
19477
19478    // id which identifies single session of client interacting with NNAPI runtime
19479    optional int32 session_id = 2;
19480
19481    // NNAPI mainline module version.
19482    optional int64 version_nnapi_module = 3;
19483
19484    // An identifier that can be used to match events for ML model architecture.
19485    // Hash is generated from model operations and operands definition, but not weights.
19486    // Hash algorithm: HMAC-SHA256
19487    // Size: 32 byte
19488    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];
19489
19490    // Device driver identifier used by this compilation.
19491    // NeuralNetworks models are compiled/prepared for one or more device drivers (e.g., DSP, GPU,
19492    // TPU, CPU). The device driver identifier is a concatenation of [device driver name, =, and
19493    // device driver version]. If multiple device drivers are used, all device driver identifiers
19494    // are sorted and concatenated with comma as a separator.
19495    optional string device_id = 5;
19496
19497    // Type of tensors used for inputs
19498    optional android.neuralnetworks.DataClass input_data_class = 6;
19499
19500    // Type of tensors used for outputs
19501    optional android.neuralnetworks.DataClass output_data_class = 7;
19502
19503    // Error code returned by compilation call
19504    optional android.neuralnetworks.ResultCode error_code = 8;
19505
19506    // Did client name target devices explicitly?
19507    optional bool introspection_enabled = 9;
19508
19509    // Was cache enabled?
19510    optional bool cache_enabled = 10;
19511
19512    // Was control flow used in the model?
19513    optional bool has_control_flow = 11;
19514
19515    // Whether there exists a partition boundary in the compilation that has dynamic size
19516    optional bool has_dynamic_temporaries = 12;
19517
19518    // How many times this atom occurred locally before being pushed.
19519    optional int32 count = 13;
19520
19521    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
19522    optional int64 model_arch_hash_64 = 14;
19523}
19524
19525/**
19526 * Logs when NNAPI model is executed successfully
19527 *
19528 * Logged from
19529 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
19530 */
19531message NeuralNetworksExecutionCompleted {
19532    // Linux process uid for the package.
19533    optional int32 uid = 1 [(is_uid) = true];
19534
19535    // id which identifies single session of client interacting with NNAPI runtime
19536    optional int32 session_id = 2;
19537
19538    // NNAPI mainline module version.
19539    optional int64 version_nnapi_module = 3;
19540
19541    // An identifier that can be used to match events for ML model architecture.
19542    // Hash is generated from model operations and operands definition, but not weights.
19543    // Hash algorithm: HMAC-SHA256
19544    // Size: 32 byte
19545    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];
19546
19547    // Device driver identifier used by this execution.
19548    // NeuralNetworks models are executed on one or more device drivers (e.g., DSP, GPU, TPU, CPU).
19549    // The device driver identifier is a concatenation of [device driver name, =, and device driver
19550    // version]. If multiple device drivers are used, all device driver identifiers are sorted and
19551    // concatenated with comma as a separator.
19552    optional string device_id = 5;
19553
19554    // Execution mode
19555    optional android.neuralnetworks.Mode mode = 6;
19556
19557    // Type of tensors used for inputs
19558    optional android.neuralnetworks.DataClass input_data_class = 7;
19559
19560    // Type of tensors used for outputs
19561    optional android.neuralnetworks.DataClass output_data_class = 8;
19562
19563    // Did client name target devices explicitly?
19564    optional bool introspection_enabled = 9;
19565
19566    // Was cache enabled?
19567    optional bool cache_enabled = 10;
19568
19569    // Was control flow used in the model?
19570    optional bool has_control_flow = 11;
19571
19572    // Whether there exists a partition boundary in the compilation that has dynamic size
19573    optional bool has_dynamic_temporaries = 12;
19574
19575    // Time taken to execute from runtime, including runtime/ipc overhead
19576    optional int64 duration_runtime_sum_micros = 13;
19577    optional int64 duration_runtime_min_micros = 14;
19578    optional int64 duration_runtime_max_micros = 15;
19579    optional int64 duration_runtime_sum_squared_micros = 16;
19580    optional int32 duration_runtime_count = 17;
19581
19582    // Time taken to execute in the driver, excluding runtime/ipc overhead
19583    optional int64 duration_driver_sum_micros = 18;
19584    optional int64 duration_driver_min_micros = 19;
19585    optional int64 duration_driver_max_micros = 20;
19586    optional int64 duration_driver_sum_squared_micros = 21;
19587    optional int32 duration_driver_count = 22;
19588
19589    // Time taken to execute on the hardware, excluding driver overhead
19590    optional int64 duration_hardware_sum_micros = 23;
19591    optional int64 duration_hardware_min_micros = 24;
19592    optional int64 duration_hardware_max_micros = 25;
19593    optional int64 duration_hardware_sum_squared_micros = 26;
19594    optional int32 duration_hardware_count = 27;
19595
19596    // How many times this atom occurred locally before being pushed.
19597    optional int32 count = 28;
19598
19599    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
19600    optional int64 model_arch_hash_64 = 29;
19601}
19602
19603/**
19604 * Logs when NNAPI model fails execution
19605 * Logged from
19606 *   modules/NeuralNetworks/runtime/TelemetryStatsd.cpp
19607 */
19608message NeuralNetworksExecutionFailed {
19609    // Linux process uid for the package.
19610    optional int32 uid = 1 [(is_uid) = true];
19611
19612    // id which identifies single session of client interacting with NNAPI runtime
19613    optional int32 session_id = 2;
19614
19615    // NNAPI mainline module version.
19616    optional int64 version_nnapi_module = 3;
19617
19618    // An identifier that can be used to match events for ML model architecture.
19619    // Hash is generated from model operations and operands definition, but not weights.
19620    // Hash algorithm: HMAC-SHA256
19621    // Size: 32 byte
19622    optional bytes model_arch_hash = 4 [(log_mode) = MODE_BYTES];
19623
19624    // Device driver identifier used by this execution.
19625    // NeuralNetworks models are executed on one or more device drivers (e.g., DSP, GPU, TPU, CPU).
19626    // The device driver identifier is a concatenation of [device driver name, =, and device driver
19627    // version]. If multiple device drivers are used, all device driver identifiers are sorted and
19628    // concatenated with comma as a separator.
19629    optional string device_id = 5;
19630
19631    // Execution mode
19632    optional android.neuralnetworks.Mode mode = 6;
19633
19634    // Type of tensors used for inputs
19635    optional android.neuralnetworks.DataClass input_data_class = 7;
19636
19637    // Type of tensors used for outputs
19638    optional android.neuralnetworks.DataClass output_data_class = 8;
19639
19640    // Error code returned by execution call
19641    optional android.neuralnetworks.ResultCode error_code = 9;
19642
19643    // Did client name target devices explicitly?
19644    optional bool introspection_enabled = 10;
19645
19646    // Was cache enabled?
19647    optional bool cache_enabled = 11;
19648
19649    // Was control flow used in the model?
19650    optional bool has_control_flow = 12;
19651
19652    // Whether there exists a partition boundary in the compilation that has dynamic size
19653    optional bool has_dynamic_temporaries = 13;
19654
19655    // How many times this atom occurred locally before being pushed.
19656    optional int32 count = 14;
19657
19658    // model_arch_hash compressed to 64 bits by bitwise-xor each 64 chunk of model_arch_hash.
19659    optional int64 model_arch_hash_64 = 15;
19660}
19661
19662/**
19663 * Logs boot-time info for a Context Hub.
19664 */
19665message ContextHubBooted {
19666  // The amount of time it took the framework to connect to CHRE/Context Hub HAL
19667  // since the framework has booted.
19668  optional int64 boot_time_nanos = 1;
19669
19670  // The number of Context Hub instances found on this system.
19671  optional int32 num_context_hubs = 2;
19672}
19673
19674/**
19675 * Logs Context Hub restart events (e.g. crashes).
19676 */
19677message ContextHubRestarted {
19678  // The duration of time between the last time Context Hub restart and this event.
19679  // This should use the SystemClock.elapsedRealTime() API.
19680  optional int64 elapsed_time_millis_since_boot = 1;
19681
19682  // The ID of the Context Hub that has restarted (zero-indexed).
19683  optional int32 context_hub_id = 2;
19684}
19685
19686/**
19687 * Logs a snapshot of all the nanoapps loaded on this Context Hub.
19688 */
19689message ContextHubLoadedNanoappSnapshotReported {
19690  // The ID of the Context Hub the snapshot is for (zero-indexed).
19691  optional int32 context_hub_id = 1;
19692
19693  // The nanoapp this snapshot is for. The nanoapp ID is the 64-bit unique identifier
19694  // for the application, and the version is the semantic versioning (https://semver.org)
19695  // used to determine the software version.
19696  optional int64 nanoapp_id = 2;
19697  optional int32 nanoapp_version = 3;
19698}
19699
19700/**
19701 * Logs details of a dynamic CHRE nanoapp code download transaction.
19702 */
19703message ChreCodeDownloadTransacted {
19704  enum Type {
19705    TYPE_UNKNOWN = 0;
19706    TYPE_LOAD = 1;
19707    TYPE_UNLOAD = 2;
19708  }
19709  // The ID/version of the nanoapp this code download was for.
19710  optional int64 nanoapp_id = 1;
19711  optional int32 nanoapp_version = 2;
19712
19713  // The type of code download transaction.
19714  optional Type transaction_type = 3;
19715
19716  // The result of this transaction.
19717  optional android.contexthub.ContextHubTransactionResult transaction_result = 4;
19718}
19719
19720/**
19721 * Stats about each feature tag that was included in the registration.
19722 *
19723 * Logged from:
19724 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
19725 */
19726message ImsRegistrationFeatureTagStats {
19727    // the carrier id associated with this SIP delegate
19728    // Used as a dimension
19729    optional int32 carrier_id = 1;
19730
19731    // The slot id associated with this SIP delegate
19732    // Used as a dimension
19733    optional int32 slot_id = 2;
19734
19735    // The name of the feature tag
19736    // used as a dimension
19737    optional android.telephony.ImsFeatureTag feature_tag_name = 3;
19738
19739    // The underlying radio technology type associated with the feature tag
19740    // used as a dimension
19741    // See the ImsRegistrationImplBase#REGISTRATION_TECH*
19742    optional int32 registration_tech = 4;
19743
19744    // The time this feature tag was registered, rounded to 5 minutes
19745    optional int32 registered_seconds = 5;
19746}
19747
19748/**
19749 * Stats about the messaging client interacting with telephony
19750 *
19751 * Logged from:
19752 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
19753 */
19754message RcsClientProvisioningStats {
19755    enum EventType {
19756        EVENT_TYPE_UNSPECIFIED = 0;
19757        // The client sent its client params to the ACS service.
19758        CLIENT_PARAMS_SENT = 1;
19759        // The client has manually triggered reconfiguration
19760        TRIGGER_RCS_RECONFIGURATION = 2;
19761        // Default messaging application changed.
19762        DMA_CHANGED = 3;
19763    }
19764    // Carrier ID of the SIM used for IMS registration.
19765    // See https://source.android.com/devices/tech/config/carrierid.
19766    // Used as a dimension
19767    optional int32 carrier_id = 1;
19768
19769    // Index of the SIM used, 0 for single-SIM devices.
19770    // Used as a dimension
19771    optional int32 slot_id = 2;
19772
19773    // Used as a dimension
19774    optional EventType event = 3;
19775
19776    // The number of times this event has occurred.
19777    optional int32 count = 4;
19778}
19779
19780/**
19781 * Stats about the RCS provisioning via ACS
19782 *
19783 * Logged from:
19784 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
19785 */
19786message RcsAcsProvisioningStats {
19787    enum ResponseType {
19788        RESPONSE_TYPE_UNSPECIFIED = 0;
19789        // a provisioning request resulted in an error.
19790        ERROR = 1;
19791        // a provisioning request succeeded and provided an xml
19792        PROVISIONING_XML = 2;
19793        // a provisioning request has resulted in a "pre-provisioning" xml, which
19794        // means RCS is not provisioned and requires the user to intervene.
19795        PRE_PROVISIONING_XML = 3;
19796    }
19797
19798    // Carrier ID of the SIM used for IMS registration.
19799    // See https://source.android.com/devices/tech/config/carrierid.
19800    // Used as a dimension
19801    optional int32 carrier_id = 1;
19802
19803    // Index of the SIM used, 0 for single-SIM devices.
19804    // Used as a dimension
19805    optional int32 slot_id = 2;
19806
19807    // The response code of provisioning if the provisioning resulted in
19808    // ResponseType.ERROR
19809    // Used as a dimension
19810    optional int32 response_code = 3;
19811
19812    // used as a dimension.
19813    optional ResponseType response_type = 4;
19814
19815    // Does the provisioning XML have single registration provisioned.
19816    // Populated if response_type is ResponseType.PROVISIONING_XML
19817    // used as a dimension
19818    optional bool is_single_registration_enabled = 5;
19819
19820    // The number of times this event has occurred.
19821    optional int32 count = 6;
19822
19823    // The amount of time in seconds that the device was in this state in total, rounded 5 minutes
19824    optional int32 state_timer_sec = 7;
19825}
19826
19827/**
19828 * Metrics surrounding the lifetime of a SIP delegate created by applications.
19829 *
19830 * Logged from:
19831 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
19832 */
19833message SipDelegateStats {
19834    // The random number identifier with this SIP delegate
19835    optional int32 dimension = 1;
19836
19837    // The carrier id associated with this SIP delegate
19838    optional int32 carrier_id = 2;
19839
19840    // The slot id associated with this SIP delegate
19841    optional int32 slot_id = 3;
19842
19843    // The total uptime of this delegate, rounded 5 minutes
19844    optional int32 uptime_seconds = 4;
19845
19846    // The reason why this SIP delegate was destroyed.
19847    // See the SipDelegateManager#SIP_DELEGATE_DESTROY_REASON*
19848    optional int32 destroy_reason = 5;
19849}
19850
19851/**
19852 * Tracks each feature tag associated with the SipDelegates that are currently active.
19853 *
19854 * Logged from:
19855 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
19856 */
19857message SipTransportFeatureTagStats {
19858    // the carrier id associated with this SIP delegate
19859    // Used as a dimension
19860    optional int32 carrier_id = 1;
19861
19862    // The slot id associated with this SIP delegate
19863    // Used as a dimension
19864    optional int32 slot_id = 2;
19865
19866    // The name of the feature tag
19867    // used as a dimension
19868    optional android.telephony.ImsFeatureTag feature_tag_name = 3;
19869
19870    // The reason why this feature tag was denied on the SIP Transport
19871    // used as a dimension
19872    // Use SIP transport denied reason.
19873    // See the SipDelegateManager#DENIED_REASON*
19874    optional int32 sip_transport_denied_reason = 4;
19875
19876    // The reason why this feature tag was associated with the SIP Transport but not
19877    // marked as deregistered.
19878    // used as a dimension
19879    // Use SIP transport deregistered reason.
19880    // See the DelegateRegistrationState#DEREGISTERING_REASON*
19881    optional int32 sip_transport_deregistered_reason = 5;
19882
19883    // the time this feature tag was in this state, rounded 5 minutes
19884    optional int32 associated_seconds = 6;
19885}
19886
19887/**
19888 * Tracks each SIP message and the response from either the app or network.
19889 *
19890 * Logged from:
19891 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
19892 */
19893message SipMessageResponse {
19894    enum Direction {
19895        UNKNOWN = 0;
19896        INCOMING = 1;
19897        OUTGOING = 2;
19898    }
19899    // the carrier id associated with this SIP delegate
19900    // Used as a dimension
19901    optional int32 carrier_id = 1;
19902
19903    // The slot id associated with this SIP delegate
19904    // Used as a dimension
19905    optional int32 slot_id = 2;
19906
19907    // The SIP message method type (INVITE, MESSAGE, etc...)
19908    // used as a dimension
19909    optional android.telephony.SipRequestMethodType sip_message_method = 3;
19910
19911    // The SIP message response code, used if this is a response to a request.
19912    // used as a dimension.
19913    optional int32 sip_message_response = 4;
19914
19915    // The SIP message direction
19916    // used as a dimension
19917    optional Direction sip_message_direction = 5;
19918
19919    // The response from the SIP stack to sending/receiving the message
19920    // used as a dimension
19921    // See the SipDelegateManager#MESSAGE_FAILURE_REASON*
19922    optional int32 message_error = 6;
19923
19924    // The number of messages that fit this criteria.
19925    optional int32 count = 7;
19926}
19927
19928/**
19929 * Tracks SIP sessions managed by the SIP transport.
19930 *
19931 * Logged from:
19932 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
19933 */
19934message SipTransportSession {
19935    enum Direction {
19936        UNKNOWN = 0;
19937        INCOMING = 1;
19938        OUTGOING = 2;
19939    }
19940    // the carrier id associated with this SIP delegate
19941    // Used as a dimension
19942    optional int32 carrier_id = 1;
19943
19944    // The slot id associated with this SIP delegate
19945    // Used as a dimension
19946    optional int32 slot_id = 2;
19947
19948    // The SIP message method that started the session (INVITE, SUBSCRIBE, etc...)
19949    // used as a dimension
19950    optional android.telephony.SipRequestMethodType session_method = 3;
19951
19952    // The SIP message direction
19953    // used as a dimension
19954    optional Direction sip_message_direction = 4;
19955
19956    // The response from the SIP stack or network.
19957    // used as a dimension.
19958    optional int32 sip_response = 5;
19959
19960    // The number of these sessions counted
19961    optional int32 session_count = 6;
19962
19963    // The number of sessions that were started properly and did not require
19964    // the SIP transport to forcefully close them.
19965    optional int32 ended_gracefully_count = 7;
19966}
19967
19968/**
19969 * Used to determine if there were dedicated bearers set up for a specific listener.
19970 * If not, this indicates that there may have been a network issue in the dedicated bearer setup.
19971 *
19972 * Logged from:
19973 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
19974 */
19975message ImsDedicatedBearerListenerEvent {
19976    // Carrier ID of the SIM used for IMS registration.
19977    // See https://source.android.com/devices/tech/config/carrierid.
19978    // Used as a dimension
19979    optional int32 carrier_id = 1;
19980
19981    // Index of the SIM used, 0 for single-SIM devices.
19982    // Used as a dimension
19983    optional int32 slot_id = 2;
19984
19985    // Radio access technology (RAT) used by the registration when it terminated.
19986    // The value is either 4G or 5G.
19987    // Used as a dimension
19988    optional android.telephony.NetworkTypeEnum rat_at_end = 3;
19989
19990    // QoS class identifier.
19991    // dimension
19992    optional int32 qci = 4;
19993
19994    // True if there was a dedicated bearer established for this listener.
19995    // dimension
19996    optional bool dedicated_bearer_established = 5;
19997
19998    // The count of listeners with this result.
19999    optional int32 event_count = 6;
20000}
20001
20002/**
20003 * Logs information related to ims dedicated bearer which fulfills required qos and provides guaranteed service.
20004 *
20005 * Logged from:
20006 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20007 */
20008message ImsDedicatedBearerEvent {
20009    enum State {
20010        STATE_UNSPECIFIED = 0;
20011        STATE_ADDED = 1;
20012        STATE_MODIFIED = 2;
20013        STATE_DELETED = 3;
20014    }
20015    // Carrier ID of the SIM used for IMS registration.
20016    // See https://source.android.com/devices/tech/config/carrierid.
20017    // Used as a dimension
20018    optional int32 carrier_id = 1;
20019
20020    // Index of the SIM used, 0 for single-SIM devices.
20021    // Used as a dimension
20022    optional int32 slot_id = 2;
20023
20024    // Radio access technology (RAT) used by the registration when it terminated.
20025    // The value is either 4G or 5G.
20026    // Used as a dimension
20027    optional android.telephony.NetworkTypeEnum rat_at_end = 3;
20028
20029    // Qos class identifier.
20030    // Used as a dimension
20031    optional int32 qci = 4;
20032
20033    // Dedicated bearer state from the network.
20034    // Used as a dimension
20035    optional State bearer_state = 5;
20036
20037    // Whether location connection information is received.
20038    // Used as a dimension
20039    optional bool local_connection_info_received = 6;
20040
20041    // Whether remote connection information is received.
20042    // Used as a dimension
20043    optional bool remote_connection_info_received = 7;
20044
20045    // Whether or not the QoS indication had listeners.
20046    // Used as a dimension
20047    optional bool has_listeners = 8;
20048
20049    // The count that matches the above conditions.
20050    optional int32 count = 9;
20051}
20052
20053/**
20054 * Stats about each ServiceDescription that was included in the PIDF XML sent to the network during publish.
20055 *
20056 * Logged from:
20057 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20058 */
20059message ImsRegistrationServiceDescStats {
20060    // Describe Service IDs will be included PUBLISH
20061    // See RcsContactPresenceTuple.java
20062    enum ServiceId {
20063        SERVICE_ID_UNSPECIFIED = 0;
20064        SERVICE_ID_CUSTOM = 1;
20065        SERVICE_ID_MMTEL = 2;
20066        SERVICE_ID_CHAT_V1 = 3;
20067        SERVICE_ID_CHAT_V2 = 4;
20068        SERVICE_ID_FT = 5;
20069        SERVICE_ID_FT_OVER_SMS = 6;
20070        SERVICE_ID_GEO_PUSH = 7;
20071        SERVICE_ID_GEO_PUSH_VIA_SMS = 8;
20072        SERVICE_ID_CALL_COMPOSER = 9;
20073        SERVICE_ID_POST_CALL = 10;
20074        SERVICE_ID_SHARED_MAP = 11;
20075        SERVICE_ID_SHARED_SKETCH = 12;
20076        SERVICE_ID_CHATBOT = 13;
20077        SERVICE_ID_CHATBOT_STANDALONE = 14;
20078        SERVICE_ID_CHATBOT_ROLE = 15;
20079    }
20080
20081    // the carrier id associated with this SIP delegate
20082    // Used as a dimension
20083    optional int32 carrier_id = 1;
20084
20085    // The slot id associated with this SIP delegate
20086    // Used as a dimension
20087    optional int32 slot_id = 2;
20088
20089    // The service id portion of the ServiceDescription
20090    // used as a dimension
20091    optional ServiceId service_id_name = 3;
20092
20093    // The version portion of the ServiceDescription
20094    // used as a dimension
20095    optional float service_id_version = 4;
20096
20097    // The underlying radio technology type associated with the feature tag
20098    // used as a dimension
20099    // See the ImsRegistrationImplBase#REGISTRATION_TECH*
20100    optional int32 registration_tech = 5;
20101
20102    // the time this feature tag was registered, rounded 5 minutes
20103    optional int32 published_seconds = 6;
20104}
20105
20106/**
20107 * Stats related to UCE queries to the network
20108 *
20109 * Logged from:
20110 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20111 */
20112message UceEventStats {
20113    enum MessageType {
20114        MESSAGE_TYPE_UNSPECIFIED = 0;
20115        PUBLISH = 1;
20116        SUBSCRIBE = 2;
20117        INCOMING_OPTION = 3;
20118        OUTGOING_OPTION = 4;
20119    }
20120    enum CommandCode {
20121        SERVICE_UNKNOWN = 0;
20122        GENERIC_FAILURE = 1;
20123        INVALID_PARAM = 2;
20124        FETCH_ERROR = 3;
20125        REQUEST_TIMEOUT = 4;
20126        INSUFFICIENT_MEMORY = 5;
20127        LOST_NETWORK_CONNECTION = 6;
20128        NOT_SUPPORTED = 7;
20129        NOT_FOUND = 8;
20130        SERVICE_UNAVAILABLE = 9;
20131        NO_CHANGE = 10;
20132    }
20133    // Carrier ID of the SIM used for IMS registration.
20134    // See https://source.android.com/devices/tech/config/carrierid.
20135    // Used as a dimension
20136    optional int32 carrier_id = 1;
20137
20138    // Index of the SIM used, 0 for single-SIM devices.
20139    // Used as a dimension
20140    optional int32 slot_id = 2;
20141
20142    // Used to identify the message type.
20143    // Used as a dimension
20144    optional MessageType type = 3;
20145
20146    // Whether the UCE event is successfully finished. If false, the request to the
20147    // modem timed out and we sent a timeout error back to the requesting app.
20148    // Used as a dimension
20149    optional bool successful = 4;
20150
20151    // The command error code for the Uce event. Not populated if the modem
20152    // accepted the request and delivered a network_response.
20153    // Used as a dimension
20154    optional CommandCode command_code = 5;
20155
20156    // The network response code for the Uce event. Will not be populated if
20157    // command_code is present.
20158    // Used as a dimension
20159    optional int32 network_response = 6;
20160
20161    // The count that matches the above conditions;
20162    optional int32 count = 7;
20163}
20164
20165/**
20166 * Information related to a SIP NOTIFY event from modem.
20167 *
20168 * Logged from:
20169 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20170 */
20171message PresenceNotifyEvent {
20172    // See RFC3265 Section 3.2.4 for more information about these subscription states.
20173    enum TerminatedReason {
20174        REASON_UNSPECIFIED = 0;
20175        // Not spec defined, the network returned a custom code that is not spec defined.
20176        REASON_CUSTOM = 1;
20177        REASON_DEACTIVATED = 2;
20178        REASON_PROBATION = 3;
20179        REASON_REJECTED = 4;
20180        REASON_TIMEOUT = 5;
20181        REASON_GIVEUP = 6;
20182        REASON_NORESOURCE = 7;
20183    }
20184
20185    // Carrier ID of the SIM used for IMS registration.
20186    // See https://source.android.com/devices/tech/config/carrierid.
20187    // Used as a dimension
20188    optional int32 carrier_id = 1;
20189
20190    // Index of the SIM used, 0 for single-SIM devices.
20191    // Used as a dimension
20192    optional int32 slot_id = 2;
20193
20194    // The terminated reason associated with the subscription state.
20195    // Used as a dimension
20196    optional TerminatedReason reason = 3;
20197
20198    // Whether or not the NOTIFY received contained at least one body with PIDF
20199    // content before moving to the terminated state.
20200    // Used as a dimension
20201    optional bool content_body_received = 4;
20202
20203    // The count of PIDF info received that contained RCS caps.
20204    optional int32 rcs_caps_count = 5;
20205
20206    // The count of PIDF info received that contained MMTEL caps.
20207    optional int32 mmtel_caps_count = 6;
20208
20209    // The count of PIDF info received that contained no mmtel or RCS caps.
20210    optional int32 no_caps_count = 7;
20211
20212    // The count that matches the above conditions;
20213    optional int32 count = 8;
20214}
20215
20216/**
20217 * Tracks GBA requests from applications
20218 *
20219 * Logged from:
20220 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/RcsStats.java
20221 */
20222message GbaEvent {
20223    enum FailedReason {
20224        UNKNOWN = 0;
20225        FEATURE_NOT_SUPPORTED = 1;
20226        FEATURE_NOT_READY = 2;
20227        NETWORK_FAILURE = 3;
20228        INCORRECT_NAF_ID = 4;
20229        SECURITY_PROTOCOL_NOT_SUPPORTED = 5;
20230    }
20231    // Carrier ID of the SIM used for IMS registration.
20232    // See https://source.android.com/devices/tech/config/carrierid.
20233    // Used as a dimension
20234    optional int32 carrier_id = 1;
20235
20236    // Index of the SIM used, 0 for single-SIM devices.
20237    // Used as a dimension
20238    optional int32 slot_id = 2;
20239
20240    // Whether the GBA event is successful.
20241    // Used as a dimension
20242    optional bool successful = 3;
20243
20244    // Gba authentication failed reason.
20245    // Used as a dimension
20246    optional FailedReason failed_reason = 4;
20247
20248    // The count that matches the above conditions.
20249    optional int32 count = 5;
20250}
20251
20252/*
20253 * Logs details of initiated UWB ranging session
20254 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
20255 */
20256message UwbSessionInitiated {
20257    // UWB profiles
20258    optional android.uwb.Profile profile = 1;
20259    // Scrambled timestamp sequence (STS) Type
20260    optional android.uwb.Sts sts = 2;
20261    // Was it an initiator as opposed to responder?
20262    optional bool is_initiator = 3;
20263    // Was it a controller as opposed to controlee?
20264    optional bool is_controller = 4;
20265    // Was the discovery done by the framework?
20266    optional bool is_discovered_by_framework = 5;
20267    // Was it out-of-band connection as opposed to in-band connection?
20268    // Note that this field is ignored if is_discovered_by_framework is false.
20269    optional bool is_out_of_band = 6;
20270    // UWB channel 5, 6, 9, etc.
20271    optional int32 channel = 7;
20272    // The status code of session initialization.
20273    optional android.uwb.Status status = 8;
20274    // Initialization latency in ms if is_discovered_by_framework is true.
20275    optional int32 latency_ms = 9;
20276    // Initialization latency in step size of 200 ms if is_discovered_by_framework is true.
20277    optional int32 latency_200ms = 10;
20278}
20279
20280/*
20281 * Logs details of closed UWB ranging session
20282 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
20283 */
20284message UwbSessionClosed {
20285    // UWB profiles
20286    optional android.uwb.Profile profile = 1;
20287    // Scrambled timestamp sequence (STS) Type
20288    optional android.uwb.Sts sts = 2;
20289    // Was it an initiator as opposed to responder?
20290    optional bool is_initiator = 3;
20291    // Was it a controller as opposed to controlee?
20292    optional bool is_controller = 4;
20293    // Was the connection done by the app as opposed to by the framework?
20294    optional bool is_framework_initiated = 5;
20295    // Was it out-of-band connection as opposed to in-band connection?
20296    // Note that this field is ignored if is_framework_initiated is false.
20297    optional bool is_out_of_band = 6;
20298    // Session active duration in seconds
20299    optional int32 duration_sec = 7;
20300    // Session active duration bucket
20301    optional android.uwb.DurationBucket duration_bucket = 8;
20302    // Total ranging measurement count
20303    optional int32 ranging_count = 9;
20304    // Valid ranging measurement count
20305    optional int32 valid_ranging_count = 10;
20306    // Ranging measurement count bucket.
20307    optional android.uwb.CountBucket ranging_count_bucket = 11;
20308    // Valid ranging measurement count bucket.
20309    optional android.uwb.CountBucket valid_ranging_count_bucket = 12;
20310    // Ranging start count
20311    optional int32 start_count = 13;
20312    // Ranging start failure count
20313    optional int32 start_failure_count = 14;
20314    // Ranging start without valid ranging result count
20315    optional int32 start_no_valid_report_count = 15;
20316}
20317
20318/*
20319 * Log that the ranging measurement is received
20320 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
20321 */
20322message UwbRangingMeasurementReceived {
20323    // UWB profiles
20324    optional android.uwb.Profile profile = 1;
20325    // None-Line-of-sight (LOS) indication
20326    optional android.uwb.Nlos nlos = 2;
20327    // Was the distance valid?
20328    optional bool is_distance_valid = 3;
20329    // The distance measurement in centimeters.
20330    optional int32 distance_cm = 4;
20331    // The distance measurement in step size of 50 cm
20332    optional int32 distance_50cm = 5;
20333    // RSSI of ranging report, in dBm
20334    optional int32 rssi = 6;
20335    // Was azimuth angle valid?
20336    optional bool is_azimuth_valid = 7;
20337    // The azimuth angle measurement in degrees.
20338    optional int32 azimuth_degree = 8;
20339    // The azimuth angle measurement in step size of 10 degree.
20340    optional int32 azimuth_10degree = 9;
20341    // The figure of merit of azimuth angle measurement.
20342    optional int32 azimuth_fom = 10;
20343    // Was elevation angle valid?
20344    optional bool is_elevation_valid = 11;
20345    // The elevation angle measurement in degrees.
20346    optional int32 elevation_degree = 12;
20347    // The elevation angle measurement in step size of 10 degree.
20348    optional int32 elevation_10degree = 13;
20349    // The figure of merit of elevation angle measurement.
20350    optional int32 elevation_fom = 14;
20351}
20352
20353/*
20354 * Log that the first ranging measurement is received
20355 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
20356 */
20357message UwbFirstRangingReceived {
20358    // UWB profiles
20359    optional android.uwb.Profile profile = 1;
20360    // The latency between the ranging start/resume and 1st ranging measurement, in ms.
20361    optional int32 latency_ms = 2;
20362    // The ranging latency in 200ms.
20363    optional int32 latency_200ms = 3;
20364}
20365
20366/*
20367 * Log that UWB device error is detected
20368 * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
20369 */
20370message UwbDeviceErrorReported {
20371    enum Type {
20372        UNKNOWN = 0;
20373        // Initialization error
20374        INIT_ERROR = 1;
20375        // Device status error
20376        DEVICE_STATUS_ERROR = 2;
20377        // UCI generic error
20378        UCI_GENERIC_ERROR = 3;
20379    }
20380    // Error type
20381    optional Type type= 1;
20382}
20383
20384/**
20385 * Log that the clipboard has been cleared
20386 * Logged from frameworks/base/services/core/java/android/content/ClipboardAutoWipeService.java
20387 */
20388message ClipboardCleared {
20389    enum Source {
20390        SOURCE_UNKNOWN = 0;
20391        AUTO_CLEAR = 1;
20392    }
20393
20394    // Source of the wipe
20395    optional Source source = 1;
20396}
20397
20398/**
20399 * Pulls status for a SIM.
20400 *
20401 * Each pull creates multiple atoms, one for each SIM. The atom holds the status for a SIM that's
20402 * sensitive per carrier. The atom would be aggregated per carrier for analysis.
20403 *
20404 * Pulled from:
20405 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
20406 */
20407message PerSimStatus {
20408    enum WfcMode {
20409        UNKNOWN = 0;
20410        WIFI_ONLY = 1;
20411        CELLULAR_PREFERRED = 2;
20412        WIFI_PREFERRED = 3;
20413    }
20414    enum SimVoltageClass {
20415        VOLTAGE_CLASS_UNKNOWN = 0;
20416        VOLTAGE_CLASS_A = 1;
20417        VOLTAGE_CLASS_B = 2;
20418        VOLTAGE_CLASS_C = 3;
20419    }
20420
20421    // Index of the SIM, 0 for single-SIM devices.
20422    optional int32 sim_slot_index = 1;
20423
20424    // Carrier ID of the SIM.
20425    // See https://source.android.com/devices/tech/config/carrierid.
20426    optional int32 carrier_id = 2;
20427
20428    // Indicates whether phone number source UICC provides a phone number
20429    // and whether it agrees with other sources:
20430    //  - 0: no number provided
20431    //  - a positive integer (> 0): sources providing the same phone number
20432    //    shall use the same integer. The integer shall start from 1, and
20433    //    for each new unique source the next integer (2, 3, …) is used.
20434    // This way, the raw phone number cannot be derived from the value of
20435    // this field.
20436    // This also allows a quick check of conflicts: any field > 1 means conflict,
20437    // and the max means the count of unique phone numbers.
20438    optional int32 phone_number_source_uicc = 3;
20439
20440    // Indicates whether phone number source CARRIER provides a phone number
20441    // and whether it agrees with other sources.
20442    // See field phone_number_source_uicc.
20443    optional int32 phone_number_source_carrier = 4;
20444
20445    // Indicates whether phone number source IMS provides a phone number
20446    // and whether it agrees with other sources.
20447    // See field phone_number_source_uicc.
20448    optional int32 phone_number_source_ims = 5;
20449
20450    // Indicates whether VoLTE is enabled
20451    optional bool volte_enabled = 6;
20452
20453    // Indicates whether WFC is enabled
20454    optional bool wfc_enabled = 7;
20455
20456    // Indicates the user's WFC mode
20457    optional WfcMode wfc_mode = 8;
20458
20459    // Indicates the user's WFC mode when roaming
20460    optional WfcMode wfc_roaming_mode = 9;
20461
20462    // Indicates the user's setting for video calling.
20463    optional bool video_calling_enabled = 10;
20464
20465    // Indicates if data roaming is enabled
20466    optional bool data_roaming_enabled = 11;
20467
20468    // Indicates the list of networks allowed by the user. Bitmask is encoded as
20469    // TelephonyManager#NetworkTypeBitMask.
20470    optional int64 allowed_networks_by_user = 12;
20471
20472    // Indicates if 2G is disabled by the user using the "Allow 2G" toggle
20473    optional bool is_2g_disabled = 13;
20474
20475    // Indicates if PIN1 of the SIM card is enabled
20476    optional bool is_pin1_enabled = 14;
20477
20478    // Indicates the lowest voltage class supported by the SIM
20479    optional SimVoltageClass sim_voltage_class = 15;
20480
20481    // APN type bitmask of the APNs added or modified by user:
20482    // @ApnType in frameworks/base/telephony/java/android/telephony/Annotation.java.
20483    optional int32 user_modified_apn_type_bitmask = 16;
20484
20485    // Indicates the unmetered networks
20486    // Bitmask is encoded as TelephonyManager#NetworkTypeBitMask.
20487    optional int64 unmetered_networks = 17;
20488}
20489
20490/*
20491 * Logs Device Scan State events generated by Nearby Scan API.
20492 */
20493message NearbyDeviceScanStateChanged {
20494  // Uid of the client that triggers the Nearby scan.
20495  optional int32 uid = 1 [(is_uid) = true];
20496
20497  // Scan start timestamp as session id.
20498  optional int64 scan_session_id = 2;
20499
20500  // Scan state.
20501  optional android.nearby.NearbyScanState scan_state = 3;
20502
20503  // Scan type.
20504  optional android.nearby.NearbyScanType scan_type = 4;
20505
20506  // Medium that this device was discovered/lost.
20507  optional android.nearby.NearbyNetworkMedium network_medium = 5;
20508
20509  // Received Signal Strength Indication (RSSI) value of the device discovered/lost.
20510  optional int32 rssi = 6;
20511
20512  // Model of the device discovered/lost.
20513  optional string scanned_device_model = 7;
20514
20515  // Manufacturer of the device discovered/lost.
20516  optional string scanned_device_manufacturer = 8;
20517}
20518
20519/**
20520 * Logs when locales of an application are changed.
20521 * Logged from
20522 *   frameworks/base/services/core/java/com/android/server/locales/LocaleManagerService.java
20523 */
20524message ApplicationLocalesChanged {
20525    // The uid which invoked this update. The locales for an application
20526    // could be changed from the in-app picker OR from the settings UI.
20527    optional int32 calling_uid = 1 [(is_uid) = true];
20528
20529    // The uid for which the locale change is being done.
20530    optional int32 target_uid = 2 [(is_uid) = true];
20531
20532    // The new locales for the target package. A comma separated list of BCP 47
20533    // locale identifiers, compatible with LocaleList#forLanguageTags.
20534    optional string new_locales = 3;
20535
20536    // The previous locales for the target package. A comma separated list of
20537    // BCP 47 locale identifiers, compatible with LocaleList#forLanguageTags.
20538    optional string prev_locales = 4;
20539
20540    // Application locales changed status.
20541    enum Status {
20542        // A placeholder for unspecified values.
20543        STATUS_UNSPECIFIED = 0;
20544
20545        // New locales were committed.
20546        CONFIG_COMMITTED = 1;
20547
20548        // Likely because no change is required.
20549        CONFIG_UNCOMMITTED = 2;
20550
20551        // Failed because the target package is invalid.
20552        FAILURE_INVALID_TARGET_PACKAGE = 3;
20553
20554        // Failed because the calling package does not have the required permission.
20555        FAILURE_PERMISSION_ABSENT = 4;
20556    }
20557
20558    optional Status status = 5;
20559}
20560
20561/* Logs when the display HBM state changes.
20562 *
20563 * Logged from:
20564 *   frameworks/base/services/core/java/com/android/server/display/HighBrightnessModeController.java
20565 */
20566message DisplayHbmStateChanged {
20567    optional int32 display_id = 1;
20568
20569    // New HBM state
20570    optional android.server.display.HbmState state = 2;
20571
20572    // The reason the state changes.
20573    optional android.server.display.HbmStateTransitionReason reason = 3;
20574}
20575
20576/*
20577 * Logs when the display HBM brightness changes.
20578 * Logged from:
20579 *   frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessControllerjava
20580 */
20581message DisplayHbmBrightnessChanged {
20582    optional int32 display_id = 1;
20583
20584    // display brightness
20585    optional float brightness = 2;
20586}
20587
20588/**
20589 * Per-UID time spent running work on the GPU.
20590 *
20591 * Each pull creates multiple atoms, one per (GPU ID, UID) pair, for at most 10
20592 * randomly selected UIDs.
20593 *
20594 * Pulled from:
20595 *    frameworks/native/services/gpuservice/gpuwork/GpuWork.cpp
20596 */
20597message GpuWorkPerUid {
20598  // The UID (i.e. app id) that scheduled work on the GPU.
20599  optional int32 uid = 1 [(is_uid) = true];
20600
20601  // The GPU ID for which we have work information.
20602  optional int32 gpu_id = 2;
20603
20604  // The time duration (in seconds) over which this data was collected (most
20605  // likely 24 hours).
20606  optional int32 time_duration_seconds = 3;
20607
20608  // The total amount of time (in milliseconds) the GPU spent running work for
20609  // |uid|.
20610  optional int32 total_active_duration_millis = 4;
20611
20612  // The total amount of time (in milliseconds) the GPU was inactive while
20613  // running "continuous" work for |uid|. This is estimated by adding up the
20614  // duration of the small gaps between GPU work for |uid|.
20615  optional int32 total_inactive_duration_millis = 5;
20616}
20617
20618/**
20619 * Logs when entries are dropped in DropBox and the reason for the drop.
20620 *
20621 * Logged from: frameworks/base/services/
20622 */
20623message DropboxEntryDropped {
20624    // Explains at which stage of the DropBox workflow the entry was dropped.
20625    enum DropReason {
20626        UNKNOWN = 0;
20627        CLEARING_DATA = 3;
20628        AGED = 4;
20629        WRITE_FAILURE = 5;
20630
20631        reserved 1, 2;
20632    }
20633
20634    optional DropReason drop_reason = 1;
20635
20636    // Tag describing the type of dropbox entry.
20637    optional string tag = 2;
20638
20639    // The age (millis) of the dropped dropbox entry.
20640    optional int64 age_millis = 3;
20641}
20642
20643message PersistentUriPermissionsFlushed {
20644    // Current amount of persistent uri permissions overall
20645    optional int32 permissions_flushed_amount = 1;
20646}
20647
20648message PersistentUriPermissionsAmountPerPackage {
20649    // The uid persistent uri permissions amount reported for
20650    optional int32 uid = 1 [(is_uid) = true];
20651    // Current amount of persistent uri permissions for this package
20652    optional int32 amount = 2;
20653}
20654
20655/**
20656 * VBMeta Digest cryptographically encapsulates the composition of signed images or partitions of
20657 * a particular build.
20658 *
20659 * Logs when boot is complete.
20660 * Pushed from:
20661 *    frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
20662 */
20663message VBMetaDigestReported {
20664    // the hex encoded string of VBMeta Digest value
20665    optional string vbmeta_digest = 1;
20666}
20667
20668/**
20669 * APEXs can either be signed by Google or OEMs. This atom captures basic metadata of APEXs
20670 * pre-installed on a build or a device.
20671 *
20672 * Logs when boot is complete.
20673 * Pushed from:
20674 *    frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
20675 */
20676message ApexInfoGathered {
20677    // APEX package names are determined by OEMs
20678    optional string package_name = 1;
20679    // the version code of the APEX
20680    optional int64 version_code = 2;
20681    // the hex encoded SHA256 digest of the APEX file
20682    optional string sha256_digest = 3;
20683}
20684
20685/**
20686 * PVM is protected virtual machine. This atom captures the notion of a container
20687 * that describes a virtual machine.
20688 *
20689 * Will be pushed from:
20690 *      frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
20691 */
20692message PvmInfoGathered {
20693    // PVM names are determined by OEMs
20694    optional string name = 1;
20695    // an int describing the version of the VM
20696    optional int64 version = 2;
20697    // the hex encoded SHA256 digest of the pvm descriptor file
20698    optional string sha256_digest = 3;
20699}
20700
20701/**
20702 * This will be pulled from
20703 *     frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
20704 */
20705message SignedPartitionInfo {
20706    // partition name (e.g. vendor, product) is determined by OEM
20707    optional string partition_name = 1;
20708    // the hex encoded SHA256 digest of the partition image file
20709    optional string sha256_digest = 2;
20710}
20711
20712/**
20713 * Logs when Wear Settings UI is interacted with
20714 */
20715message WearSettingsUIInteracted {
20716    /** The UI action category */
20717    optional android.app.wearsettings.Action action = 1;
20718
20719    /** The ID of the entry that the users actioned on. */
20720    optional android.app.wearsettings.ItemId item_id = 2;
20721}
20722
20723message TracingServiceReportEvent {
20724    enum Event {
20725      TRACING_SERVICE_REPORT_UNDEFINED = 0;
20726
20727      // Checkpoints inside TracingServiceProxy.
20728      TRACING_SERVICE_REPORT_BEGIN = 1;
20729      TRACING_SERVICE_REPORT_SVC_HANDOFF = 2;
20730
20731      // Guardrails inside TracingServiceProxy.
20732      TRACING_SERVICE_REPORT_BIND_PERM_INCORRECT = 3;
20733      TRACING_SERVICE_REPORT_SVC_PERM_MISSING = 4;
20734      TRACING_SERVICE_REPORT_SVC_COMM_ERROR = 5;
20735  }
20736
20737  // Which stage of the pipeline we are reporting from.
20738  optional Event event = 1;
20739
20740  // UUID of the trace.
20741  optional int64 trace_uuid_lsb = 2;
20742  optional int64 trace_uuid_msb = 3;
20743}
20744
20745/** Pulled from PinnerService. */
20746message PinnedFileSizesPerPackage {
20747    // If the file is pinned but not as part of a specific pinned app,
20748    // this will be set to 1000 - the value of system_server.
20749    optional int32 uid = 1 [(is_uid) = true];
20750
20751    // Consists of only the pinned file's filename, not its full path; for example
20752    // Given a pinned file at ‘/vendor/lib64/libCB.so’, then this field will be
20753    // Determined to have have the value ‘libCB.so’.
20754    optional string filename = 2;
20755
20756    // The size of the pinned file, in kilobytes.
20757    optional int32 size_kb = 3;
20758}
20759
20760/** Pulled from PendingIntentController. */
20761message PendingIntentsPerPackage {
20762    // The UID of the app that sent the PendingIntent.
20763    optional int32 uid = 1 [(is_uid) = true];
20764    // The total number of currently active PendingIntents belonging to this uid.
20765    optional int32 pending_intent_count = 2;
20766    // The total size of all currently active PendingIntents belonging to this uid, in kilobytes.
20767    optional int32 pending_intent_total_bundle_size_kb = 3;
20768}
20769
20770/**
20771 * Logs for Launcher latency. Uses KLL to reduce the data pression
20772 *
20773 * Logged from:
20774 *      vendor/unbundled_google/packages/NexusLauncher
20775 */
20776message LauncherLatency {
20777    // The event id generated from go/uievents
20778    optional int32 event_id = 1;
20779    // The instance id to track multiple partial durations or parellel running durations
20780    optional int32 instance_id = 2;
20781    optional int32 package_id = 3;
20782    optional int64 latency_in_millis = 4;
20783    optional int32 type = 5;
20784    optional int32 query_length = 6 [default = -1];
20785    optional int32 sub_event_type = 7;
20786}
20787
20788/**
20789 * Logs for Launcher Impression logging.
20790 *
20791 * Logged from:
20792 *      vendor/unbundled_google/packages/NexusLauncher
20793 */
20794message LauncherImpressionEvent {
20795    // The event id generated from go/uievents
20796    optional int32 event_id = 1;
20797    // The instance id to track multiple partial impression event.
20798    optional int32 instance_id = 2;
20799
20800    // The state defines the surface where the impression is being logged.
20801    optional int32 state = 3;
20802    optional int32 query_length = 4 [default = -1];
20803
20804    // ResultType of the search result as defined in frameworks/libs/systemui/searchuilib/src/com/android/app/search/ResultType.java
20805    repeated int32 result_type = 5;
20806
20807    // Number of results of corresponding result_type.
20808    repeated int32 result_count = 6;
20809
20810    // If the corresponding result_type is above or below keyboard.
20811    // If 50% of result is visible, then is_above_keyboard = true
20812    repeated bool is_above_keyboard = 7;
20813}
20814
20815/*
20816 * Logs changes to game state set by game applications via GameService.
20817 */
20818message GameStateChanged {
20819    enum State {
20820        // Game mode is unknown.
20821        MODE_UNKNOWN = 0;
20822
20823        // The game is not in active play, e.g.e the user is using a game menu.
20824        MODE_NONE = 1;
20825
20826        // The game is in active, but interruptible, game play.
20827        MODE_GAMEPLAY_INTERRUPTIBLE = 2;
20828
20829        // The game is in active user play mode, which cannot be interrupted.
20830        MODE_GAMEPLAY_UNINTERRUPTIBLE = 3;
20831
20832        // The current content shown is not gameplay related (e.g. an ad).
20833        MODE_CONTENT = 4;
20834    }
20835
20836    // Provided to ensure package is available even with UID sharing.
20837    optional string package_name = 1;
20838
20839    // The UID (i.e. app id).
20840    optional int32 uid = 2 [(is_uid) = true];
20841
20842    // Whether the device enabled performance boost when the state was changed.
20843    optional bool boost_enabled = 3;
20844
20845    // This includes a top-level state for the game.
20846    optional State state = 4;
20847
20848    // Indicates if the game is loading assets/resources/compiling/etc.
20849    optional bool is_loading = 5;
20850
20851    // A developer-selected enum, for example to indicate level or scene.
20852    optional int32 label = 6;
20853
20854    // A developer-supplied enum, e.g. to indicate the current quality level.
20855    optional int32 quality = 7;
20856}
20857
20858/**
20859 * Logs information related to creating hotword detector.
20860 */
20861message HotwordDetectorCreateRequested {
20862    // The type of detector.
20863    optional android.hotword.HotwordDetectorType detector_type = 1;
20864
20865    // True if the detector is created successfully.
20866    optional bool is_created_done = 2;
20867
20868    // The UID for which assistant application is active.
20869    optional int32 uid = 3 [(is_uid) = true];
20870}
20871
20872/**
20873 * Logs information related to hotword detection service init result.
20874 */
20875message HotwordDetectionServiceInitResultReported {
20876    // The type of detector.
20877    optional android.hotword.HotwordDetectorType detector_type = 1;
20878
20879    // The result of initialization.
20880    enum Result {
20881        // Indicates that the service was initialized successfully.
20882        CALLBACK_INIT_STATE_SUCCESS = 0;
20883
20884        // Indicates that the service was not initialized successfully.
20885        CALLBACK_INIT_STATE_ERROR = 1;
20886
20887        // Indicates that the callback was invoked without init state.
20888        CALLBACK_INIT_STATE_UNKNOWN_NO_VALUE = 2;
20889
20890        // Indicates that the callback was invoked, but the init state value exceeded
20891        // the defined maximum.
20892        CALLBACK_INIT_STATE_UNKNOWN_OVER_MAX_CUSTOM_VALUE = 3;
20893
20894        // Indicates that the callback was not invoked within timeout.
20895        CALLBACK_INIT_STATE_UNKNOWN_TIMEOUT = 4;
20896    }
20897    optional Result result = 2;
20898
20899    // The UID for which assistant application is active.
20900    optional int32 uid = 3 [(is_uid) = true];
20901}
20902
20903/**
20904 * Logs information related to restarting hotword detection service.
20905 */
20906message HotwordDetectionServiceRestarted {
20907    // The type of detector.
20908    optional android.hotword.HotwordDetectorType detector_type = 1;
20909
20910    // The reason for restarting service.
20911    enum Reason {
20912        // UNKNOWN value.
20913        UNKNOWN = 0;
20914
20915        // Indicates that the service was restarted due to audio service died.
20916        AUDIO_SERVICE_DIED = 1;
20917
20918        // Indicates that the service was restarted regularly.
20919        SCHEDULE = 2;
20920
20921        // Indicates that the service was restarted due to service crashed.
20922        CRASH = 3;
20923    }
20924    optional Reason reason = 2;
20925
20926    // The UID for which assistant application is active.
20927    optional int32 uid = 3 [(is_uid) = true];
20928}
20929
20930/**
20931 * Logs information related to keyphrase trigger.
20932 */
20933message HotwordDetectorKeyphraseTriggered {
20934    // The type of detector.
20935    optional android.hotword.HotwordDetectorType detector_type = 1;
20936
20937    // The result of detection.
20938    enum Result {
20939        // Indicates that the system got the keyphrase from DSP.
20940        KEYPHRASE_TRIGGER = 0;
20941
20942        // Indicates that the system can not inform the service to verify the keyphrase.
20943        FAILED_TO_INFORM_SERVICE = 1;
20944
20945        // Indicates that the callback was not invoked within timeout after informing
20946        // the service.
20947        DETECT_TIMEOUT = 2;
20948
20949        // Indicates that the system got the exception after informing the service.
20950        DETECT_EXCEPTION = 3;
20951
20952        // Indicates that the service crashed.
20953        SERVICE_CRASH = 4;
20954
20955        // Indicates that the keyphrase was detected.
20956        DETECTED = 5;
20957
20958        // Indicates that the keyphrase was not detected.
20959        REJECTED = 6;
20960
20961        // Indicates that the system got the unexpected detected callback.
20962        DETECT_UNEXPECTED_CALLBACK = 7;
20963
20964        // Indicates that the system got the security exception when handling detected callback.
20965        DETECT_SECURITY_EXCEPTION = 8;
20966
20967        // Indicates that the system got the unexpected rejected callback.
20968        REJECT_UNEXPECTED_CALLBACK = 9;
20969
20970        // Indicates that the system called rejected callback when the trusted process was
20971        // restarted.
20972        REJECTED_FROM_RESTART = 10;
20973    }
20974    // What result after detecting.
20975    optional Result result = 2;
20976
20977    // The UID for which assistant application is active.
20978    optional int32 uid = 3 [(is_uid) = true];
20979}
20980
20981/**
20982 * Logs information related to hotword detector events.
20983 */
20984message HotwordDetectorEvents {
20985    // The type of detector.
20986    optional android.hotword.HotwordDetectorType detector_type = 1;
20987
20988    // The type of event.
20989    enum Event {
20990        // UNKNOWN value.
20991        UNKNOWN = 0;
20992
20993        // Indicates that the system requested to bind the service.
20994        REQUEST_BIND_SERVICE = 1;
20995
20996        // Indicates that the system connected the service successfully.
20997        ON_CONNECTED = 2;
20998
20999        // Indicates that the system failed to bind the service.
21000        REQUEST_BIND_SERVICE_FAIL = 3;
21001
21002        // Indicates that the system called the updateState function of service.
21003        REQUEST_UPDATE_STATE = 4;
21004
21005        // Indicates that the callback was not invoked within timeout after calling
21006        // the updateState function of service.
21007        CALLBACK_UPDATE_STATE_AFTER_TIMEOUT = 5;
21008
21009        // Indicates that no starting recognition after creating the detector.
21010        DID_NOT_CALL_START_RECOGNITION = 6;
21011
21012        // Indicates that the system disconnected the service.
21013        ON_DISCONNECTED = 7;
21014
21015        // Indicates that the application called the updateState function.
21016        APP_REQUEST_UPDATE_STATE = 8;
21017
21018        // Indicates that starting to listen software detection.
21019        START_SOFTWARE_DETECTION = 9;
21020
21021        // Indicates that starting to listen external source detection.
21022        START_EXTERNAL_SOURCE_DETECTION = 10;
21023
21024        // Indicates that the external source detection was detected.
21025        EXTERNAL_SOURCE_DETECTED = 11;
21026
21027        // Indicates that the external source detection was not detected.
21028        EXTERNAL_SOURCE_REJECTED = 12;
21029
21030        // Indicates that the system got the security exception when handling external
21031        // source detected callback.
21032        EXTERNAL_SOURCE_DETECT_SECURITY_EXCEPTION = 13;
21033
21034        // Indicates that the callback onStatusReported was not invoked successfully.
21035        CALLBACK_ON_STATUS_REPORTED_EXCEPTION = 14;
21036
21037        // Indicates that the callback onError was not invoked successfully.
21038        CALLBACK_ON_ERROR_EXCEPTION = 15;
21039
21040        // Indicates that the callback onRejected was not invoked successfully.
21041        CALLBACK_ON_REJECTED_EXCEPTION = 16;
21042
21043        // Indicates that the callback onDetected was not invoked successfully.
21044        CALLBACK_ON_DETECTED_EXCEPTION = 17;
21045
21046        // Indicates that the callback onProcessRestarted was not invoked successfully.
21047        CALLBACK_ON_PROCESS_RESTARTED_EXCEPTION = 18;
21048
21049        // Indicates that the updateState was not invoked successfully.
21050        CALL_UPDATE_STATE_EXCEPTION = 19;
21051
21052        // Indicates that the audio egress starts.
21053        AUDIO_EGRESS_START = 20;
21054
21055        // Indicates that the audio egress ends.
21056        AUDIO_EGRESS_END = 21;
21057
21058        // Indicates that the audio egress got interrupted exception.
21059        AUDIO_EGRESS_INTERRUPTED_EXCEPTION = 22;
21060
21061        // Indicates that the client is not granted permission to access audio
21062        // egress.
21063        AUDIO_EGRESS_NO_PERMISSION = 23;
21064
21065        // Indicates that the client is inactive over a period of time.
21066        AUDIO_EGRESS_INACTIVE_CLIENT = 24;
21067
21068        // Indicates that the HotwordDetectionService is inactive over a period
21069        // of time.
21070        AUDIO_EGRESS_INACTIVE_HOTWORD_DETECTION_SERVICE = 25;
21071
21072        // Indicates that the list of audio stream is empty.
21073        AUDIO_EGRESS_EMPTY_AUDIO_STREAM_LIST = 26;
21074
21075        // Indicates that there is no data from the system audio stream.
21076        AUDIO_EGRESS_SOURCE_IS_EMPTY = 27;
21077
21078        // Indicates that the copy buffer size the client sets is illegal.
21079        AUDIO_EGRESS_ILLEGAL_COPY_BUFFER_SIZE = 28;
21080
21081        // Indicates that the audio egress is closed with error from the system.
21082        AUDIO_EGRESS_CLOSE_ERROR_FROM_SYSTEM = 29;
21083
21084        // Indicates that the audio egress is closed with error from the client
21085        // side.
21086        AUDIO_EGRESS_CLOSE_ERROR_FROM_CLIENT = 30;
21087
21088        // Indicates that the audio egress is closed with error from the
21089        // HotwordDetectionService.
21090        AUDIO_EGRESS_CLOSE_ERROR_FROM_HOTWORD_DETECTION_SERVICE = 31;
21091    }
21092    optional Event event = 2;
21093
21094    // The UID for which assistant application is active.
21095    optional int32 uid = 3 [(is_uid) = true];
21096}
21097
21098/**
21099 * Log the duration of executing all receivers of LOCKED_BOOT_COMPLETED or BOOT_COMPLETED broadcast.
21100 * The dispatch latency is the dispatchTime - enqueueTime.
21101 * The completion latency is the completeTime - enqueueTime.
21102 * Logged from:
21103 *   frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
21104 */
21105message BootCompletedBroadcastCompletionLatencyReported {
21106    enum Event {
21107        UNKNOWN = 0;
21108        LOCKED_BOOT_COMPLETED = 1;
21109        BOOT_COMPLETED = 2;
21110    }
21111
21112    optional Event event = 1;
21113    // from enqueueTime to dispatchTime.
21114    optional int32 dispatch_latency_uptime_millis = 2;
21115    // from enqueueTime to completeTime.
21116    optional int32 complete_latency_uptime_millis = 3;
21117    // from enqueueRealTime to dispatchRealTime.
21118    optional int32 dispatch_latency_realtime_millis = 4;
21119    // from enqueueRealTime to completeRealTime.
21120    optional int32 complete_latency_realtime_millis = 5;
21121
21122    optional int32 user_id = 6;
21123    optional UserLifecycleJourneyReported.UserType user_type = 7;
21124}
21125
21126/**
21127 * Logs information about app background restrictions.
21128 *
21129 * Logged from:
21130 *      frameworks/base/services/core/java/com/android/server/am/AppRestrictionController.java
21131 */
21132message AppBackgroundRestrictionsInfo {
21133    // the uid of the app.
21134    optional int32 uid = 1 [(is_uid) = true];
21135
21136    enum RestrictionLevel {
21137        LEVEL_UNKNOWN = 0;
21138        LEVEL_UNRESTRICTED = 1;
21139        LEVEL_EXEMPTED = 2;
21140        LEVEL_ADAPTIVE_BUCKET = 3;
21141        LEVEL_RESTRICTED_BUCKET = 4;
21142        LEVEL_BACKGROUND_RESTRICTED = 5;
21143        LEVEL_HIBERNATION = 6;
21144    }
21145    // indicates the app background restriction level.
21146    optional RestrictionLevel restriction_level = 2;
21147
21148    enum Threshold {
21149        THRESHOLD_UNKNOWN = 0;
21150        THRESHOLD_RESTRICTED = 1; // app was background restricted by the system.
21151        THRESHOLD_USER = 2; // app was background restricted by user action.
21152    }
21153    // indicates which threshold caused the app to be put into bg restriction.
21154    optional Threshold threshold = 3;
21155
21156    enum StateTracker {
21157        UNKNOWN_TRACKER = 0;
21158        BATTERY_TRACKER = 1;
21159        BATTERY_EXEMPTION_TRACKER = 2;
21160        FGS_TRACKER = 3;
21161        MEDIA_SESSION_TRACKER = 4;
21162        PERMISSION_TRACKER = 5;
21163        BROADCAST_EVENTS_TRACKER = 6;
21164        BIND_SERVICE_EVENTS_TRACKER = 7;
21165    }
21166    // indicates the reason/tracker which caused the app to hit the threshold.
21167    optional StateTracker tracker = 4;
21168
21169    message FgsTrackerInfo {
21170        // indicates whether an fgs notification was visible for this app or not.
21171        optional bool fgs_notification_visible = 1;
21172        // total FGS duration for this app.
21173        optional int64 fgs_duration = 2;
21174    }
21175    optional FgsTrackerInfo fgs_tracker_info = 5 [(log_mode) = MODE_BYTES];
21176
21177    message BatteryTrackerInfo {
21178        // total battery usage within last 24h (1/10000th)
21179        optional int32 battery_24h = 1;
21180        // background battery usage (1/10000th)
21181        optional int32 battery_usage_background = 2;
21182        // FGS battery usage (1/10000th)
21183        optional int32 battery_usage_fgs = 3;
21184        // Foreground battery usage (1/10000th)
21185        optional int32 battery_usage_foreground = 4;
21186        // Cached battery usage (1/10000th)
21187        optional int32 battery_usage_cached = 5;
21188    }
21189    optional BatteryTrackerInfo battery_tracker_info = 6 [(log_mode) = MODE_BYTES];
21190
21191    message BroadcastEventsTrackerInfo {
21192        // the number of broadcasts sent by this app.
21193        optional int32 broadcasts_sent = 1;
21194    }
21195    optional BroadcastEventsTrackerInfo broadcast_events_tracker_info = 7 [(log_mode) = MODE_BYTES];
21196
21197    message BindServiceEventsTrackerInfo {
21198        // the number of bind service requests by this app.
21199        optional int32 bind_service_requests = 1;
21200    }
21201    optional BindServiceEventsTrackerInfo bind_service_events_tracker_info =
21202        8 [(log_mode) = MODE_BYTES];
21203
21204    // The reasons listed below are defined in PowerExemptionManager.java
21205    enum ExemptionReason {
21206        // range 0-9 is reserved for default reasons
21207        REASON_UNKNOWN = 0;
21208        REASON_DENIED = 1;
21209        REASON_OTHER = 2;
21210        // range 10-49 is reserved for BG-FGS-launch allowed proc states
21211        REASON_PROC_STATE_PERSISTENT = 10;
21212        REASON_PROC_STATE_PERSISTENT_UI = 11;
21213        REASON_PROC_STATE_TOP = 12;
21214        REASON_PROC_STATE_BTOP = 13;
21215        REASON_PROC_STATE_FGS = 14;
21216        REASON_PROC_STATE_BFGS = 15;
21217        // range 50-99 is reserved for BG-FGS-launch allowed reasons
21218        REASON_UID_VISIBLE = 50;
21219        REASON_SYSTEM_UID = 51;
21220        REASON_ACTIVITY_STARTER = 52;
21221        REASON_START_ACTIVITY_FLAG = 53;
21222        REASON_FGS_BINDING = 54;
21223        REASON_DEVICE_OWNER = 55;
21224        REASON_PROFILE_OWNER = 56;
21225        REASON_COMPANION_DEVICE_MANAGER = 57;
21226        REASON_BACKGROUND_ACTIVITY_PERMISSION = 58;
21227        REASON_BACKGROUND_FGS_PERMISSION = 59;
21228        REASON_INSTR_BACKGROUND_ACTIVITY_PERMISSION = 60;
21229        REASON_INSTR_BACKGROUND_FGS_PERMISSION = 61;
21230        REASON_SYSTEM_ALERT_WINDOW_PERMISSION = 62;
21231        REASON_DEVICE_DEMO_MODE = 63;
21232        REASON_ALLOWLISTED_PACKAGE = 65;
21233        REASON_APPOP = 66;
21234        REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD = 67;
21235        REASON_OP_ACTIVATE_VPN = 68;
21236        REASON_OP_ACTIVATE_PLATFORM_VPN = 69;
21237        REASON_TEMP_ALLOWED_WHILE_IN_USE = 70;
21238        REASON_CURRENT_INPUT_METHOD = 71;
21239        // range 100-199 is reserved for public reasons
21240        REASON_GEOFENCING = 100;
21241        REASON_PUSH_MESSAGING = 101;
21242        REASON_PUSH_MESSAGING_OVER_QUOTA = 102;
21243        REASON_ACTIVITY_RECOGNITION = 103;
21244        REASON_ACCOUNT_TRANSFER = 104;
21245        // range 200-299 is reserved for broadcast actions
21246        REASON_BOOT_COMPLETED = 200;
21247        REASON_PRE_BOOT_COMPLETED = 201;
21248        REASON_LOCKED_BOOT_COMPLETED = 202;
21249        REASON_BLUETOOTH_BROADCAST = 203;
21250        REASON_TIMEZONE_CHANGED = 204;
21251        REASON_TIME_CHANGED = 205;
21252        REASON_LOCALE_CHANGED = 206;
21253        REASON_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED = 207;
21254        REASON_REFRESH_SAFETY_SOURCES = 208;
21255        // range 300-399 is reserved for other internal reasons
21256        REASON_SYSTEM_ALLOW_LISTED = 300;
21257        REASON_ALARM_MANAGER_ALARM_CLOCK = 301;
21258        REASON_ALARM_MANAGER_WHILE_IDLE = 302;
21259        REASON_SERVICE_LAUNCH = 303;
21260        REASON_KEY_CHAIN = 304;
21261        REASON_PACKAGE_VERIFIER = 305;
21262        REASON_SYNC_MANAGER = 306;
21263        REASON_DOMAIN_VERIFICATION_V1 = 307;
21264        REASON_DOMAIN_VERIFICATION_V2 = 308;
21265        REASON_VPN = 309;
21266        REASON_NOTIFICATION_SERVICE = 310;
21267        REASON_PACKAGE_REPLACED = 311;
21268        REASON_LOCATION_PROVIDER = 312;
21269        REASON_MEDIA_BUTTON = 313;
21270        REASON_EVENT_SMS = 314;
21271        REASON_EVENT_MMS = 315;
21272        REASON_SHELL = 316;
21273        REASON_MEDIA_SESSION_CALLBACK = 317;
21274        REASON_ROLE_DIALER = 318;
21275        REASON_ROLE_EMERGENCY = 319;
21276        REASON_SYSTEM_MODULE = 320;
21277        REASON_CARRIER_PRIVILEGED_APP = 321;
21278        REASON_DPO_PROTECTED_APP = 322;
21279        REASON_DISALLOW_APPS_CONTROL = 323;
21280        REASON_ACTIVE_DEVICE_ADMIN = 324;
21281        // app requested to be exempt
21282        REASON_OPT_OUT_REQUESTED = 1000;
21283    }
21284    // indicates if the app is exempt from background restrictions and the reason if applicable.
21285    optional ExemptionReason exemption_reason = 9;
21286
21287    enum OptimizationLevel {
21288        UNKNOWN = 0;
21289        OPTIMIZED = 1;
21290        BACKGROUND_RESTRICTED = 2;
21291        NOT_OPTIMIZED = 3;
21292    }
21293    // the user choice for the optimization level of the app.
21294    optional OptimizationLevel opt_level = 10;
21295
21296    enum TargetSdk {
21297        SDK_UNKNOWN = 0;
21298        SDK_PRE_S = 1;
21299        SDK_S = 2;
21300        SDK_T = 3;
21301    }
21302    // indicates the target sdk level for this app.
21303    optional TargetSdk target_sdk = 11;
21304
21305    // indicates if the current device is a low ram device.
21306    optional bool low_mem_device = 12;
21307
21308    // indicates previous background restriction level.
21309    optional RestrictionLevel previous_restriction_level = 13;
21310}
21311
21312/**
21313 * Log that the permission reminder notification has been displayed or clicked.
21314 */
21315message PermissionReminderNotificationInteracted {
21316    // id which identifies single session of user interacting with permission
21317    // controller
21318    optional int64 session_id = 1;
21319
21320    enum Result {
21321        UNDEFINED = 0;
21322        // notification was presented to the user
21323        NOTIFICATION_PRESENTED = 1;
21324        // notification was clicked by the user
21325        NOTIFICATION_CLICKED = 2;
21326    }
21327
21328    // View / interaction recorded
21329    optional Result result = 2;
21330}
21331
21332/**
21333 * Log that the user has interacted with the permission decision screen.
21334 */
21335message RecentPermissionDecisionsInteracted {
21336    // id which identifies single session of user interacting with permission
21337    // controller
21338    optional int64 session_id = 1;
21339
21340    enum Action {
21341        ACTION_UNKNOWN = 0;
21342        SCREEN_VIEWED = 1;
21343        REVIEW_DECISION = 2;
21344        VIEW_ALL_CLICKED = 3;
21345    }
21346
21347    // Action taken on the recent permission decisions page.
21348    optional Action action = 2;
21349
21350    // Uid of the package for the permission decision being reviewed
21351    optional int32 uid = 3 [(is_uid) = true];
21352
21353    // Name of the permission for the permission decision being reviewed.
21354    optional string permission_group_name = 4;
21355}
21356
21357/**
21358 * Logs failure reason when MmsSmsProvider#getThreadId fails to return a threadId
21359 */
21360message MmsSmsProviderGetThreadIdFailed {
21361    enum FailureCode {
21362        FAILURE_UNKNOWN = 0;
21363        // Did not return a threadId due to recipients being passed in
21364        FAILURE_NO_RECIPIENTS = 1;
21365        FAILURE_FIND_OR_CREATE_THREAD_ID_SQL = 2;
21366        // Found more than one threadId for the given of recipients
21367        FAILURE_MULTIPLE_THREAD_IDS_FOUND = 3;
21368    }
21369
21370    optional FailureCode failure_code = 1;
21371}
21372
21373/**
21374 * Logs failure reason when MmsSmsDatabaseHelperOnUpgradeFailed fails on an upgrade step
21375 */
21376message MmsSmsDatabaseHelperOnUpgradeFailed {
21377    enum FailureCode {
21378        FAILURE_UNKNOWN = 0;
21379        FAILURE_IO_EXCEPTION = 1;
21380        FAILURE_SECURITY_EXCEPTION = 2;
21381        FAILURE_SQL_EXCEPTION = 3;
21382    }
21383
21384    // Database version being upgraded from
21385    optional int32 old_version = 1;
21386    // Database version being upgraded to
21387    optional int32 current_version = 2;
21388    // Version number of the database upgrade step that failed
21389    optional int32 upgrade_failed_to_version = 3;
21390    optional FailureCode failure_code = 4;
21391}
21392
21393/**
21394 * Logs for task manager events
21395 *
21396 * Logged from SystemUI
21397 */
21398message TaskManagerEventReported {
21399
21400    enum Event {
21401        VIEWED = 1;
21402        STOPPED = 2;
21403    }
21404
21405    optional int32 uid = 1 [(is_uid) = true];
21406
21407    optional Event event = 2;
21408
21409    optional int64 time_running_ms = 3;
21410}
21411
21412/** Log for autofill events. This captures events till the view goes out of
21413 * focus. For each auttofilled view going out of focus, and coming back, a
21414 * separate event would be generated.
21415 *
21416 * Logged from:
21417 * frameworks/base/services/autofill/java/com/android/server/autofill/
21418 */
21419message AutofillPresentationEventReported {
21420  enum PresentationEventResult {
21421    NONE_SHOWN_UNKNOWN_REASON =
21422        0;  // Includes reasons where losses can be partial: eg: IME not showing
21423            // certain datasets, while others are filtered out because user
21424            // started typing. So, it can either refer to a set of mixed of
21425            // known or unknown reasons.
21426    ANY_SHOWN =
21427        1;  // This is counter to the event name, but we need it in order to get
21428            // overall success rate.
21429    // Below ones corresponds to no presentation getting shown
21430    NONE_SHOWN_VIEW_FOCUS_CHANGED =
21431        2;  // User action leads to focus getting shifted to another field
21432    NONE_SHOWN_VIEW_CHANGED =
21433        3;  // This would also include if view becomes invisible.
21434    NONE_SHOWN_ACTIVITY_FINISHED = 4;  // Eg: User pressed back
21435    NONE_SHOWN_REQUEST_TIMEOUT =
21436        5;  // Autofill provider didn't respond in the given time.
21437    NONE_SHOWN_SESSION_COMMITTED_PREMATURELY =
21438        6;  // Session was prematurely committed. This can happen due to various
21439            // reasons, eg: app developers calling commit() earlier than when
21440            // they should.
21441    NONE_SHOWN_FILL_REQUEST_FAILED =
21442        7; // Autofill provider request failed. Different from timeout.
21443    NONE_SHOWN_NO_FOCUS =
21444        8; // Autofill provider request was triggered pre-focus. User never
21445           // focussed on autofillable fields. This can happen for FillDialog
21446           // where we trigger fill request at layout time.
21447
21448  }
21449
21450  // Id number which increases for each subsequent request.
21451  optional int32 request_id = 1;
21452
21453  // SessionId to aggregate requests within a session, and see overall
21454  // performance.
21455  optional int32 session_id = 2;
21456
21457  // Result of autofill event.
21458  optional PresentationEventResult presentation_event_result = 3;
21459
21460  // Count of datasets that should've been available for display. If the request
21461  // times out, this won't be populated.
21462  optional int32 available_count = 4;
21463
21464  // Count of datasets that are shown to the user.
21465  optional int32 count_shown = 5;
21466
21467  // Count of datasets that are eligible to be shown to the user, but aren't
21468  // shown because user started typing already, and the results were filtered.
21469  // If the user starts typing, dataset isn't shown at the moment, but then the
21470  // user deletes text, and the dataset becomes visible, it would count as
21471  // shown, and not as filtered out.
21472  optional int32 count_filtered_user_typing = 6;
21473
21474  // Count of datasets that aren't shown because IME didn't use datasets at all.
21475  optional int32 count_not_shown_unused_by_ime = 7;
21476
21477  // Count of datasets that are eligible to be shown to the user, but aren't
21478  // shown because display didn't show them (probably user didn't scroll to see
21479  // the view). The dataset was requested by display, but not shown.
21480  optional int32 count_not_shown_never_visible = 8;
21481
21482  // How the dataset is supposed to be shown to the user
21483  optional AutofillDisplayPresentationType display_presentation_type = 9;
21484
21485  // Autofill Service Provider's uid
21486  optional int32 autofill_service_uid = 10 [(is_uid) = true];
21487
21488  // Inline suggestion host's uid. Populated only when
21489  // AutofillDisplayPresentationType = INLINE
21490  optional int32 inline_suggestion_host_uid = 11 [(is_uid) = true];
21491
21492  // Whether a new request was triggered or alternatively served from cached
21493  // response.
21494  optional bool is_request_triggered = 12;
21495
21496  // Timestamps are in milliseconds, relative to when the Session was created
21497  // For example, if timestamp has a value = 100, the event was triggered
21498  // 100ms after the session was created.
21499  // Since these are relative to Session creation, you can subtract events to
21500  // get the latency duration between events.
21501  // t1 = 100
21502  // t2 = 300
21503  // duration = t2 - t1 = 200ms
21504  // ------------------------------------------------------------------------
21505  // Timestamp of when FillRequest is sent to Autofill provider
21506  // This is also the latency of when a field is focused to Framework sending a FillRequest
21507  optional int32 fill_request_sent_timestamp_ms = 13;
21508
21509  // Timestamp of when Autofill provider returns a FillResponse
21510  // The latency of the Autofill provider IPC can be calculated
21511  // by fillResponseReceivedTimestampMs - fillRequestSentTimestampMs
21512  optional int32 fill_response_received_timestamp_ms = 14;
21513
21514  // Timestamp of when FillResponse is sent to the IME/Dropdown handler/Fill Dialog UI
21515  // The latency of processing provider FillResponse to when suggestions are sent to be rendered
21516  // can be calculated by suggestionSentTimestampMs - fillResponseReceivedTimestampMs
21517  optional int32 suggestion_sent_timestamp_ms = 15;
21518
21519  // Timestamp of when the suggestion is shown
21520  // The latency of showing suggestions can be calculated by
21521  // suggestionPresentedTimestampMs - suggestionSentTimestampMs
21522  optional int32 suggestion_presented_timestamp_ms = 16;
21523}
21524
21525// Tells how Autofill dataset was/will-be displayed.
21526enum AutofillDisplayPresentationType {
21527  UNKNOWN_AUTOFILL_DISPLAY_PRESENTATION_TYPE = 0;
21528  MENU = 1;    // aka drop-down
21529  INLINE = 2;  // shown via IME
21530  DIALOG = 3;  // aka Bottom-sheet dialog
21531}
21532
21533/**
21534 * Logs when text and reading options changed.
21535 *
21536 * Logged from:
21537 *   packages/apps/Settings/src/com/android/settings/accessibility
21538 */
21539message AccessibilityTextReadingOptionsChanged {
21540    // The item name of the accessibility feature "Text and Reading Options".
21541    optional android.stats.accessibility.TextReadingOption name = 1;
21542
21543    // The status value of the item of the accessibility feature "Text and Reading Options".
21544    optional int32 value = 2;
21545
21546    // The entry point from which page.
21547    optional android.stats.accessibility.TextReadingEntry entry_point = 3;
21548}
21549
21550/** Log the CompanionDeviceManager associations are created by various device
21551 * profiles
21552 *
21553 * Logged from:
21554 * frameworks/base/services/companion/java/com/android/server/companion/
21555 * CompanionDeviceManagerService.java
21556 */
21557message CdmAssociationAction {
21558    enum Action {
21559        UNKNOWN = 0;
21560        CREATED = 1;
21561        REMOVED = 2;
21562    }
21563
21564    enum DeviceProfile{
21565        DEVICE_PROFILE_NULL = 0;
21566        DEVICE_PROFILE_WATCH = 1;
21567        DEVICE_PROFILE_APP_STREAMING = 2;
21568        DEVICE_PROFILE_AUTO_PROJECTION = 3;
21569        DEVICE_PROFILE_COMPUTER = 4;
21570    }
21571
21572    // Action taken on the CDM association been created by companion apps.
21573    optional Action action = 1;
21574
21575    // Name of the CDM Association Request profiles.
21576    optional DeviceProfile device_profile = 2;
21577}
21578
21579/**
21580 * Logs when a telephony anomaly is reported.
21581 *
21582 * Logged from:
21583 *   frameworks/base/telephony/java/android/telephony/AnomalyReporter.java
21584 */
21585message TelephonyAnomalyDetected {
21586    // Carrier ID of the SIM card.
21587    // See https://source.android.com/devices/tech/config/carrierid.
21588    optional int32 carrier_id = 1;
21589    // UUID of the anomaly, as generated by android.telephony.AnomalyReporter
21590    optional int64 event_id_lsb = 2;
21591    optional int64 event_id_msb = 3;
21592}
21593
21594/**
21595 * Logs information about sync exemptions when they occur.
21596 *
21597 * Logged from:
21598 *      frameworks/base/services/core/java/com/android/server/content/ContentService.java
21599 */
21600message SyncExemptionOccurred {
21601    optional int32 uid = 1 [(is_uid) = true]; // the uid of the app.
21602
21603    enum ProcState {
21604        UNKNOWN = 0;
21605        PERSISTENT = 1;
21606        PERSISTENT_UI = 2;
21607        TOP = 3;
21608        BOUND_TOP = 4;
21609        FOREGROUND_SERVICE = 5;
21610        BOUND_FOREGROUND_SERVICE = 6;
21611        IMPORTANT_FOREGROUND = 7;
21612        IMPORTANT_BACKGROUND = 8;
21613        TRANSIENT_BACKGROUND = 9;
21614        BACKUP = 10;
21615        SERVICE = 11;
21616        RECEIVER = 12;
21617        TOP_SLEEPING = 13;
21618        HEAVY_WEIGHT = 14;
21619        HOME = 15;
21620        LAST_ACTIVITY = 16;
21621        CACHED_ACTIVITY = 17;
21622        CACHED_ACTIVITY_CLIENT = 18;
21623        CACHED_RECENT = 19;
21624        CACHED_EMPTY = 20;
21625    }
21626    optional ProcState proc_state = 2; // the proc state of the app when the exemption occurred.
21627
21628    optional bool is_uid_active = 3; // was the uid active when the exemption occurred.
21629
21630    optional AppBackgroundRestrictionsInfo.RestrictionLevel restriction_level = 4;
21631}
21632
21633// Logs when the remote key provisioner application is invoked, either
21634// due to a periodically scheduled job, due to an attestation key being
21635// consumed from the pool, or when the system has detected that it's
21636// completely out of attestation keys.
21637//
21638// Logged from:
21639//   packages/apps/RemoteProvisioner/src/com/android/remoteprovisioner/
21640message RemoteKeyProvisioningAttempt {
21641    // The reason for the provisioning attempt.
21642    enum Cause {
21643        CAUSE_UNKNOWN = 0;
21644        SCHEDULED = 1;          // A scheduled job issued the request
21645        KEY_CONSUMED = 2;       // A provisioned key was consumed from the pool
21646        OUT_OF_KEYS = 3;        // The system is out of keys
21647    }
21648    optional Cause cause = 1;
21649
21650    // The name of the remotely provisioned component for whom keys are being
21651    // generated and certified. The string value is determined by the vendor,
21652    // and is fixed for the lifetime of the device. The number of unique string
21653    // values on a given device is determined by how many remotely provisioned
21654    // component HALs are on a given device. Typically, this is 2-3 HALs.
21655    optional string remotely_provisioned_component = 2;
21656
21657    // The uptime of the device, organized into time ranges of interest.
21658    enum UpTime {
21659        UPTIME_UNKNOWN = 0;
21660        LESS_THAN_5_MINUTES = 1;
21661        BETWEEN_5_AND_60_MINUTES = 2;
21662        MORE_THAN_60_MINUTES = 3;
21663    }
21664    optional UpTime uptime = 3;
21665
21666    // The state of remote provisioning enablement
21667    enum Enablement {
21668        ENABLEMENT_UNKNOWN = 0;
21669        ENABLED_WITH_FALLBACK = 1;
21670        ENABLED_RKP_ONLY = 2;
21671        DISABLED = 3;
21672    }
21673    optional Enablement enablement = 4;
21674
21675    // If the key pool is completely exhausted, this is set to true. Typically,
21676    // we do not expect to see a pool with no spare keys available.
21677    optional bool is_key_pool_empty = 5;
21678
21679    // Indicates success or failure of the provisioning attempt.
21680    optional com.android.remoteprovisioner.RemoteKeyProvisioningStatus status = 6;
21681}
21682
21683// Logs that correlate remote key provisioning status with the active
21684// network for the given provisioning attempt.
21685//
21686// Logged from:
21687//   packages/apps/RemoteProvisioner/src/com/android/remoteprovisioner/
21688message RemoteKeyProvisioningNetworkInfo {
21689    // The network transport, according ConnectivityManager::getActiveNetwork().
21690    optional android.stats.connectivity.TransportType transport_type = 1;
21691
21692    // Indicates success or failure of the provisioning attempt.
21693    optional com.android.remoteprovisioner.RemoteKeyProvisioningStatus status = 2;
21694
21695    // If an HTTP error was received, this contains the code. Else, contains 200.
21696    optional int32 http_status_error = 3;
21697}
21698
21699// Logs indicating timing data to understand how long the remote provisioner is
21700// taking to perform various sub-tasks. This is intended to be used with KLL metrics.
21701//
21702// Logged from:
21703//   packages/apps/RemoteProvisioner/src/com/android/remoteprovisioner/
21704message RemoteKeyProvisioningTiming {
21705    // Time spent waiting on the RKP service to reply.
21706    optional int32 server_wait_millis = 1;
21707
21708    // Time spent waiting on internal binder calls to the provisioning service.
21709    optional int32 binder_wait_millis = 2;
21710
21711    // Time spent waiting on the serialization lock.
21712    optional int32 lock_wait_millis = 3;
21713
21714    // Total time spent processing the attempt.
21715    optional int32 total_processing_time = 4;
21716
21717    // The network transport, according ConnectivityManager::getActiveNetwork().
21718    optional android.stats.connectivity.TransportType transport_type = 5;
21719
21720    // The name of the remotely provisioned component for whom keys are being
21721    // generated and certified. The string value is determined by the vendor,
21722    // and is fixed for the lifetime of the device. The number of unique string
21723    // values on a given device is determined by how many remotely provisioned
21724    // component HALs are on a given device. Typically, this is 2-3 HALs.
21725    optional string remotely_provisioned_component = 6;
21726}
21727
21728// Counters that track how many errors we're seeing on the device for the
21729// given boot.
21730//
21731// Logged from:
21732//   packages/apps/RemoteProvisioner/src/com/android/remoteprovisioner/
21733message RemoteKeyProvisioningErrorCounts {
21734    // The total number of RKP attempts there have been this boot.
21735    optional int32 total_count = 1;
21736
21737    // How many errors this device has encountered this boot.
21738    optional int32 error_count = 2;
21739
21740    // How many bytes of data have been sent that resulted in errors. These
21741    // bytes count against an error budget, so it's important to track.
21742    optional int32 error_bytes = 3;
21743}
21744
21745/*
21746 * Pushed atom logged by ONS service.
21747 */
21748message OnsOpportunisticEsimProvisioningComplete {
21749    enum ResultCode {
21750        // Unknown
21751        RESULT_UNKNOWN = 0;
21752
21753        // Operation was successful.
21754        RESULT_SUCCESS = 1;
21755
21756        // Device capabilities not met such as eSIM and MultiSIM not supported.
21757        RESULT_DEVICE_NOT_CAPABLE = 2;
21758
21759        // Internet connection is not available while trying to download opportunistic eSIM.
21760        RESULT_INTERNET_NOT_AVAILABLE = 3;
21761
21762        // Error occurred while switching device from Single to MultiSIM mode.
21763        RESULT_SWITCH_TO_MULTISIM_FAILED = 4;
21764
21765        // Connection error occurred while downloading opportunistic eSIM from SMDP server.
21766        RESULT_CONNECTION_ERROR = 5;
21767
21768        // Download failed because there is no sufficient storage available in eUICC memory.
21769        RESULT_MEMORY_FULL = 6;
21770
21771        // Installation of downloaded eSIM failed.
21772        RESULT_INSTALL_ESIM_PROFILE_FAILED = 7;
21773
21774        // Unresolvable errors such as Invalid SMDP address or activation code.
21775        RESULT_UNRESOLVABLE_ERROR = 8;
21776
21777        // Auto provisioning disabled
21778        RESULT_AUTO_PROVISIONING_DISABLED = 9;
21779
21780        // eSIM provisioning failed
21781        RESULT_ESIM_PROVISIONING_FAILED = 10;
21782    }
21783
21784    // CBRS carrier id. Filled only while reporting failure cases.
21785    optional int32 carrier_id = 1;
21786
21787    // carrier id of the opportunistic eSIM downloaded from the SMDP server.
21788    // Filled only while reporting failure cases.
21789    optional int32 opportunistic_esim_carrier_id = 2;
21790
21791    // Flag to indicate that the data connection was used for downloading.
21792    optional bool is_mobile_data_used = 3;
21793
21794    // Error code occurred during the above operation.
21795    optional ResultCode error_code = 4;
21796
21797    // Retry count of the above operation.
21798    optional int32 retry_count = 5;
21799
21800    // Detailed error code.
21801    optional int32 detailed_error_code = 6;
21802}
21803
21804/**
21805 * Logs when a background dexopt job is ended.
21806 *
21807 * Logged from:
21808 *   frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
21809 */
21810message BackgroundDexoptJobEnded {
21811    // Corresponds to `BackgroundDexOptService.Status`, except for
21812    // `STATUS_JOB_FINISHED`.
21813    enum Status {
21814        STATUS_UNKNOWN = 0;
21815
21816        // The job has finished. This value is used even if some packages have
21817        // failed compilation during the job. (Corresponds to either
21818        // `BackgroundDexOptService.Status.STATUS_OK` or
21819        // `BackgroundDexOptService.Status.STATUS_DEX_OPT_FAILED`.)
21820        STATUS_JOB_FINISHED = 1;
21821
21822        STATUS_ABORT_BY_CANCELLATION = 2;
21823        STATUS_ABORT_NO_SPACE_LEFT = 3;
21824        STATUS_ABORT_THERMAL = 4;
21825        STATUS_ABORT_BATTERY = 5;
21826    }
21827
21828    optional Status status = 1;
21829
21830    // If `status` is `STATUS_ABORT_BY_CANCELLATION`, the reason of the
21831    // cancellation.
21832    optional android.app.job.StopReasonEnum cancellation_reason = 2;
21833
21834    // The duration of the job run, in milliseconds, not counting time spent in
21835    // sleep.
21836    optional int64 duration_ms = 3;
21837
21838    // The duration of the job run, in milliseconds, including time spent in
21839    // sleep.
21840    optional int64 duration_including_sleep_ms = 4;
21841}
21842
21843/**
21844 * Pulls information for a single incoming MMS.
21845 *
21846 * Each pull creates multiple atoms, one for each MMS.
21847 * The sequence is randomized when pulled.
21848 *
21849 * Pulled from:
21850 *   packages/services/Mms/src/com/android/mms/service/metrics/MmsMetricsCollector.java
21851 */
21852message IncomingMms {
21853    // Radio access technology (RAT) used for downloading the MMS.
21854    // It can be IWLAN in case of IMS.
21855    // RAT is logged at the end of the download.
21856    optional android.telephony.NetworkTypeEnum rat = 1;
21857
21858    // Indicate a specific result handling the MMS.
21859    optional android.mms.MmsResultEnum result = 2;
21860
21861    // Roaming type when MMS was received.
21862    optional android.telephony.RoamingTypeEnum roaming = 3;
21863
21864    // Index of the SIM used, 0 for single-SIM devices.
21865    optional int32 sim_slot_index = 4;
21866
21867    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
21868    optional bool is_multi_sim = 5;
21869
21870    // Whether the MMS was received with an eSIM profile.
21871    optional bool is_esim = 6;
21872
21873    // Carrier ID of the SIM card used for the MMS.
21874    // See https://source.android.com/devices/tech/config/carrierid.
21875    optional int32 carrier_id = 7;
21876
21877    // Average time in milliseconds to download MMS from the network.
21878    optional int64 avg_interval_millis = 8;
21879
21880    // Total number of MMS having same configuration.
21881    optional int64 mms_count = 9;
21882
21883    // Retry count: 0 for the first attempt and then increasing for each attempt.
21884    optional int32 retry_id = 10;
21885
21886    // Whether MmsService or carrier app downloaded the MMS from the network.
21887    optional bool handled_by_carrier_app = 11;
21888}
21889
21890/**
21891 * Pulls information for a single outgoing MMS.
21892 *
21893 * Each pull creates multiple atoms, one for each MMS.
21894 * The sequence is randomized when pulled.
21895 *
21896 * Pulled from:
21897 *   packages/services/Mms/src/com/android/mms/service/metrics/MmsMetricsCollector.java
21898 */
21899message OutgoingMms {
21900    // Radio access technology (RAT) used for uploading the MMS.
21901    // It can be IWLAN in case of IMS.
21902    // RAT is logged at the end of the upload.
21903    optional android.telephony.NetworkTypeEnum rat = 1;
21904
21905    // Indicate a specific result handling the MMS.
21906    optional android.mms.MmsResultEnum result = 2;
21907
21908    // Roaming type when MMS was received.
21909    optional android.telephony.RoamingTypeEnum roaming = 3;
21910
21911    // Index of the SIM used, 0 for single-SIM devices.
21912    optional int32 sim_slot_index = 4;
21913
21914    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
21915    optional bool is_multi_sim = 5;
21916
21917    // Whether the MMS was sent with an eSIM profile.
21918    optional bool is_esim = 6;
21919
21920    // Carrier ID of the SIM card used for the MMS.
21921    // See https://source.android.com/devices/tech/config/carrierid.
21922    optional int32 carrier_id = 7;
21923
21924    // Average time in milliseconds to download MMS from the network.
21925    optional int64 avg_interval_millis = 8;
21926
21927    // Total number of MMS having same configuration.
21928    optional int64 mms_count = 9;
21929
21930    // Whether the default MMS application sent the MMS (regardless of which application).
21931    optional bool is_from_default_app = 10;
21932
21933    // Retry count: 0 for the first attempt and then increasing for each attempt.
21934    optional int32 retry_id = 11;
21935
21936    // Whether MmsService or carrier app uploaded the MMS to the network.
21937    optional bool handled_by_carrier_app = 12;
21938}
21939
21940// Logs Display Brightness change events.
21941message DisplayBrightnessChanged {
21942
21943    enum Reason {
21944        REASON_UNKNOWN = 0;
21945        REASON_MANUAL = 1;
21946    }
21947
21948    // Display brightness before the brightness event, in nits.
21949    optional float initial_nits = 1;
21950
21951    // Display brightness after the brightness event, in nits.
21952    optional float end_nits = 2;
21953
21954    // Estimated ambient light, in lux.
21955    optional float lux = 3;
21956
21957    // Physical display id, with format $ADAPTER_PREFIX:$ID, in this case
21958    // "local:$PHYSICAL_ID".
21959    optional string physical_display_id = 4;
21960
21961    // Whether the short term model was active at the time of the event.
21962    optional bool short_term_model_active = 5;
21963
21964    // The factor to adjust the screen brightness in low power mode in the range
21965    // 0 (screen off) to 1 (no change).
21966    // If not applied, this is set to -1.
21967    optional float power_brightness_factor = 6;
21968
21969    // The level of Reduce Bright Colors (RBC) intensity, the range is [0, 100].
21970    // If RBC is not enabled, this is set to -1;
21971    optional int32 reduce_bright_colors_strength = 7;
21972
21973    // Max nits value when High Brightness Mode (HBM) is enabled.
21974    // If HBM is not enabled, this is set to -1;
21975    optional float hbm_current_max = 8;
21976
21977    // Thermal throttling cap.
21978    // If thermal throttling not enabled, this is -1.
21979    optional float thermal_throttling_cap = 9;
21980
21981    // Whether adaptive brightness is enabled.
21982    optional bool adaptive_brightness_enabled = 10;
21983
21984    // Reason that triggered the brightness event to occur.
21985    optional Reason reason = 11;
21986}
21987
21988/**
21989 * Logs information when a hearing aid is bonded
21990 *
21991 * Logged from:
21992 *   frameworks/base/packages/SettingsLib/src/com/android/settingslib/bluetooth/
21993 *   CachedBluetoothDevice.java
21994 */
21995message HearingAidInfoReported {
21996    // The device mode of the bonded hearing aid
21997    // Mode definition for hearing aids. See {@link BluetoothHearingAid}.
21998    enum DeviceMode {
21999        MODE_UNKNOWN = -1;
22000        MONAURAL = 0;
22001        BINAURAL = 1;
22002    }
22003    optional DeviceMode device_mode = 1;
22004
22005    // The device side of the bonded hearing aid
22006    // Side definition for hearing aids. See {@link BluetoothHearingAid}.
22007    enum DeviceSide {
22008        SIDE_UNKNOWN = -1;
22009        LEFT = 0;
22010        RIGHT = 1;
22011    }
22012    optional DeviceSide device_side = 2;
22013
22014    // The entry page id where the bonding process starts
22015    enum BondEntry {
22016        PAGE_UNKNOWN = -1;
22017        CONNECTED_DEVICES = 0;
22018        ACCESSIBILITY_HEARING_AIDS = 1;
22019        ACCESSIBILITY_HEARING_AID_PAIR_ANOTHER = 2;
22020        BLUETOOTH = 3;
22021    }
22022    optional BondEntry bond_entry = 3;
22023}
22024
22025// Logs daily ambient brightness stats.
22026message AmbientBrightnessStatsReported {
22027
22028    // How much time was spent in each of the buckets, in seconds.
22029    repeated float bucket_size_seconds = 1;
22030
22031    // Ambient brightness values for creating bucket boundaries from.
22032    repeated float bucket_boundary_lux = 2;
22033}
22034
22035/**
22036 * Logs the Brightness Configuration pushed by the long term model. The Brightness Configuration is
22037 * expressed as a curve where each point is a pair of ambient light (lux) and the corresponding
22038 * screen brightness (nits).
22039 *
22040 * Logged from:
22041 *    frameworks/base/services/core/java/com/android/server/display/DisplayManagerService.java
22042 */
22043message BrightnessConfigurationUpdated {
22044    // Array of ambient light values (in lux) to define the configuration.
22045    repeated float lux = 1;
22046    // Array of screen brightness values (in nits) corresponding to the lux
22047    // values above.
22048    repeated float nits = 2;
22049    // Physical display id, with format $ADAPTER_PREFIX:$ID, in this case
22050    // "local:$PHYSICAL_ID".
22051    optional string physical_display_id = 3;
22052}
22053
22054/**
22055
22056 * Logs when Iwlan responds the setup data call request.
22057 *
22058 * Logged from:
22059 *   packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
22060 */
22061message IwlanSetupDataCallResultReported {
22062  enum IwlanError {
22063    NO_ERROR = 0;
22064    IKE_PROTOCOL_EXCEPTION = 1;
22065    IKE_INTERNAL_IO_EXCEPTION = 2;
22066    IKE_GENERIC_EXCEPTION = 3;
22067    EPDG_SELECTOR_SERVER_SELECTION_FAILED = 4;
22068    TUNNEL_TRANSFORM_FAILED = 5;
22069    SIM_NOT_READY_EXCEPTION = 6;
22070    NETWORK_FAILURE = 7;
22071    UNKNOWN_EXCEPTION = 8;
22072  }
22073
22074  // Setup data call apn type
22075  // See go/apntypedefinition
22076  optional int32 apn_type = 1;
22077  // Is the request for handover
22078  optional bool is_handover = 2;
22079  // ePDG server address
22080  optional string epdg_server_address = 3;
22081  // If the request type is handover, record the source network type
22082  // See
22083  // frameworks/base/telephony/java/android/telephony/TelephonyManager.java
22084  optional int32 source_rat = 4;
22085  // If the request type is handover, record the source network roaming status
22086  optional bool is_cellular_roaming = 5;
22087  // Is network connected
22088  optional bool is_network_connected = 6;
22089  // Default network transport type
22090  // See
22091  // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
22092  optional int32 transport_type = 7;
22093  // Setup result
22094  optional int32 setup_request_result = 8;
22095  // Iwlan error code if setup failed
22096  optional IwlanError iwlan_error = 9;
22097  // Data call fail cause
22098  // See
22099  // frameworks/base/telephony/java/android/telephony/DataFailCause.java
22100  optional int32 data_call_fail_cause = 10;
22101  // Setup request processing duration
22102  optional int32 processing_duration_millis = 11;
22103  // Time for doing ePDG server selection through DNS query of FQDNs
22104  optional int32 epdg_server_selection_duration_millis = 12;
22105  // Time for establishing IKE tunnel
22106  optional int32 ike_tunnel_establishment_duration_millis = 13;
22107  // Tunnel State
22108  // See
22109  // packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
22110  optional int32 tunnel_state = 14;
22111  // Handover failure mode
22112  // See
22113  // frameworks/base/telephony/java/android/telephony/data/DataCallResponse.java
22114  optional int32 handover_failure_mode = 15;
22115  // Retry duration
22116  optional int32 retry_duration_millis = 16;
22117  // Iwlan error wrapped exception classname
22118  optional string iwlan_error_wrapped_classname = 17;
22119  // Iwlan error wrapped exception 1st line of stack trace
22120  optional string iwlan_error_wrapped_stack_first_frame = 18;
22121}
22122
22123/**
22124 * Logs when Iwlan reports IWLAN PDN disconnected without deactivation request.
22125 *
22126 * Logged from:
22127 *   packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
22128 */
22129message IwlanPdnDisconnectedReasonReported {
22130  // Disconnection cause
22131  // See
22132  // frameworks/base/telephony/java/android/telephony/DataFailCause.java
22133  optional int32 cause = 1;
22134  // Is network connected
22135  optional bool is_network_connected = 2;
22136  // default network transport type
22137  // See
22138  // packages/services/Iwlan/src/com/google/android/iwlan/IwlanDataService.java
22139  optional int32 transport_type = 3;
22140  // Wifi signal level
22141  optional int32 wifi_signal_level = 4;
22142}
22143
22144/**
22145 * Logs information related to audio egress in hotword.
22146 */
22147message HotwordAudioEgressEventReported {
22148    // The type of detector.
22149    optional android.hotword.HotwordDetectorType detector_type = 1;
22150
22151    // The type of event.
22152    enum Event {
22153        // UNKNOWN value.
22154        UNKNOWN = 0;
22155
22156        // Indicates that the audio egress started.
22157        STARTED = 1;
22158
22159        // Indicates that the audio egress ended.
22160        ENDED = 2;
22161
22162        // Indicates that the audio egress got interrupted exception.
22163        INTERRUPTED_EXCEPTION = 3;
22164
22165        // Indicates that the client is not granted permission to access audio egress.
22166        NO_PERMISSION = 4;
22167
22168        // Indicates that the client is inactive over a period of time.
22169        INACTIVE_CLIENT = 5;
22170
22171        // Indicates that the HotwordDetectionService is inactive over a period
22172        // of time.
22173        INACTIVE_HOTWORD_DETECTION_SERVICE = 6;
22174
22175        // Indicates that the list of audio stream is empty.
22176        EMPTY_AUDIO_STREAM_LIST = 7;
22177
22178        // Indicates that there is no data from the system audio stream.
22179        SOURCE_IS_EMPTY = 8;
22180
22181        // Indicates that the copy buffer size the client sets is illegal.
22182        ILLEGAL_COPY_BUFFER_SIZE = 9;
22183
22184        // Indicates that the audio egress is closed with error from the system.
22185        CLOSE_ERROR_FROM_SYSTEM = 10;
22186
22187        // Indicates that the audio egress is closed with error from the client side.
22188        CLOSE_ERROR_FROM_CLIENT = 11;
22189
22190        // Indicates that the audio egress is closed with error from the
22191        // HotwordDetectionService.
22192        CLOSE_ERROR_FROM_HOTWORD_DETECTION_SERVICE = 12;
22193   }
22194    optional Event event = 2;
22195
22196    // The UID for which the assistant application is active.
22197    optional int32 uid = 3 [(is_uid) = true];
22198
22199    // The number of bytes egressed in audio stream
22200    optional int32 egressed_stream_size_bytes = 4;
22201
22202    // The number of bytes egressed in metadata bundle
22203    optional int32 egressed_metadata_bundle_size_bytes = 5;
22204
22205    // The count of audio streams
22206    optional int32 stream_count = 6;
22207}
22208
22209/**
22210 * Logs information related to Android Dynamic Performance Framework (ADPF).
22211 */
22212
22213message PerformanceHintSessionReported {
22214    // UID of the package.
22215    optional int32 package_uid = 1 [(is_uid) = true];
22216
22217    // Unique ID of the hint session.
22218    optional int64 session_id = 2;
22219
22220    // Hint session target duration, in nanoseconds.
22221    optional int64 target_duration_ns = 3;
22222
22223    // Number of threads affected by this session
22224    optional int32 tid_count = 4;
22225}
22226
22227message ADPFSystemComponentInfo {
22228    // True if SurfaceFlinger CPU hint is enabled on the device.
22229    optional bool surfaceflinger_cpu_hint_enabled = 1;
22230
22231    // True if HWUI hint is enabled on the device.
22232    optional bool hwui_hint_enabled = 2;
22233}
22234