From dfed2b5c6d9c012dac6e2e5afab43f455ec6ba50 Mon Sep 17 00:00:00 2001 From: Frando Date: Mon, 10 Mar 2025 13:24:00 +0100 Subject: [PATCH] feat: add more info to android device names --- src/host/oboe/mod.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/host/oboe/mod.rs b/src/host/oboe/mod.rs index e2acb5208..d8be97297 100644 --- a/src/host/oboe/mod.rs +++ b/src/host/oboe/mod.rs @@ -275,7 +275,17 @@ impl DeviceTrait for Device { fn name(&self) -> Result { match &self.0 { None => Ok("default".to_owned()), - Some(info) => Ok(info.product_name.clone()), + Some(info) => { + let name = if info.address.is_empty() { + format!("{}:{:?}", info.product_name, info.device_type) + } else { + format!( + "{}:{:?}:{}", + info.product_name, info.device_type, info.address + ) + }; + Ok(name) + } } }