Skip to content

Commit

Permalink
SDP: Only start discovery once
Browse files Browse the repository at this point in the history
Bug: 174052148
Test: pair with headphones
Tag: #security
Change-Id: I1d014a7b793bb1b66e26652f6696499ea36a6510
(cherry picked from commit cfa5a74ea90a09e1c7413a25f04332ee2d1e3f21)
Merged-In: I1d014a7b793bb1b66e26652f6696499ea36a6510
(cherry picked from commit f0994f6e4723eddaa617b68139f064d945d9389e)
  • Loading branch information
myles-android authored and haggertk committed Mar 4, 2021
1 parent 6d8d51b commit ab54cd0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bta/ag/bta_ag_sdp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "bta_api.h"
#include "bta_sys.h"
#include "btm_api.h"
#include "osi/include/log.h"
#include "osi/include/osi.h"
#include "sdp_api.h"
#include "utl.h"
Expand Down Expand Up @@ -452,6 +453,12 @@ void bta_ag_do_disc(tBTA_AG_SCB* p_scb, tBTA_SERVICE_MASK service) {
}
}

if (p_scb->p_disc_db != nullptr) {
android_errorWriteLog(0x534e4554, "174052148");
APPL_TRACE_ERROR("Discovery already in progress... returning.");
return;
}

/* allocate buffer for sdp database */
p_scb->p_disc_db = (tSDP_DISCOVERY_DB*)osi_malloc(BTA_AG_DISC_BUF_SIZE);
/* set up service discovery database; attr happens to be attr_list len */
Expand Down

0 comments on commit ab54cd0

Please sign in to comment.