[audio][fidl] Fix type direction in GetChannel call
Also remove unnecessary Simple layout.
Test: fx run-test audio_core_unittests
Test: Boot on Astro
Change-Id: Ib211f6154dbaa714e96d3f2e4951eb5a37c5db56
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/377150
Reviewed-by: Yifei Teng <yifeit@google.com>
Reviewed-by: Dale Sather <dalesat@google.com>
Testability-Review: Yifei Teng <yifeit@google.com>
API-Review: Ruchira Ravoori <ravoorir@google.com>
Commit-Queue: Andres Oportus <andresoportus@google.com>
diff --git a/sdk/fidl/fuchsia.hardware.audio/audio.fidl b/sdk/fidl/fuchsia.hardware.audio/audio.fidl
index cbbc464..6278f86 100644
--- a/sdk/fidl/fuchsia.hardware.audio/audio.fidl
+++ b/sdk/fidl/fuchsia.hardware.audio/audio.fidl
@@ -6,8 +6,7 @@
// For an overview see //zircon/driver_interfaces/audio_streaming.md
-[Layout = "Simple"]
protocol Device {
/// This method obtains a channel in order to serve FIDL over it outside the devhost's control.
- GetChannel() -> (request<StreamConfig> channel);
+ GetChannel() -> (StreamConfig channel);
};
diff --git a/src/media/audio/audio_core/plug_detector.cc b/src/media/audio/audio_core/plug_detector.cc
index afcced8..48d4188 100644
--- a/src/media/audio/audio_core/plug_detector.cc
+++ b/src/media/audio/audio_core/plug_detector.cc
@@ -114,8 +114,8 @@
FX_PLOGS(ERROR, res) << "Failed to open channel to audio " << (is_input ? "input" : "output");
});
device->GetChannel([d = std::move(device), this, is_input, name](
- ::fidl::InterfaceRequest<fuchsia::hardware::audio::StreamConfig> req) {
- observer_(req.TakeChannel(), name, is_input);
+ ::fidl::InterfaceHandle<fuchsia::hardware::audio::StreamConfig> intf) {
+ observer_(intf.TakeChannel(), name, is_input);
});
}
Observer observer_;
diff --git a/src/media/audio/audio_core/plug_detector_unittest.cc b/src/media/audio/audio_core/plug_detector_unittest.cc
index 635cf51..03ac758 100644
--- a/src/media/audio/audio_core/plug_detector_unittest.cc
+++ b/src/media/audio/audio_core/plug_detector_unittest.cc
@@ -39,9 +39,9 @@
private:
void GetChannel(GetChannelCallback callback) override {
FX_CHECK(client_);
- fidl::InterfaceRequest<fuchsia::hardware::audio::StreamConfig> intf_req = {};
- intf_req.set_channel(std::move(client_));
- callback(std::move(intf_req));
+ fidl::InterfaceHandle<fuchsia::hardware::audio::StreamConfig> intf = {};
+ intf.set_channel(std::move(client_));
+ callback(std::move(intf));
}
zx::channel client_, server_;
diff --git a/src/media/audio/drivers/test/audio_driver_test.cc b/src/media/audio/drivers/test/audio_driver_test.cc
index 7ee65a0..ec1c802 100644
--- a/src/media/audio/drivers/test/audio_driver_test.cc
+++ b/src/media/audio/drivers/test/audio_driver_test.cc
@@ -160,15 +160,15 @@
// Obtain the stream channel
auto dev =
fidl::InterfaceHandle<fuchsia::hardware::audio::Device>(std::move(dev_channel)).BindSync();
- fidl::InterfaceRequest<fuchsia::hardware::audio::StreamConfig> intf_req = {};
+ fidl::InterfaceHandle<fuchsia::hardware::audio::StreamConfig> intf = {};
- status = dev->GetChannel(&intf_req);
+ status = dev->GetChannel(&intf);
if (status != ZX_OK) {
FX_PLOGS(ERROR, status) << "Failed to open channel to audio "
<< ((device_type == DeviceType::Input) ? "input" : "output");
FAIL();
}
- stream_channel_ = intf_req.TakeChannel();
+ stream_channel_ = intf.TakeChannel();
AUD_VLOG(TRACE) << "Successfully opened devnode '" << name << "' for audio "
<< ((device_type == DeviceType::Input) ? "input" : "output");