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

Commit 165e1325 authored by Chris Manton's avatar Chris Manton Committed by Gerrit Code Review
Browse files

Merge changes I76dbf73a,I5f9317ef,Ic2ef77de into main

* changes:
  Remove unused stack::btm::btm_ble_resume_bg_conn
  Remove unused stack::btm::btm_ble_suspend_bg_conn
  Dead code removal stack::btm::btm_ble_update_mode_operation
parents 65bbd11d 76448642
Loading
Loading
Loading
Loading
+0 −34
Original line number Diff line number Diff line
@@ -91,40 +91,6 @@ void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy) {
                               scan_policy);
}

/*******************************************************************************
 *
 * Function         btm_ble_suspend_bg_conn
 *
 * Description      This function is to suspend an active background connection
 *                  procedure.
 *
 * Parameters       none.
 *
 * Returns          none.
 *
 ******************************************************************************/
bool btm_ble_suspend_bg_conn(void) {
    LOG_DEBUG("Gd acl_manager handles sync of background connections");
    return true;
}

/*******************************************************************************
 *
 * Function         btm_ble_resume_bg_conn
 *
 * Description      This function is to resume a background auto connection
 *                  procedure.
 *
 * Parameters       none.
 *
 * Returns          none.
 *
 ******************************************************************************/
bool btm_ble_resume_bg_conn(void) {
    LOG_DEBUG("Gd acl_manager handles sync of background connections");
    return true;
}

/** Adds the device into acceptlist. Returns false if acceptlist is full and
 * device can't be added, true otherwise. */
bool BTM_AcceptlistAdd(const RawAddress& address) {
+0 −18
Original line number Diff line number Diff line
@@ -3226,24 +3226,6 @@ void btm_ble_update_mode_operation(uint8_t link_role, const RawAddress* bd_addr,
    btm_ble_set_connectability(btm_cb.btm_inq_vars.connectable_mode |
                               btm_cb.ble_ctr_cb.inq_var.connectable_mode);
  }

  /* in case of disconnected, we must cancel bgconn and restart
     in order to add back device to acceptlist in order to reconnect */
  if (bd_addr != nullptr) {
      LOG_DEBUG("gd_acl enabled so skip background connection logic");
  }

  /* when no connection is attempted, and controller is not rejecting last
     request
     due to resource limitation, start next direct connection or background
     connection
     now in order */
  if (btm_cb.ble_ctr_cb.is_connection_state_idle() &&
      status != HCI_ERR_HOST_REJECT_RESOURCES &&
      status != HCI_ERR_MAX_NUM_OF_CONNECTIONS) {
      LOG_DEBUG("Resuming le background connections");
      btm_ble_resume_bg_conn();
  }
}

/*******************************************************************************
+0 −2
Original line number Diff line number Diff line
@@ -48,8 +48,6 @@ void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode,
void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy);

/* background connection function */
bool btm_ble_suspend_bg_conn(void);
bool btm_ble_resume_bg_conn(void);
void btm_ble_update_mode_operation(uint8_t link_role, const RawAddress* bda,
                                   tHCI_STATUS status);
/* BLE address management */
+0 −10
Original line number Diff line number Diff line
@@ -37,8 +37,6 @@ namespace stack_btm_ble_bgconn {

// Function state capture and return values, if needed
struct btm_update_scanner_filter_policy btm_update_scanner_filter_policy;
struct btm_ble_suspend_bg_conn btm_ble_suspend_bg_conn;
struct btm_ble_resume_bg_conn btm_ble_resume_bg_conn;
struct BTM_SetLeConnectionModeToFast BTM_SetLeConnectionModeToFast;
struct BTM_SetLeConnectionModeToSlow BTM_SetLeConnectionModeToSlow;
struct BTM_AcceptlistAdd BTM_AcceptlistAdd;
@@ -55,14 +53,6 @@ void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy) {
  test::mock::stack_btm_ble_bgconn::btm_update_scanner_filter_policy(
      scan_policy);
}
bool btm_ble_suspend_bg_conn(void) {
  inc_func_call_count(__func__);
  return test::mock::stack_btm_ble_bgconn::btm_ble_suspend_bg_conn();
}
bool btm_ble_resume_bg_conn(void) {
  inc_func_call_count(__func__);
  return test::mock::stack_btm_ble_bgconn::btm_ble_resume_bg_conn();
}
bool BTM_SetLeConnectionModeToFast() {
  inc_func_call_count(__func__);
  return test::mock::stack_btm_ble_bgconn::BTM_SetLeConnectionModeToFast();
+0 −17
Original line number Diff line number Diff line
@@ -43,23 +43,6 @@ struct btm_update_scanner_filter_policy {
  void operator()(tBTM_BLE_SFP scan_policy) { body(scan_policy); };
};
extern struct btm_update_scanner_filter_policy btm_update_scanner_filter_policy;
// Name: btm_ble_suspend_bg_conn
// Params: void
// Returns: bool
struct btm_ble_suspend_bg_conn {
  std::function<bool(void)> body{[](void) { return false; }};
  bool operator()(void) { return body(); };
};
extern struct btm_ble_suspend_bg_conn btm_ble_suspend_bg_conn;
// Name: btm_ble_resume_bg_conn
// Params: void
// Returns: bool
struct btm_ble_resume_bg_conn {
  std::function<bool(void)> body{[](void) { return false; }};
  bool operator()(void) { return body(); };
};
extern struct btm_ble_resume_bg_conn btm_ble_resume_bg_conn;

// Name: BTM_SetLeConnectionModeToFast
// Params:
// Returns: bool