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

Commit 9fd10491 authored by Chris Manton's avatar Chris Manton
Browse files

stack::sdp [4/12] handle.SDP_DeleteRecord

Bug: 339311914
Test: m .
Flag: EXEMPT, Logging Change

Change-Id: I77dd9d3c88c9fe796e34fb7b85c64dad770a3ec2
parent 9321662b
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -300,8 +300,11 @@ void bta_ag_del_records(tBTA_AG_SCB* p_scb) {
    if (((services & 1) == 1) && ((others & 1) == 0)) {
      log::verbose("bta_ag_del_records {}", i);
      if (bta_ag_cb.profile[i].sdp_handle != 0) {
        get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
        if (!get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
                bta_ag_cb.profile[i].sdp_handle)) {
          log::warn("Unable to delete record sdp_handle:{}",
                    bta_ag_cb.profile[i].sdp_handle);
        }
        bta_ag_cb.profile[i].sdp_handle = 0;
      }
      BTA_FreeSCN(bta_ag_cb.profile[i].scn);
+10 −4
Original line number Diff line number Diff line
@@ -255,8 +255,11 @@ void bta_ar_dereg_avrc(uint16_t service_uuid) {
  if (service_uuid == UUID_SERVCLASS_AV_REM_CTRL_TARGET) {
    if (bta_ar_cb.sdp_tg_handle && mask == bta_ar_cb.tg_registered) {
      bta_ar_cb.tg_registered = 0;
      get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
      if (!get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
              bta_ar_cb.sdp_tg_handle)) {
        log::warn("Unable to delete SDP record handle:{}",
                  bta_ar_cb.sdp_tg_handle);
      }
      bta_ar_cb.sdp_tg_handle = 0;
      bta_sys_remove_uuid(service_uuid);
    }
@@ -266,8 +269,11 @@ void bta_ar_dereg_avrc(uint16_t service_uuid) {
      categories = bta_ar_cb.ct_categories[0] | bta_ar_cb.ct_categories[1];
      if (!categories) {
        /* no CT is still registered - cleaup */
        get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
        if (get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
                bta_ar_cb.sdp_ct_handle)) {
          log::warn("Unable to delete SDP record handle:{}",
                    bta_ar_cb.sdp_ct_handle);
        }
        bta_ar_cb.sdp_ct_handle = 0;
        bta_sys_remove_uuid(service_uuid);
      } else {
+3 −1
Original line number Diff line number Diff line
@@ -183,7 +183,9 @@ static void bta_av_close_all_rc(tBTA_AV_CB* p_cb) {
 ******************************************************************************/
static void bta_av_del_sdp_rec(uint32_t* p_sdp_handle) {
  if (*p_sdp_handle != 0) {
    get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(*p_sdp_handle);
    if (!get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(*p_sdp_handle)) {
      log::warn("Unable to delete SDP record:{}", *p_sdp_handle);
    }
    *p_sdp_handle = 0;
  }
}
+10 −4
Original line number Diff line number Diff line
@@ -165,13 +165,19 @@ static void bta_av_api_enable(tBTA_AV_DATA* p_data) {
      return;
    }
    if (bta_av_cb.sdp_a2dp_handle) {
      get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
      if (!get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
              bta_av_cb.sdp_a2dp_handle)) {
        log::warn("Unable to delete SDP record handle:{}",
                  bta_av_cb.sdp_a2dp_handle);
      }
      bta_sys_remove_uuid(UUID_SERVCLASS_AUDIO_SOURCE);
    }
    if (bta_av_cb.sdp_a2dp_snk_handle) {
      get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
      if (!get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
              bta_av_cb.sdp_a2dp_snk_handle)) {
        log::warn("Unable to delete SDP record handle:{}",
                  bta_av_cb.sdp_a2dp_snk_handle);
      }
      bta_sys_remove_uuid(UUID_SERVCLASS_AUDIO_SINK);
    }
    // deregister from AVDT
+12 −3
Original line number Diff line number Diff line
@@ -132,7 +132,10 @@ void bta_hd_api_disable(void) {

  /* Remove service record */
  if (bta_hd_cb.sdp_handle != 0) {
    get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(bta_hd_cb.sdp_handle);
    if (!get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
            bta_hd_cb.sdp_handle)) {
      log::warn("Unable to delete SDP record handle:{}", bta_hd_cb.sdp_handle);
    };
    bta_sys_remove_uuid(UUID_SERVCLASS_HUMAN_INTERFACE);
  }

@@ -189,7 +192,10 @@ void bta_hd_register_act(tBTA_HD_DATA* p_data) {

  /* Remove old record if for some reason it's already registered */
  if (bta_hd_cb.sdp_handle != 0) {
    get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(bta_hd_cb.sdp_handle);
    if (!get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
            bta_hd_cb.sdp_handle)) {
      log::warn("Unable to delete SDP record handle:{}", bta_hd_cb.sdp_handle);
    }
  }

  bta_hd_cb.use_report_id = use_report_id;
@@ -237,7 +243,10 @@ void bta_hd_unregister_act() {
  HID_DevSetIncomingPolicy(FALSE);

  if (bta_hd_cb.sdp_handle != 0) {
    get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(bta_hd_cb.sdp_handle);
    if (!get_legacy_stack_sdp_api()->handle.SDP_DeleteRecord(
            bta_hd_cb.sdp_handle)) {
      log::warn("Unable to delete SDP record handle:{}", bta_hd_cb.sdp_handle);
    }
  }

  bta_hd_cb.sdp_handle = 0;
Loading