/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto2";

package android.os.statsd;
option java_package = "com.android.os";
option java_outer_classname = "AtomsProto";

import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
import "frameworks/base/core/proto/android/app/enums.proto";
import "frameworks/base/core/proto/android/app/job/enums.proto";
import "frameworks/base/core/proto/android/app/settings_enums.proto";
import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
import "frameworks/base/core/proto/android/bluetooth/enums.proto";
import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
import "frameworks/base/core/proto/android/debug/enums.proto";
import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
import "frameworks/base/core/proto/android/os/enums.proto";
import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
import "frameworks/base/core/proto/android/server/enums.proto";
import "frameworks/base/core/proto/android/server/job/enums.proto";
import "frameworks/base/core/proto/android/server/location/enums.proto";
import "frameworks/base/core/proto/android/service/procstats_enum.proto";
import "frameworks/base/core/proto/android/service/usb.proto";
import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
import "frameworks/base/core/proto/android/stats/enums.proto";
import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
import "frameworks/base/core/proto/android/telecomm/enums.proto";
import "frameworks/base/core/proto/android/telephony/enums.proto";
import "frameworks/base/core/proto/android/view/enums.proto";
import "frameworks/base/core/proto/android/wifi/enums.proto";

/**
 * The master atom class. This message defines all of the available
 * raw stats log events from the Android system, also known as "atoms."
 *
 * This field contains a single oneof with all of the available messages.
 * The stats-log-api-gen tool runs as part of the Android build and
 * generates the android.util.StatsLog class, which contains the constants
 * and methods that Android uses to log.
 *
 * This Atom class is not actually built into the Android system.
 * Instead, statsd on Android constructs these messages synthetically,
 * in the format defined here and in stats_log.proto.
 */
message Atom {
    // Pushed atoms start at 2.
    oneof pushed {
        // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
        BleScanStateChanged ble_scan_state_changed = 2;
        ProcessStateChanged process_state_changed = 3;
        BleScanResultReceived ble_scan_result_received = 4;
        SensorStateChanged sensor_state_changed = 5;
        GpsScanStateChanged gps_scan_state_changed = 6;
        SyncStateChanged sync_state_changed = 7;
        ScheduledJobStateChanged scheduled_job_state_changed = 8;
        ScreenBrightnessChanged screen_brightness_changed = 9;
        WakelockStateChanged wakelock_state_changed = 10;
        LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
        MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
        WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
        ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
        MemoryFactorStateChanged memory_factor_state_changed = 15;
        ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
        CachedKillReported cached_kill_reported = 17;
        ProcessMemoryStatReported process_memory_stat_reported = 18;
        LauncherUIChanged launcher_event = 19;
        BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
        DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
        DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
        AudioStateChanged audio_state_changed = 23;
        MediaCodecStateChanged media_codec_state_changed = 24;
        CameraStateChanged camera_state_changed = 25;
        FlashlightStateChanged flashlight_state_changed = 26;
        UidProcessStateChanged uid_process_state_changed = 27;
        ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
        ScreenStateChanged screen_state_changed = 29;
        BatteryLevelChanged battery_level_changed = 30;
        ChargingStateChanged charging_state_changed = 31;
        PluggedStateChanged plugged_state_changed = 32;
        InteractiveStateChanged interactive_state_changed = 33;
        TouchEventReported touch_event_reported = 34;
        WakeupAlarmOccurred wakeup_alarm_occurred = 35;
        KernelWakeupReported kernel_wakeup_reported = 36;
        WifiLockStateChanged wifi_lock_state_changed = 37;
        WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
        WifiScanStateChanged wifi_scan_state_changed = 39;
        PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
        SettingChanged setting_changed = 41;
        ActivityForegroundStateChanged activity_foreground_state_changed = 42;
        IsolatedUidChanged isolated_uid_changed = 43;
        PacketWakeupOccurred packet_wakeup_occurred = 44;
        WallClockTimeShifted wall_clock_time_shifted = 45;
        AnomalyDetected anomaly_detected = 46;
        AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
        AppStartOccurred app_start_occurred = 48;
        AppStartCanceled app_start_canceled = 49;
        AppStartFullyDrawn app_start_fully_drawn = 50;
        LmkKillOccurred lmk_kill_occurred = 51;
        PictureInPictureStateChanged picture_in_picture_state_changed = 52;
        WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
        LmkStateChanged lmk_state_changed = 54;
        AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
        ShutdownSequenceReported shutdown_sequence_reported = 56;
        BootSequenceReported boot_sequence_reported = 57;
        DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
        OverlayStateChanged overlay_state_changed = 59;
        ForegroundServiceStateChanged foreground_service_state_changed = 60;
        CallStateChanged call_state_changed = 61;
        KeyguardStateChanged keyguard_state_changed = 62;
        KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
        KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
        AppDied app_died = 65;
        ResourceConfigurationChanged resource_configuration_changed = 66;
        BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
        BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
        GpsSignalQualityChanged gps_signal_quality_changed = 69;
        UsbConnectorStateChanged usb_connector_state_changed = 70;
        SpeakerImpedanceReported speaker_impedance_reported = 71;
        HardwareFailed hardware_failed = 72;
        PhysicalDropDetected physical_drop_detected = 73;
        ChargeCyclesReported charge_cycles_reported = 74;
        MobileConnectionStateChanged mobile_connection_state_changed = 75;
        MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
        UsbDeviceAttached usb_device_attached = 77;
        AppCrashOccurred app_crash_occurred = 78;
        ANROccurred anr_occurred = 79;
        WTFOccurred wtf_occurred = 80;
        LowMemReported low_mem_reported = 81;
        GenericAtom generic_atom = 82;
        KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
        VibratorStateChanged vibrator_state_changed = 84;
        DeferredJobStatsReported deferred_job_stats_reported = 85;
        ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
        BiometricAcquired biometric_acquired = 87;
        BiometricAuthenticated biometric_authenticated = 88;
        BiometricErrorOccurred biometric_error_occurred = 89;
        // Atom number 90 is available for use.
        BatteryHealthSnapshot battery_health_snapshot = 91;
        SlowIo slow_io = 92;
        BatteryCausedShutdown battery_caused_shutdown = 93;
        PhoneServiceStateChanged phone_service_state_changed = 94;
        PhoneStateChanged phone_state_changed = 95;
        UserRestrictionChanged user_restriction_changed = 96;
        SettingsUIChanged settings_ui_changed = 97;
        ConnectivityStateChanged connectivity_state_changed = 98;
        // TODO: service state change is very noisy shortly after boot, as well
        // as at other transitions - coming out of doze, device plugged in, etc.
        // Consider removing this if it becomes a problem
        ServiceStateChanged service_state_changed = 99;
        ServiceLaunchReported service_launch_reported = 100;
        FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
        BinaryPushStateChanged binary_push_state_changed = 102;
        DevicePolicyEvent device_policy_event = 103;
        DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
            104 [(log_from_module) = "docsui"];
        DocsUIFileOperationCopyMoveModeReported
            docs_ui_file_op_copy_move_mode_reported =
            105 [(log_from_module) = "docsui"];
        DocsUIFileOperationFailureReported docs_ui_file_op_failure =
            106 [(log_from_module) = "docsui"];
        DocsUIFileOperationReported docs_ui_provider_file_op =
            107 [(log_from_module) = "docsui"];
        DocsUIInvalidScopedAccessRequestReported
            docs_ui_invalid_scoped_access_request =
            108 [(log_from_module) = "docsui"];
        DocsUILaunchReported docs_ui_launch_reported =
            109 [(log_from_module) = "docsui"];
        DocsUIRootVisitedReported docs_ui_root_visited =
            110 [(log_from_module) = "docsui"];
        DocsUIStartupMsReported docs_ui_startup_ms =
            111 [(log_from_module) = "docsui"];
        DocsUIUserActionReported docs_ui_user_action_reported =
            112 [(log_from_module) = "docsui"];
        WifiEnabledStateChanged wifi_enabled_state_changed = 113;
        WifiRunningStateChanged wifi_running_state_changed = 114;
        AppCompacted app_compacted = 115;
        NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
        DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
            117 [(log_from_module) = "docsui"];
        DocsUIPickResultReported docs_ui_pick_result_reported =
            118 [(log_from_module) = "docsui"];
        DocsUISearchModeReported docs_ui_search_mode_reported =
            119 [(log_from_module) = "docsui"];
        DocsUISearchTypeReported docs_ui_search_type_reported =
            120 [(log_from_module) = "docsui"];
        DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
        RescuePartyResetReported rescue_party_reset_reported = 122;
        SignedConfigReported signed_config_reported = 123;
        GnssNiEventReported gnss_ni_event_reported = 124;
        BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
        BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
        BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
        AppDowngraded app_downgraded = 128;
        AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
        LowStorageStateChanged low_storage_state_changed = 130;
        GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
        GnssConfigurationReported gnss_configuration_reported = 132;
        UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
        NfcErrorOccurred nfc_error_occurred = 134;
        NfcStateChanged nfc_state_changed = 135;
        NfcBeamOccurred nfc_beam_occurred = 136;
        NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
        NfcTagOccurred nfc_tag_occurred = 138;
        NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
        SeStateChanged se_state_changed = 140;
        SeOmapiReported se_omapi_reported = 141;
        BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
        AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
        AdbConnectionChanged adb_connection_changed = 144;
        SpeechDspStatReported speech_dsp_stat_reported = 145;
        UsbContaminantReported usb_contaminant_reported = 146;
        WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
        BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
        BubbleUIChanged bubble_ui_changed = 149;
        ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
        BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
        BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
        BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
        BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
        BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
        BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
        BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
        BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
        BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
        BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
        BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
        BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
        BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
        BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
        BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
        BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
        BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
        ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
        ProcessStartTime process_start_time = 169;
        PermissionGrantRequestResultReported permission_grant_request_result_reported =
            170 [(log_from_module) = "permissioncontroller"];
        BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
        DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
        BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
        AssistGestureStageReported assist_gesture_stage_reported = 174;
        AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
        AssistGestureProgressReported assist_gesture_progress_reported = 176;
        TouchGestureClassified touch_gesture_classified = 177;
        HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
        StyleUIChanged style_ui_changed = 179;
        PrivacyIndicatorsInteracted privacy_indicators_interacted =
            180 [(log_from_module) = "permissioncontroller"];
        AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
        NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
        AppMovedStorageReported app_moved_storage_reported = 183;
        BiometricEnrolled biometric_enrolled = 184;
        SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
        TombStoneOccurred tomb_stone_occurred = 186;
        BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
        IntelligenceEventReported intelligence_event_reported =
            188 [(log_from_module) = "intelligence"];
        ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
        RoleRequestResultReported role_request_result_reported =
            190 [(log_from_module) = "permissioncontroller"];
        MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
        MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
        MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
        MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
        MediametricsCodecReported mediametrics_codec_reported = 195;
        MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
        MediametricsExtractorReported mediametrics_extractor_reported = 197;
        MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
        MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
        MediametricsRecorderReported mediametrics_recorder_reported = 200;
        VehicleMapServicePacketReported vms_packet_reported = 201;
        VehicleMapServicePacketFailureReported vms_packet_failure_reported = 202;
        CarPowerStateChanged car_power_state_changed = 203;
        GarageModeInfo garage_mode_info = 204;
        TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
        ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
        ContentCaptureServiceEvents content_capture_service_events = 207;
        ContentCaptureSessionEvents content_capture_session_events = 208;
        ContentCaptureFlushed content_capture_flushed = 209;
    }

    // Pulled events will start at field 10000.
    // Next: 10059
    oneof pulled {
        WifiBytesTransfer wifi_bytes_transfer = 10000;
        WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
        MobileBytesTransfer mobile_bytes_transfer = 10002;
        MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
        BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
        KernelWakelock kernel_wakelock = 10004;
        SubsystemSleepState subsystem_sleep_state = 10005;
        CpuTimePerFreq cpu_time_per_freq = 10008;
        CpuTimePerUid cpu_time_per_uid = 10009;
        CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
        WifiActivityInfo wifi_activity_info = 10011;
        ModemActivityInfo modem_activity_info = 10012;
        BluetoothActivityInfo bluetooth_activity_info = 10007;
        ProcessMemoryState process_memory_state = 10013;
        SystemElapsedRealtime system_elapsed_realtime = 10014;
        SystemUptime system_uptime = 10015;
        CpuActiveTime cpu_active_time = 10016;
        CpuClusterTime cpu_cluster_time = 10017;
        DiskSpace disk_space = 10018 [deprecated=true];
        RemainingBatteryCapacity remaining_battery_capacity = 10019;
        FullBatteryCapacity full_battery_capacity = 10020;
        Temperature temperature = 10021;
        BinderCalls binder_calls = 10022;
        BinderCallsExceptions binder_calls_exceptions = 10023;
        LooperStats looper_stats = 10024;
        DiskStats disk_stats = 10025;
        DirectoryUsage directory_usage = 10026;
        AppSize app_size = 10027;
        CategorySize category_size = 10028;
        ProcStats proc_stats = 10029;
        BatteryVoltage battery_voltage = 10030;
        NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
        DiskIo disk_io = 10032;
        PowerProfile power_profile = 10033;
        ProcStatsPkgProc proc_stats_pkg_proc = 10034;
        ProcessCpuTime process_cpu_time = 10035;
        NativeProcessMemoryState native_process_memory_state = 10036;
        CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
        OnDevicePowerMeasurement on_device_power_measurement = 10038;
        DeviceCalculatedPowerUse device_calculated_power_use = 10039;
        DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
        DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
        ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
        BatteryLevel battery_level = 10043;
        BuildInformation build_information = 10044;
        BatteryCycleCount battery_cycle_count = 10045;
        DebugElapsedClock debug_elapsed_clock = 10046;
        DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
        NumFacesEnrolled num_faces_enrolled = 10048;
        RoleHolder role_holder = 10049;
        DangerousPermissionState dangerous_permission_state = 10050;
        TrainInfo train_info = 10051;
        TimeZoneDataInfo time_zone_data_info = 10052;
        ExternalStorageInfo external_storage_info = 10053;
        GpuStatsGlobalInfo gpu_stats_global_info = 10054;
        GpuStatsAppInfo gpu_stats_app_info = 10055;
        SystemIonHeapSize system_ion_heap_size = 10056;
        AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
        FaceSettings face_settings = 10058;
        CoolingDevice cooling_device = 10059;
        AppOps app_ops = 10060;
    }

    // DO NOT USE field numbers above 100,000 in AOSP.
    // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
    // Field numbers 200,000 and above are reserved for future use; do not use them at all.
}

/**
 * This proto represents a node of an attribution chain.
 * Note: All attribution chains are represented as a repeated field of type
 * AttributionNode. It is understood that in such arrays, the order is that
 * of calls, that is [A, B, C] if A calls B that calls C.
 */
message AttributionNode {
    // The uid for a given element in the attribution chain.
    optional int32 uid = 1;

    // The (optional) string tag for an element in the attribution chain. If the
    // element has no tag, it is encoded as an empty string.
    optional string tag = 2;
}

message KeyValuePair {
    optional int32 key = 1;
    oneof value {
        int32 value_int = 2;
        int64 value_long = 3;
        string value_str = 4;
        float value_float = 5;
    }
}

message KeyValuePairsAtom {
    optional int32 uid = 1;
    repeated KeyValuePair pairs = 2;
}

/*
 * *****************************************************************************
 * Below are all of the individual atoms that are logged by Android via statsd.
 *
 * RULES:
 *   - The field ids for each atom must start at 1, and count upwards by 1.
 *     Skipping field ids is not allowed.
 *   - These form an API, so renaming, renumbering or removing fields is
 *     not allowed between android releases.  (This is not currently enforced,
 *     but there will be a tool to enforce this restriction).
 *   - The types must be built-in protocol buffer types, namely, no sub-messages
 *     are allowed (yet).  The bytes type is also not allowed.
 *   - The CamelCase name of the message type should match the
 *     underscore_separated name as defined in Atom.
 *   - If an atom represents work that can be attributed to an app, there can
 *     be exactly one AttributionChain field. It must be field number 1.
 *   - A field that is a uid should be a string field, tagged with the [xxx]
 *     annotation. The generated code on android will be represented by UIDs,
 *     and those UIDs will be translated in xxx to those strings.
 *
 * CONVENTIONS:
 *   - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
 *   - If there is a UID, it goes first. Think in an object-oriented fashion.
 * *****************************************************************************
 */

/**
 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
 * Logs when the Thermal service HAL notifies the throttling start/stop events.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
 */
message ThermalThrottlingStateChanged {
    // The type of temperature being reported (CPU, GPU, SKIN, etc)
    optional android.os.TemperatureTypeEnum sensor_type = 1;

    // Throttling state, this field is DEPRECATED
    enum State {
        UNKNOWN = 0;
        START = 1; // START indicated that throttling was triggered.
        STOP = 2; // STOP indicates that throttling was cleared.
    }
    optional State state = 2;

    optional float temperature = 3;
}

/**
 * Logs when the screen state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message ScreenStateChanged {
    // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
    optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
}

/**
 * Logs that the process state of the uid, as determined by ActivityManager
 * (i.e. the highest process state of that uid's processes) has changed.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message UidProcessStateChanged {
    optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];

    // The state, from frameworks/base/core/proto/android/app/enums.proto.
    optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
}

/**
 * Logs process state change of a process, as per the activity manager.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
 */
message ProcessStateChanged {
    optional int32 uid = 1;
    optional string process_name = 2;
    optional string package_name = 3;
    // TODO: remove this when validation is done
    optional int64 version = 5;
    // The state, from frameworks/base/core/proto/android/app/enums.proto.
    optional android.app.ProcessStateEnum state = 4;
}

/**
 * Logs when ActivityManagerService sleep state is changed.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
 */
message ActivityManagerSleepStateChanged {
    // TODO: import frameworks proto
    enum State {
        UNKNOWN = 0;
        ASLEEP = 1;
        AWAKE = 2;
    }
    optional State state = 1 [(state_field_option).option = EXCLUSIVE];
}

/**
 * Logs when system memory state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message MemoryFactorStateChanged {
    // TODO: import frameworks proto
    enum State {
        MEMORY_UNKNOWN = 0;
        NORMAL = 1;     // normal.
        MODERATE = 2;   // moderate memory pressure.
        LOW = 3;        // low memory.
        CRITICAL = 4;   // critical memory.

    }
    optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
}

/**
 * Logs when app is using too much cpu, according to ActivityManagerService.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message ExcessiveCpuUsageReported {
    optional int32 uid = 1;
    optional string process_name = 2;
    optional string package_name = 3;
    // package version. TODO: remove this when validation is done
    optional int64 version = 4;
}

/**
 * Logs when a cached process is killed, along with its pss.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message CachedKillReported {
    optional int32 uid = 1;
    optional string process_name = 2;
    optional string package_name = 3;
    // TODO: remove this when validation is done
    optional int64 version = 5;
    optional int64 pss = 4;
}

/**
 * Logs when memory stats of a process is reported.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
 */
message ProcessMemoryStatReported {
    optional int32 uid = 1;
    optional string process_name = 2;
    optional string package_name = 3;
    //TODO: remove this when validation is done
    optional int64 version = 9;
    optional int64 pss = 4;
    optional int64 uss = 5;
    optional int64 rss = 6;
    enum Type {
        ADD_PSS_INTERNAL_SINGLE = 0;
        ADD_PSS_INTERNAL_ALL_MEM = 1;
        ADD_PSS_INTERNAL_ALL_POLL = 2;
        ADD_PSS_EXTERNAL = 3;
        ADD_PSS_EXTERNAL_SLOW = 4;
    }
    optional Type type = 7;
    optional int64 duration_millis = 8;
}

/**
 * Logs that a process started, finished, crashed, or ANRed.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message ProcessLifeCycleStateChanged {
    optional int32 uid = 1 [(is_uid) = true];

    // The process name (usually same as the app name).
    optional string process_name = 2;

    // What lifecycle state the process changed to.
    // This enum is specific to atoms.proto.
    enum State {
        FINISHED = 0;
        STARTED = 1;
        CRASHED = 2;
    }
    optional State state = 3;
}

/**
 * Logs when the ble scan state changes.
 *
 * Logged from:
 *   packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
 */
message BleScanStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
        // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
        RESET = 2;
    }
    optional State state = 2;

    // Does the scan have a filter.
    optional bool is_filtered = 3;
    // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
    optional bool is_first_match = 4;
    // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
    optional bool is_opportunistic = 5;
}

