Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4597b0ea authored by Oscar Azucena's avatar Oscar Azucena
Browse files

Add legacy HAL get audio device port method

Audio device factory only exposes a single HIDL version. Devices
using previous versions of the HIDL HAL will not be able to use BT audio
HAL since the get device port will not be available.

Bug: 305301155
Test: m -j, test manual
Change-Id: I9cd92218a0d32fd22c44a9cc4f0e86adb02c92fe
parent 0da4cf20
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -153,6 +153,14 @@ static int adev_get_audio_port_v7(struct audio_hw_device* device,
  return -ENOSYS;
}

static int adev_get_audio_port(struct audio_hw_device* device,
                               struct audio_port* port) {
  if (device == nullptr || port == nullptr) {
    return -EINVAL;
  }
  return -ENOSYS;
}

static int adev_dump(const audio_hw_device_t* device, int fd) { return 0; }

static int adev_close(hw_device_t* device) {
@@ -195,6 +203,7 @@ static int adev_open(const hw_module_t* module, const char* name,
  adev->create_audio_patch = adev_create_audio_patch;
  adev->release_audio_patch = adev_release_audio_patch;
  adev->get_audio_port_v7 = adev_get_audio_port_v7;
  adev->get_audio_port = adev_get_audio_port;

  *device = &adev->common;
  return 0;