From ce87f91873335256d1deab13aa617d88a5087468 Mon Sep 17 00:00:00 2001 From: Alice Kuo Date: Fri, 21 Jan 2022 11:52:29 +0800 Subject: [PATCH] Add a2dp vendor codec extension Bug: 215645164 Test: make build Change-Id: I1ed80ab5cd4a9fbb9ea6fef7a5192241af76f1ea --- .../hardware/bluetooth/audio/CodecCapabilities.aidl | 5 +++++ .../hardware/bluetooth/audio/CodecConfiguration.aidl | 7 +++++++ .../hardware/bluetooth/audio/CodecCapabilities.aidl | 5 +++++ .../hardware/bluetooth/audio/CodecConfiguration.aidl | 7 +++++++ .../audio/utils/aidl_session/BluetoothAudioCodecs.cpp | 1 - 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl index e2a08a0e6d..948c04a513 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl @@ -37,11 +37,16 @@ parcelable CodecCapabilities { android.hardware.bluetooth.audio.CodecType codecType; android.hardware.bluetooth.audio.CodecCapabilities.Capabilities capabilities; @VintfStability + parcelable VendorCapabilities { + ParcelableHolder extension; + } + @VintfStability union Capabilities { android.hardware.bluetooth.audio.SbcCapabilities sbcCapabilities; android.hardware.bluetooth.audio.AacCapabilities aacCapabilities; android.hardware.bluetooth.audio.LdacCapabilities ldacCapabilities; android.hardware.bluetooth.audio.AptxCapabilities aptxCapabilities; android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities; + android.hardware.bluetooth.audio.CodecCapabilities.VendorCapabilities vendorCapabilities; } } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl index 34ebd60530..32bccd8501 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl @@ -40,11 +40,18 @@ parcelable CodecConfiguration { boolean isScmstEnabled; android.hardware.bluetooth.audio.CodecConfiguration.CodecSpecific config; @VintfStability + parcelable VendorConfiguration { + int vendorId; + char codecId; + ParcelableHolder codecConfig; + } + @VintfStability union CodecSpecific { android.hardware.bluetooth.audio.SbcConfiguration sbcConfig; android.hardware.bluetooth.audio.AacConfiguration aacConfig; android.hardware.bluetooth.audio.LdacConfiguration ldacConfig; android.hardware.bluetooth.audio.AptxConfiguration aptxConfig; android.hardware.bluetooth.audio.Lc3Configuration lc3Config; + android.hardware.bluetooth.audio.CodecConfiguration.VendorConfiguration vendorConfig; } } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl index 5bf0252bf8..41e243168c 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl @@ -29,6 +29,10 @@ import android.hardware.bluetooth.audio.SbcCapabilities; */ @VintfStability parcelable CodecCapabilities { + @VintfStability + parcelable VendorCapabilities { + ParcelableHolder extension; + } @VintfStability union Capabilities { SbcCapabilities sbcCapabilities; @@ -36,6 +40,7 @@ parcelable CodecCapabilities { LdacCapabilities ldacCapabilities; AptxCapabilities aptxCapabilities; Lc3Capabilities lc3Capabilities; + VendorCapabilities vendorCapabilities; } CodecType codecType; Capabilities capabilities; diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl index 9e43f2244a..3679537af7 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl @@ -29,6 +29,12 @@ import android.hardware.bluetooth.audio.SbcConfiguration; */ @VintfStability parcelable CodecConfiguration { + @VintfStability + parcelable VendorConfiguration { + int vendorId; + char codecId; + ParcelableHolder codecConfig; + } @VintfStability union CodecSpecific { SbcConfiguration sbcConfig; @@ -36,6 +42,7 @@ parcelable CodecConfiguration { LdacConfiguration ldacConfig; AptxConfiguration aptxConfig; Lc3Configuration lc3Config; + VendorConfiguration vendorConfig; } CodecType codecType; /** diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp index 380732fda4..4693d970e6 100644 --- a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp +++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp @@ -356,7 +356,6 @@ BluetoothAudioCodecs::GetA2dpOffloadCodecCapabilities( break; case CodecType::UNKNOWN: case CodecType::VENDOR: - codec_capability = {}; break; } }