summaryrefslogtreecommitdiff
path: root/btif/src
diff options
context:
space:
mode:
Diffstat (limited to 'btif/src')
-rw-r--r--btif/src/btif_a2dp_source.cc10
-rw-r--r--btif/src/btif_ahim.cc64
-rw-r--r--btif/src/btif_core.cc6
3 files changed, 22 insertions, 58 deletions
diff --git a/btif/src/btif_a2dp_source.cc b/btif/src/btif_a2dp_source.cc
index d1b5ec373..d1647576d 100644
--- a/btif/src/btif_a2dp_source.cc
+++ b/btif/src/btif_a2dp_source.cc
@@ -66,7 +66,6 @@ using ::bluetooth::audio::a2dp::SessionType;
#include "btif_hf.h"
#include "btif_av.h"
#include "bta_sys.h"
-#include "btif_acm.h"
using system_bt_osi::BluetoothMetricsLogger;
using system_bt_osi::A2dpSessionMetrics;
@@ -175,9 +174,6 @@ extern int btif_av_get_tws_pair_idx(int index);
extern void btif_av_clear_pending_start_flag();
extern bool btif_av_is_tws_suspend_triggered(int index);
-extern bool btif_acm_check_in_call_tracker_timer_exist();
-extern void stop_stream_acm_initiator_now();
-
static char a2dp_hal_imp[PROPERTY_VALUE_MAX] = "false";
UNUSED_ATTR static const char* dump_media_event(uint16_t event) {
switch (event) {
@@ -1832,12 +1828,6 @@ void btif_a2dp_source_process_request(tA2DP_CTRL_CMD cmd) {
status = A2DP_CTRL_ACK_INCALL_FAILURE;
break;
}
- if (btif_ahim_is_aosp_aidl_hal_enabled() &&
- btif_acm_check_in_call_tracker_timer_exist()) {
- stop_stream_acm_initiator_now();
- status = A2DP_CTRL_ACK_INCALL_FAILURE;
- break;
- }
if (btif_ba_is_active())
{
ba_send_message(BTIF_BA_AUDIO_START_REQ_EVT, 0, NULL, false);
diff --git a/btif/src/btif_ahim.cc b/btif/src/btif_ahim.cc
index ead9ae1cd..080348bbc 100644
--- a/btif/src/btif_ahim.cc
+++ b/btif/src/btif_ahim.cc
@@ -68,8 +68,10 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
#include "audio_hal_interface/aidl/le_audio_software.h"
#include <hardware/audio.h>
#include <vector>
+#ifdef ADV_AUDIO_FEATURE
#include <hardware/bt_pacs_client.h>
#include <btif_vmcp.h>
+#endif
#include <aidl/vendor/qti/hardware/bluetooth/audio/LeAudioVendorConfiguration.h>
#include <aidl/vendor/qti/hardware/bluetooth/audio/VendorCodecType.h>
@@ -94,7 +96,9 @@ using VendorConfiguration =
::aidl::android::hardware::bluetooth::audio::LeAudioCodecConfiguration::VendorConfiguration;
using ::aidl::android::hardware::bluetooth::audio::UnicastCapability;
using vendor::qti::hardware::bluetooth_audio::V2_1::LC3ChannelMode;
+#ifdef ADV_AUDIO_FEATURE
using bluetooth::bap::pacs::CodecIndex;
+#endif
//using ::bluetooth::audio::BitsPerSample;
LeAudioClientInterface* leAudioClientInterface = nullptr;
LeAudioClientInterface::Sink* unicastSinkClientInterface = nullptr;
@@ -248,17 +252,6 @@ void btif_ahim_update_src_metadata (const source_metadata_t& source_metadata) {
}
}
-void btif_ahim_update_params (uint16_t delay, uint8_t mode) {
- // pass on the callbacks to ACM only for new vendor
- if(btif_ahim_is_aosp_aidl_hal_enabled()) {
- if (pclient_cbs[AUDIO_GROUP_MGR - 1] &&
- pclient_cbs[AUDIO_GROUP_MGR - 1]->params_update) {
- BTIF_TRACE_IMP("%s: calling updateParams for Audio Group Manager", __func__);
- pclient_cbs[AUDIO_GROUP_MGR - 1]->params_update(delay, mode);
- }
- }
-}
-
void btif_ahim_update_sink_metadata (const sink_metadata_t& sink_metadata) {
auto track_count = sink_metadata.track_count;
auto source = sink_metadata.tracks->source;
@@ -518,6 +511,8 @@ LeAudioConfiguration fetch_offload_audio_config(int profile, int direction) {
uint16_t type = pclient_cbs[profile - 1]->get_profile_status_cb();
uint16_t frame_duration = pclient_cbs[profile - 1]->get_frame_length_cb(direction);
+
+#ifdef ADV_AUDIO_FEATURE
bool is_lc3q_supported = false;
CodecIndex codec_type = (CodecIndex) pclient_cbs[profile - 1]->get_codec_type(direction);
if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_LE ||
@@ -527,7 +522,6 @@ LeAudioConfiguration fetch_offload_audio_config(int profile, int direction) {
<< frame_duration << ", from leaudio_configs.xml";
}
uint8_t encoder_version = 0;
- if(1) {
/*if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_LE ||
pclient_cbs[profile - 1]->get_is_codec_type_lc3q(direction)) {*/
VendorConfiguration vendor_config;
@@ -565,12 +559,11 @@ LeAudioConfiguration fetch_offload_audio_config(int profile, int direction) {
le_vendor_config.vendorCodecType = VendorCodecType::APTX_ADAPTIVE_R4;
LOG(ERROR) << __func__ << ": AptX R4 metadata params are updated";
for (int i = 0; i < 4; i++) {
- le_vendor_config.codecSpecificData.push_back((pclient_cbs[profile - 1]->get_mode_cb() &
- (0xff <<((3 - i)*8))) >> ((3 - i)*8));
- }
- for (int i = 4; i < 6; i++) {
- le_vendor_config.codecSpecificData.push_back((unicastSinkClientInterface->GetRemoteDelay() &
- (0xff <<((5 - i)*8))) >> ((5 - i)*8));
+ le_vendor_config.codecSpecificData.push_back((
+ pclient_cbs[profile - 1]->get_mode_cb() &
+ (0xff <<((3 - i)*8))) >> ((3 - i)*8));
+ BTIF_TRACE_IMP("%s: AIDL, extension metadata for AAR4 [%d]: %d", __func__, i+16,
+ le_vendor_config.codecSpecificData[i+16]);
}
} else {
le_vendor_config.vendorCodecType = VendorCodecType::APTX_ADAPTIVE_R3;
@@ -636,7 +629,7 @@ LeAudioConfiguration fetch_offload_audio_config(int profile, int direction) {
}
}
return ucast_config;
- } else {
+#else /* ADV_AUDIO_FEATURE */
// TODO to fill the right PD
Lc3Configuration lc3_config = {
.pcmBitDepth = 24,
@@ -662,7 +655,7 @@ LeAudioConfiguration fetch_offload_audio_config(int profile, int direction) {
});
}
return ucast_config;
- }
+#endif /* ADV_AUDIO_FEATURE */
}
bool leAudio_get_selected_hal_codec_config(AudioConfigurationAIDL *lea_config,
@@ -699,6 +692,7 @@ bool btif_ahim_setup_codec(uint8_t profile) {
uint16_t profile_type = btif_ahim_get_lea_active_profile(profile);
BTIF_TRACE_IMP("%s: AIDL, profile_type: %d", __func__, profile_type);
if(profile_type == BAP || profile_type == GCP) { // ToAIr only
+#ifdef ADV_AUDIO_FEATURE
CodecIndex codec_type = (CodecIndex) pclient_cbs[profile - 1]->get_codec_type(TX_ONLY_CONFIG);
if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_R4) {
if (!leAudio_get_selected_hal_codec_config(&lea_tx_config, profile,
@@ -717,6 +711,7 @@ bool btif_ahim_setup_codec(uint8_t profile) {
if(unicastSourceClientInterface)
unicastSourceClientInterface->UpdateAudioConfigToHal(lea_rx_config);
} else {
+#endif
if (!leAudio_get_selected_hal_codec_config(&lea_tx_config, profile,
TX_ONLY_CONFIG)) {
LOG(ERROR) << __func__ << ": Failed to get CodecConfiguration";
@@ -728,7 +723,9 @@ bool btif_ahim_setup_codec(uint8_t profile) {
// TODO to fill both session/single session configs based on profile
if(unicastSinkClientInterface)
unicastSinkClientInterface->UpdateAudioConfigToHal(lea_tx_config);
+#ifdef ADV_AUDIO_FEATURE
}
+#endif
} else if(profile_type == BAP_CALL ||
profile_type == GCP_RX ||
profile_type == WMCP_TX) { // Toair and FromAir
@@ -786,6 +783,7 @@ void btif_ahim_start_session(uint8_t profile) {
btif_ahim_get_lea_active_profile(profile);
BTIF_TRACE_IMP("%s: AIDL, profile_type: %d", __func__, profile_type);
if(profile_type == BAP || profile_type == GCP) { // ToAIr only
+#ifdef ADV_AUDIO_FEATURE
CodecIndex codec_type = (CodecIndex) pclient_cbs[profile - 1]->get_codec_type(TX_ONLY_CONFIG);
if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_R4) {
if(unicastSinkClientInterface)
@@ -793,9 +791,12 @@ void btif_ahim_start_session(uint8_t profile) {
if(unicastSourceClientInterface)
unicastSourceClientInterface->StartSession();
} else {
+#endif
if(unicastSinkClientInterface)
unicastSinkClientInterface->StartSession();
+#ifdef ADV_AUDIO_FEATURE
}
+#endif
} else if(profile_type == BAP_CALL ||
profile_type == GCP_RX ||
profile_type == WMCP_TX) { // Toair and FromAir
@@ -1181,28 +1182,6 @@ size_t btif_ahim_read(uint8_t* p_buf, uint32_t len) {
return bluetooth::audio::aidl::a2dp::read(p_buf, len);
}
-void btif_ahim_update_audio_config() {
- AudioConfigurationAIDL lea_tx_config, lea_rx_config;
- CodecIndex codec_type =
- (CodecIndex) pclient_cbs[AUDIO_GROUP_MGR - 1]->get_codec_type(TX_ONLY_CONFIG);
- if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_R4) {
- if (!leAudio_get_selected_hal_codec_config(&lea_tx_config, AUDIO_GROUP_MGR,
- TX_ONLY_CONFIG)) {
- LOG(ERROR) << __func__ << ": Failed to get CodecConfiguration";
- return;
- }
- if(unicastSinkClientInterface)
- unicastSinkClientInterface->UpdateAudioConfigToHal(lea_tx_config);
- }
-}
-
-uint16_t btif_ahim_get_remote_delay() {
-if(unicastSinkClientInterface)
- return unicastSinkClientInterface->GetRemoteDelay();
-else
- return 0xFFFF;
-}
-
void btif_ahim_set_remote_delay(uint16_t delay_report, uint8_t profile) {
BTIF_TRACE_IMP("%s: AIDL, profile: %d, delay_report: %d",
__func__, profile, delay_report);
@@ -1227,6 +1206,7 @@ void btif_ahim_set_remote_delay(uint16_t delay_report, uint8_t profile) {
if(unicastSourceClientInterface)
unicastSourceClientInterface->SetRemoteDelay(delay_report);
}
+
} else if (profile == BROADCAST) {
if (broadcastSinkClientInterface) {
broadcastSinkClientInterface->SetRemoteDelay(delay_report);
diff --git a/btif/src/btif_core.cc b/btif/src/btif_core.cc
index 843b1eb66..44d6acb94 100644
--- a/btif/src/btif_core.cc
+++ b/btif/src/btif_core.cc
@@ -67,7 +67,6 @@
#include "stack_manager.h"
#include "device/include/device_iot_config.h"
-#include "btif_ahim.h"
using bluetooth::Uuid;
/*******************************************************************************
* Constants & Macros
@@ -1450,8 +1449,3 @@ bt_status_t btif_set_dynamic_audio_buffer_size(int codec, int size) {
return BT_STATUS_SUCCESS;
}
-
-void btif_update_params(uint16_t delay, uint8_t mode) {
- BTIF_TRACE_DEBUG("%s", __func__);
- btif_ahim_update_params(delay, mode);
-}