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

Commit 9da502c5 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

legacy: Make gd_scan and gd_adver true am: c9374e1b am: 69ac88d4

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1914580

Change-Id: Iab8e111940f2cea01a59a53ecd37894e45a45016
parents a9cdd203 69ac88d4
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -1128,10 +1128,7 @@ class CsisClientImpl : public CsisClient {
  void CsisActiveObserverSet(bool enable) {
    LOG(INFO) << __func__ << " CSIS Discovery SET: " << enable;

    if (bluetooth::shim::is_gd_scanning_enabled()) {
    bluetooth::shim::set_empty_filter(enable);
    }

    BTA_DmBleCsisObserve(
        enable, [](tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH* p_data) {
          /* If there's no instance we are most likely shutting
+2 −10
Original line number Diff line number Diff line
@@ -260,17 +260,9 @@ class BleAdvertiserInterfaceImpl : public BleAdvertiserInterface {
  }
};

BleAdvertiserInterface* btLeAdvertiserInstance = nullptr;

}  // namespace

BleAdvertiserInterface* get_ble_advertiser_instance() {
  if (bluetooth::shim::is_gd_advertising_enabled()) {
  LOG(INFO) << __func__ << " use gd le advertiser";
  return bluetooth::shim::get_ble_advertiser_instance();
  } else if (btLeAdvertiserInstance == nullptr) {
    btLeAdvertiserInstance = new BleAdvertiserInterfaceImpl();
  }

  return btLeAdvertiserInstance;
}
+2 −9
Original line number Diff line number Diff line
@@ -343,16 +343,9 @@ class BleScannerInterfaceImpl : public BleScannerInterface {
  }
};

BleScannerInterface* btLeScannerInstance = nullptr;

}  // namespace

BleScannerInterface* get_ble_scanner_instance() {
  if (bluetooth::shim::is_gd_scanning_enabled()) {
  LOG_INFO("Use gd le scanner");
  return bluetooth::shim::get_ble_scanner_instance();
  } else if (btLeScannerInstance == nullptr) {
    btLeScannerInstance = new BleScannerInterfaceImpl();
  }
  return btLeScannerInstance;
}
+3 −8
Original line number Diff line number Diff line
@@ -207,7 +207,6 @@ static bool subevent_already_registered_in_le_hci_layer(
    case bluetooth::hci::SubeventCode::REMOTE_CONNECTION_PARAMETER_REQUEST:
    case bluetooth::hci::SubeventCode::ADVERTISING_SET_TERMINATED:
    case bluetooth::hci::SubeventCode::SCAN_REQUEST_RECEIVED:
      return true;
    case bluetooth::hci::SubeventCode::SCAN_TIMEOUT:
    case bluetooth::hci::SubeventCode::ADVERTISING_REPORT:
    case bluetooth::hci::SubeventCode::DIRECTED_ADVERTISING_REPORT:
@@ -215,7 +214,7 @@ static bool subevent_already_registered_in_le_hci_layer(
    case bluetooth::hci::SubeventCode::PERIODIC_ADVERTISING_REPORT:
    case bluetooth::hci::SubeventCode::PERIODIC_ADVERTISING_SYNC_ESTABLISHED:
    case bluetooth::hci::SubeventCode::PERIODIC_ADVERTISING_SYNC_LOST:
      return bluetooth::shim::is_gd_scanning_enabled();
      return true;
    case bluetooth::hci::SubeventCode::READ_REMOTE_FEATURES_COMPLETE:
    case bluetooth::hci::SubeventCode::READ_LOCAL_P256_PUBLIC_KEY_COMPLETE:
    case bluetooth::hci::SubeventCode::GENERATE_DHKEY_COMPLETE:
@@ -245,7 +244,7 @@ static bool event_already_registered_in_le_advertising_manager(
    bluetooth::hci::EventCode event_code) {
  for (auto event : bluetooth::hci::AclConnectionEvents) {
    if (event == event_code) {
      return bluetooth::shim::is_gd_advertising_enabled();
      return true;
    }
  }
  return false;
@@ -255,7 +254,7 @@ static bool event_already_registered_in_le_scanning_manager(
    bluetooth::hci::EventCode event_code) {
  for (auto event : bluetooth::hci::AclConnectionEvents) {
    if (event == event_code) {
      return bluetooth::shim::is_gd_scanning_enabled();
      return true;
    }
  }
  return false;
@@ -531,10 +530,6 @@ static void on_shutting_down() {
    pending_iso_data = nullptr;
  }
  if (hci_queue_end != nullptr) {
    if (!bluetooth::shim::is_gd_advertising_enabled() &&
        !bluetooth::shim::is_gd_l2cap_enabled()) {
      hci_queue_end->UnregisterDequeue();
    }
    for (uint16_t event_code_raw = 0; event_code_raw < 0x100;
         event_code_raw++) {
      auto event_code = static_cast<bluetooth::hci::EventCode>(event_code_raw);
+5 −12
Original line number Diff line number Diff line
@@ -153,12 +153,8 @@ void Stack::StartEverything() {
  if (common::init_flags::gd_security_is_enabled()) {
    modules.add<security::SecurityModule>();
  }
  if (common::init_flags::gd_advertising_is_enabled()) {
  modules.add<hci::LeAdvertisingManager>();
  }
  if (common::init_flags::gd_scanning_is_enabled()) {
  modules.add<hci::LeScanningManager>();
  }
  if (common::init_flags::btaa_hci_is_enabled()) {
    modules.add<activity_attribution::ActivityAttribution>();
  }
@@ -192,12 +188,9 @@ void Stack::StartEverything() {
    bluetooth::shim::hci_on_reset_complete();
  }

  if (common::init_flags::gd_advertising_is_enabled()) {
  bluetooth::shim::init_advertising_manager();
  }
  if (common::init_flags::gd_scanning_is_enabled()) {
  bluetooth::shim::init_scanning_manager();
  }

  if (common::init_flags::gd_l2cap_is_enabled() &&
      !common::init_flags::gd_core_is_enabled()) {
    L2CA_UseLegacySecurityModule();
Loading