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

Commit 59582ba3 authored by Zach Johnson's avatar Zach Johnson
Browse files

booleans are a thing for a reason

so don't create an enum that looks like
a boolean and doesn't add any helpful context

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I1b43513dd49e1bec17695783cb5e370f306892fc
parent 4c4dac04
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -328,7 +328,7 @@ static void bta_sdp_search_cback(uint16_t result, void* user_data) {
  int count = 0;
  APPL_TRACE_DEBUG("%s() -  res: 0x%x", __func__, result);

  bta_sdp_cb.sdp_active = BTA_SDP_ACTIVE_NONE;
  bta_sdp_cb.sdp_active = false;

  if (bta_sdp_cb.p_dm_cback == NULL) return;

@@ -423,7 +423,7 @@ void bta_sdp_search(const RawAddress bd_addr, const bluetooth::Uuid uuid) {

  APPL_TRACE_DEBUG("%s in, sdp_active:%d", __func__, bta_sdp_cb.sdp_active);

  if (bta_sdp_cb.sdp_active != BTA_SDP_ACTIVE_NONE) {
  if (bta_sdp_cb.sdp_active) {
    /* SDP is still in progress */
    status = BTA_SDP_BUSY;
    if (bta_sdp_cb.p_dm_cback) {
@@ -439,7 +439,7 @@ void bta_sdp_search(const RawAddress bd_addr, const bluetooth::Uuid uuid) {
    return;
  }

  bta_sdp_cb.sdp_active = BTA_SDP_ACTIVE_YES;
  bta_sdp_cb.sdp_active = true;
  bta_sdp_cb.remote_addr = bd_addr;

  /* initialize the search for the uuid */
@@ -453,7 +453,7 @@ void bta_sdp_search(const RawAddress bd_addr, const bluetooth::Uuid uuid) {
  if (!SDP_ServiceSearchAttributeRequest2(bd_addr, p_bta_sdp_cfg->p_sdp_db,
                                          bta_sdp_search_cback,
                                          (void*)bta_sdp_search_uuid)) {
    bta_sdp_cb.sdp_active = BTA_SDP_ACTIVE_NONE;
    bta_sdp_cb.sdp_active = false;

    /* failed to start SDP. report the failure right away */
    if (bta_sdp_cb.p_dm_cback) {
+1 −6
Original line number Diff line number Diff line
@@ -35,14 +35,9 @@
 *  Constants
 ****************************************************************************/

enum {
  BTA_SDP_ACTIVE_NONE = 0,
  BTA_SDP_ACTIVE_YES /* waiting for SDP result */
};

/* SDP control block */
typedef struct {
  uint8_t sdp_active; /* see BTA_SDP_SDP_ACT_* */
  bool sdp_active;
  RawAddress remote_addr;
  tBTA_SDP_DM_CBACK* p_dm_cback;
} tBTA_SDP_CB;