Skip to content
Snippets Groups Projects
Commit a9c53c68 authored by Zach Johnson's avatar Zach Johnson
Browse files

Add ability to disable wide band speech

Some HF android-based devices need to disable
wide band speech due to interop issues.

Test: Pair and test phone calls
Bug: 65053641

Change-Id: Ie8c4a50c40149562d6b52336fba1a61f1abf5198
parent f719457e
No related branches found
No related tags found
No related merge requests found
...@@ -379,8 +379,10 @@ static void bta_ag_create_sco(tBTA_AG_SCB* p_scb, bool is_orig) { ...@@ -379,8 +379,10 @@ static void bta_ag_create_sco(tBTA_AG_SCB* p_scb, bool is_orig) {
return; return;
} }
#if (DISABLE_WBS == FALSE)
if ((p_scb->sco_codec == BTA_AG_CODEC_MSBC) && !p_scb->codec_fallback) if ((p_scb->sco_codec == BTA_AG_CODEC_MSBC) && !p_scb->codec_fallback)
esco_codec = BTA_AG_CODEC_MSBC; esco_codec = BTA_AG_CODEC_MSBC;
#endif
if (p_scb->codec_fallback) { if (p_scb->codec_fallback) {
p_scb->codec_fallback = false; p_scb->codec_fallback = false;
...@@ -621,9 +623,14 @@ static void bta_ag_sco_event(tBTA_AG_SCB* p_scb, uint8_t event) { ...@@ -621,9 +623,14 @@ static void bta_ag_sco_event(tBTA_AG_SCB* p_scb, uint8_t event) {
/* remove listening connection */ /* remove listening connection */
bta_ag_remove_sco(p_scb, false); bta_ag_remove_sco(p_scb, false);
#if (DISABLE_WBS == FALSE)
/* start codec negotiation */ /* start codec negotiation */
p_sco->state = BTA_AG_SCO_CODEC_ST; p_sco->state = BTA_AG_SCO_CODEC_ST;
bta_ag_codec_negotiate(p_scb); bta_ag_codec_negotiate(p_scb);
#else
bta_ag_create_sco(p_scb, true);
p_sco->state = BTA_AG_SCO_OPENING_ST;
#endif
break; break;
case BTA_AG_SCO_SHUTDOWN_E: case BTA_AG_SCO_SHUTDOWN_E:
...@@ -718,11 +725,13 @@ static void bta_ag_sco_event(tBTA_AG_SCB* p_scb, uint8_t event) { ...@@ -718,11 +725,13 @@ static void bta_ag_sco_event(tBTA_AG_SCB* p_scb, uint8_t event) {
} }
break; break;
#if (DISABLE_WBS == FALSE)
case BTA_AG_SCO_REOPEN_E: case BTA_AG_SCO_REOPEN_E:
/* start codec negotiation */ /* start codec negotiation */
p_sco->state = BTA_AG_SCO_CODEC_ST; p_sco->state = BTA_AG_SCO_CODEC_ST;
bta_ag_codec_negotiate(p_scb); bta_ag_codec_negotiate(p_scb);
break; break;
#endif
case BTA_AG_SCO_XFER_E: case BTA_AG_SCO_XFER_E:
/* save xfer scb */ /* save xfer scb */
...@@ -995,11 +1004,18 @@ static void bta_ag_sco_event(tBTA_AG_SCB* p_scb, uint8_t event) { ...@@ -995,11 +1004,18 @@ static void bta_ag_sco_event(tBTA_AG_SCB* p_scb, uint8_t event) {
bta_ag_create_sco(p_scb, false); bta_ag_create_sco(p_scb, false);
bta_ag_remove_sco(p_sco->p_xfer_scb, false); bta_ag_remove_sco(p_sco->p_xfer_scb, false);
#if (DISABLE_WBS == FALSE)
/* start codec negotiation */ /* start codec negotiation */
p_sco->state = BTA_AG_SCO_CODEC_ST; p_sco->state = BTA_AG_SCO_CODEC_ST;
tBTA_AG_SCB* p_cn_scb = p_sco->p_xfer_scb; tBTA_AG_SCB* p_cn_scb = p_sco->p_xfer_scb;
p_sco->p_xfer_scb = nullptr; p_sco->p_xfer_scb = nullptr;
bta_ag_codec_negotiate(p_cn_scb); bta_ag_codec_negotiate(p_cn_scb);
#else
/* create sco connection to peer */
bta_ag_create_sco(p_sco->p_xfer_scb, true);
p_sco->p_xfer_scb = nullptr;
p_sco->state = BTA_AG_SCO_OPENING_ST;
#endif
break; break;
} }
......
...@@ -280,6 +280,10 @@ ...@@ -280,6 +280,10 @@
#define BTM_SCO_INCLUDED TRUE /* TRUE includes SCO code */ #define BTM_SCO_INCLUDED TRUE /* TRUE includes SCO code */
#endif #endif
#ifndef DISABLE_WBS
#define DISABLE_WBS FALSE
#endif
/* This is used to work around a controller bug that doesn't like Disconnect /* This is used to work around a controller bug that doesn't like Disconnect
* issued while there is a role switch in progress * issued while there is a role switch in progress
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment