Skip to content

Commit dfed2b5

Browse files
committed
feat: add more info to android device names
1 parent 33b8919 commit dfed2b5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/host/oboe/mod.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,17 @@ impl DeviceTrait for Device {
275275
fn name(&self) -> Result<String, DeviceNameError> {
276276
match &self.0 {
277277
None => Ok("default".to_owned()),
278-
Some(info) => Ok(info.product_name.clone()),
278+
Some(info) => {
279+
let name = if info.address.is_empty() {
280+
format!("{}:{:?}", info.product_name, info.device_type)
281+
} else {
282+
format!(
283+
"{}:{:?}:{}",
284+
info.product_name, info.device_type, info.address
285+
)
286+
};
287+
Ok(name)
288+
}
279289
}
280290
}
281291

0 commit comments

Comments
 (0)