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

Commit 3547309e authored by Chienyuan's avatar Chienyuan Committed by Automerger Merge Worker
Browse files

gd: Add dependency for Advertising/Scanning/L2CAP module am: b8f635e6 am: 9893e2f5

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1565193

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I09df417ad2bd20ddd8b0e45c2783c488a8e74d26
parents ab032ed2 9893e2f5
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -91,6 +91,9 @@ init_flags!(
    dependencies: {
    dependencies: {
        gd_core => gd_security,
        gd_core => gd_security,
        gd_security => gd_acl,
        gd_security => gd_acl,
        gd_l2cap => gd_scanning,
        gd_scanning => gd_advertising,
        gd_advertising => gd_acl,
        gd_acl => gd_controller,
        gd_acl => gd_controller,
        gd_controller => gd_hci,
        gd_controller => gd_hci,
        gd_link_policy => gd_acl
        gd_link_policy => gd_acl
+0 −18
Original line number Original line Diff line number Diff line
@@ -50,24 +50,6 @@ class BleAdvertiserInterfaceImpl : public BleAdvertiserInterface,
  void Init() {
  void Init() {
    // Register callback
    // Register callback
    bluetooth::shim::GetAdvertising()->RegisterAdvertisingCallback(this);
    bluetooth::shim::GetAdvertising()->RegisterAdvertisingCallback(this);

    if (!bluetooth::common::init_flags::gd_security_is_enabled() &&
        !bluetooth::common::init_flags::gd_acl_is_enabled()) {
      // Set private policy
      auto address = bluetooth::shim::GetController()->GetMacAddress();
      auto storage = bluetooth::shim::GetStorage();
      auto adapter_config = storage->GetAdapterConfig();
      auto irk_bytes = adapter_config.GetLeIdentityResolvingKey();
      std::array<uint8_t, 16> irk{0};
      std::copy_n(irk.begin(), 16, irk_bytes->data());
      bluetooth::hci::AddressWithType address_with_type(
          address, bluetooth::hci::AddressType::PUBLIC_DEVICE_ADDRESS);
      auto minimum_rotation_time = std::chrono::minutes(7);
      auto maximum_rotation_time = std::chrono::minutes(15);
      bluetooth::shim::GetAclManager()->SetPrivacyPolicyForInitiatorAddress(
          bluetooth::hci::LeAddressManager::AddressPolicy::USE_PUBLIC_ADDRESS,
          address_with_type, irk, minimum_rotation_time, maximum_rotation_time);
    }
  }
  }


  // nobody use this function
  // nobody use this function