/**
 * Logs reporting of a ble scan finding results.
 *
 * Logged from:
 *   packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
 */
// TODO: Consider also tracking per-scanner-id.
message BleScanResultReceived {
    repeated AttributionNode attribution_node = 1;

    // Number of ble scan results returned.
    optional int32 num_results = 2;
}

/**
 * Logs when a sensor state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message SensorStateChanged {
    repeated AttributionNode attribution_node = 1;

    // The id (int) of the sensor.
    optional int32 sensor_id = 2;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 3;
}

/**
 * Logs when GPS state changes.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message GpsScanStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 2;
}

/**
 * Logs when GPS signal quality.
 *
 * Logged from:
 *   /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
 */
message GpsSignalQualityChanged {
    optional android.server.location.GpsSignalQualityEnum level = 1;
}


/**
 * Logs when a sync manager sync state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message SyncStateChanged {
    repeated AttributionNode attribution_node = 1;

    // Name of the sync (as named in the app). Can be chosen at run-time.
    optional string sync_name = 2;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 3;
}

/*
 * Deferred job stats.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
*/
message DeferredJobStatsReported {
    repeated AttributionNode attribution_node = 1;

    // Number of jobs deferred.
    optional int32 num_jobs_deferred = 2;

    // Time since the last job runs.
    optional int64 time_since_last_job_millis = 3;
}

/**
 * Logs when a job scheduler job state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message ScheduledJobStateChanged {
    repeated AttributionNode attribution_node = 1;

    // Name of the job (as named in the app)
    optional string job_name = 2;

    enum State {
        FINISHED = 0;
        STARTED = 1;
        SCHEDULED = 2;
    }
    optional State state = 3;

    // The reason a job has stopped.
    // This is only applicable when the state is FINISHED.
    // The default value is STOP_REASON_UNKNOWN.
    optional android.app.job.StopReasonEnum stop_reason = 4;
}

/**
 * Logs when the audio state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message AudioStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
        // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
        RESET = 2;
    }
    optional State state = 2;
}

/**
 * Logs when the video codec state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message MediaCodecStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
        // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
        RESET = 2;
    }
    optional State state = 2;
}

/**
 * Logs when the flashlight state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message FlashlightStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
        // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
        RESET = 2;
    }
    optional State state = 2;
}

/**
 * Logs when the camera state changes.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message CameraStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
        // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
        RESET = 2;
    }
    optional State state = 2;
}

/**
 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
 *
 * Logged from:
 *   TODO
 */
message WakelockStateChanged {
    repeated AttributionNode attribution_node = 1;

    // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
    // From frameworks/base/core/proto/android/os/enums.proto.
    optional android.os.WakeLockLevelEnum type = 2;

    // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
    optional string tag = 3;

    enum State {
        RELEASE = 0;
        ACQUIRE = 1;
        CHANGE_RELEASE = 2;
        CHANGE_ACQUIRE = 3;
    }
    optional State state = 4;
}

/**
 * Logs when a partial wakelock is considered 'long' (over 1 min).
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message LongPartialWakelockStateChanged {
    repeated AttributionNode attribution_node = 1;

    // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
    optional string tag = 2;

    // TODO: I have no idea what this is.
    optional string history_tag = 3;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 4;
}

/**
 * Logs when the device is interactive, according to the PowerManager Notifier.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/power/Notifier.java
 */
message InteractiveStateChanged {
    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 1;
}

/**
 * Logs Battery Saver state change.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message BatterySaverModeStateChanged {
    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 1;
}

/**
 * Logs Doze mode state change.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message DeviceIdleModeStateChanged {
    optional android.server.DeviceIdleModeEnum state = 1;
}


/**
 * Logs state change of Doze mode including maintenance windows.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message DeviceIdlingModeStateChanged {
    optional android.server.DeviceIdleModeEnum state = 1;
}

/**
 * Logs screen brightness level.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message ScreenBrightnessChanged {
    // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
    optional int32 level = 1;
}

/**
 * Logs battery level (percent full, from 0 to 100).
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message BatteryLevelChanged {
    // Battery level. Should be in [0, 100].
    optional int32 battery_level = 1;
}

/**
 * Logs change in charging status of the device.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message ChargingStateChanged {
    // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
    optional android.os.BatteryStatusEnum state = 1;
}

/**
 * Logs whether the device is plugged in, and what power source it is using.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message PluggedStateChanged {
    // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
    optional android.os.BatteryPluggedStateEnum state = 1;
}

/**
 * Logs when an app's wakeup alarm fires.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message WakeupAlarmOccurred {
    repeated AttributionNode attribution_node = 1;

    // Name of the wakeup alarm.
    optional string tag = 2;

    // Name of source package (for historical reasons, since BatteryStats tracked it).
    optional string package_name = 3;
}

/**
 * Logs when an an app causes the mobile radio to change state.
 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
 */
message MobileRadioPowerStateChanged {
    repeated AttributionNode attribution_node = 1;

    // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
    optional android.telephony.DataConnectionPowerStateEnum state = 2;
}

/**
 * Logs when an an app causes the wifi radio to change state.
 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
 */
message WifiRadioPowerStateChanged {
    repeated AttributionNode attribution_node = 1;

    // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
    optional android.telephony.DataConnectionPowerStateEnum state = 2;
}

/**
 * Logs kernel wakeup reasons and aborts.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message KernelWakeupReported {
    // Name of the kernel wakeup reason (or abort).
    optional string wakeup_reason_name = 1;

    // Duration (in microseconds) for the wake-up interrupt to be serviced.
    optional int64 duration_micros = 2;
}

/**
 * Logs when Wifi is toggled on/off.
 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message WifiEnabledStateChanged {
    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 1;
}

/**
 * Logs when an app causes Wifi to run. In this context, 'to run' means to use Wifi Client Mode.
 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
 */
message WifiRunningStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 2;
}

/**
 * Logs wifi locks held by an app.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message WifiLockStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 2;

    // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
    optional android.net.wifi.WifiModeEnum mode = 3;
}

/**
 * Logs wifi signal strength changes.
 *
 * Logged from:
 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
 */
message WifiSignalStrengthChanged {
    // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
    optional android.telephony.SignalStrengthEnum signal_strength = 1;
}

/**
 * Logs wifi scans performed by an app.
 *
 * Logged from:
 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
 */
message WifiScanStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 2;
}

/**
 * Logs wifi multicast locks held by an app
 *
 * Logged from:
 *   frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
 */
message WifiMulticastLockStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 2;

    optional string tag = 3;
}

/**
 * Logs shutdown reason and duration on next boot.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/server/BootReceiver.java
 */
message ShutdownSequenceReported {
    // True if shutdown is for a reboot. Default: false if we do not know.
    optional bool reboot = 1;

    // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
    optional string reason = 2;

    // Beginning of shutdown time in ms using wall clock time since unix epoch.
    // Default: 0 if no start time received.
    optional int64 start_time_millis = 3;

    // Duration of shutdown in ms. Default: 0 if no duration received.
    optional int64 duration_millis = 4;
}


/**
 * Logs boot reason and duration.
 *
 * Logged from:
 *   system/core/bootstat/bootstat.cpp
 */
message BootSequenceReported {
    // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
    // Default: "<EMPTY>" if not available.
    optional string bootloader_reason = 1;

    // Reason for system boot. Eg. bootloader, reboot,userrequested
    // Default: "<EMPTY>" if not available.
    optional string system_reason = 2;

    // End of boot time in ms from unix epoch using system wall clock.
    optional int64 end_time_millis = 3;

    // Total boot duration in ms.
    optional int64 total_duration_millis = 4;

    // Bootloader duration in ms.
    optional int64 bootloader_duration_millis = 5;

    // Time since last boot in ms. Default: 0 if not available.
    optional int64 time_since_last_boot = 6;
}


/**
 * Logs call state and disconnect cause (if applicable).
 *
 * Logged from:
 *   packages/services/Telecomm/src/com/android/server/telecom/Call.java
 */
message CallStateChanged {
    // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
    // From frameworks/base/core/proto/android/telecomm/enums.proto.
    optional android.telecom.CallStateEnum call_state = 1;

    // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
    // This value is only applicable when the call_state is DISCONNECTED, and
    // should always be UNKNOWN if the call_state is not DISCONNECTED.
    // From frameworks/base/core/proto/android/telecomm/enums.proto.
    optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;

    // True if the call is self-managed, which are apps that use the
    // telecom infrastructure to make their own calls.
    optional bool self_managed = 3;

    // True if call is external. External calls are calls on connected Wear
    // devices but show up in Telecom so the user can pull them onto the device.
    optional bool external_call = 4;
}

/**
 * Logs keyguard state. The keyguard is the lock screen.
 *
 * Logged from:
 *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
 */
message KeyguardStateChanged {
    enum State {
        UNKNOWN = 0;
        // The keyguard is hidden when the phone is unlocked.
        HIDDEN = 1;
        // The keyguard is shown when the phone is locked (screen turns off).
        SHOWN= 2;
        // The keyguard is occluded when something is overlaying the keyguard.
        // Eg. Opening the camera while on the lock screen.
        OCCLUDED = 3;
    }
    optional State state = 1;
}

/**
 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
 * prompts the user to enter a password (pattern, pin, etc).
 *
 * Logged from:
 *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
 */

message KeyguardBouncerStateChanged {
    enum State {
        UNKNOWN = 0;
        // Bouncer is hidden, either as a result of successfully entering the
        // password, screen timing out, or user going back to lock screen.
        HIDDEN = 1;
        // This is when the user is being prompted to enter the password.
        SHOWN = 2;
    }
    optional State state = 1;
}

/**
 * Logs the result of entering a password into the keyguard bouncer.
 *
 * Logged from:
 *   frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
 */
message KeyguardBouncerPasswordEntered {
    enum BouncerResult {
        UNKNOWN = 0;
        // The password entered was incorrect.
        FAILURE = 1;
        // The password entered was correct.
        SUCCESS = 2;
    }
    optional BouncerResult result = 1;
}

/*
 * Logs changes to the configuration of the device. The configuration is defined
 * in frameworks/base/core/java/android/content/res/Configuration.java
 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
 * Please go there to interpret the possible values each field can be.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message ResourceConfigurationChanged {
    // Bit mask of color capabilities of the screen.
    // Contains information about the color gamut and hdr mode of the screen.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
    optional int32 color_mode = 1;

    // The target screen density being rendered to.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
    optional int32 density_dpi = 2;

    // Current user preference for the scaling factor for fonts,
    // relative to the base density scaling.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
    optional float font_scale = 3;

    // Flag indicating whether the hard keyboard is hidden.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
    optional int32 hard_keyboard_hidden = 4;

    // The type of keyboard attached to the device.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
    optional int32 keyboard = 5;

    // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
    optional int32 keyboard_hidden = 6;

    // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
    // 0 if undefined.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
    optional int32 mcc = 7;

    // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
    // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
    // MNC_ZERO symbol defined in Configuration.java.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
    optional int32 mnc = 8;

    // The kind of navigation available on the device.
    // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
    optional int32 navigation = 9;

    // Flag indicating whether the navigation is available.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
    optional int32 navigation_hidden = 10;

    // Overall orientation of the screen.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
    optional int32 orientation = 11;

    // The current height of the available screen space, in dp units.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
    optional int32 screen_height_dp = 12;

    // Bit mask of overall layout of the screen.
    // Contains information about screen size, whether the screen is wider/taller
    // than normal, whether the screen layout is right-tl-left or left-to-right,
    // and whether the screen has a rounded shape.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
    optional int32 screen_layout = 13;

    // Current width of the available screen space, in dp units.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
    optional int32 screen_width_dp = 14;

    // The smallest screen size an application will see in normal operation.
    // This is the smallest value of both screenWidthDp and screenHeightDp
    // in portrait and landscape.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
    optional int32 smallest_screen_width_dp = 15;

    // The type of touch screen attached to the device.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
    optional int32 touchscreen = 16;

    // Bit mask of the ui mode.
    // Contains information about the overall ui mode of the device.
    // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
    // Also contains information about whether the device is in night mode.
    // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
    optional int32 ui_mode = 17;
}


/**
 * Logs changes in the connection state of the mobile radio.
 *
 * Logged from:
 *    frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
 */
message MobileConnectionStateChanged {
    // States are from the state machine DataConnection.java.
    enum State {
        UNKNOWN = 0;
        // The connection is inactive, or disconnected.
        INACTIVE = 1;
        // The connection is being activated, or connecting.
        ACTIVATING = 2;
        // The connection is active, or connected.
        ACTIVE = 3;
        // The connection is disconnecting.
        DISCONNECTING = 4;
        // The connection is disconnecting after creating a connection.
        DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
    }
    optional State state  = 1;
    // For multi-sim phones, this distinguishes between the sim cards.
    optional int32 sim_slot_index = 2;
    // Used to identify the connection. Starts at 0 and increments by 1 for
    // every new network created. Resets whenever the device reboots.
    optional int32 data_connection_id = 3;
    // A bitmask for the capabilities of this connection.
    // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
    // Default value (if we have no information): 0
    optional int64 capabilities = 4;
    // If this connection has internet.
    // This just checks if the DEFAULT bit of capabilities is set.
    optional bool has_internet = 5;
}

/**
 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
 */
message MobileRadioTechnologyChanged {
    optional android.telephony.NetworkTypeEnum state = 1;
    // For multi-sim phones, this distinguishes between the sim cards.
    optional int32 sim_slot_index = 2;
}

/**
 * Logs the VID and PID of any connected USB devices.
 *
 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
 *
 * Logged by Vendor.
 */
message UsbDeviceAttached {
    optional int32 vid = 1;
    optional int32 pid = 2;
    optional bool has_audio = 3;
    optional bool has_hid = 4;
    optional bool has_storage = 5;
    enum State {
        STATE_DISCONNECTED = 0;
        STATE_CONNECTED = 1;
    }
    optional State state = 6;
    optional int64 last_connect_duration_millis = 7;
}


/**
 * Logs when Bluetooth is enabled and disabled.
 *
 * Logged from:
 *   services/core/java/com/android/server/BluetoothManagerService.java
 */
message BluetoothEnabledStateChanged {
    repeated AttributionNode attribution_node = 1;
    // Whether or not bluetooth is enabled on the device.
    enum State {
        UNKNOWN = 0;
        ENABLED = 1;
        DISABLED = 2;
    }
    optional State state = 2;
    // The reason for being enabled/disabled.
    // Eg. Airplane mode, crash, application request.
    optional android.bluetooth.EnableDisableReasonEnum reason = 3;
    // If the reason is an application request, this will be the package name.
    optional string pkg_name = 4;
}

/**
 * Logs when profiles on a Bluetooth device connects and disconnects.
 *
 * Logged from:
 *    packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
 *
 * Next Tag: 5
 */
message BluetoothConnectionStateChanged {
    // The state of the connection.
    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
    optional android.bluetooth.ConnectionStateEnum state = 1;
    // An identifier that can be used to match connect and disconnect events.
    // Currently is last two bytes of a hash of a device level ID and
    // the mac address of the bluetooth device that is connected.
    // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
    optional int32 obfuscated_id = 2 [deprecated = true];
    // The profile that is connected. Eg. GATT, A2DP, HEADSET.
    // From android.bluetooth.BluetoothAdapter.java
    // Default: 0 when not used
    optional int32 bt_profile = 3;
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Logs when a Bluetooth device connects and disconnects over ACL
 *
 * Logged from:
 *    packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
 *
 * Next Tag: 3
 */
message BluetoothAclConnectionStateChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // The state of the connection.
    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
    optional android.bluetooth.ConnectionStateEnum state = 2;
}

/**
 * Logs when a Bluetooth device connects and disconnects over SCO
 *
 * Logged from:
 *    packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
 *    packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
 *
 * Next Tag: 4
 */
message BluetoothScoConnectionStateChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // The state of the connection.
    // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
    optional android.bluetooth.ConnectionStateEnum state = 2;
    // Codec used for this SCO connection
    // Default: UNKNOWN
    optional android.bluetooth.hfp.ScoCodec codec = 3;
}

/**
 * Logged when active device of a profile changes
 *
 * Logged from:
 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
 *     packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
 *     packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
 */
message BluetoothActiveDeviceChanged {
    // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
    // From android.bluetooth.BluetoothProfile
    optional int32 bt_profile = 1;
    // An identifier that can be used to match events for this new active device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if there is no active device for this profile
    optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
}

// Logs when there is an event affecting Bluetooth device's link layer connection.
// - This event is triggered when there is a related HCI command or event
// - Users of this metrics can deduce Bluetooth device's connection state from these events
// - HCI commands are logged before the command is sent, after receiving command status, and after
//   receiving command complete
// - HCI events are logged when they arrive
//
// Low level log from system/bt
//
// Bluetooth classic commands:
// - CMD_CREATE_CONNECTION
// - CMD_DISCONNECT
// - CMD_CREATE_CONNECTION_CANCEL
// - CMD_ACCEPT_CONNECTION_REQUEST
// - CMD_REJECT_CONNECTION_REQUEST
// - CMD_SETUP_ESCO_CONNECTION
// - CMD_ACCEPT_ESCO_CONNECTION
// - CMD_REJECT_ESCO_CONNECTION
// - CMD_ENH_SETUP_ESCO_CONNECTION
// - CMD_ENH_ACCEPT_ESCO_CONNECTION
//
// Bluetooth low energy commands:
// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
// - CMD_BLE_CLEAR_WHITE_LIST
// - CMD_BLE_ADD_WHITE_LIST
// - CMD_BLE_REMOVE_WHITE_LIST
//
// Bluetooth classic events:
// - EVT_CONNECTION_COMP
// - EVT_CONNECTION_REQUEST
// - EVT_DISCONNECTION_COMP
// - EVT_ESCO_CONNECTION_COMP
// - EVT_ESCO_CONNECTION_CHANGED
//
// Bluetooth low energy meta events:
// - BLE_EVT_CONN_COMPLETE_EVT
// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
//
// Next tag: 10
message BluetoothLinkLayerConnectionEvent {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Connection handle of this connection if available
    // Range: 0x0000 - 0x0EFF (12 bits)
    // Default: 0xFFFF if the handle is unknown
    optional int32 connection_handle = 2;
    // Direction of the link
    // Default: DIRECTION_UNKNOWN
    optional android.bluetooth.DirectionEnum direction = 3;
    // Type of this link
    // Default: LINK_TYPE_UNKNOWN
    optional android.bluetooth.LinkTypeEnum type = 4;

    // Reason metadata for this link layer connection event, rules for interpretation:
    // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
    //    EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
    // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
    //    set and valid, ignore hci_ble_event

    // HCI command associated with this event
    // Default: CMD_UNKNOWN
    optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
    // HCI event associated with this event
    // Default: EVT_UNKNOWN
    optional android.bluetooth.hci.EventEnum hci_event = 6;
    // HCI BLE meta event associated with this event
    // Default: BLE_EVT_UNKNOWN
    optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
    // HCI command status code if this is triggerred by hci_cmd
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum cmd_status = 8;
    // HCI reason code associated with this event
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum reason_code = 9;
}

/**
 * Logs when a module is rolled back by Watchdog.
 *
 * Logged from: Rollback Manager
 */
message WatchdogRollbackOccurred {
    enum RollbackType {
        UNKNOWN = 0;
        ROLLBACK_INITIATE = 1;
        ROLLBACK_SUCCESS = 2;
        ROLLBACK_FAILURE = 3;
        ROLLBACK_BOOT_TRIGGERED = 4;
    }
    optional RollbackType rollback_type = 1;

    optional string package_name = 2;

    optional int32 package_version_code = 3;
}

/**
 * Logs when there is a change in Bluetooth A2DP playback state
 *
 * Logged from:
 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
 */
message BluetoothA2dpPlaybackStateChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Current playback state
    // Default: PLAYBACK_STATE_UNKNOWN
    optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
    // Current audio coding mode
    // Default: AUDIO_CODING_MODE_UNKNOWN
    optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
}

/**
 * Logs when there is a change in A2DP codec config for a particular remote device
 *
 * Logged from:
 *     frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
 */
message BluetoothA2dpCodecConfigChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
    // Default SOURCE_CODEC_TYPE_INVALID
    optional int32 codec_type = 2;
    // Codec priroity, the higher the more preferred, -1 for disabled
    // Default: CODEC_PRIORITY_DEFAULT
    optional int32 codec_priority = 3;
    // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
    // Default: SAMPLE_RATE_NONE
    optional int32 sample_rate = 4;
    // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
    // Default: BITS_PER_SAMPLE_NONE
    optional int32 bits_per_sample = 5;
    // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
    // Default: CHANNEL_MODE_NONE
    optional int32 channel_mode = 6;
    // Codec specific values
    // Default 0
    optional int64 codec_specific_1 = 7;
    optional int64 codec_specific_2 = 8;
    optional int64 codec_specific_3 = 9;
    optional int64 codec_specific_4 = 10;
}

/**
 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
 * Each codec's capability is logged separately due to statsd restriction
 *
 * Logged from:
 *     frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
 *     packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
 */
message BluetoothA2dpCodecCapabilityChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
    // Default SOURCE_CODEC_TYPE_INVALID
    optional int32 codec_type = 2;
    // Codec priroity, the higher the more preferred, -1 for disabled
    // Default: CODEC_PRIORITY_DEFAULT
    optional int32 codec_priority = 3;
    // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
    // in BluetoothCodecConfig
    // Default: empty and SAMPLE_RATE_NONE for individual item
    optional int32 sample_rate = 4;
    // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
    // in BluetoothCodecConfig
    // Default: empty and BITS_PER_SAMPLE_NONE for individual item
    optional int32 bits_per_sample = 5;
    // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
    // BluetoothCodecConfig
    // Default: empty and CHANNEL_MODE_NONE for individual item
    optional int32 channel_mode = 6;
    // Codec specific values
    // Default 0
    optional int64 codec_specific_1 = 7;
    optional int64 codec_specific_2 = 8;
    optional int64 codec_specific_3 = 9;
    optional int64 codec_specific_4 = 10;
}

/**
 * Logs when A2DP failed to read from PCM source.
 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
 *
 * Logged from:
 *     system/bt
 */
message BluetoothA2dpAudioUnderrunReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Encoding interval in nanoseconds
    // Default: 0
    optional int64 encoding_interval_nanos = 2;
    // Number of bytes of PCM data that could not be read from the source
    // Default: 0
    optional int32 num_missing_pcm_bytes = 3;
}

/**
 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
 * buffer queue is full and we have to drop data
 *
 * Logged from:
 *     system/bt
 */
message BluetoothA2dpAudioOverrunReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Encoding interval in nanoseconds
    // Default: 0
    optional int64 encoding_interval_nanos = 2;
    // Number of buffers dropped in this event
    // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
    // Default: 0
    optional int32 num_dropped_buffers = 3;
    // Number of encoded buffers dropped in this event
    // Default 0
    optional int32 num_dropped_encoded_frames = 4;
    // Number of encoded bytes dropped in this event
    // Default: 0
    optional int32 num_dropped_encoded_bytes = 5;
}

/**
 * Logs when we receive reports regarding a device's RSSI value
 *
 * Logged from:
 *     system/bt
 */
message BluetoothDeviceRssiReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Connection handle of this connection if available
    // Range: 0x0000 - 0x0EFF (12 bits)
    // Default: 0xFFFF if the handle is unknown
    optional int32 connection_handle = 2;
    // HCI command status code if this is triggerred by hci_cmd
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum hci_status = 3;
    // BR/EDR
    //   Range: -128 ≤ N ≤ 127 (signed integer)
    //   Units: dB
    // LE:
    //   Range: -127 to 20, 127 (signed integer)
    //   Units: dBm
    // Invalid when an out of range value is reported
    optional int32 rssi = 4;
}

/**
 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
 *
 * Logged from:
 *     system/bt
 */
message BluetoothDeviceFailedContactCounterReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Connection handle of this connection if available
    // Range: 0x0000 - 0x0EFF (12 bits)
    // Default: 0xFFFF if the handle is unknown
    optional int32 connection_handle = 2;
    // HCI command status code if this is triggerred by hci_cmd
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum cmd_status = 3;
    // Number of consecutive failed contacts for a connection corresponding to the Handle
    // Range: uint16_t, 0-0xFFFF
    // Default: 0xFFFFF
    optional int32 failed_contact_counter = 4;
}

/**
 * Logs when we receive reports regarding the tranmit power level used for a specific connection
 *
 * Logged from:
 *     system/bt
 */
message BluetoothDeviceTxPowerLevelReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Connection handle of this connection if available
    // Range: 0x0000 - 0x0EFF (12 bits)
    // Default: 0xFFFF if the handle is unknown
    optional int32 connection_handle = 2;
    // HCI command status code if this is triggered by hci_cmd
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum hci_status = 3;
    // Range: -30 ≤ N ≤ 20
    // Units: dBm
    // Invalid when an out of range value is reported
    optional int32 transmit_power_level = 4;
}

/**
 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
 * receiving an HCI command from the host
 *
 * Logged from: system/bt
 */
message BluetoothHciTimeoutReported {
    // HCI command associated with this event
    // Default: CMD_UNKNOWN
    optional android.bluetooth.hci.CommandEnum hci_command = 1;
}

/**
 * Logs when we receive Bluetooth Link Quality Report event from the controller
 * See Android Bluetooth HCI specification for more details
 *
 * Note: all count and bytes field are counted since last event
 *
 * Logged from: system/bt
 */
message BluetoothQualityReportReported {
    // Quality report ID
    // Original type: uint8_t
    // Default: BQR_ID_UNKNOWN
    optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
    // Packet type of the connection
    // Original type: uint8_t
    // Default: BQR_PACKET_TYPE_UNKNOWN
    optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
    // Connection handle of the connection
    // Original type: uint16_t
    optional int32 connection_handle = 3;
    // Performing Role for the connection
    // Original type: uint8_t
    optional int32 connection_role = 4;
    // Current Transmit Power Level for the connection. This value is the same as the controller's
    // response to the HCI_Read_Transmit_Power_Level HCI command
    // Original type: uint8_t
    optional int32 tx_power_level = 5;
    // Received Signal Strength Indication (RSSI) value for the connection. This value is an
    // absolute receiver signal strength value
    // Original type: int8_t
    optional int32 rssi = 6;
    // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
    // channels used by the link currently
    // Original type: uint8_t
    optional int32 snr = 7;
    // Indicates the number of unused channels in AFH_channel_map
    // Original type: uint8_t
    optional int32 unused_afh_channel_count = 8;
    // Indicates the number of the channels which are interfered and quality is bad but are still
    // selected for AFH
    // Original type: uint8_t
    optional int32 afh_select_unideal_channel_count = 9;
    // Current Link Supervision Timeout Setting
    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
    // Original type: uint16_t
    optional int32 lsto = 10;
    // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
    // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
    // 0x01 (Piconet Clock)
    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
    // Original type: uint32_t
    optional int64 connection_piconet_clock = 11;
    // The count of retransmission
    // Original type: uint32_t
    optional int64 retransmission_count = 12;
    // The count of no RX
    // Original type: uint32_t
    optional int64 no_rx_count = 13;
    // The count of NAK (Negative Acknowledge)
    // Original type: uint32_t
    optional int64 nak_count = 14;
    // Controller timestamp of last TX ACK
    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
    // Original type: uint32_t
    optional int64 last_tx_ack_timestamp = 15;
    // The count of Flow-off (STOP)
    // Original type: uint32_t
    optional int64 flow_off_count = 16;
    // Controller timestamp of last Flow-on (GO)
    // Unit: N * 0.3125 ms (1 Bluetooth Clock)
    // Original type: uint32_t
    optional int64 last_flow_on_timestamp = 17;
    // Buffer overflow count (how many bytes of TX data are dropped) since the last event
    // Original type: uint32_t
    optional int64 buffer_overflow_bytes = 18;
    // Buffer underflow count (in byte) since last event
    // Original type: uint32_t
    optional int64 buffer_underflow_bytes = 19;
}

/**
 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
 *
 * Notes:
 * - Each event can be partially filled as we might learn different pieces of device
 *   information at different time
 * - Multiple device info events can be combined to give more complete picture
 * - When multiple device info events tries to describe the same information, the
 *   later one wins
 *
 * Logged from:
 *     packages/apps/Bluetooth
 */
message BluetoothDeviceInfoReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Where is this device info obtained from
    optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
    // Name of the data source
    // For EXTERNAL: package name of the data source
    // For INTERNAL: null for general case, component name otherwise
    optional string source_name = 3;
    // Name of the manufacturer of this device
    optional string manufacturer = 4;
    // Model of this device
    optional string model = 5;
    // Hardware version of this device
    optional string hardware_version = 6;
    // Software version of this device
    optional string software_version = 7;
}

/**
 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
 * device, as documented by the Bluetooth Core HCI specification
 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
 * Vol 2, Part E, Page 1118
 *
 * Logged from:
 *     system/bt
 */
message BluetoothRemoteVersionInfoReported {
    // Connection handle of the connection
    // Original type: uint16_t
    optional int32 connection_handle = 1;
    // HCI command status code
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum hci_status = 2;
    // 1 byte Version of current LMP in the remote controller
    optional int32 lmp_version = 3;
    // 2 bytes LMP manufacturer code of the remote controller
    // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
    optional int32 lmp_manufacturer_code = 4;
    // 4 bytes subversion of the LMP in the remote controller
    optional int32 lmp_subversion = 5;
}

/**
 * Logs when certain Bluetooth SDP attributes are discovered
 * Constant definitions are from:
 *     https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
 *
 * Current logged attributes:
 * - BluetoothProfileDescriptorList
 * - Supported Features Bitmask
 *
 * Logged from:
 *     system/bt
 */
message BluetoothSdpAttributeReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
    // Original type: uint16_t
    optional int32 protocol_uuid = 2;
    // Short form UUIDs used to identify Bluetooth SDP attribute types
    // Original type: uint16_t
    optional int32 attribute_id = 3;
    // Attribute value for the particular attribute
    optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Logs when bond state of a Bluetooth device changes
 *
 * Logged from:
 *     frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
 *     packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
 */
message BluetoothBondStateChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Preferred transport type to remote dual mode device
    // Default: TRANSPORT_AUTO means no preference
    optional android.bluetooth.TransportTypeEnum transport = 2;
    // The type of this Bluetooth device (Classic, LE, or Dual mode)
    // Default: UNKNOWN
    optional android.bluetooth.DeviceTypeEnum type = 3;
    // Current bond state (NONE, BONDING, BONDED)
    // Default: BOND_STATE_UNKNOWN
    optional android.bluetooth.BondStateEnum bond_state = 4;
    // Bonding sub state
    // Default: BOND_SUB_STATE_UNKNOWN
    optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
    // Unbond Reason
    // Default: UNBOND_REASON_UNKNOWN
    optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
}

/**
 * Logs there is an event related Bluetooth classic pairing
 *
 * Logged from:
 *     system/bt
 */
message BluetoothClassicPairingEventReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Connection handle of this connection if available
    // Range: 0x0000 - 0x0EFF (12 bits)
    // Default: 0xFFFF if the handle is unknown
    optional int32 connection_handle = 2;
    // HCI command associated with this event
    // Default: CMD_UNKNOWN
    optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
    // HCI event associated with this event
    // Default: EVT_UNKNOWN
    optional android.bluetooth.hci.EventEnum hci_event = 4;
    // HCI command status code if this is triggerred by hci_cmd
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum cmd_status = 5;
    // HCI reason code associated with this event
    // Default: STATUS_UNKNOWN
    optional android.bluetooth.hci.StatusEnum reason_code = 6;
    // A status value related to this specific event
    // Default: 0
    optional int64 event_value = 7;
}

/**
 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
 *
 * Logged from:
 *     system/bt
 */
message BluetoothSmpPairingEventReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if the device identifier is not known
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // SMP command sent or received over L2CAP
    // Default: CMD_UNKNOWN
    optional android.bluetooth.smp.CommandEnum smp_command = 2;
    // Whether this command is sent or received
    // Default: DIRECTION_UNKNOWN
    optional android.bluetooth.DirectionEnum direction = 3;
    // SMP failure reason code
    // Default: PAIRING_FAIL_REASON_DEFAULT
    optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
}

/**
 * Logs when a Bluetooth socket’s connection state changed
 *
 * Logged from:
 *   system/bt
 */
message BluetoothSocketConnectionStateChanged {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if this is a server listener socket
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Temporary port of this socket for the current connection or session only
    // Default 0 when unknown or don't care
    optional int32 port = 2;
    // Socket type as mentioned in
    // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
    // Default: SOCKET_TYPE_UNKNOWN
    optional android.bluetooth.SocketTypeEnum type = 3;
    // Socket connection state
    // Default: SOCKET_CONNECTION_STATE_UNKNOWN
    optional android.bluetooth.SocketConnectionstateEnum state = 4;
    // Number of bytes sent to remote device during this connection
    optional int64 tx_bytes = 5;
    // Number of bytes received from remote device during this connection
    optional int64 rx_bytes = 6;
    // Socket owner's UID
    optional int32 uid = 7 [(is_uid) = true];
    // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
    // |port| must be spawned by |server_port|
    // Default 0 when unknown or don't care
    optional int32 server_port = 8;
    // Whether this is a server listener socket
    optional android.bluetooth.SocketRoleEnum is_server = 9;
}

/**
 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
 *
 * Logged from:
 *   packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
 *   packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
 *
 */
message BluetoothClassOfDeviceReported {
    // An identifier that can be used to match events for this device.
    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
    // Salt: Randomly generated 256 bit value
    // Hash algorithm: HMAC-SHA256
    // Size: 32 byte
    // Default: null or empty if this is a server listener socket
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Class of Device (CoD) value including both Major, Minor device class and service class
    // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
    // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
    // Default: 0
    optional int32 class_of_device = 2;
}

/**
 * Logs when something is plugged into or removed from the USB-C connector.
 *
 * Logged from:
 *  UsbService
 */
message UsbConnectorStateChanged {
    enum State {
        STATE_DISCONNECTED = 0;
        STATE_CONNECTED = 1;
    }
    optional State state = 1;
    optional string id = 2;
    // Last active session in ms.
    // 0 when the port is in connected state.
    optional int64 last_connect_duration_millis = 3;
}

/**
 * Logs the reported speaker impedance.
 *
 * Logged from:
 *  Vendor audio implementation.
 */
message SpeakerImpedanceReported {
    optional int32 speaker_location = 1;
    optional int32 impedance = 2;
}

/**
 * Logs the report of a failed hardware.
 *
 * Logged from:
 *  Vendor HALs.
 *
 */
message HardwareFailed {
    enum HardwareType {
        HARDWARE_FAILED_UNKNOWN = 0;
        HARDWARE_FAILED_MICROPHONE = 1;
        HARDWARE_FAILED_CODEC = 2;
        HARDWARE_FAILED_SPEAKER = 3;
        HARDWARE_FAILED_FINGERPRINT = 4;
    }
    optional HardwareType hardware_type = 1;

   /**
    * hardware_location allows vendors to differentiate between multiple instances of
    * the same hardware_type.  The specific locations are vendor defined integers,
    * referring to board-specific numbering schemes.
    */
    optional int32 hardware_location = 2;

    /**
     * failure_code is specific to the HardwareType of the failed hardware.
     * It should use one of the enum values defined below.
     */
    enum HardwareErrorCode {
        UNKNOWN = 0;
        COMPLETE = 1;
        SPEAKER_HIGH_Z = 2;
        SPEAKER_SHORT = 3;
        FINGERPRINT_SENSOR_BROKEN = 4;
        FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
        DEGRADE = 6;
    }
    optional int32 failure_code = 3;
}

/**
 * Log an event when the device has been physically dropped.
 * Reported from the /vendor partition.
 */
message PhysicalDropDetected {
    // Confidence that the event was actually a drop, 0 -> 100
    optional int32 confidence_pctg = 1;
    // Peak acceleration of the drop, in 1/1000s of a g.
    optional int32 accel_peak_thousandths_g = 2;
    // Duration of freefall in ms
    optional int32 freefall_time_millis = 3;
}

/**
 * Log bucketed battery charge cycles.
 *
 * Each bucket represents cycles of the battery past
 * a given charge point.  For example, if 10 cycle buckets are
 * initialized, bucket 1 is the lowest 1/10th of the battery,
 * and bucket 10 is 100%.
 *
 * Logged from:
 * /sys/class/power_supply/bms/cycle_count, via Vendor.
 */
message ChargeCyclesReported {
    optional int32 cycle_bucket_1 = 1;
    optional int32 cycle_bucket_2 = 2;
    optional int32 cycle_bucket_3 = 3;
    optional int32 cycle_bucket_4 = 4;
    optional int32 cycle_bucket_5 = 5;
    optional int32 cycle_bucket_6 = 6;
    optional int32 cycle_bucket_7 = 7;
    optional int32 cycle_bucket_8 = 8;
    optional int32 cycle_bucket_9 = 9;
    optional int32 cycle_bucket_10 = 10;
}

/**
 * Log battery health snapshot.
 *
 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
 * are snapshotted periodically over 24hrs.
 */
message BatteryHealthSnapshot {
    enum BatterySnapshotType {
        UNKNOWN = 0;
        MIN_TEMP = 1;         // Snapshot at min batt temp over 24hrs.
        MAX_TEMP = 2;         // Snapshot at max batt temp over 24hrs.
        MIN_RESISTANCE = 3;   // Snapshot at min batt resistance over 24hrs.
        MAX_RESISTANCE = 4;   // Snapshot at max batt resistance over 24hrs.
        MIN_VOLTAGE = 5;      // Snapshot at min batt voltage over 24hrs.
        MAX_VOLTAGE = 6;      // Snapshot at max batt voltage over 24hrs.
        MIN_CURRENT = 7;      // Snapshot at min batt current over 24hrs.
        MAX_CURRENT = 8;      // Snapshot at max batt current over 24hrs.
        MIN_BATT_LEVEL = 9;   // Snapshot at min battery level (SoC) over 24hrs.
        MAX_BATT_LEVEL = 10;  // Snapshot at max battery level (SoC) over 24hrs.
        AVG_RESISTANCE = 11;  // Snapshot at average battery resistance over 24hrs.
    }
    optional BatterySnapshotType type = 1;
    // Temperature, in 1/10ths of degree C.
    optional int32 temperature_deci_celsius = 2;
    // Voltage Battery Voltage, in microVolts.
    optional int32 voltage_micro_volt = 3;
    // Current Battery current, in microAmps.
    optional int32 current_micro_amps = 4;
    // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
    optional int32 open_circuit_micro_volt = 5;
    // Resistance Battery Resistance, in microOhms.
    optional int32 resistance_micro_ohm = 6;
    // Level Battery Level, as % of full.
    optional int32 level_percent = 7;
}

/**
 * Log slow I/O operations on the primary storage.
 */
message SlowIo {
    // Classifications of IO Operations.
    enum IoOperation {
        UNKNOWN = 0;
        READ = 1;
        WRITE = 2;
        UNMAP = 3;
        SYNC = 4;
    }
    optional IoOperation operation = 1;

    // The number of slow IO operations of this type over 24 hours.
    optional int32 count = 2;
}

/**
 * Log battery caused shutdown with the last recorded voltage.
 */
message BatteryCausedShutdown {
    // The last recorded battery voltage prior to shutdown.
    optional int32 last_recorded_micro_volt = 1;
}

/**
 * Logs when ThermalService receives throttling events.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
 */
message ThermalThrottlingSeverityStateChanged {
    // The type of temperature being reported (CPU, GPU, SKIN, etc)
    optional android.os.TemperatureTypeEnum sensor_type = 1;

    // The name of the temperature source. Eg. CPU0
    optional string sensor_name = 2;

    // Temperature in tenths of a degree C.
    // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
    optional int32 temperature_deci_celsius = 3;

    // Relative severity of the throttling, see enum definition.
    optional android.os.ThrottlingSeverityEnum severity = 4;
}

/**
 * Logs the duration of a davey (jank of >=700ms) when it occurs
 *
 * Logged from:
 *   frameworks/base/libs/hwui/JankTracker.cpp
 */
message DaveyOccurred {
    // The UID that logged this atom.
    optional int32 uid = 1 [(is_uid) = true];

    // Amount of time it took to render the frame. Should be >=700ms.
    optional int64 jank_duration_millis = 2;
}

/**
 * Logs phone signal strength changes.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message PhoneSignalStrengthChanged {
    // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
    optional android.telephony.SignalStrengthEnum signal_strength = 1;
}


/**
 * Logs when the phone state, sim state or signal strength changes
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message PhoneServiceStateChanged {
    optional android.telephony.ServiceStateEnum state = 1;
    optional android.telephony.SimStateEnum sim_state = 2;
    optional android.telephony.SignalStrengthEnum signal_strength = 3;
}

/**
 * Logs when the phone becomes on or off.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
 */
message PhoneStateChanged {
    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 1;
}

message LauncherUIChanged {
    optional android.stats.launcher.LauncherAction action = 1;
    optional android.stats.launcher.LauncherState src_state = 2;
    optional android.stats.launcher.LauncherState dst_state = 3;
    optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
    optional bool is_swipe_up_enabled = 5;
}

message StyleUIChanged {
    optional android.stats.style.Action action = 1;
    optional int32 color_package_hash = 2;
    optional int32 font_package_hash  = 3;
    optional int32 shape_package_hash = 4;
    optional int32 clock_package_hash = 5;
    optional int32 launcher_grid = 6;
    optional int32 wallpaper_category_hash = 7;
    optional int32 wallpaper_id_hash = 8;
}

/**
 * Logs when Settings UI has changed.
 *
 * Logged from:
 *   packages/apps/Settings
 */
message SettingsUIChanged {
    /**
     * Where this SettingsUIChange event comes from. For example, if
     * it's a PAGE_VISIBLE event, where the page is opened from.
     */
    optional android.app.settings.PageId attribution = 1;

    /**
     * What the UI action is.
     */
    optional android.app.settings.Action action = 2;

    /**
     * Where the action is happening
     */
    optional android.app.settings.PageId page_id = 3;

    /**
     * What preference changed in this event.
     */
    optional string changed_preference_key = 4;

    /**
     * The new value of the changed preference.
     */
    optional int64 changed_preference_int_value = 5;
}

/**
 * Logs basic timing information about touch events.
 * Reported at most every 5 minutes while device is being interacted with.
 *
 * Logged from:
 *   frameworks/native/services/inputflinger
 */
message TouchEventReported {
    /**
     * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
     * and the standard deviation of latency between the kernel and framework
     * for touchscreen events. The units are microseconds.
     *
     * The number is measured as the difference between the time at which
     * the input event was received in the evdev driver,
     * and the time at which the input event was received in EventHub.
     */
    // Minimum value
    optional float latency_min_micros = 1;
    // Maximum value
    optional float latency_max_micros = 2;
    // Average value
    optional float latency_mean_micros = 3;
    // Standard deviation
    optional float latency_stdev_micros = 4;
    // Number of touch events (input_event) in this report
    optional int32 count = 5;
}

/**
 * Logs gesture classification and timing information for touch events.
 *
 * Logged from:
 *   frameworks/base/core/java/android/view/GestureDetector.java
 *   frameworks/base/core/java/android/view/View.java
 */
message TouchGestureClassified {
    // The source of the classification (e.g. Java class name).
    optional string source = 1;

    enum Classification {
        UNKNOWN_CLASSIFICATION = 0;
        SINGLE_TAP = 1;
        DOUBLE_TAP = 2;
        LONG_PRESS = 3;
        DEEP_PRESS = 4;
        SCROLL = 5;
    }
    // The classification of the gesture.
    optional Classification classification = 2;

    // The interval from the start of a touch event stream until the
    // classification was made.
    optional int32 latency_millis = 3;

    // The distance from the location of the first touch event to the
    // location of the touch event when the classification was made.
    optional float displacement_px = 4;
}

/**
 * Logs that a setting was updated.
 * Logged from:
 *   frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
 * The tag and is_default allow resetting of settings to default values based on the specified
 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
 */
message SettingChanged {
    // The name of the setting.
    optional string setting = 1;

    // The change being imposed on this setting. May represent a number, eg "3".
    optional string value = 2;

    // The new value of this setting. For most settings, this is same as value. For some settings,
    // value is +X or -X where X represents an element in a set. For example, if the previous value
    // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
    // The +/- feature is currently only used for location_providers_allowed.
    optional string new_value = 3;

    // The previous value of this setting.
    optional string prev_value = 4;

    // The tag used with the is_default for resetting sets of settings. This is generally null.
    optional string tag = 5;

    // True if this setting with tag should be resettable.
    optional bool is_default = 6;

    // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
    optional int32 user = 7;

    enum ChangeReason {
        UPDATED = 1; // Updated can be an insertion or an update.
        DELETED = 2;
    }
    optional ChangeReason reason = 8;
}

/**
 * Logs activity going to foreground or background
 *
 * Logged from:
  *   frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
 */
message ActivityForegroundStateChanged {
    optional int32 uid = 1 [(is_uid) = true];
    optional string pkg_name = 2;
    optional string class_name = 3;

    enum State {
        BACKGROUND = 0;
        FOREGROUND = 1;
    }
    optional State state = 4;
}

/**
 * Logs when a volume entered low Storage state.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
 */
message LowStorageStateChanged {
    // Volume that ran out of storage.
    optional string volume_description = 1;

    enum State {
        UNKNOWN = 0;
        OFF = 1;
        ON = 2;
    }
    optional State state = 2;
}

/**
 * Logs when an app is downgraded.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
 */
message AppDowngraded {
    optional string package_name = 1;
    // Size of the package (all data) before being downgraded.
    optional int64 size_in_bytes_before = 2;
    // Size of the package (all data) after being downgraded.
    optional int64 size_in_bytes_after = 3;

    optional bool aggressive = 4;
}

/**
 * Logs when an app is optimized after being downgraded.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
 */
message AppOptimizedAfterDowngraded {
    optional string package_name = 1;
}

/**
 * Logs whenever an app is installed on external storage.
 * Logged from:
        frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
 */
message AppInstallOnExternalStorageReported {
    // The type of external storage.
    optional android.stats.storage.ExternalStorageType storage_type = 1;
    // The name of the package that is installed on the sd card.
    optional string package_name = 2;
}

/**
 * Logs when an app crashes.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message AppCrashOccurred {
    optional int32 uid = 1 [(is_uid) = true];

    optional string event_type = 2;

    // The name of the process.
    // system_server if it is not by an app
    optional string process_name = 3;

    // The pid if available. -1 means not available.
    optional sint32 pid = 4;

    optional string package_name = 5;

    enum InstantApp {
        UNAVAILABLE = 0;
        FALSE = 1;
        TRUE = 2;
    }
    optional InstantApp is_instant_app = 6;

    enum ForegroundState {
        UNKNOWN = 0;
        BACKGROUND = 1;
        FOREGROUND = 2;
    }
    optional ForegroundState foreground_state = 7;

    optional android.server.ErrorSource error_source = 8;
}

/**
 * Logs when a WTF (What a Terrible Failure) happened.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message WTFOccurred {
    optional int32 uid = 1 [(is_uid) = true];

    optional string tag = 2;

    // The name of the process.
    // system_server if it is not by an app
    optional string process_name = 3;

    // The pid if available. -1 means not available.
    optional sint32 pid = 4;

    optional android.server.ErrorSource error_source = 5;
}

/**
 * Logs when system server reports low memory.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message LowMemReported {
}

/**
 * Logs when an app ANR (App Not Responding) occurs.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/AppErrors.java
 */
message ANROccurred {
    optional int32 uid = 1 [(is_uid) = true];

    optional string process_name = 2;

    optional string short_component_name = 3;

    optional string reason = 4;

    enum InstantApp {
        UNAVAILABLE = 0;
        FALSE = 1;
        TRUE = 2;
    }
    optional InstantApp is_instant_app = 5;

    enum ForegroundState {
        UNKNOWN = 0;
        BACKGROUND = 1;
        FOREGROUND = 2;
    }
    optional ForegroundState foreground_state = 6;

    optional android.server.ErrorSource error_source = 7;

    optional string package_name = 8;
}

/**
 * Logs when the vibrator state changes.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/VibratorService.java
 */
message VibratorStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 2;

    // Duration (in milliseconds) requested to keep the vibrator on.
    // Only applicable for State == ON.
    optional int64 duration_millis = 3;
}

/*
 * Allows other apps to push events into statsd.
 * Logged from:
 *      frameworks/base/core/java/android/util/StatsLog.java
 */
message AppBreadcrumbReported {
    // The uid of the application that sent this custom atom.
    optional int32 uid = 1 [(is_uid) = true];

    // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
    optional int32 label = 2;

    // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
    // predicates for the metrics).
    enum State {
        UNKNOWN = 0;
        UNSPECIFIED = 1;  // For events that are known to not represent START/STOP.
        STOP = 2;
        START = 3;
    }
    optional State state = 3;
}

/**
 * Logs the wall-clock time when a significant wall-clock time shift occurs.
 * For example, this could be due to the user manually changing the time.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
 */
message WallClockTimeShifted {
    // New wall-clock time in milliseconds, according to System.currentTimeMillis().
    optional int64 wall_clock_timestamp_millis = 1;
}

/**
 * Logs when statsd detects an anomaly.
 *
 * Logged from:
 *   frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
 */
message AnomalyDetected {
    // Uid that owns the config whose anomaly detection alert fired.
    optional int32 config_uid = 1 [(is_uid) = true];

    // Id of the config whose anomaly detection alert fired.
    optional int64 config_id = 2;

    // Id of the alert (i.e. name of the anomaly that was detected).
    optional int64 alert_id = 3;
}

message AppStartOccurred {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The app package name.
    optional string pkg_name = 2;

    enum TransitionType {
        UNKNOWN = 0;
        WARM = 1;
        HOT = 2;
        COLD = 3;
    }
    // The transition type.
    optional TransitionType type = 3;

    // The activity name.
    optional string activity_name = 4;

    // The name of the calling app. Empty if not set.
    optional string calling_pkg_name = 5;

    // Whether the app is an instant app.
    optional bool is_instant_app = 6;

    // Device uptime when activity started.
    optional int64 activity_start_millis = 7;

    optional android.app.AppTransitionReasonEnum reason = 8;

    optional int32 transition_delay_millis = 9;
    // -1 if not set.
    optional int32 starting_window_delay_millis = 10;
    // -1 if not set.
    optional int32 bind_application_delay_millis = 11;
    optional int32 windows_drawn_delay_millis = 12;

    // Empty if not set.
    optional string launch_token = 13;

    // The compiler filter used when when the package was optimized.
    optional int32 package_optimization_compilation_filter = 14;

    // The reason why the package was optimized.
    optional int32 package_optimization_compilation_reason = 15;
}

message AppStartCanceled {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The app package name.
    optional string pkg_name = 2;

    enum TransitionType {
        UNKNOWN = 0;
        WARM = 1;
        HOT = 2;
        COLD = 3;
    }
    // The transition type.
    optional TransitionType type = 3;

    // The activity name.
    optional string activity_name = 4;
}

message AppStartFullyDrawn {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The app package name.
    optional string pkg_name = 2;

    enum TransitionType {
        UNKNOWN = 0;
        WITH_BUNDLE = 1;
        WITHOUT_BUNDLE = 2;
    }
    // The transition type.
    optional TransitionType type = 3;

    // The activity name.
    optional string activity_name = 4;

    optional bool transition_process_running = 5;

    // App startup time (until call to Activity#reportFullyDrawn()).
    optional int64 app_startup_time_millis = 6;
}

/**
 * Logs a picture-in-picture action
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 *      frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
 *      frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
 */
message PictureInPictureStateChanged {
    // -1 if it is not available
    optional int32 uid = 1 [(is_uid) = true];

    optional string short_name = 2;

    enum State {
        ENTERED = 1;
        EXPANDED_TO_FULL_SCREEN = 2;
        MINIMIZED = 3;
        DISMISSED = 4;
    }
    optional State state = 3;
}

/**
 * Logs overlay action
 * Logged from:
 *     services/core/java/com/android/server/wm/Session.java
 */
message OverlayStateChanged {
    optional int32 uid = 1 [(is_uid) = true];

    optional string package_name = 2;

    optional bool using_alert_window = 3;

    enum State {
        ENTERED = 1;
        EXITED = 2;
    }
    optional State state = 4;
}

/*
 * Logs foreground service starts and stops.
 * Note that this is not when a service starts or stops, but when it is
 * considered foreground.
 * Logged from
 *     //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
 */
message ForegroundServiceStateChanged {
    optional int32 uid = 1 [(is_uid) = true];
    // package_name + "/" + class_name
    optional string short_name = 2;

    enum State {
        ENTER = 1;
        EXIT = 2;
    }
    optional State state = 3;
}

/**
 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
 * attributed back to the parent (host) uid. One example is Chrome.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message IsolatedUidChanged {
    // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
    // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
    // This field is ignored when event == REMOVED.
    optional int32 parent_uid = 1;

    optional int32 isolated_uid = 2;

    // We expect an isolated uid to be removed before if it's used for another parent uid.
    enum Event {
        REMOVED = 0;
        CREATED = 1;
    }
    optional Event event = 3;
}

/*
 * Logs the reception of an incoming network packet causing the main system to wake up for
 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
 * and processed by WakeupController.cpp.
 */
message PacketWakeupOccurred {
    // The uid owning the socket into which the packet was delivered, or -1 if the packet was
    // delivered nowhere.
    optional int32 uid = 1 [(is_uid) = true];
    // The interface name on which the packet was received.
    optional string iface = 2;
    // The ethertype value of the packet.
    optional int32 ethertype = 3;
    // String representation of the destination MAC address of the packet.
    optional string destination_hardware_address = 4;
    // String representation of the source address of the packet if this was an IP packet.
    optional string source_ip = 5;
    // String representation of the destination address of the packet if this was an IP packet.
    optional string destination_ip = 6;
    // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
    // field if this was an IPv6 packet. The range of possible values is the same for both IP
    // families.
    optional int32 ip_next_header = 7;
    // The source port if this was a TCP or UDP packet.
    optional int32 source_port = 8;
    // The destination port if this was a TCP or UDP packet.
    optional int32 destination_port = 9;
}

/*
 * Logs the memory stats for an app on startup.
 * Logged from:
 *     frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message AppStartMemoryStateCaptured {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The process name.
    optional string process_name = 2;

    // The activity name.
    optional string activity_name = 3;

    // # of page-faults
    optional int64 page_fault = 4;

    // # of major page-faults
    optional int64 page_major_fault = 5;

    // RSS
    optional int64 rss_in_bytes = 6;

    // CACHE
    optional int64 cache_in_bytes = 7;

    // SWAP
    optional int64 swap_in_bytes = 8;
}

/*
 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
 * for LMK event.
 * Logged from:
 *      system/core/lmkd/lmkd.c
 */
message LmkStateChanged {
    enum State {
        UNKNOWN = 0;
        START = 1;
        STOP = 2;
    }
    optional State state = 1;
}

/*
 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
 * Logged from:
 *      system/core/lmkd/lmkd.c
 */
message LmkKillOccurred {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The process name.
    optional string process_name = 2;

    // oom adj score.
    optional int32 oom_adj_score = 3;

    // # of page-faults
    optional int64 page_fault = 4;

    // # of major page-faults
    optional int64 page_major_fault = 5;

    // RSS
    optional int64 rss_in_bytes = 6;

    // CACHE
    optional int64 cache_in_bytes = 7;

    // SWAP
    optional int64 swap_in_bytes = 8;

    // The elapsed real time of start of the process.
    optional int64 process_start_time_nanos = 9;

    // Min oom adj score considered by lmkd.
    optional int32 min_oom_score = 10;
}

/*
 * Logs when the ActivityManagerService detects that an app died.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message AppDied {
    // timestamp(elapsedRealtime) of record creation
    optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
}

/**
 * An atom for generic metrics logging. Available from Android Q.
 */
message GenericAtom {
    // The uid of the application that sent this custom atom.
    optional int32 uid = 1 [(is_uid) = true];

    // An event_id indicates the type of event.
    optional android.stats.EventType event_id = 2;
}

/**
 * Logs when a biometric acquire event occurs.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 */
message BiometricAcquired {
    // Biometric modality that was acquired.
    optional android.hardware.biometrics.ModalityEnum modality = 1;
    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
    optional int32 user = 2;
    // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
    optional bool is_crypto = 3;
    // Action that the device is performing. Acquired messages are only expected for enroll and
    // authenticate. Other actions may indicate an error.
    optional android.hardware.biometrics.ActionEnum action = 4;
    // The client that this acquisition was received for.
    optional android.hardware.biometrics.ClientEnum client = 5;
    // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
    optional int32 acquire_info = 6;
    // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
    optional int32 acquire_info_vendor = 7;
    // Dictates if this message should trigger additional debugging.
    optional bool debug = 8;
}

/**
 * Logs when a biometric authentication event occurs.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 */
message BiometricAuthenticated {
    // Biometric modality that was used.
    optional android.hardware.biometrics.ModalityEnum modality = 1;
    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
    optional int32 user = 2;
    // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
    // storage.
    optional bool is_crypto = 3;
    // The client that this acquisition was received for.
    optional android.hardware.biometrics.ClientEnum client = 4;
    // If authentication requires user confirmation. See BiometricPrompt's
    // setRequireConfirmation(bool) method.
    optional bool require_confirmation = 5;

    enum State {
        UNKNOWN = 0;
        REJECTED = 1;
        PENDING_CONFIRMATION = 2;
        CONFIRMED = 3;
    }

    // State of the current auth attempt.
    optional State state = 6;
    // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
    // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
    // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
    // CONFIRMED.
    optional int64 latency_millis = 7;
    // Dictates if this message should trigger additional debugging.
    optional bool debug = 8;
}

/**
 * Logs when a biometric error occurs.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 */
message BiometricErrorOccurred {
    // Biometric modality that was used.
    optional android.hardware.biometrics.ModalityEnum modality = 1;
    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
    optional int32 user = 2;
    // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
    optional bool is_crypto = 3;
    // Action that the device is performing.
    optional android.hardware.biometrics.ActionEnum action = 4;
    // The client that this acquisition was received for.
    optional android.hardware.biometrics.ClientEnum client = 5;
    // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
    // are unique to modality.
    optional int32 error_info = 6;
    // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
    // by the vendor and not specified by the HIDL interface.
    optional int32 error_info_vendor = 7;
    // Dictates if this message should trigger additional debugging.
    optional bool debug = 8;
}

/**
 * Logs when a system health issue is detected.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 */
message BiometricSystemHealthIssueDetected {
    // Biometric modality.
    optional android.hardware.biometrics.ModalityEnum modality = 1;
    // Type of issue detected.
    optional android.hardware.biometrics.IssueEnum issue = 2;
    // Dictates if this message should trigger additional debugging.
    optional bool debug = 3;
}

/**
 * Logs when a biometric enrollment occurs.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/biometrics
 */
message BiometricEnrolled {
    // Biometric modality that was used.
    optional android.hardware.biometrics.ModalityEnum modality = 1;
    // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
    optional int32 user = 2;
    // The amount of time the enrollment took in milliseconds.
    optional int64 latency_millis = 3;
    // Whether or not the enrollment was successful.
    optional bool success = 4;
}

/*
 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
 */
message FlagFlipUpdateOccurred {
    // If the event is from a flag config package, specify the package name.
    optional string flag_flip_package_name = 1;

    // The order id of the package
    optional int64 order_id = 2;
}

/**
 * Potential experiment ids that goes with a train install.
 */
message TrainExperimentIds {
    repeated int64 experiment_id = 1;
}

/*
 * Logs when a binary push state changes.
 * Logged by the installer via public api.
 */
message BinaryPushStateChanged {
    // Name of the train.
    optional string train_name = 1;
    // Version code for a "train" of packages that need to be installed atomically
    optional int64 train_version_code = 2;
    // After installation of this package, device requires a restart.
    optional bool requires_staging = 3;
    // Rollback should be enabled for this install.
    optional bool rollback_enabled = 4;
    // Requires low latency monitoring if possible.
    optional bool requires_low_latency_monitor = 5;

    enum State {
        UNKNOWN = 0;
        INSTALL_REQUESTED = 1;
        INSTALL_STARTED = 2;
        INSTALL_STAGED_NOT_READY = 3;
        INSTALL_STAGED_READY = 4;
        INSTALL_SUCCESS = 5;
        // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
        // and INSTALL_FAILURE_COMMIT.
        INSTALL_FAILURE = 6  [deprecated = true];
        // This enum is for installs that are manually cancelled via the Manual Update UI.
        INSTALL_CANCELLED = 7;
        INSTALLER_ROLLBACK_REQUESTED = 8;
        INSTALLER_ROLLBACK_INITIATED = 9;
        INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
        INSTALLER_ROLLBACK_STAGED = 11;
        INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
        INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
        INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
        INSTALLER_ROLLBACK_SUCCESS = 15;
        INSTALLER_ROLLBACK_FAILURE = 16;
        INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
        INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
        INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
        INSTALL_STAGED_CANCEL_REQUESTED = 20;
        INSTALL_STAGED_CANCEL_SUCCESS = 21;
        INSTALL_STAGED_CANCEL_FAILURE = 22;
        INSTALL_FAILURE_DOWNLOAD = 23;
        INSTALL_FAILURE_STATE_MISMATCH = 24;
        INSTALL_FAILURE_COMMIT = 25;
    }
    optional State state = 6;
    // Possible experiment ids for monitoring this push.
    optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
    // user id
    optional int32 user_id = 8;
}

