Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af029c0b authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "BTA HF_CLIENT: Always reply to +BCS"

parents 58047442 39b51f29
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -445,11 +445,6 @@ static void bta_hf_client_handle_bcs(tBTA_HF_CLIENT_CB* client_cb,
                                     uint32_t codec) {
  APPL_TRACE_DEBUG("%s: codec: %u sco listen state: %d", __func__, codec,
                   client_cb->sco_state);

  // Only send acceptance for the codec request if we are ready to accept the
  // SCO connection. sco_state is set to listen when the upper layer calls for
  // audio connection.
  if (client_cb->sco_state == BTA_HF_CLIENT_SCO_LISTEN_ST) {
  if (codec == BTM_SCO_CODEC_CVSD || codec == BTM_SCO_CODEC_MSBC) {
    client_cb->negotiated_codec = codec;
    bta_hf_client_send_at_bcs(client_cb, codec);
@@ -458,7 +453,6 @@ static void bta_hf_client_handle_bcs(tBTA_HF_CLIENT_CB* client_cb,
    bta_hf_client_send_at_bac(client_cb);
  }
}
}

static void bta_hf_client_handle_bsir(tBTA_HF_CLIENT_CB* client_cb,
                                      uint32_t provided) {
+15 −6
Original line number Diff line number Diff line
@@ -330,12 +330,25 @@ static void bta_hf_client_sco_event(tBTA_HF_CLIENT_CB* client_cb,
  switch (client_cb->sco_state) {
    case BTA_HF_CLIENT_SCO_SHUTDOWN_ST:
      switch (event) {
        // For WBS we only listen to SCO requests. Even for outgoing SCO
        // requests we first do a AT+BCC and wait for remote to initiate SCO
        case BTA_HF_CLIENT_SCO_LISTEN_E:
          /* create sco listen connection */
          bta_hf_client_sco_create(client_cb, false);
          client_cb->sco_state = BTA_HF_CLIENT_SCO_LISTEN_ST;
          break;

        // For non WBS cases and enabling outgoing SCO requests we need to force
        // open a SCO channel
        case BTA_HF_CLIENT_SCO_OPEN_E:
          /* remove listening connection */
          bta_hf_client_sco_remove(client_cb);

          /* create sco connection to peer */
          bta_hf_client_sco_create(client_cb, true);
          client_cb->sco_state = BTA_HF_CLIENT_SCO_OPENING_ST;
          break;

        default:
          APPL_TRACE_WARNING("BTA_HF_CLIENT_SCO_SHUTDOWN_ST: Ignoring event %d",
                             event);
@@ -345,10 +358,6 @@ static void bta_hf_client_sco_event(tBTA_HF_CLIENT_CB* client_cb,

    case BTA_HF_CLIENT_SCO_LISTEN_ST:
      switch (event) {
        case BTA_HF_CLIENT_SCO_LISTEN_E:
          /* Ignore */
          break;

        case BTA_HF_CLIENT_SCO_OPEN_E:
          /* remove listening connection */
          bta_hf_client_sco_remove(client_cb);
@@ -396,8 +405,8 @@ static void bta_hf_client_sco_event(tBTA_HF_CLIENT_CB* client_cb,

        case BTA_HF_CLIENT_SCO_CONN_CLOSE_E:
          /* sco failed; create sco listen connection */
          bta_hf_client_sco_create(client_cb, false);
          client_cb->sco_state = BTA_HF_CLIENT_SCO_LISTEN_ST;
          // bta_hf_client_sco_create(client_cb, false);
          client_cb->sco_state = BTA_HF_CLIENT_SCO_SHUTDOWN_ST;
          break;

        default: