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

Commit b3c9912c authored by Zach Johnson's avatar Zach Johnson
Browse files

btm_inq_vars.scan_type is not useful

was never checked to do anything interesting, was always general or none

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ie8d7e20a11a5d256cc19504abdfdb893f18459f6
parent 04d63c90
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -242,7 +242,6 @@ tBTM_STATUS bluetooth::shim::BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
  std::lock_guard<std::mutex> lock(btm_cb_mutex_);

  btm_cb.btm_inq_vars.inq_cmpl_info.num_resp = 0;
  btm_cb.btm_inq_vars.scan_type = INQ_GENERAL;

  Stack::GetInstance()->GetBtm()->StartActiveScanning();
  if (inqparms.duration != 0) {
@@ -293,10 +292,6 @@ tBTM_STATUS bluetooth::shim::BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
                btm_cb.btm_inq_vars.p_inq_cmpl_cb = nullptr;
              }
            }
            if (btm_cb.btm_inq_vars.inqparms.mode == BTM_INQUIRY_NONE &&
                btm_cb.btm_inq_vars.scan_type == INQ_GENERAL) {
              btm_cb.btm_inq_vars.scan_type = INQ_NONE;
            }
          })) {
    LOG_WARN("%s Unable to start inquiry", __func__);
    return BTM_ERR_PROCESSING;
@@ -395,7 +390,6 @@ tBTM_STATUS bluetooth::shim::BTM_BleObserve(bool start, uint8_t duration_sec,
            btm_cb.ble_ctr_cb.p_obs_cmpl_cb = nullptr;

            btm_cb.btm_inq_vars.inqparms.mode &= ~(BTM_BLE_INQUIRY_MASK);
            btm_cb.btm_inq_vars.scan_type = INQ_NONE;

            btm_acl_update_inquiry_status(BTM_INQUIRY_COMPLETE);

@@ -559,10 +553,6 @@ void bluetooth::shim::BTM_CancelInquiry(void) {
      btm_cb.btm_inq_vars.p_inq_cmpl_cb = nullptr;
    }
  }
  if (btm_cb.btm_inq_vars.inqparms.mode == BTM_INQUIRY_NONE &&
      btm_cb.btm_inq_vars.scan_type == INQ_GENERAL) {
    btm_cb.btm_inq_vars.scan_type = INQ_NONE;
  }
}

tBTM_STATUS bluetooth::shim::BTM_ReadRemoteDeviceName(
+2 −3
Original line number Diff line number Diff line
@@ -389,9 +389,8 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration,
  uint32_t scan_window =
      !p_inq->scan_window ? BTM_BLE_GAP_DISC_SCAN_WIN : p_inq->scan_window;

  BTM_TRACE_EVENT("%s : scan_type:%d, %d, %d", __func__,
                  btm_cb.btm_inq_vars.scan_type, p_inq->scan_interval,
                  p_inq->scan_window);
  BTM_TRACE_EVENT("%s : scan_type:%d, %d, %d", __func__, p_inq->scan_type,
                  p_inq->scan_interval, p_inq->scan_window);

  if (!controller_get_interface()->supports_ble()) return BTM_ILLEGAL_VALUE;

+0 −7
Original line number Diff line number Diff line
@@ -563,8 +563,6 @@ tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
  if (p_inq->inq_active) {
    LOG(ERROR) << __func__ << ": BTM_BUSY";
    return (BTM_BUSY);
  } else {
    p_inq->scan_type = INQ_GENERAL;
  }

  /*** Make sure the device is ready ***/
@@ -1357,11 +1355,6 @@ void btm_process_inq_complete(uint8_t status, uint8_t mode) {
      if (p_inq_cb) (p_inq_cb)((tBTM_INQUIRY_CMPL*)&p_inq->inq_cmpl_info);
    }
  }
  if (p_inq->inqparms.mode == 0 &&
      p_inq->scan_type == INQ_GENERAL)  // this inquiry is complete
  {
    p_inq->scan_type = INQ_NONE;
  }
#if (BTM_INQ_DEBUG == TRUE)
  BTM_TRACE_DEBUG("inq_active:0x%x state:%d", btm_cb.btm_inq_vars.inq_active,
                  btm_cb.btm_inq_vars.state);
+0 −1
Original line number Diff line number Diff line
@@ -179,7 +179,6 @@ typedef struct {
  uint16_t inq_scan_period;
  uint16_t inq_scan_type;
  uint16_t page_scan_type; /* current page scan type */
  tBTM_INQ_TYPE scan_type;

  RawAddress remname_bda; /* Name of bd addr for active remote name request */
#define BTM_RMT_NAME_EXT 0x1 /* Initiated through API */