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

Commit 4be3e5d5 authored by Calvin On's avatar Calvin On
Browse files

Only initiate Codec Negotation if locally supported.

Currently, because of aosp/683369 the device will initiate
Codec Negotiation even if the remote device does not send the
required AT+BAC command during Service Level Connection setup.

This enables in the following out-of-spec sequence:
1. Device sends Codec Negotiation NOT supported to a Headset which does.
2. Headset respects the feature not supported, and does not send AT+BAC.
3. Device initiates Codec Negotiation with the Headset anyway.

This check ensures that Device will not attempt to initiate
Codec Negotiation at all if the local feature is not enabled.

Bug: 267171863
Test: make
Change-Id: I446e071e3b66875a2bacde228841ca703acd5739
parent 52f330bc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -593,6 +593,7 @@ void bta_ag_codec_negotiate(tBTA_AG_SCB* p_scb) {
  }

  if ((p_scb->codec_updated || p_scb->codec_fallback) &&
      (p_scb->features & BTA_AG_FEAT_CODEC) &&
      (p_scb->peer_features & BTA_AG_PEER_FEAT_CODEC)) {
    LOG_INFO("Starting codec negotiation");
    /* Change the power mode to Active until SCO open is completed. */