use std::collections::HashMap;
use std::os::raw::c_char;
use anyhow::Result;
use base::RecvTube;
use base::SendTube;
use serde::Deserialize;
use serde::Serialize;
#[cfg(windows)]
use win_util::ProcessType;
#[cfg(any(target_os = "android", target_os = "linux"))]
pub enum ProcessType {}
#[derive(Clone, Copy, Serialize, Deserialize, Debug, Eq, PartialEq)]
pub enum CrashReportReason {
Unknown,
GfxstreamRenderThreadHang,
GfxstreamSyncThreadHang,
GfxstreamOtherHang,
}
#[derive(Clone, Copy, Serialize, Deserialize, Debug, PartialEq, Eq)]
enum CrashTubeCommand {
UploadCrashReport(CrashReportReason),
}
pub mod product_type {
pub const EMULATOR: &str = "KiwiEmulator_main";
pub const BROKER: &str = "KiwiEmulator_broker";
pub const DISK: &str = "KiwiEmulator_disk";
pub const NET: &str = "KiwiEmulator_net";
pub const SLIRP: &str = "KiwiEmulator_slirp";
pub const METRICS: &str = "KiwiEmulator_metrics";
pub const GPU: &str = "KiwiEmulator_gpu";
pub const SND: &str = "KiwiEmulator_snd";
pub const SPU: &str = "KiwiEmulator_spu";
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct CrashReportAttributes {
pub product_type: String,
pub pipe_name: Option<String>,
pub report_uuid: Option<String>,
pub product_name: Option<String>,
pub product_version: Option<String>,
}
pub struct RemoteCrashHandler {}
impl RemoteCrashHandler {
pub fn new(_crash_tube: RecvTube) -> Result<Self> {
Ok(Self {})
}
}
impl Drop for RemoteCrashHandler {
fn drop(&mut self) {}
}
pub fn setup_crash_reporting(mut _attrs: CrashReportAttributes) -> Result<String> {
Ok(String::new())
}
pub fn set_crash_tube_map(_map: HashMap<ProcessType, Vec<SendTube>>) {}
pub fn upload_crash_report(_reason: CrashReportReason) {}
pub fn set_package_name(_package_name: &str) {}
pub extern "C" fn update_annotation(_key: *const c_char, _value: *const c_char) {}
pub struct GfxstreamAbort;