From 1bc606fafea8e2488836ad34f51d6d51c60169fa Mon Sep 17 00:00:00 2001 From: Josh Wu Date: Tue, 21 Dec 2021 03:17:23 -0800 Subject: [PATCH] BT: Support LC3 over A2DP Test: m android.hardware.bluetooth.audio-update-api Bug: 211589164 Change-Id: Ib2efd9b5af71fa0188edb85b13cf031710b6fe21 --- .../android/hardware/bluetooth/audio/AudioCapabilities.aidl | 2 +- .../hardware/bluetooth/audio/AudioConfiguration.aidl | 2 +- .../android/hardware/bluetooth/audio/CodecCapabilities.aidl | 1 + .../hardware/bluetooth/audio/CodecConfiguration.aidl | 1 + .../android/hardware/bluetooth/audio/Lc3Capabilities.aidl | 1 + .../android/hardware/bluetooth/audio/Lc3Configuration.aidl | 1 + .../android/hardware/bluetooth/audio/AudioCapabilities.aidl | 2 +- .../hardware/bluetooth/audio/AudioConfiguration.aidl | 2 +- .../android/hardware/bluetooth/audio/CodecCapabilities.aidl | 2 ++ .../hardware/bluetooth/audio/CodecConfiguration.aidl | 2 ++ .../android/hardware/bluetooth/audio/Lc3Capabilities.aidl | 6 ++++++ .../android/hardware/bluetooth/audio/Lc3Configuration.aidl | 6 ++++++ 12 files changed, 24 insertions(+), 4 deletions(-) diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioCapabilities.aidl index 43d79111d9..8ae716ff23 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioCapabilities.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioCapabilities.aidl @@ -35,6 +35,6 @@ package android.hardware.bluetooth.audio; @VintfStability union AudioCapabilities { android.hardware.bluetooth.audio.PcmCapabilities pcmCapabilities; - android.hardware.bluetooth.audio.CodecCapabilities codecCapabilities; + android.hardware.bluetooth.audio.CodecCapabilities a2dpCapabilities; android.hardware.bluetooth.audio.LeAudioCodecCapabilitiesSetting leAudioCapabilities; } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl index 34f7837967..50b54c30c0 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl @@ -35,6 +35,6 @@ package android.hardware.bluetooth.audio; @VintfStability union AudioConfiguration { android.hardware.bluetooth.audio.PcmConfiguration pcmConfig; - android.hardware.bluetooth.audio.CodecConfiguration codecConfig; + android.hardware.bluetooth.audio.CodecConfiguration a2dpConfig; android.hardware.bluetooth.audio.LeAudioConfiguration leAudioConfig; } 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 b451880e05..e2a08a0e6d 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 @@ -42,5 +42,6 @@ parcelable CodecCapabilities { android.hardware.bluetooth.audio.AacCapabilities aacCapabilities; android.hardware.bluetooth.audio.LdacCapabilities ldacCapabilities; android.hardware.bluetooth.audio.AptxCapabilities aptxCapabilities; + android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities; } } 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 863aee244c..34ebd60530 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 @@ -45,5 +45,6 @@ parcelable CodecConfiguration { android.hardware.bluetooth.audio.AacConfiguration aacConfig; android.hardware.bluetooth.audio.LdacConfiguration ldacConfig; android.hardware.bluetooth.audio.AptxConfiguration aptxConfig; + android.hardware.bluetooth.audio.Lc3Configuration lc3Config; } } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Capabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Capabilities.aidl index 3c650da4f7..cc4449aea9 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Capabilities.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Capabilities.aidl @@ -39,4 +39,5 @@ parcelable Lc3Capabilities { int[] frameDurationUs; int[] octetsPerFrame; byte[] blocksPerSdu; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Configuration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Configuration.aidl index ef77da7023..7e8dccff5f 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Configuration.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Configuration.aidl @@ -39,4 +39,5 @@ parcelable Lc3Configuration { int frameDurationUs; int octetsPerFrame; byte blocksPerSdu; + android.hardware.bluetooth.audio.ChannelMode channelMode; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioCapabilities.aidl index 339c475d47..a75c4457e9 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioCapabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioCapabilities.aidl @@ -26,6 +26,6 @@ import android.hardware.bluetooth.audio.PcmCapabilities; @VintfStability union AudioCapabilities { PcmCapabilities pcmCapabilities; - CodecCapabilities codecCapabilities; + CodecCapabilities a2dpCapabilities; LeAudioCodecCapabilitiesSetting leAudioCapabilities; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl index ce515b5611..81b41dcf7f 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl @@ -26,6 +26,6 @@ import android.hardware.bluetooth.audio.PcmConfiguration; @VintfStability union AudioConfiguration { PcmConfiguration pcmConfig; - CodecConfiguration codecConfig; + CodecConfiguration a2dpConfig; LeAudioConfiguration leAudioConfig; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl index 0eee8cb55b..5bf0252bf8 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl @@ -19,6 +19,7 @@ package android.hardware.bluetooth.audio; import android.hardware.bluetooth.audio.AacCapabilities; import android.hardware.bluetooth.audio.AptxCapabilities; import android.hardware.bluetooth.audio.CodecType; +import android.hardware.bluetooth.audio.Lc3Capabilities; import android.hardware.bluetooth.audio.LdacCapabilities; import android.hardware.bluetooth.audio.SbcCapabilities; @@ -34,6 +35,7 @@ parcelable CodecCapabilities { AacCapabilities aacCapabilities; LdacCapabilities ldacCapabilities; AptxCapabilities aptxCapabilities; + Lc3Capabilities lc3Capabilities; } 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 fac90f065d..9e43f2244a 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl @@ -19,6 +19,7 @@ package android.hardware.bluetooth.audio; import android.hardware.bluetooth.audio.AacConfiguration; import android.hardware.bluetooth.audio.AptxConfiguration; import android.hardware.bluetooth.audio.CodecType; +import android.hardware.bluetooth.audio.Lc3Configuration; import android.hardware.bluetooth.audio.LdacConfiguration; import android.hardware.bluetooth.audio.SbcConfiguration; @@ -34,6 +35,7 @@ parcelable CodecConfiguration { AacConfiguration aacConfig; LdacConfiguration ldacConfig; AptxConfiguration aptxConfig; + Lc3Configuration lc3Config; } CodecType codecType; /** diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Capabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Capabilities.aidl index 1aedefd2d5..fc2f382d18 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Capabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Capabilities.aidl @@ -16,6 +16,8 @@ package android.hardware.bluetooth.audio; +import android.hardware.bluetooth.audio.ChannelMode; + /** * Used for Hardware Encoding/Decoding LC3 codec capabilities. */ @@ -41,4 +43,8 @@ parcelable Lc3Capabilities { * Number of blocks of codec frames per single SDU (Service Data Unit) */ byte[] blocksPerSdu; + /* + * Channel mode used in A2DP special audio, ignored in standard LE Audio mode + */ + ChannelMode[] channelMode; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Configuration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Configuration.aidl index 77c04c1b6e..e8a93b27d8 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Configuration.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Configuration.aidl @@ -16,6 +16,8 @@ package android.hardware.bluetooth.audio; +import android.hardware.bluetooth.audio.ChannelMode; + /** * Used for Hardware Encoding/Decoding LC3 codec configuration. */ @@ -41,4 +43,8 @@ parcelable Lc3Configuration { * Number of blocks of codec frames per single SDU (Service Data Unit) */ byte blocksPerSdu; + /* + * Channel mode used in A2DP special audio, ignored in standard LE Audio mode + */ + ChannelMode channelMode; }