/* Test atom, is not logged anywhere */
message TestAtomReported {
    repeated AttributionNode attribution_node = 1;
    optional int32 int_field = 2;
    optional int64 long_field = 3;
    optional float float_field = 4;
    optional string string_field = 5;
    optional bool boolean_field = 6;
    enum State {
        UNKNOWN = 0;
        OFF = 1;
        ON = 2;
    }
    optional State state = 7;
    optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/** Represents USB port overheat event. */
message UsbPortOverheatEvent {
    /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
    optional int32 plug_temperature_deci_c = 1;

    /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
    optional int32 max_temperature_deci_c = 2;

    /* Time between USB plug event and overheat threshold trip, in seconds. */
    optional int32 time_to_overheat_secs = 3;

    /* Time between overheat threshold trip and hysteresis, in seconds. */
    optional int32 time_to_hysteresis_secs = 4;

    /* Time between hysteresis and active mitigation ending, in seconds. */
    optional int32 time_to_inactive_secs = 5;
};

/**
 * Logs total effective full charge and discharge cycles on a battery.
 * Here are some examples of one effective cycle:
 *   1) the battery charges from 0% to 100% and drains back to 0%,
 *   2) charging from 50% to 100% and draining back to 50% twice.
 * Pulled from:
 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
 */
message BatteryCycleCount {
    /* Number of total charge and discharge cycles on the system battery. */
    optional int32 cycle_count = 1;
}

/**
 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
 * others), its type (public or private) and the size in bytes.
 * Pulled from:
 *   StatsCompanionService
 */

message ExternalStorageInfo {

    enum VolumeType {
        UNKNOWN = 0;
        PUBLIC = 1;
        PRIVATE = 2;
        OTHER = 3;
    }

    // The type of external storage.
    optional android.stats.storage.ExternalStorageType storage_type = 1;
    // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
    optional VolumeType volume_type = 2;
    // Total size of the sd card in bytes.
    optional int64 size_bytes = 3;
}

/*
 * Logs when a connection becomes available and lost.
 * Logged in StatsCompanionService.java
 */
message ConnectivityStateChanged {
  // Id of the network.
  optional int32 net_id = 1;

  enum State {
    UNKNOWN = 0;
    CONNECTED = 1;
    DISCONNECTED = 2;
  }
  // Connected state of a network.
  optional State state = 2;
}

/**
 * Logs when a service starts and stops.
 * Logged from:
 *   services/core/java/com/android/server/am/ActiveServices.java
 */
message ServiceStateChanged {

    optional int32 uid = 1 [(is_uid) = true];

    optional string package_name = 2;

    optional string service_name = 3;

    enum State {
        START = 1;
        STOP = 2;
    }

    optional State state = 4;
}

/**
 * Logs when a service is launched.
 * Logged from:
 *   services/core/java/com/android/server/am/ActiveServices.java
 */
message ServiceLaunchReported {

    optional int32 uid = 1 [(is_uid) = true];

    optional string package_name = 2;

    optional string service_name = 3;
}

/**
 * Logs when a hidden API is used.
 *
 * Logged from:
 *     libcore/libart/src/main/java/dalvik/system/VMRuntime.java
 */
message HiddenApiUsed {
    // The uid of the app making the hidden access.
    optional int32 uid = 1 [(is_uid) = true];

    // Signature of the method or field accessed.
    optional string signature = 2;

    enum AccessMethod {
        NONE = 0;
        REFLECTION = 1;
        JNI = 2;
        LINKING = 3;
    }

    // Type of access.
    optional AccessMethod access_method = 3;

    // Whether the access was prevented or not.
    optional bool access_denied = 4;
}

/**
 * Logs user interaction with the Privacy Indicators added in Q. In particular:
 * - When user sees privacy chip
 * - When user clicks privacy chip
 * - How does the user exit the Privacy Dialog
 * Logged from:
 *   packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
 */
message PrivacyIndicatorsInteracted {

    enum Type {
        UNKNOWN = 0;
        CHIP_VIEWED = 1;
        CHIP_CLICKED = 2;
        DIALOG_PRIVACY_SETTINGS = 3;
        DIALOG_DISMISS = 4;
        DIALOG_LINE_ITEM = 5;
    }

    optional Type type = 1 [(state_field_option).option = EXCLUSIVE];

    // Used if the type is LINE_ITEM
    optional string package_name = 2;
}

/**
 * Logs information about a package that is moved from the internal to external storage and vice
 * versa.
 * It logs the package name, the type of the external storage where the package is installed
 * (if moved to external storage, or UNKNOWN if moved to internal storage),
 * and the move type: if it's from internal to external or the other way around.
 *
 * Logged from:
        frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
 */
message AppMovedStorageReported {
    enum MoveType {
        UNKNOWN = 0;
        TO_EXTERNAL = 1;
        TO_INTERNAL = 2;
    }
    // The type of the external storage.
    optional android.stats.storage.ExternalStorageType external_storage_type = 1;
    // The type of move.
    optional MoveType move_type = 2;
    // The name of the package that was moved.
    optional string package_name = 3;
}

/**
 * Logs when system server watchdog occurs.
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/Watchdog.java
 */
message SystemServerWatchdogOccurred {
    optional string subject = 1;
}

/**
 * Logs when new file added to tombstones.
 * Logged from:
 *      frameworks/base/core/java/com/android/server/BootReceiver.java
 */
message TombStoneOccurred {
}

/*
 * Information about a role request
 *
 * Logged from:
 *   packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
 */
message RoleRequestResultReported {
    // UID of application requesting the role
    optional int32 requesting_uid = 1;

    // Package name of application requesting the role
    optional string requesting_package_name = 2;

    // The role to be granted
    optional string role_name = 3;

    // The count of applications qualifying for the role
    optional int32 qualifying_count = 4;

    // UID of application current granted the role
    optional int32 current_uid = 5;

    // Package name of application current granted the role
    optional string current_package_name = 6;

    // UID of another application that user chose to grant the role to, instead of the requesting
    // application
    optional int32 granted_another_uid = 7;

    // Package name of another application that user chose to grant the role to, instead of the
    // requesting application
    optional string granted_another_package_name = 8;

    enum Result {
        UNDEFINED = 0;
        // role request was ignored
        IGNORED = 1;
        // role request was ignored because it's already granted
        IGNORED_ALREADY_GRANTED = 2;
        // role request was ignored because the application isn't qualified
        IGNORED_NOT_QUALIFIED = 3;
        // role request was ignored because user said it should be always denied
        IGNORED_USER_ALWAYS_DENIED = 4;
        // role was granted by user action
        USER_GRANTED = 5;
        // role was denied by user action
        USER_DENIED = 6;
        // role was denied by user granting another application the role
        USER_DENIED_GRANTED_ANOTHER = 7;
        // role was denied and set to be always denied by the user
        USER_DENIED_WITH_ALWAYS = 8;
    }
    // The result of the role request
    optional Result result = 9;
}

//////////////////////////////////////////////////////////////////////
// Pulled atoms below this line //
//////////////////////////////////////////////////////////////////////

/**
 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
 *
 * Pulled from:
 *   StatsCompanionService (using BatteryStats to get which interfaces are wifi)
 */
message WifiBytesTransfer {
    optional int32 uid = 1 [(is_uid) = true];

    optional int64 rx_bytes = 2;

    optional int64 rx_packets = 3;

    optional int64 tx_bytes = 4;

    optional int64 tx_packets = 5;
}

/**
 * Pulls bytes transferred via wifi (separated by foreground and background usage).
 *
 * Pulled from:
 *   StatsCompanionService (using BatteryStats to get which interfaces are wifi)
 */
message WifiBytesTransferByFgBg {
    optional int32 uid = 1 [(is_uid) = true];

    // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
    optional bool is_foreground = 2;

    optional int64 rx_bytes = 3;

    optional int64 rx_packets = 4;

    optional int64 tx_bytes = 5;

    optional int64 tx_packets = 6;
}

/**
 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
 *
 * Pulled from:
 *   StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
 */
message MobileBytesTransfer {
    optional int32 uid = 1 [(is_uid) = true];

    optional int64 rx_bytes = 2;

    optional int64 rx_packets = 3;

    optional int64 tx_bytes = 4;

    optional int64 tx_packets = 5;
}

/**
 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
 *
 * Pulled from:
 *   StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
 */
message MobileBytesTransferByFgBg {
    optional int32 uid = 1 [(is_uid) = true];

    // 1 denotes foreground and 0 denotes background. This is called Set in
    // NetworkStats.
    optional bool is_foreground = 2;

    optional int64 rx_bytes = 3;

    optional int64 rx_packets = 4;

    optional int64 tx_bytes = 5;

    optional int64 tx_packets = 6;
}

/**
 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
 *
 * Pulled from:
 *   StatsCompanionService
 */
message BluetoothBytesTransfer {
    optional int32 uid = 1 [(is_uid) = true];

    optional int64 rx_bytes = 2;

    optional int64 tx_bytes = 3;
}

/**
 * Pulls the kernel wakelock durations. This atom is adapted from
 * android/internal/os/KernelWakelockStats.java
 *
 * Pulled from:
 *   StatsCompanionService using KernelWakelockReader.
 */
message KernelWakelock {
    optional string name = 1;

    optional int32 count = 2;

    optional int32 version = 3;

    optional int64 time_micros = 4;
}

/**
 * Pulls low power state information. If power.stats HAL is not available, this
 * includes platform and subsystem sleep state information,
 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
 * as defined in:
 *   hardware/interfaces/power/1.0/types.hal
 *   hardware/interfaces/power/1.1/types.hal
 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
 * as defined in:
 *   hardware/interfaces/power/stats/1.0/types.hal
 */
message SubsystemSleepState {
    // Subsystem name
    optional string subsystem_name = 1;
    // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
    // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
    // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
    //    powerEntityStateName from the corresponding PowerEntityStateInfo.
    optional string subname = 2;
    // The number of times it entered, or voted for entering the sleep state
    optional uint64 count = 3;
    // The length of time spent in, or spent voting for, the sleep state
    optional uint64 time_millis = 4;
}

/**
 * Pulls on-device power measurement information.
 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
 * Pulled from:
 *   frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
 */
message OnDevicePowerMeasurement {
    // Name of the subsystem (to which the rail belongs).
    optional string subsystem_name = 1;

    // Rail name. The rail lies within the subsystem.
    optional string rail_name = 2;

    // Time (in ms since boot) at which the rail energy value was measured.
    // This may differ slightly from the time that statsd logs this information.
    optional uint64 measurement_timestamp_millis = 3;

    // Accumulated energy used via the rail since device boot in uWs.
    optional uint64 energy_microwatt_secs = 4;
}

/**
 * Pulls Cpu time per frequency.
 * Pulls the time the cpu spend on the frequency index. Frequency index
 * starts from highest to lowest. The value should be monotonically
 * increasing since boot. However, if there is a cpu
 * hotplug event, the value would be reset as well.
 */
message CpuTimePerFreq {
    optional uint32 cluster = 1;
    optional uint32 freq_index = 2;
    optional uint64 time_millis = 3;
}

/**
 * Pulls Cpu Time Per Uid.
 * Note that isolated process uid time should be attributed to host uids.
 */
message CpuTimePerUid {
    optional int32 uid = 1 [(is_uid) = true];
    optional uint64 user_time_micros = 2;
    optional uint64 sys_time_micros = 3;
}

/**
 * Pulls Cpu Time Per Uid per frequency.
 * Note that isolated process uid time should be attributed to host uids.
 * For each uid, we order the time by descending frequencies.
 */
message CpuTimePerUidFreq {
    optional int32 uid = 1 [(is_uid) = true];
    optional uint32 freq_index = 2;
    optional uint64 time_millis = 3;
}

/**
 * Pulls Wifi Controller Activity Energy Info
 */
message WifiActivityInfo {
    // timestamp(wall clock) of record creation
    optional uint64 timestamp_millis = 1;
    // stack reported state
    // TODO: replace this with proto enum
    optional int32 stack_state = 2;
    // tx time in millis
    optional uint64 controller_tx_time_millis = 3;
    // rx time in millis
    optional uint64 controller_rx_time_millis = 4;
    // idle time in millis
    optional uint64 controller_idle_time_millis = 5;
    // product of current(mA), voltage(V) and time(ms)
    optional uint64 controller_energy_used = 6;
}

/**
 * Pulls Modem Activity Energy Info
 */
message ModemActivityInfo {
    // timestamp(wall clock) of record creation
    optional uint64 timestamp_millis = 1;
    // sleep time in millis.
    optional uint64 sleep_time_millis = 2;
    // idle time in millis
    optional uint64 controller_idle_time_millis = 3;
    /**
     * Tx power index
     * index 0 = tx_power < 0dBm
     * index 1 = 0dBm < tx_power < 5dBm
     * index 2 = 5dBm < tx_power < 15dBm
     * index 3 = 15dBm < tx_power < 20dBm
     * index 4 = tx_power > 20dBm
     */
    // tx time in ms at power level 0
    optional uint64 controller_tx_time_pl0_millis = 4;
    // tx time in ms at power level 1
    optional uint64 controller_tx_time_pl1_millis = 5;
    // tx time in ms at power level 2
    optional uint64 controller_tx_time_pl2_millis = 6;
    // tx time in ms at power level 3
    optional uint64 controller_tx_time_pl3_millis = 7;
    // tx time in ms at power level 4
    optional uint64 controller_tx_time_pl4_millis = 8;
    // rx time in ms at power level 5
    optional uint64 controller_rx_time_millis = 9;
    // product of current(mA), voltage(V) and time(ms)
    optional uint64 energy_used = 10;
}

/**
 * Pulls Bluetooth Activity Energy Info
 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
 */
message BluetoothActivityInfo {
    // timestamp(wall clock) of record creation
    optional uint64 timestamp_millis = 1;
    // bluetooth stack state
    optional int32 bluetooth_stack_state = 2;
    // tx time in millis
    optional uint64 controller_tx_time_millis = 3;
    // rx time in millis
    optional uint64 controller_rx_time_millis = 4;
    // idle time in millis
    optional uint64 controller_idle_time_millis = 5;
    // product of current(mA), voltage(V) and time(ms)
    optional uint64 energy_used = 6;
}

/*
 * Logs the memory stats for a process.
 *
 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
 */
message ProcessMemoryState {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The process name.
    // Usually package name, "system" for system server.
    // Provided by ActivityManagerService.
    optional string process_name = 2;

    // Current OOM score adjustment. Value read from ProcessRecord.
    optional int32 oom_adj_score = 3;

    // # of page-faults
    optional int64 page_fault = 4;

    // # of major page-faults
    optional int64 page_major_fault = 5;

    // RSS
    // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
    // total_rss if per-app memory cgroups are enabled.
    optional int64 rss_in_bytes = 6;

    // CACHE
    // Value is read from memory.stat, field total_cache if per-app memory
    // cgroups are enabled. Otherwise, 0.
    optional int64 cache_in_bytes = 7;

    // SWAP
    // Value is read from memory.stat, field total_swap if per-app memory
    // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
    optional int64 swap_in_bytes = 8;

    // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
    optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];

    // Elapsed real time when the process started.
    // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
    optional int64 start_time_nanos = 10;
}

/*
 * Logs the memory stats for a native process (from procfs).
 *
 * Pulled from StatsCompanionService for selected native processes.
 */
message NativeProcessMemoryState {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The process name.
    // Value read from /proc/PID/cmdline.
    optional string process_name = 2;

    // # of page-faults
    optional int64 page_fault = 3;

    // # of major page-faults
    optional int64 page_major_fault = 4;

    // RSS
    // Value read from /proc/PID/stat, field 24.
    optional int64 rss_in_bytes = 5;

    // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
    optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];

    // Elapsed real time when the process started.
    // Value is read from /proc/PID/stat, field 22.
    optional int64 start_time_nanos = 7;

    // SWAP
    // Value read from /proc/PID/status, field VmSwap.
    optional int64 swap_in_bytes = 8;
}

/*
 * Logs the memory high-water mark for a process.
 *
 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
 * and for selected native processes.
 *
 * Pulling this atom resets high-water mark counters for all processes.
 */
message ProcessMemoryHighWaterMark {
    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

    // The process name.
    // Usually package name or process cmdline.
    // Provided by ActivityManagerService or read from /proc/PID/cmdline.
    optional string process_name = 2;

    // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
    // /proc/PID/status.
    optional int64 rss_high_water_mark_in_bytes = 3;
}

/*
 * Elapsed real time from SystemClock.
 */
message SystemElapsedRealtime {
    optional uint64 time_millis = 1;
}

/*
 * Up time from SystemClock.
 */
message SystemUptime {
    // Milliseconds since the system was booted.
    // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
    // for external input).
    // It is not affected by clock scaling, idle, or other power saving mechanisms.
    optional uint64 uptime_millis = 1;
}

/*
 * Reads from /proc/uid_concurrent_active_time which has the format:
 * active: X (X is # cores)
 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
 * [uid1]: [time-0] [time-1] [time-2] ... ...
 * ...
 * Time-N means the CPU time a UID spent running concurrently with N other processes.
 * The file contains a monotonically increasing count of time for a single boot.
 */
message CpuActiveTime {
    optional int32 uid = 1 [(is_uid) = true];
    optional uint64 time_millis = 2;
}

/**
 * Reads from /proc/uid_concurrent_policy_time which has the format:
 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
 * ...
 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
 * The file contains a monotonically increasing count of time for a single boot.
 */
message CpuClusterTime {
    optional int32 uid = 1 [(is_uid) = true];
    optional int32 cluster_index = 2;
    optional uint64 time_millis = 3;
}

/*
 * Pulls free disk space, for data, system partition and temporary directory.
 */
message DiskSpace {
    // available bytes in data partition
    optional uint64 data_available_bytes = 1;
    // available bytes in system partition
    optional uint64 system_available_bytes = 2;
    // available bytes in download cache or temp directories
    optional uint64 temp_available_bytes = 3;
}

/**
 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
 *
 * Pulled from StatsCompanionService.java
 */
message RemainingBatteryCapacity {
    optional int32 charge_micro_ampere_hour = 1;
}

/**
 * Pulls battery capacity, which is the battery capacity when full in uAh.
 * Pulled from:
 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
 */
message FullBatteryCapacity {
    optional int32 capacity_micro_ampere_hour = 1;
}

/**
 * Pulls battery voltage.
 * Pulled from:
 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
 */
message BatteryVoltage {
    // The voltage of the battery, in millivolts.
    optional int32 voltage_millivolt = 1;
}

/**
 * Pulls battery level (percent full, from 0 to 100).
 *
 * Pulled from:
 *   frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
 */
message BatteryLevel {
    // Battery level. Should be in [0, 100].
    optional int32 battery_level = 1;
}

/**
 * Pulls the temperature of various parts of the device.
 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
 *
 * Pulled from StatsCompanionService.java
 */
message Temperature {
    // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
    optional android.os.TemperatureTypeEnum sensor_location = 1;

    // The name of the temperature source. Eg. CPU0
    optional string sensor_name = 2;

    // Temperature in tenths of a degree C.
    // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
    optional int32 temperature_deci_celsius = 3;

    // Relative severity of the throttling, see enum definition.
    optional android.os.ThrottlingSeverityEnum severity = 4;
}

/**
 * Pulls the statistics of calls to Binder.
 *
 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
 * config on the device.
 *
 * Next tag: 15
 */
