diff --git a/system/audio_bluetooth_hw/audio_bluetooth_hw.cc b/system/audio_bluetooth_hw/audio_bluetooth_hw.cc
index 887c4e3..35de87d 100644
--- a/system/audio_bluetooth_hw/audio_bluetooth_hw.cc
+++ b/system/audio_bluetooth_hw/audio_bluetooth_hw.cc
@@ -99,6 +99,59 @@
   return -ENOSYS;
 }
 
+static int adev_create_audio_patch(struct audio_hw_device* device,
+                                   unsigned int num_sources,
+                                   const struct audio_port_config* sources,
+                                   unsigned int num_sinks,
+                                   const struct audio_port_config* sinks,
+                                   audio_patch_handle_t* handle) {
+  if (device == nullptr || sources == nullptr || sinks == nullptr ||
+      handle == nullptr || num_sources != 1 || num_sinks == 0 ||
+      num_sinks > AUDIO_PATCH_PORTS_MAX) {
+    return -EINVAL;
+  }
+  if (sources[0].type == AUDIO_PORT_TYPE_DEVICE) {
+    if (num_sinks != 1 || sinks[0].type != AUDIO_PORT_TYPE_MIX) {
+      return -EINVAL;
+    }
+  } else if (sources[0].type == AUDIO_PORT_TYPE_MIX) {
+    for (unsigned int i = 0; i < num_sinks; i++) {
+      if (sinks[i].type != AUDIO_PORT_TYPE_DEVICE) {
+        return -EINVAL;
+      }
+    }
+  } else {
+    return -EINVAL;
+  }
+
+  auto* bluetooth_device = reinterpret_cast<BluetoothAudioDevice*>(device);
+  std::lock_guard<std::mutex> guard(bluetooth_device->mutex_);
+  if (*handle == AUDIO_PATCH_HANDLE_NONE) {
+    *handle = ++bluetooth_device->next_unique_id;
+  }
+
+  LOG(INFO) << __func__ << ": device=" << std::hex << sinks[0].ext.device.type
+            << " handle: " << *handle;
+  return 0;
+}
+
+static int adev_release_audio_patch(struct audio_hw_device* device,
+                                    audio_patch_handle_t patch_handle) {
+  if (device == nullptr) {
+    return -EINVAL;
+  }
+  LOG(INFO) << __func__ << ": patch_handle=" << patch_handle;
+  return 0;
+}
+
+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) {
@@ -117,7 +170,7 @@
   if (!adev) return -ENOMEM;
 
   adev->common.tag = HARDWARE_DEVICE_TAG;
-  adev->common.version = AUDIO_DEVICE_API_VERSION_2_0;
+  adev->common.version = AUDIO_DEVICE_API_VERSION_3_0;
   adev->common.module = (struct hw_module_t*)module;
   adev->common.close = adev_close;
 
@@ -138,6 +191,9 @@
   adev->dump = adev_dump;
   adev->set_master_mute = adev_set_master_mute;
   adev->get_master_mute = adev_get_master_mute;
+  adev->create_audio_patch = adev_create_audio_patch;
+  adev->release_audio_patch = adev_release_audio_patch;
+  adev->get_audio_port = adev_get_audio_port;
 
   *device = &adev->common;
   return 0;
diff --git a/system/audio_bluetooth_hw/stream_apis.h b/system/audio_bluetooth_hw/stream_apis.h
index 36dd589..d101027 100644
--- a/system/audio_bluetooth_hw/stream_apis.h
+++ b/system/audio_bluetooth_hw/stream_apis.h
@@ -81,6 +81,7 @@
   std::mutex mutex_;
   std::list<BluetoothStreamOut*> opened_stream_outs_ =
       std::list<BluetoothStreamOut*>(0);
+  uint32_t next_unique_id = 1;
 };
 
 struct BluetoothStreamIn {
