Skip to content

Commit 10b56d1

Browse files
committed
Add AudioDeviceType::Unsupported(i32) variant, as future-proofing
1 parent d6325ca commit 10b56d1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/java_interface/definitions.rs

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ pub enum AudioDeviceType {
116116
UsbHeadset = 22,
117117
WiredHeadphones = 4,
118118
WiredHeadset = 3,
119+
Unsupported(i32),
119120
}
120121

121122
/**

src/java_interface/devices_info.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn try_request_devices_info<'a>(
6363
device_type: FromPrimitive::from_i32(call_method_no_args_ret_int(
6464
env, device, "getType",
6565
)?)
66-
.unwrap(),
66+
.unwrap_or_else(|device_type| Unsupported(device_type)),
6767
direction: AudioDeviceDirection::new(
6868
call_method_no_args_ret_bool(env, device, "isSource")?,
6969
call_method_no_args_ret_bool(env, device, "isSink")?,

0 commit comments

Comments
 (0)