message BinderCalls {
    // UID of the process responsible for the binder transaction. It will be set if the process
    // executing the binder transaction attribute the transaction to another uid using
    // Binder.setThreadWorkSource().
    //
    // If not set, the value will be -1.
    optional int32 uid = 1 [(is_uid) = true];
    // UID of the process executing the binder transaction.
    optional int32 direct_caller_uid = 14;
    // Fully qualified class name of the API call.
    //
    // This is a system server class name.
    //
    // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
    // gets recycled and we have isolated uids, we might attribute the data incorrectly.
    // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
    // commonly used APIs.
    optional string service_class_name = 2;
    // Method name of the API call. It can also be a transaction code if we cannot
    // resolve it to a name. See Binder#getTransactionName.
    //
    // This is a system server method name.
    optional string service_method_name = 3;
    // Total number of API calls.
    optional int64 call_count = 4;
    // True if the screen was interactive PowerManager#isInteractive at the end of the call.
    optional bool screen_interactive = 13;
    // Total number of API calls we have data recorded for. If we collected data for all the calls,
    // call_count will be equal to recorded_call_count.
    //
    // If recorded_call_count is different than call_count, it means data collection has been
    // sampled. All the fields below will be sampled in this case.
    optional int64 recorded_call_count = 12;
    // Number of exceptions thrown by the API.
    optional int64 recorded_exception_count = 5;
    // Total latency of all API calls.
    // Average can be computed using total_latency_micros / recorded_call_count.
    optional int64 recorded_total_latency_micros = 6;
    // Maximum latency of one API call.
    optional int64 recorded_max_latency_micros = 7;
    // Total CPU usage of all API calls.
    // Average can be computed using total_cpu_micros / recorded_call_count.
    // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
    optional int64 recorded_total_cpu_micros = 8;
    // Maximum CPU usage of one API call.
    optional int64 recorded_max_cpu_micros = 9;
    // Maximum parcel reply size of one API call.
    optional int64 recorded_max_reply_size_bytes = 10;
    // Maximum parcel request size of one API call.
    optional int64 recorded_max_request_size_bytes = 11;
}

/**
 * Pulls the statistics of exceptions during calls to Binder.
 *
 * Binder stats are cumulative from boot unless somebody reset the data using
 * > adb shell dumpsys binder_calls_stats --reset
 */
message BinderCallsExceptions {
    // Exception class name, e.g. java.lang.IllegalArgumentException.
    //
    // This is an exception class name thrown by the system server.
    optional string exception_class_name = 1;
    // Total number of exceptions.
    optional int64 exception_count = 2;
}

/**
 * Pulls the statistics of message dispatching on HandlerThreads.
 *
 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
 * config on the device.
 *
 * Next tag: 11
 */
message LooperStats {
    // The uid that made a call to the System Server and caused the message to be enqueued.
    optional int32 uid = 1 [(is_uid) = true];

    // Fully qualified class name of the handler target class.
    //
    // This field does not contain PII. This is a system server class name.
    optional string handler_class_name = 2;

    // The name of the thread that runs the Looper.
    //
    // This field does not contain PII. This is a system server thread name.
    optional string looper_thread_name = 3;

    // The name of the dispatched message.
    //
    // This field does not contain PII. This is a system server constant or class
    // name.
    optional string message_name = 4;

    // Total number of successfully dispatched messages.
    optional int64 message_count = 5;

    // Total number of messages that failed dispatching.
    optional int64 exception_count = 6;

    // Total number of processed messages we have data recorded for. If we
    // collected data for all the messages, message_count will be equal to
    // recorded_message_count.
    //
    // If recorded_message_count is different than message_count, it means data
    // collection has been sampled. The fields below will be sampled in this case.
    optional int64 recorded_message_count = 7;

    // Total latency of all processed messages.
    // Average can be computed using recorded_total_latency_micros /
    // recorded_message_count.
    optional int64 recorded_total_latency_micros = 8;

    // Total CPU usage of all processed message.
    // Average can be computed using recorded_total_cpu_micros /
    // recorded_message_count. Total can be computed using
    // recorded_total_cpu_micros / recorded_message_count * message_count.
    optional int64 recorded_total_cpu_micros = 9;

    // True if the screen was interactive PowerManager#isInteractive at the end of the call.
    optional bool screen_interactive = 10;

    // Max recorded CPU usage of all processed messages.
    optional int64 recorded_max_cpu_micros = 11;

    // Max recorded latency of all processed messages.
    optional int64 recorded_max_latency_micros = 12;

    // Total number of messages we tracked the dispatching delay for. If we
    // collected data for all the messages, message_count will be equal to
    // recorded_delay_message_count.
    //
    // If recorded_delay_message_count is different than message_count, it means data
    // collection has been sampled or/and not all messages specified the target dispatch time.
    // The fields below will be sampled in this case.
    optional int64 recorded_delay_message_count = 13;

    // Total dispatching delay of all processed messages.
    // Calculated as a difference between the target dispatching time (Message.when)
    // and the actual dispatching time.
    // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
    optional int64 recorded_total_delay_millis = 14;

    // Max dispatching delay of all processed messages.
    // Calculated as a difference between the target dispatching time (Message.when)
    // and the actual dispatching time.
    optional int64 recorded_max_delay_millis = 15;
}

/**
 * Pulls disk information, such as write speed and latency.
 */
message DiskStats {
    // Time taken to open, write 512B to, and close a file.
    // -1 if error performing the check.
    optional int64 data_write_latency_millis = 1;

    optional bool file_based_encryption = 2;

    // Recent disk write speed in kB/s.
    // -1 if error querying storageed.
    // 0 if data is unavailable.
    optional int32 recent_disk_write_speed = 3;
}


/**
 * Free and total bytes of the Data, Cache, and System partition.
 */
message DirectoryUsage {
    enum Directory {
        UNKNOWN = 0;
        DATA = 1;
        CACHE = 2;
        SYSTEM = 3;
    }
    optional Directory directory = 1;
    optional int64 free_bytes = 2;
    optional int64 total_bytes = 3;
}


/**
 * Size of an application: apk size, data size, and cache size.
 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
 * Information is only reported for apps with the primary user (user 0).
 * Sizes are aggregated by package name.
 */
message AppSize {
    // Including uids will involve modifying diskstats logic.
    optional string package_name = 1;
    // App size in bytes. -1 if unavailable.
    optional int64 app_size_bytes = 2;
    // App data size in bytes. -1 if unavailable.
    optional int64 app_data_size_bytes = 3;
    // App cache size in bytes. -1 if unavailable.
    optional int64 app_cache_size_bytes = 4;
    // Time that the cache file was produced.
    // Uses System.currentTimeMillis(), which is wall clock time.
    optional int64 cache_time_millis = 5;
}


/**
 * Size of a particular category. Eg: photos, videos.
 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
 */
message CategorySize {
    enum Category {
        UNKNOWN = 0;
        APP_SIZE = 1;
        APP_DATA_SIZE = 2;
        APP_CACHE_SIZE = 3;
        PHOTOS = 4;
        VIDEOS = 5;
        AUDIO = 6;
        DOWNLOADS = 7;
        SYSTEM = 8;
        OTHER = 9;
    }
    optional Category category = 1;
    // Category size in bytes.
    optional int64 size_bytes = 2;
    // Time that the cache file was produced.
    // Uses System.currentTimeMillis(), which is wall clock time.
    optional int64 cache_time_millis = 3;
}

/**
 * Pulls per uid I/O stats. The stats are cumulative since boot.
 *
 * Read/write bytes are I/O events from a storage device
 * Read/write chars are data requested by read/write syscalls, and can be
 *   satisfied by caching.
 *
 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
 */
message DiskIo {
    optional int32 uid = 1 [(is_uid) = true];
    optional int64 fg_chars_read = 2;
    optional int64 fg_chars_write = 3;
    optional int64 fg_bytes_read = 4;
    optional int64 fg_bytes_write = 5;
    optional int64 bg_chars_read = 6;
    optional int64 bg_chars_write = 7;
    optional int64 bg_bytes_read = 8;
    optional int64 bg_bytes_write = 9;
    optional int64 fg_fsync = 10;
    optional int64 bg_fsync= 11;
}


/**
 * Pulls the number of fingerprints for each user.
 *
 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
 */
message NumFingerprintsEnrolled {
    // The associated user. Eg: 0 for owners, 10+ for others.
    // Defined in android/os/UserHandle.java
    optional int32 user = 1;
    // Number of fingerprints registered to that user.
    optional int32 num_fingerprints_enrolled = 2;
}

/**
 * Pulls the number of faces for each user.
 *
 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
 */
message NumFacesEnrolled {
    // The associated user. Eg: 0 for owners, 10+ for others.
    // Defined in android/os/UserHandle.java
    optional int32 user = 1;
    // Number of faces registered to that user.
    optional int32 num_faces_enrolled = 2;
}
/**
 * A mapping of role holder -> role
 */
message RoleHolder {
    // uid of the role holder
    optional int32 uid = 1 [(is_uid) = true];

    // package name of the role holder
    optional string package_name = 2;

    // the role held
    optional string role = 3;
}

message AggStats {
    optional int64 min = 1;

    optional int64 average = 2;

    optional int64 max = 3;
}

message ProcessStatsStateProto {
    optional android.service.procstats.ScreenState screen_state = 1;

    optional android.service.procstats.MemoryState memory_state = 2;

    // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
    // and not frameworks/base/core/java/android/app/ActivityManager.java
    optional android.service.procstats.ProcessState process_state = 3;

    // Millisecond uptime duration spent in this state
    optional int64 duration_millis = 4;

    // Millisecond elapsed realtime duration spent in this state
    optional int64 realtime_duration_millis = 9;

    // # of samples taken
    optional int32 sample_size = 5;

    // PSS is memory reserved for this process
    optional AggStats pss = 6;

    // USS is memory shared between processes, divided evenly for accounting
    optional AggStats uss = 7;

    // RSS is memory resident for this process
    optional AggStats rss = 8;
}

// Next Tag: 7
message ProcessStatsProto {
    // Name of process.
    optional string process = 1;

    // Uid of the process.
    optional int32 uid = 2;

    // Information about how often kills occurred
    message Kill {
        // Count of excessive CPU kills
        optional int32 cpu = 1;

        // Count of kills when cached
        optional int32 cached = 2;

        // PSS stats during cached kill
        optional AggStats cached_pss = 3;
    }
    optional Kill kill = 3;

    // Time and memory spent in various states.
    repeated ProcessStatsStateProto states = 5;

    // Total time process has been running...  screen_state, memory_state, and process_state
    // will not be set.
    optional ProcessStatsStateProto total_running_state = 6;
}

message PackageServiceOperationStatsProto {
    // Operate enum: Started, Foreground, Bound, Executing
    optional android.service.procstats.ServiceOperationState operation = 1;

    // Number of times the service was in this operation.
    optional int32 count = 2;

    // Information about a state the service can be in.
    message StateStats {
        // Screen state enum.
        optional android.service.procstats.ScreenState screen_state = 1;
        // Memory state enum.
        optional android.service.procstats.MemoryState memory_state = 2;

        // duration in milliseconds.
        optional int64 duration_millis = 3;
        // Millisecond elapsed realtime duration spent in this state
        optional int64 realtime_duration_millis = 4;
    }
    repeated StateStats state_stats = 3;
}

message PackageServiceStatsProto {
    // Name of service component.
    optional string service_name = 1;

    // The operation stats.
    // The package_name, package_uid, package_version, service_name will not be set to save space.
    repeated PackageServiceOperationStatsProto operation_stats = 2;
}

message PackageAssociationSourceProcessStatsProto {
    // Uid of the process.
    optional int32 process_uid = 1;
    // Process name.
    optional string process_name = 2;
    // Package name.
    optional string package_name = 7;
    // Total count of the times this association appeared.
    optional int32 total_count = 3;

    // Millisecond uptime total duration this association was around.
    optional int64 total_duration_millis = 4;

    // Total count of the times this association became actively impacting its target process.
    optional int32 active_count = 5;

    // Information on one source in this association.
    message StateStats {
        // Process state enum.
        optional android.service.procstats.ProcessState process_state = 1;
        // Millisecond uptime duration spent in this state
        optional int64 duration_millis = 2;
        // Millisecond elapsed realtime duration spent in this state
        optional int64 realtime_duration_mmillis = 3;
    }
    repeated StateStats active_state_stats = 6;
}

message PackageAssociationProcessStatsProto {
    // Name of the target component.
    optional string component_name = 1;
    // Information on one source in this association.
    repeated PackageAssociationSourceProcessStatsProto sources = 2;
}


message ProcessStatsPackageProto {
    // Name of package.
    optional string package = 1;

    // Uid of the package.
    optional int32 uid = 2;

    // Version of the package.
    optional int64 version = 3;

    // Stats for each process running with the package loaded in to it.
    repeated ProcessStatsProto process_stats = 4;

    // Stats for each of the package's services.
    repeated PackageServiceStatsProto service_stats = 5;

    // Stats for each association with the package.
    repeated PackageAssociationProcessStatsProto association_stats = 6;
}

message ProcessStatsSectionProto {
    // Elapsed realtime at start of report.
    optional int64 start_realtime_millis = 1;

    // Elapsed realtime at end of report.
    optional int64 end_realtime_millis = 2;

    // CPU uptime at start of report.
    optional int64 start_uptime_millis = 3;

    // CPU uptime at end of report.
    optional int64 end_uptime_millis = 4;

    // System runtime library. e.g. "libdvm.so", "libart.so".
    optional string runtime = 5;

    // whether kernel reports swapped pss.
    optional bool has_swapped_pss = 6;

    // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
    enum Status {
        STATUS_UNKNOWN = 0;
        STATUS_COMPLETE = 1;
        STATUS_PARTIAL = 2;
        STATUS_SHUTDOWN = 3;
        STATUS_SYSPROPS = 4;
    }
    repeated Status status = 7;

    // Number of pages available of various types and sizes, representation fragmentation.
    repeated ProcessStatsAvailablePagesProto available_pages = 10;

    // Stats for each process.
    repeated ProcessStatsProto process_stats = 8;

    // Stats for each package.
    repeated ProcessStatsPackageProto package_stats = 9;
}

message ProcessStatsAvailablePagesProto {
    // Node these pages are in (as per /proc/pagetypeinfo)
    optional int32 node = 1;

    // Zone these pages are in (as per /proc/pagetypeinfo)
    optional string zone = 2;

    // Label for the type of these pages (as per /proc/pagetypeinfo)
    optional string label = 3;

    // Distribution of number of pages available by order size.  First entry in array is
    // order 0, second is order 1, etc.  Each order increase is a doubling of page size.
    repeated int32 pages_per_order = 4;
}

/**
 * Pulled from ProcessStatsService.java
 */
message ProcStats {
    optional ProcessStatsSectionProto proc_stats_section = 1;
}

/**
 * Pulled from ProcessStatsService.java
 */
message ProcStatsPkgProc {
    optional ProcessStatsSectionProto proc_stats_section = 1;
}

message PowerProfileProto {
    optional double cpu_suspend = 1;

    optional double cpu_idle = 2;

    optional double cpu_active = 3;

    message CpuCluster {
        optional int32 id = 1;
        optional double cluster_power = 2;
        optional int32 cores = 3;
        repeated int64 speed = 4;
        repeated double core_power = 5;
    }

    repeated CpuCluster cpu_cluster = 40;

    optional double wifi_scan = 4;

    optional double wifi_on = 5;

    optional double wifi_active = 6;

    optional double wifi_controller_idle = 7;

    optional double wifi_controller_rx = 8;

    optional double wifi_controller_tx = 9;

    repeated double wifi_controller_tx_levels = 10;

    optional double wifi_controller_operating_voltage = 11;

    optional double bluetooth_controller_idle = 12;

    optional double bluetooth_controller_rx = 13;

    optional double bluetooth_controller_tx = 14;

    optional double bluetooth_controller_operating_voltage = 15;

    optional double modem_controller_sleep = 16;

    optional double modem_controller_idle = 17;

    optional double modem_controller_rx = 18;

    repeated double modem_controller_tx = 19;

    optional double modem_controller_operating_voltage = 20;

    optional double gps_on = 21;

    repeated double gps_signal_quality_based = 22;

    optional double gps_operating_voltage = 23;

    optional double bluetooth_on = 24;

    optional double bluetooth_active = 25;

    optional double bluetooth_at_cmd = 26;

    optional double ambient_display = 27;

    optional double screen_on = 28;

    optional double radio_on = 29;

    optional double radio_scanning = 30;

    optional double radio_active = 31;

    optional double screen_full = 32;

    optional double audio = 33;

    optional double video = 34;

    optional double flashlight = 35;

    optional double memory = 36;

    optional double camera = 37;

    optional double wifi_batched_scan = 38;

    optional double battery_capacity = 39;
}

/**
 * power_profile.xml and other constants for power model calculations.
 * Pulled from PowerProfile.java
 */
message PowerProfile {
    optional PowerProfileProto power_profile = 1;
}

/**
 * Logs when a user restriction was added or removed.
 *
 * Logged from:
 *   frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
 */
message UserRestrictionChanged {
    // The raw string of the user restriction as defined in UserManager.
    // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
    optional string restriction = 1;
    // Whether the restriction is enabled or disabled.
    optional bool enabled = 2;
}

/**
 * Pulls process user time and system time. Puller takes a snapshot of all pids
 * in the system and returns cpu stats for those that are working at the time.
 * Dead pids will be dropped. Kernel processes are excluded.
 * Min cool-down is 5 sec.
 */
message ProcessCpuTime {
    optional int32 uid = 1 [(is_uid) = true];

    optional string process_name = 2;
    // Process cpu time in user space, cumulative from boot/process start
    optional int64 user_time_millis = 3;
    // Process cpu time in system space, cumulative from boot/process start
    optional int64 system_time_millis = 4;
}

/**
 * Pulls the CPU usage for each thread.
 *
 * Read from /proc/$PID/task/$TID/time_in_state files.
 *
 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
 * time_in_state files not being present on some phones, have not been addressed. These should be
 * considered before a public release.
 */
message CpuTimePerThreadFreq {
    // UID that owns the process.
    optional int32 uid = 1 [(is_uid) = true];
    // ID of the process.
    optional int32 process_id = 2;
    // ID of the thread.
    optional int32 thread_id = 3;
    // Name of the process taken from `/proc/$PID/cmdline`.
    optional string process_name = 4;
    // Name of the thread taken from `/proc/$PID/task/$TID/comm`
    optional string thread_name = 5;

    // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
    // are given in KHz, and time is given in milliseconds since the thread started. All eight
    // frequencies are given here as the alternative is sending eight separate atoms. This method
    // significantly reduces the amount of data created
    optional int32 frequency1_khz = 6;
    optional int32 time1_millis = 7;
    optional int32 frequency2_khz = 8;
    optional int32 time2_millis = 9;
    optional int32 frequency3_khz = 10;
    optional int32 time3_millis = 11;
    optional int32 frequency4_khz = 12;
    optional int32 time4_millis = 13;
    optional int32 frequency5_khz = 14;
    optional int32 time5_millis = 15;
    optional int32 frequency6_khz = 16;
    optional int32 time6_millis = 17;
    optional int32 frequency7_khz = 18;
    optional int32 time7_millis = 19;
    optional int32 frequency8_khz = 20;
    optional int32 time8_millis = 21;
}

/**
 * Pulls information about the device's build.
 */
message BuildInformation {
    // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
    // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
    optional string fingerprint = 1;

    // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
    optional string brand = 2;

    // Build.PRODUCT. The name of the overall product.
    optional string product = 3;

    // Build.DEVICE. The name of the industrial design.
    optional string device = 4;

    // Build.VERSION.RELEASE. The user-visible version string.  E.g., "1.0" or "3.4b5" or "bananas".
    optional string version_release = 5;

    // Build.ID. E.g. a label like "M4-rc20".
    optional string id = 6;

    // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
    // represent this build.
    optional string version_incremental = 7;

    // Build.TYPE. The type of build, like "user" or "eng".
    optional string type = 8;

    // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
    optional string tags = 9;
}

/**
 * Logs information about mismatched caller for content capture.
 *
 * Logged from:
 *   frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
 */
message ContentCaptureCallerMismatchReported {
    optional string intended_package = 1;
    optional string calling_package = 2;
}

/**
 * Logs information about content capture service events.
 *
 * Logged from:
 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
 */
message ContentCaptureServiceEvents {
    // The type of event.
    enum Event {
        UNKNOWN = 0;
        ON_CONNECTED = 1;
        ON_DISCONNECTED = 2;
        SET_WHITELIST = 3;
        SET_DISABLED = 4;
        ON_USER_DATA_REMOVED = 5;
    }
    optional Event event = 1;
    // component/package of content capture service.
    optional string service_info = 2;
    // component/package of target.
    // it's a concatenated list of component/package for SET_WHITELIST event
    // separated by " ".
    optional string target_info = 3;
}

/**
 * Logs information about content capture session events.
 *
 * Logged from:
 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
 */
message ContentCaptureSessionEvents {
    // The type of event.
    enum Event {
        UNKNOWN = 0;
        ON_SESSION_STARTED = 1;
        ON_SESSION_FINISHED = 2;
        SESSION_NOT_CREATED = 3;
    }
    optional int32 session_id = 1;
    optional Event event = 2;
    // (n/a on session finished)
    optional int32 state_flags = 3;
    // component/package of content capture service.
    optional string service_info = 4;
    // component/package of app.
    // (n/a on session finished)
    optional string app_info = 5;
    optional bool is_child_session = 6;
}

/**
 * Logs information about session being flushed.
 *
 * Logged from:
 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
 */
message ContentCaptureFlushed {
    optional int32 session_id = 1;
    // component/package of content capture service.
    optional string service_info = 2;
    // component/package of app.
    optional string app_info = 3;
    // session start/finish events
    optional int32 child_session_started = 4;
    optional int32 child_session_finished = 5;
    // count of view events.
    optional int32 view_appeared_count = 6;
    optional int32 view_disappeared_count = 7;
    optional int32 view_text_changed_count = 8;

    // Flush stats.
    optional int32 max_events = 9;
    optional int32 idle_flush_freq = 10;
    optional int32 text_flush_freq = 11;
    optional int32 flush_reason = 12;
}

/**
 * Pulls on-device BatteryStats power use calculations for the overall device.
 */
message DeviceCalculatedPowerUse {
    // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
    // BatteryStats last reset (i.e. roughly since device was last significantly charged).
    // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
    optional int64 computed_power_nano_amp_secs = 1;
}

/**
 * Pulls on-device BatteryStats power use calculations broken down by uid.
 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
 * that is attributed to non-uid items. They must all be included to get the total power use.
 */
message DeviceCalculatedPowerBlameUid {
    // Uid being blamed. Note: isolated uids have already been mapped to host uid.
    optional int32 uid = 1 [(is_uid) = true];

    // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
    // BatteryStats last reset (i.e. roughly since device was last significantly charged).
    optional int64 power_nano_amp_secs = 2;
}

/**
 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
 * drain type.
 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
 * is attributed uids. They must all be included to get the total power use.
 */
message DeviceCalculatedPowerBlameOther {
    // The type of item whose power use is being reported.
    enum DrainType {
        AMBIENT_DISPLAY = 0;
        // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
        BLUETOOTH = 2;
        CAMERA = 3;
        // Cell-standby
        CELL = 4;
        FLASHLIGHT = 5;
        IDLE = 6;
        MEMORY = 7;
        // Amount that total computed drain exceeded the drain estimated using the
        // battery level changes and capacity.
        OVERCOUNTED = 8;
        PHONE = 9;
        SCREEN = 10;
        // Amount that total computed drain was below the drain estimated using the
        // battery level changes and capacity.
        UNACCOUNTED = 11;
        // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
        WIFI = 13;
    }
    optional DrainType drain_type = 1;

    // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
    // BatteryStats last reset (i.e. roughly since device was last significantly charged).
    optional int64 power_nano_amp_secs = 2;
}

/**
 * Logs device policy features.
 *
 * Logged from:
 *   frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
 *   packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
 */
message DevicePolicyEvent {
    // The event id - unique for each event.
    optional android.stats.devicepolicy.EventId event_id = 1;
    // The admin package name.
    optional string admin_package_name = 2;
    // A generic integer parameter.
    optional int32 integer_value = 3;
    // A generic boolean parameter.
    optional bool boolean_value = 4;
    // A parameter specifying a time period in milliseconds.
    optional uint64 time_period_millis = 5;
    // A parameter specifying a list of package names, bundle extras or string parameters.
    optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
}

/**
 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUILaunchReported {
    optional android.stats.docsui.LaunchAction launch_action = 1;
    optional bool has_initial_uri = 2;
    optional android.stats.docsui.MimeType mime_type = 3;
    optional android.stats.docsui.Root initial_root = 4;
}

/**
 * Logs root/app visited event in file managers/picker. Call this when the user
 * taps on root/app in hamburger menu.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIRootVisitedReported {
    optional android.stats.docsui.ContextScope scope = 1;
    optional android.stats.docsui.Root root = 2;
}

/**
 * Logs file operation stats. Call this when a file operation has completed.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIFileOperationReported {
    optional android.stats.docsui.Provider provider = 1;
    optional android.stats.docsui.FileOperation file_op = 2;
}

/**
 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
 * mode.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIFileOperationCopyMoveModeReported {
    optional android.stats.docsui.FileOperation file_op = 1;
    optional android.stats.docsui.CopyMoveOpMode mode = 2;
}


/**
 * Logs file sub operation stats. Call this when a file operation has failed.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIFileOperationFailureReported {
    optional android.stats.docsui.Authority authority = 1;
    optional android.stats.docsui.SubFileOperation sub_op = 2;
}

/**
* Logs the cancellation of a file operation. Call this when a job is canceled
*
* Logged from:
*     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
*/
message DocsUIFileOperationCanceledReported {
    optional android.stats.docsui.FileOperation file_op = 1;
}

/**
 * Logs startup time in milliseconds.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIStartupMsReported {
    optional int32 startup_millis = 1;
}

/**
 * Logs the action that was started by user.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIUserActionReported {
    optional android.stats.docsui.UserAction action = 1;
}

/**
 * Logs the invalid type when invalid scoped access is requested.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
 */
message DocsUIInvalidScopedAccessRequestReported {
    optional android.stats.docsui.InvalidScopedAccess type = 1;
}

/**
 * Logs the package name that launches docsui picker mode.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIPickerLaunchedFromReported {
    optional string package_name = 1;
}

/**
 * Logs the search type.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUISearchTypeReported {
    optional android.stats.docsui.SearchType search_type = 1;
}

/**
 * Logs the search mode.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUISearchModeReported {
    optional android.stats.docsui.SearchMode search_mode = 1;
}

/**
 * Logs the pick result information.
 *
 * Logged from:
 *     package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
 */
message DocsUIPickResultReported {
    optional int32 total_action_count = 1;
    optional int64 duration_millis = 2;
    optional int32 file_count= 3;
    optional bool is_searching = 4;
    optional android.stats.docsui.Root picked_from = 5;
    optional android.stats.docsui.MimeType mime_type = 6;
    optional int32 repeatedly_pick_times = 7;
}

/**
 * Logs when an app's memory is compacted.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message AppCompacted {
  // The pid of the process being compacted.
  optional int32 pid = 1;

  // The name of the process being compacted.
  optional string process_name = 2;

  // The type of compaction.
  enum Action {
    UNKNOWN = 0;
    SOME = 1;
    FULL = 2;
    PERSISTENT = 3;
    BFGS = 4;
  }
  optional Action action = 3;

  // Total RSS in kilobytes consumed by the process prior to compaction.
  optional int64 before_rss_total_kilobytes = 4;

  // File RSS in kilobytes consumed by the process prior to compaction.
  optional int64 before_rss_file_kilobytes = 5;

  // Anonymous RSS in kilobytes consumed by the process prior to compaction.
  optional int64 before_rss_anon_kilobytes = 6;

  // Swap in kilobytes consumed by the process prior to compaction.
  optional int64 before_swap_kilobytes = 7;

  // Total RSS in kilobytes consumed by the process after compaction.
  optional int64 after_rss_total_kilobytes = 8;

  // File RSS in kilobytes consumed by the process after compaction.
  optional int64 after_rss_file_kilobytes = 9;

  // Anonymous RSS in kilobytes consumed by the process after compaction.
  optional int64 after_rss_anon_kilobytes = 10;

  // Swap in kilobytes consumed by the process after compaction.
  optional int64 after_swap_kilobytes = 11;

  // The time taken to perform compaction in milliseconds.
  optional int64 time_to_compact_millis = 12;

  // The last compaction action performed for this app.
  optional Action last_action = 13;

  // The last time that compaction was attempted on this process in milliseconds
  // since boot, not including sleep (see SystemClock.uptimeMillis()).
  optional int64 last_compact_timestamp_ms_since_boot = 14;

  // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
  optional int32 oom_score_adj = 15;

  // The process state at the time of compaction.
  optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];

  // Free ZRAM in kilobytes before compaction.
  optional int64 before_zram_free_kilobytes = 17;

  // Free ZRAM in kilobytes after compaction.
  optional int64 after_zram_free_kilobytes = 18;
}

/**
 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
 *
 * The NetworkDnsEventReported message represents the entire lookup operation, which may
 * result one or more queries to the recursive DNS resolvers. Those are individually logged
 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
 * broken up by query type, transport, network interface, etc.
 */
message NetworkDnsEventReported {
    optional android.stats.dnsresolver.EventType event_type = 1;

    optional android.stats.dnsresolver.ReturnCode return_code = 2;

    // The latency in microseconds of the entire DNS lookup operation.
    optional int32 latency_micros = 3;

    // Only valid for event_type = EVENT_GETADDRINFO.
    optional int32 hints_ai_flags = 4;

    // Flags passed to android_res_nsend() defined in multinetwork.h
    // Only valid for event_type = EVENT_RESNSEND.
    optional int32 res_nsend_flags = 5;

    optional android.stats.dnsresolver.Transport network_type = 6;

    // The DNS over TLS mode on a specific netId.
    optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;

    // Additional pass-through fields opaque to statsd.
    // The DNS resolver Mainline module can add new fields here without requiring an OS update.
    optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
}

/**
 * Logs when a data stall event occurs.
 *
 * Log from:
 *     frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
 */
message DataStallEvent {
    // Data stall evaluation type.
    // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
    // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
    optional int32 evaluation_type = 1;
    // See definition in data_stall_event.proto.
    optional com.android.server.connectivity.ProbeResult validation_result = 2;
    // See definition in data_stall_event.proto.
    optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
    // See definition in data_stall_event.proto.
    optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
    // See definition in data_stall_event.proto.
    optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
    // See definition in data_stall_event.proto.
    optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
}

/*
 * Logs when RescueParty resets some set of experiment flags.
 *
 * Logged from:
 *     frameworks/base/services/core/java/com/android/server/RescueParty.java
 */
message RescuePartyResetReported {
    // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
    optional int32 rescue_level = 1;
}

/**
 * Logs when signed config is received from an APK, and if that config was applied successfully.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
 */
message SignedConfigReported {
    enum Type {
        UNKNOWN_TYPE = 0;
        GLOBAL_SETTINGS = 1;
    }
    optional Type type = 1;

    // The final status of the signed config received.
    enum Status {
        UNKNOWN_STATUS = 0;
        APPLIED = 1;
        BASE64_FAILURE_CONFIG = 2;
        BASE64_FAILURE_SIGNATURE = 3;
        SECURITY_EXCEPTION = 4;
        INVALID_CONFIG = 5;
        OLD_CONFIG = 6;
        SIGNATURE_CHECK_FAILED = 7;
        NOT_APPLICABLE = 8;
        SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
    }
    optional Status status = 2;

    // The version of the signed config processed.
    optional int32 version = 3;

    // The package name that the config was extracted from.
    optional string from_package = 4;

    enum Key {
        NO_KEY = 0;
        DEBUG = 1;
        PRODUCTION = 2;
    }
    // Which key was used to verify the config.
    optional Key verified_with = 5;
}

/*
 * Logs GNSS Network-Initiated (NI) location events.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
 */
message GnssNiEventReported {
    // The type of GnssNiEvent.
    enum EventType {
        UNKNOWN = 0;
        NI_REQUEST = 1;
        NI_RESPONSE = 2;
    }
    optional EventType event_type = 1;

    // An ID generated by HAL to associate NI notifications and UI responses.
    optional int32 notification_id = 2;

    // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
    optional android.server.location.GnssNiType ni_type = 3;

    // NI requires notification.
    optional bool need_notify = 4;

    // NI requires verification.
    optional bool need_verify = 5;

    // NI requires privacy override, no notification/minimal trace.
    optional bool privacy_override = 6;

    // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
    // seconds.
    optional int32 timeout = 7;

    // Default response when timeout.
    optional android.server.location.GnssUserResponseType default_response = 8;

    // String representing the requester of the network inititated location request.
    optional string requestor_id = 9;

    // Notification message text string representing the service(for eg. SUPL-service) who sent the
    // network initiated location request.
    optional string text = 10;

    // requestorId decoding scheme.
    optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;

    // Notification message text decoding scheme.
    optional android.server.location.GnssNiEncodingType text_encoding = 12;

    // True if SUPL ES is enabled.
    optional bool is_supl_es_enabled = 13;

    // True if GNSS location is enabled.
    optional bool is_location_enabled = 14;

    // GNSS NI responses which define the response in NI structures.
    optional android.server.location.GnssUserResponseType user_response = 15;
}

/**
 * Logs GNSS non-framework (NFW) location notification.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
 */
message GnssNfwNotificationReported {
    // Package name of the Android proxy application representing the non-framework entity that
    // requested location. Set to empty string if unknown.
    optional string proxy_app_package_name = 1;

    // Protocol stack that initiated the non-framework location request.
    optional android.server.location.NfwProtocolStack protocol_stack = 2;

    // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
    // set to empty string. This field is opaque to the framework and used for logging purposes.
    optional string other_protocol_stack_name = 3;

    // Source initiating/receiving the location information.
    optional android.server.location.NfwRequestor requestor = 4;

    // Identity of the endpoint receiving the location information. For example, carrier name, OEM
    // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
    // and used for logging purposes.
    optional string requestor_id = 5;

    // Indicates whether location information was provided for this request.
    optional android.server.location.NfwResponseType response_type = 6;

    // True if the device is in user initiated emergency session.
    optional bool in_emergency_mode = 7;

    // True if cached location is provided.
    optional bool is_cached_location = 8;

    // True if proxy app permission mismatch between framework and GNSS HAL.
    optional bool is_permission_mismatched = 9;
}

/**
 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
 */
message GnssConfigurationReported {
    // SUPL host name.
    optional string supl_host = 1;

    // SUPL port number.
    optional int32 supl_port = 2;

    // C2K host name.
    optional string c2k_host = 3;

    // C2K port number.
    optional int32 c2k_port = 4;

    // The SUPL version requested by Carrier.
    optional int32 supl_ver = 5;

    // The SUPL mode.
    optional android.server.location.SuplMode supl_mode = 6;

    // True if NI emergency SUPL restrictions is enabled.
    optional bool supl_es = 7;

    // LTE Positioning Profile settings
    optional android.server.location.LppProfile lpp_profile = 8;

    // Positioning protocol on A-Glonass system.
    optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;

    // True if emergency PDN is used. Otherwise, regular PDN is used.
    optional bool use_emergency_pdn_for_emergency_supl= 10;

    // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
    optional android.server.location.GpsLock gps_lock = 11;

    // Number of seconds to extend the emergency session duration post emergency call.
    optional int32 es_extension_sec = 12;

    // The full list of package names of proxy Android applications representing the non-framework
    // location access entities (on/off the device) for which the framework user has granted
    // non-framework location access permission. The package names are concatenated in one string
    // with spaces as separators.
    optional string enabled_proxy_app_package_name_list = 13;
}

/**
 * Logs when a NFC device's error occurred.
 * Logged from:
 *     system/nfc/src/nfc/nfc/nfc_ncif.cc
 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
 */
message NfcErrorOccurred {
    enum Type {
        UNKNOWN = 0;
        CMD_TIMEOUT = 1;
        ERROR_NOTIFICATION = 2;
        AID_OVERFLOW = 3;
    }
    optional Type type = 1;
    // If it's nci cmd timeout, log the timeout command.
    optional uint32 nci_cmd = 2;

    optional uint32 error_ntf_status_code = 3;
}

/**
 * Logs when a NFC device's state changed event
 * Logged from:
 *     packages/apps/Nfc/src/com/android/nfc/NfcService.java
 */
message NfcStateChanged {
    enum State {
        UNKNOWN = 0;
        OFF = 1;
        ON = 2;
        ON_LOCKED = 3; // Secure Nfc enabled.
        CRASH_RESTART = 4; // NfcService watchdog timeout restart.
    }
    optional State state = 1;
}

/**
 * Logs when a NFC Beam Transaction occurred.
 * Logged from:
 *     packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
 */
message NfcBeamOccurred {
    enum Operation {
        UNKNOWN = 0;
        SEND = 1;
        RECEIVE = 2;
    }
    optional Operation operation = 1;
}

/**
 * Logs when a NFC Card Emulation Transaction occurred.
 * Logged from:
 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
 *     packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
 */
message NfcCardemulationOccurred {
    enum Category {
        UNKNOWN = 0;
        HCE_PAYMENT = 1;
        HCE_OTHER = 2;
        OFFHOST = 3;
    }
    // Transaction belongs to HCE payment or HCE other category, or offhost.
    optional Category category = 1;
    // SeName from transaction: SIMx, eSEx, HCE, HCEF.
    optional string se_name = 2;
}

/**
 * Logs when a NFC Tag event occurred.
 * Logged from:
 *     packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
 */
message NfcTagOccurred {
    enum Type {
        UNKNOWN = 0;
        URL = 1;
        BT_PAIRING = 2;
        PROVISION = 3;
        WIFI_CONNECT = 4;
        APP_LAUNCH = 5;
        OTHERS = 6;
    }
    optional Type type = 1;
}

/**
 * Logs when Hce transaction triggered
 * Logged from:
 *     system/nfc/src/nfc/nfc/nfc_ncif.cc
 */
message NfcHceTransactionOccurred {
    // The latency period(in microseconds) it took for the first HCE data
    // exchange.
    optional uint32 latency_micros = 1;
}

/**
 * Logs when SecureElement state event changed
 * Logged from:
 *     packages/apps/SecureElement/src/com/android/se/Terminal.java
 */
message SeStateChanged {
    enum State {
        UNKNOWN = 0;
        INITIALIZED = 1;
        DISCONNECTED = 2;
        CONNECTED = 3;
        HALCRASH = 4;
    }
    optional State state = 1;

    optional string state_change_reason = 2;
    // SIMx or eSEx.
    optional string terminal = 3;
}

/**
 * Information about a permission grant request
 */
message PermissionGrantRequestResultReported {
    // unique value identifying an API call. A API call might result in multiple of these atoms
    optional int64 request_id = 1;

    // UID of package requesting the permission grant
    optional int32 requesting_uid = 2 [(is_uid) = true];

    // Name of package requesting the permission grant
    optional string requesting_package_name = 3;

    // The permission to be granted
    optional string permission_name = 4;

    // If the permission was explicitly requested via the API or added by the system
    optional bool is_implicit = 5;

    enum Result {
        UNDEFINED = 0;
        // permission request was ignored
        IGNORED = 1;
        // permission request was ignored because it was user fixed
        IGNORED_USER_FIXED = 2;
        // permission request was ignored because it was policy fixed
        IGNORED_POLICY_FIXED = 3;
        // permission was granted by user action
        USER_GRANTED = 4;
        // permission was automatically granted
        AUTO_GRANTED = 5;
        // permission was denied by user action
        USER_DENIED = 6;
        // permission was denied with prejudice by the user
        USER_DENIED_WITH_PREJUDICE = 7;
        // permission was automatically denied
        AUTO_DENIED = 8;
        // permission request was ignored because permission is restricted
        IGNORED_RESTRICTED_PERMISSION = 9;
    }
    // The result of the permission grant
    optional Result result = 6;
}

/**
 * Logs when Omapi API used
 * Logged from:
 *     packages/apps/SecureElement/src/com/android/se/Terminal.java
 */
message SeOmapiReported {
    enum Operation {
        UNKNOWN = 0;
        OPEN_CHANNEL = 1;
    }
    optional Operation operation = 1;
    // SIMx or eSEx.
    optional string terminal = 2;

    optional string package_name = 3;
}

/**
  * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
  * The dispatch latency is the dispatchClockTime - enqueueClockTime.
  * Logged from:
  *   frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
  */
message BroadcastDispatchLatencyReported {
    optional int64 dispatch_latency_millis = 1;
}

/**
   * Logs AttentionManagerService attention check result.
   *
   * Logged from:
   *   frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
   */
message AttentionManagerServiceResultReported {
    // See core/java/android/service/attention/AttentionService.java
    enum AttentionCheckResult {
        UNKNOWN = 20;
        ATTENTION_SUCCESS_ABSENT = 0;
        ATTENTION_SUCCESS_PRESENT = 1;
        ATTENTION_FAILURE_UNKNOWN = 2;
        ATTENTION_FAILURE_CANCELLED = 3;
        ATTENTION_FAILURE_PREEMPTED = 4;
        ATTENTION_FAILURE_TIMED_OUT = 5;
        ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
    }
    optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
}

