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

Commit bee0353c authored by Henri Chataing's avatar Henri Chataing
Browse files

Relax the check for the error code in bta_av_setconfig_rej

Use the default error code AVDT_ERR_UNSUP_CFG when
not set, rather than assert.

Bug: 365696112
Bug: 338139069
Flag: com.android.bluetooth.flags.avdtp_error_codes
Test: m com.android.btservices
Change-Id: Iadae28ae7a4debb808f344cde31c7b66f26648b7
parent 3783c7bf
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1766,9 +1766,11 @@ void bta_av_setconfig_rej(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
    err_code = AVDT_ERR_UNSUP_CFG;
  }

  // The error code must be set by the caller, otherwise
  // AVDT_ConfigRsp will interpret the event as RSP instead of REJ.
  log::assert_that(err_code != 0, "err_code != 0");
  // The error code might not be set when the configuration is rejected
  // based on the current AVDTP state.
  if (err_code == AVDT_SUCCESS) {
    err_code = AVDT_ERR_UNSUP_CFG;
  }

  AVDT_ConfigRsp(avdt_handle, p_scb->avdt_label, err_code, 0);