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

Commit 68fcce00 authored by Chris Manton's avatar Chris Manton
Browse files

stack::sdp Ensure return value failures are logged

Bug: 339288758
Test: m .
Flag: EXEMPT, Logging Change
Change-Id: I293a38ae5244dda0dc71d9352465c8ef496db544
parent ec1b8d72
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -730,9 +730,11 @@ static void bta_dm_find_services(const RawAddress& bd_addr) {
     * If discovery is not successful with this device, then
     * proceed with the next one.
     */
    log::warn("Unable to start SDP service search attribute request peer:{}",
              bd_addr);

    osi_free_and_reset((void**)&bta_dm_discovery_cb.p_sdp_db);
    bta_dm_discovery_cb.service_index = BTA_MAX_SERVICE_ID;
    log::info("SDP not successful");
    bta_dm_disc_sm_execute(BTA_DM_DISCOVERY_RESULT_EVT,
                           std::make_unique<tBTA_DM_MSG>(tBTA_DM_SVC_RES{
                               .bd_addr = bta_dm_discovery_cb.peer_bdaddr,
+3 −0
Original line number Diff line number Diff line
@@ -1103,6 +1103,9 @@ static void bta_dm_find_services(const RawAddress& bd_addr) {
      if (!get_legacy_stack_sdp_api()
               ->service.SDP_ServiceSearchAttributeRequest(
                   bd_addr, bta_dm_search_cb.p_sdp_db, &bta_dm_sdp_callback)) {
        log::warn(
            "Unable to start SDP service search attribute request peer:{}",
            bd_addr);
        /*
         * If discovery is not successful with this device, then
         * proceed with the next one.
+2 −0
Original line number Diff line number Diff line
@@ -438,6 +438,8 @@ static tGATT_STATUS bta_gattc_sdp_service_disc(uint16_t conn_id,
  if (!get_legacy_stack_sdp_api()->service.SDP_ServiceSearchAttributeRequest2(
          p_server_cb->server_bda, cb_data->p_sdp_db, &bta_gattc_sdp_callback,
          const_cast<const void*>(static_cast<void*>(cb_data)))) {
    log::warn("Unable to start SDP service search attribute request peer:{}",
              p_server_cb->server_bda);
    osi_free(cb_data);
    return GATT_ERROR;
  }
+2 −0
Original line number Diff line number Diff line
@@ -358,6 +358,8 @@ void bta_hf_client_do_disc(tBTA_HF_CLIENT_CB* client_cb) {
  }

  if (!db_inited) {
    log::warn("Unable to start SDP service search request peer:{}",
              client_cb->peer_addr);
    /*free discover db */
    osi_free_and_reset((void**)&client_cb->p_disc_db);
    /* sent failed event */
+2 −0
Original line number Diff line number Diff line
@@ -699,6 +699,8 @@ void bta_sdp_search(const RawAddress bd_addr, const bluetooth::Uuid uuid) {
  if (!get_legacy_stack_sdp_api()->service.SDP_ServiceSearchAttributeRequest2(
          bd_addr, p_bta_sdp_cfg->p_sdp_db, bta_sdp_search_cback,
          (void*)bta_sdp_search_uuid)) {
    log::warn("Unable to start SDP service search attribute request peer:{}",
              bd_addr);
    bta_sdp_cb.sdp_active = false;

    /* failed to start SDP. report the failure right away */
Loading