/**
 * Logs when an adb connection changes state.
 *
 * Logged from:
 *     frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
 */
message AdbConnectionChanged {
    // The last time this system connected via adb, or 0 if the 'always allow' option was not
    // previously selected for this system.
    optional int64 last_connection_time_millis = 1;

    // The time in ms within which a subsequent connection from an 'always allow' system is allowed
    // to reconnect via adb without user interaction.
    optional int64 auth_window_millis = 2;

    // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
    optional android.debug.AdbConnectionStateEnum state = 3;

    // True if the 'always allow' option was selected for this system.
    optional bool always_allow = 4;
}

/*
 * Logs the reported speech DSP status.
 *
 * Logged from:
 *  Vendor audio implementation.
 */
message SpeechDspStatReported {
    // The total Speech DSP uptime in milliseconds.
    optional int32 total_uptime_millis = 1;
    // The total Speech DSP downtime in milliseconds.
    optional int32 total_downtime_millis = 2;
    optional int32 total_crash_count = 3;
    optional int32 total_recover_count = 4;
}

/**
 * Logs USB connector contaminant status.
 *
 * Logged from: USB Service.
 */
message UsbContaminantReported {
    optional string id = 1;
    optional android.service.usb.ContaminantPresenceStatus status = 2;
}

/**
 * This atom is for debugging purpose.
 */
message DebugElapsedClock {
    // Monotically increasing value for each pull.
    optional int64 pull_count = 1;
    // Time from System.elapsedRealtime.
    optional int64 elapsed_clock_millis = 2;
    // Time from System.elapsedRealtime.
    optional int64 same_elapsed_clock_millis = 3;
    // Diff between current elapsed time and elapsed time from previous pull.
    optional int64 elapsed_clock_diff_millis = 4;

    enum Type {
      TYPE_UNKNOWN = 0;
      ALWAYS_PRESENT = 1;
      PRESENT_ON_ODD_PULLS = 2;
    }
    // Type of behavior for the pulled data.
    optional Type type = 5;
}

/**
 * This atom is for debugging purpose.
 */
message DebugFailingElapsedClock {
    // Monotically increasing value for each pull.
    optional int64 pull_count = 1;
    // Time from System.elapsedRealtime.
    optional int64 elapsed_clock_millis = 2;
    // Time from System.elapsedRealtime.
    optional int64 same_elapsed_clock_millis = 3;
    // Diff between current elapsed time and elapsed time from previous pull.
    optional int64 elapsed_clock_diff_millis = 4;
}

/** Logs System UI bubbles event changed.
 *
 * Logged from:
 *     frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
 */
message BubbleUIChanged {

    // The app package that is posting the bubble.
    optional string package_name = 1;

    // The notification channel that is posting the bubble.
    optional string notification_channel = 2;

    // The notification id associated with the posted bubble.
    optional int32 notification_id = 3;

    // The position of the bubble within the bubble stack.
    optional int32 position = 4;

    // The total number of bubbles within the bubble stack.
    optional int32 total_number = 5;

    // User interactions with the bubble.
    enum Action {
        UNKNOWN = 0;
        POSTED = 1;
        UPDATED = 2;
        EXPANDED = 3;
        COLLAPSED = 4;
        DISMISSED = 5;
        STACK_DISMISSED = 6;
        STACK_MOVED = 7;
        HEADER_GO_TO_APP = 8;
        HEADER_GO_TO_SETTINGS = 9;
        PERMISSION_OPT_IN = 10;
        PERMISSION_OPT_OUT = 11;
        PERMISSION_DIALOG_SHOWN = 12;
        SWIPE_LEFT = 13;
        SWIPE_RIGHT = 14;
        STACK_EXPANDED = 15;
        FLYOUT = 16;
    }
    optional Action action = 6;

    // Normalized screen position of the bubble stack. The range is between 0 and 1.
    optional float normalized_x_position = 7;
    optional float normalized_y_position = 8;

    // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
    optional bool is_unread = 9;

    // Whether the bubble is an on-going one.
    optional bool is_ongoing = 10;

    // Whether the bubble is produced by an app running in foreground.
    optional bool is_foreground = 11;
}

/**
  * Logs System UI bubbles developer errors.
  *
  * Logged from:
  *   frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
  */
message BubbleDeveloperErrorReported {

    // The app package that is posting the bubble.
    optional string package_name = 1;

    // Bubble developer error type enums.
    enum Error {
        UNKNOWN = 0;
        ACTIVITY_INFO_MISSING = 1;
        ACTIVITY_INFO_NOT_RESIZABLE = 2;
        DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
    }
    optional Error error = 2 [default = UNKNOWN];
}

/**
 * Logs that a constraint for a scheduled job has changed.
 *
 * Logged from:
 *     frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
 */
message ScheduledJobConstraintChanged {
    repeated AttributionNode attribution_node = 1;

    // Name of the job.
    optional string job_name = 2;

    optional com.android.server.job.ConstraintEnum constraint = 3;

    enum State {
        UNKNOWN = 0;
        UNSATISFIED = 1;
        SATISFIED = 2;
    }
    optional State state = 4;
}

/**
 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
 * returns true.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
 */
message ScreenTimeoutExtensionReported {
    // Describes how many times in a row did the power manager reset the screen off timeout.
    optional uint32 consecutive_timeout_extended_count = 1;
}

/*
* Logs number of milliseconds it takes to start a process.
* The definition of app process start time is from the app launch time to
* the time that Zygote finished forking the app process and loaded the
* application package's java classes.

* This metric is different from AppStartOccurred which is for foreground
* activity only.

* ProcessStartTime can report all processes (both foreground and background)
* start time.
*
* Logged from:
*   frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
*/
message ProcessStartTime {
    // The uid of the ProcessRecord.
    optional int32 uid = 1 [(is_uid) = true];

    // The process pid.
    optional int32 pid = 2;

    // The process name.
    // Usually package name, "system" for system server.
    // Provided by ActivityManagerService.
    optional string process_name = 3;

    enum StartType {
        UNKNOWN = 0;
        WARM = 1;
        HOT = 2;
        COLD = 3;
    }

    // The start type.
    optional StartType type = 4;

    // The elapsed realtime at the start of the process.
    optional int64 process_start_time_millis = 5;

    // Number of milliseconds it takes to reach bind application.
    optional int32 bind_application_delay_millis = 6;

    // Number of milliseconds it takes to finish start of the process.
    optional int32 process_start_delay_millis = 7;

    // hostingType field in ProcessRecord, the component type such as "activity",
    // "service", "content provider", "broadcast" or other strings.
    optional string hosting_type = 8;

    // hostingNameStr field in ProcessRecord. The component class name that runs
    // in this process.
    optional string hosting_name = 9;
}

/**
 * Track Media Codec usage
 * Logged from:
 *   frameworks/av/media/libstagefright/MediaCodec.cpp
 *   frameworks/av/services/mediaanalytics/statsd_codec.cpp
 */
message MediametricsCodecReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track Media Extractor (pulling video/audio streams out of containers) usage
 * Logged from:
 *   frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
 *   frameworks/av/services/mediaanalytics/statsd_extractor.cpp
 */
message MediametricsExtractorReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track how we arbitrate between microphone/input requests.
 * Logged from
 *   frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
 *   frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
 */
message MediametricsAudiopolicyReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track how we arbitrate between microphone requests.
 * Logged from
 *   frameworks/av/media/libaudioclient/AudioRecord.cpp
 *   frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
 */
message MediametricsAudiorecordReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track how we arbitrate between microphone/input requests.
 * Logged from
 *   frameworks/av/media/libnblog/ReportPerformance.cpp
 *   frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
 */
message MediametricsAudiothreadReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track how we arbitrate between microphone/input requests.
 * Logged from
 *   frameworks/av/media/libaudioclient/AudioTrack.cpp
 *   frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
 */
message MediametricsAudiotrackReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track information about DRM framework performance
 * Logged from
 *   frameworks/av/drm/libmediadrm/DrmHal.cpp
 *   frameworks/av/services/mediaanalytics/statsd_drm.cpp
 */
message MediametricsMediadrmReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    // vendor+description tell about which DRM plugin is in use on this device
    optional string vendor = 5;
    optional string description = 6;
    // from frameworks/av/drm/libmediadrm/protos/metrics.proto
    optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track information about the widevine DRM plugin performance
 * Logged from
 *   vendor/widevine/libwvdrmengine/cdm/metrics
 *   frameworks/av/services/mediaanalytics/statsd_drm.cpp
 */
message MediametricsDrmWidevineReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track information about recordings (e.g. camcorder)
 * Logged from
 *   frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
 *   frameworks/av/services/mediaanalytics/statsd_recorder.cpp
 */
message MediametricsRecorderReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * Track Media Player usage
 * Logged from:
 *   frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
 *   frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
 */
message MediametricsNuPlayerReported {
    optional int64 timestamp_nanos = 1;
    optional string package_name = 2;
    optional int64 package_version_code = 3;
    optional int64 media_apex_version = 4;

    optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
}

/**
 * State of a dangerous permission requested by a package
 */
message DangerousPermissionState {
    // Name of the permission
    optional string permission_name = 1;

    // Uid of the package
    optional int32 uid = 2 [(is_uid) = true];

    // Package requesting the permission
    optional string package_name = 3;

    // If the permission is granted to the uid
    optional bool is_granted = 4;
}

/**
 * Logs when a package is denied access to a device identifier based on the new access requirements.
 *
 * Logged from:
 *     frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
 */
message DeviceIdentifierAccessDenied {
    // The name of the package denied access to the requested device identifier.
    optional string package_name = 1;

    // The name of the device identifier method the package attempted to invoke.
    optional string method_name = 2;

    // True if the package is preinstalled.
    optional bool is_preinstalled = 3;

    // True if the package is privileged.
    optional bool is_priv_app = 4;
}

/**
 * Pulls the ongoing mainline install train version code.
 * Pulled from StatsCompanionService
 */
message TrainInfo {
    optional int64 train_version_code = 1;

    optional TrainExperimentIds train_experiment_id = 2;

    optional string train_name = 3;

    enum Status {
        UNKNOWN = 0;
        INSTALL_REQUESTED = 1;
        INSTALL_STARTED = 2;
        INSTALL_STAGED_NOT_READY = 3;
        INSTALL_STAGED_READY = 4;
        INSTALL_SUCCESS = 5;
        // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
        // and INSTALL_FAILURE_COMMIT.
        INSTALL_FAILURE = 6  [deprecated = true];
        // This enum is for installs that are manually cancelled via the Manual Update UI.
        INSTALL_CANCELLED = 7;
        INSTALLER_ROLLBACK_REQUESTED = 8;
        INSTALLER_ROLLBACK_INITIATED = 9;
        INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
        INSTALLER_ROLLBACK_STAGED = 11;
        INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
        INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
        INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
        INSTALLER_ROLLBACK_SUCCESS = 15;
        INSTALLER_ROLLBACK_FAILURE = 16;
        INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
        INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
        INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
        INSTALL_STAGED_CANCEL_REQUESTED = 20;
        INSTALL_STAGED_CANCEL_SUCCESS = 21;
        INSTALL_STAGED_CANCEL_FAILURE = 22;
        INSTALL_FAILURE_DOWNLOAD = 23;
        INSTALL_FAILURE_STATE_MISMATCH = 24;
        INSTALL_FAILURE_COMMIT = 25;
    }
    optional Status status = 4;
}

/**
 * Logs the gesture stage changed event.
 *
 * Logged from:
 *   frameworks/base/packages/SystemUI/
 */
message AssistGestureStageReported {
    optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
}

/**
 * Logs the feedback type.
 *
 * Logged from:
 *   frameworks/base/packages/SystemUI/
 */
message AssistGestureFeedbackReported {
    // Whether or not the gesture was used.
    optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
}

/**
 * Logs the progress.
 *
 * Logged from:
 *   frameworks/base/packages/SystemUI/
 */
message AssistGestureProgressReported {
    // [0,100] progress for the assist gesture.
    optional int32 progress = 1;
}

/*
 * Information about the time zone data on a device.
 */
message TimeZoneDataInfo {
    // A version identifier for the data set on device. e.g. "2018i"
    optional string tzdb_version = 1;
}

/**
 * Logs the GPU stats global health information.
 *
 * Logged from:
 *   frameworks/native/services/gpuservice/gpustats/
 */
message GpuStatsGlobalInfo {
    // Package name of the gpu driver.
    optional string driver_package_name = 1;

    // Version name of the gpu driver.
    optional string driver_version_name = 2;

    // Version code of the gpu driver.
    optional int64 driver_version_code = 3;

    // Build time of the gpu driver in UTC as seconds since January 1, 1970.
    optional int64 driver_build_time = 4;

    // Total count of the gl driver gets loaded.
    optional int64 gl_loading_count = 5;

    // Total count of the gl driver fails to be loaded.
    optional int64 gl_loading_failure_count = 6;

    // Total count of the Vulkan driver gets loaded.
    optional int64 vk_loading_count = 7;

    // Total count of the Vulkan driver fails to be loaded.
    optional int64 vk_loading_failure_count = 8;

    // Api version of the system Vulkan driver.
    optional int32 vulkan_version = 9;

    // Api version of the system CPU Vulkan driver.
    optional int32 cpu_vulkan_version = 10;

    // Api version of the system GLES driver.
    optional int32 gles_version = 11;

    // Total count of the angle driver gets loaded.
    optional int64 angle_loading_count = 12;

    // Total count of the angle driver fails to be loaded.
    optional int64 angle_loading_failure_count = 13;
}

/**
 * GPU driver loading time info.
 */
message GpuDriverLoadingTime {
    // List of all the driver loading times for this app. The list size is
    // capped at 50.
    repeated int64 driver_loading_time = 1;
}

/**
 * Logs the GPU stats per app health information.
 *
 * Logged from:
 *   frameworks/native/services/gpuservice/gpustats/
 */
message GpuStatsAppInfo {
    // Package name of the application that loads the gpu driver. Total number
    // of different packages is capped at 100.
    optional string app_package_name = 1;

    // Version code of the gpu driver this app loads.
    optional int64 driver_version_code = 2;

    // gl driver loading time info.
    optional GpuDriverLoadingTime gl_driver_loading_time = 3
            [(android.os.statsd.log_mode) = MODE_BYTES];

    // Vulkan driver loading time info.
    optional GpuDriverLoadingTime vk_driver_loading_time = 4
            [(android.os.statsd.log_mode) = MODE_BYTES];

    // Angle driver loading time info.
    optional GpuDriverLoadingTime angle_driver_loading_time = 5
            [(android.os.statsd.log_mode) = MODE_BYTES];

    // CPU Vulkan implementation is in use.
    optional bool cpu_vulkan_in_use = 6;
}

/*
 * Logs the size of the system ion heap.
 *
 * Pulled from StatsCompanionService.
 */
message SystemIonHeapSize {
    // Size of the system ion heap in bytes.
    optional int64 size_in_bytes = 1;
}

/**
 * Push network stack events.
 *
 * Log from:
 *     frameworks/base/packages/NetworkStack/
 */
message NetworkStackReported {
    // The id that indicates the event reported from NetworkStack.
    optional int32 event_id = 1;
    // The data for the reported events.
    optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
}

/**
 * Logs the apps that are installed on the external storage.
 * Pulled from:
 *   StatsCompanionService
 */
message AppsOnExternalStorageInfo {
    // The type of the external storage.
    optional android.stats.storage.ExternalStorageType external_storage_type = 1;
    // The name of the package that is installed on the external storage.
    optional string package_name = 2;
}

/**
 * Logs the settings related to Face.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/stats
 */
message FaceSettings {
    // Whether or not face unlock is allowed on Keyguard.
    optional bool unlock_keyguard_enabled = 1;
    // Whether or not face unlock dismisses the Keyguard.
    optional bool unlock_dismisses_keyguard = 2;
    // Whether or not face unlock requires attention.
    optional bool unlock_attention_required = 3;
    // Whether or not face unlock is allowed for apps (through BiometricPrompt).
    optional bool unlock_app_enabled = 4;
    // Whether or not face unlock always requires user confirmation.
    optional bool unlock_always_require_confirmation = 5;
    // Whether or not a diverse set of poses are required during enrollment.
    optional bool unlock_diversity_required = 6;
}

/**
 * Logs cooling devices maintained by the kernel.
 *
 * Pulled from StatsCompanionService.java
 */
message CoolingDevice {
    // The type of cooling device being reported. Eg. CPU, GPU...
    optional android.os.CoolingTypeEnum device_location = 1;
    // The name of the cooling device source. Eg. CPU0
    optional string device_name = 2;
    // Current throttle state of the cooling device. The value can any unsigned
    // integer between 0 and max_state defined in its driver. 0 means device is
    // not in throttling, higher value means deeper throttling.
    optional int32 state = 3;
}

/**
 * Intelligence has several counter-type events that don't warrant a
 * full separate atom. These are primarily API call counters but also include
 * counters for feature usage and specific failure modes.
 *
 * Logged from the Intelligence mainline module.
 */
message IntelligenceEventReported {
  optional android.stats.intelligence.EventType event_id = 1;
  optional android.stats.intelligence.Status status = 2;
}

/**
 * Logs information about Vehicle Map Service packets. It specifies the layer
 * type, subtype, data version and size of the packet.
 */
message VehicleMapServicePacketReported {
  // Identifies the type of data being transported by a Vehicle Maps Service
  // packet.
  optional int32 layer_type = 1;
  // Identifies the subtype of the layer.
  optional int32 layer_subtype = 2;
  // Identifies the version of the data being transported by a Vehicle Maps
  // Service packet.
  optional int32 version = 3;
  // Size in bytes of the packet.
  optional int64 size_in_bytes = 4;
}

/**
 * Logs that a Vehicle Map Service packet failed to be delivered.
 */
message VehicleMapServicePacketFailureReported {
  // Identifies the type of data being transported by a Vehicle Map Service
  // packet.
  optional int32 layer_type = 1;
  // Identifies the subtype of the layer.
  optional int32 layer_subtype = 2;
  // Identifies the version of the data being transported by a Vehicle Map
  // Service packet.
  optional int32 version = 3;
  // Identifies the package name of the publisher of the data.
  optional string publisher_name = 4;
  // Identifies the package name of the subscriber of the data. An empty string
  // signifies that there are zero subscribers for the packet.
  optional string subscriber_name = 5;
}

/**
 * Logs when Car Power state changed.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/CarStatsLog.java
 */
message CarPowerStateChanged {
    // States come from CpmsState in CarPowerManagementService.java.
    enum State {
       WAIT_FOR_VHAL = 0;
       ON = 1;
       SHUTDOWN_PREPARE = 2;
       WAIT_FOR_FINISH = 3;
       SUSPEND = 4;
       SIMULATE_SLEEP = 5;
    }
    optional State state = 1;
}

/**
 * Logs whether GarageMode is entered.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/CarStatsLog.java
 */
message GarageModeInfo {
    // Whether GarageMode is entered.
    optional bool is_garage_mode = 1;
}

/**
 * Historical app ops data per package.
 */
message AppOps {
    // Uid of the package requesting the op
    optional int32 uid = 1 [(is_uid) = true];

    // Nmae of the package performing the op
    optional string package_name = 2;

    // operation id; maps to the OP_* constants in AppOpsManager.java
    optional int32 op_id = 3;

    // The number of times the op was granted while the app was in the
    // foreground (only for trusted requests)
    optional int64 trusted_foreground_granted_count = 4;

    // The number of times the op was granted while the app was in the
    // background (only for trusted requests)
    optional int64 trusted_background_granted_count = 5;

    // The number of times the op was rejected while the app was in the
    // foreground (only for trusted requests)
    optional int64 trusted_foreground_rejected_count = 6;

    // The number of times the op was rejected while the app was in the
    // background (only for trusted requests)
    optional int64 trusted_background_rejected_count = 7;

    // For long-running operations, total duration of the operation
    // while the app was in the foreground (only for trusted requests)
    optional int64 trusted_foreground_duration_millis = 8;

    // For long-running operations, total duration of the operation
    // while the app was in the background (only for trusted requests)
    optional int64 trusted_background_duration_millis = 9;
}
