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

Commit 8ca813a5 authored by Yun-hao Chung's avatar Yun-hao Chung Committed by Gerrit Code Review
Browse files

Merge "Floss: Remove TARGET_FLOSS in inq_by_rssi" into main

parents 10095dc5 8f61e3db
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -92,10 +92,6 @@
namespace {
constexpr char kBtmLogTag[] = "SCAN";

struct {
  bool inq_by_rssi{false};
} internal_;

void btm_log_history_scan_mode(uint8_t scan_mode) {
  static uint8_t scan_mode_cached_ = 0xff;
  if (scan_mode_cached_ == scan_mode) return;
@@ -258,6 +254,9 @@ void SendRemoteNameRequest(const RawAddress& raw_address) {
}
static void btm_process_cancel_complete(tHCI_STATUS status, uint8_t mode);
static void on_incoming_hci_event(bluetooth::hci::EventView event);
static bool is_inquery_by_rssi() {
  return osi_property_get_bool(PROPERTY_INQ_BY_RSSI, false);
}
/*******************************************************************************
 *
 * Function         BTM_SetDiscoverability
@@ -1077,10 +1076,6 @@ void btm_inq_db_reset(void) {
  return;
}

void btm_inq_db_set_inq_by_rssi(void) {
  internal_.inq_by_rssi = osi_property_get_bool(PROPERTY_INQ_BY_RSSI, false);
}

/*******************************************************************************
 *
 * Function         btm_inq_clear_ssp
@@ -1253,7 +1248,7 @@ tINQ_DB_ENT* btm_inq_db_new(const RawAddress& p_bda, bool is_ble) {
      return (p_ent);
    }

    if (internal_.inq_by_rssi) {
    if (is_inquery_by_rssi()) {
      if (p_ent->inq_info.results.rssi < i_rssi) {
        p_old = p_ent;
        i_rssi = p_ent->inq_info.results.rssi;
+0 −10
Original line number Diff line number Diff line
@@ -33,10 +33,6 @@
#include "stack/include/security_client_callbacks.h"
#include "types/raw_address.h"

#ifdef TARGET_FLOSS
#include "stack/include/inq_hci_link_interface.h"  // btm_inq_db_set_inq_by_rssi
#endif                                             // TARGET_FLOSS

using namespace bluetooth;

/* Global BTM control block structure
@@ -58,12 +54,6 @@ tBTM_CB btm_cb;
void btm_init(void) {
  btm_cb.Init();
  get_security_client_interface().BTM_Sec_Init();

#ifdef TARGET_FLOSS
  // Need to set inquery by rssi flag for Floss since Floss doesn't do
  // btm_inq_db_init
  btm_inq_db_set_inq_by_rssi();
#endif
}

/** This function is called to free dynamic memory and system resource allocated by btm_init */