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

Commit 5c6de495 authored by Sophie Hu's avatar Sophie Hu Committed by Automerger Merge Worker
Browse files

Set all-zero of peer address, peer address type, and peer IRK in resolving...

Set all-zero of peer address, peer address type, and peer IRK in resolving list for RPA offload am: e9b7d1d0

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



Change-Id: Iacc9b9b910a23a98c65c629f1196f63822e72e1c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents dfdc0084 e9b7d1d0
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -69,6 +69,7 @@
#include "hci/le_rand_callback.h"
#include "hci/le_rand_callback.h"
#include "internal_include/bt_target.h"
#include "internal_include/bt_target.h"
#include "internal_include/stack_config.h"
#include "internal_include/stack_config.h"
#include "main/shim/acl_api.h"
#include "main/shim/entry.h"
#include "main/shim/entry.h"
#include "main/shim/helpers.h"
#include "main/shim/helpers.h"
#include "main/shim/le_advertising_manager.h"
#include "main/shim/le_advertising_manager.h"
@@ -1967,6 +1968,22 @@ void BTIF_dm_enable() {
  pairing_cb = {};
  pairing_cb = {};
  pairing_cb.bond_type = BOND_TYPE_PERSISTENT;
  pairing_cb.bond_type = BOND_TYPE_PERSISTENT;


  /* Bluetooth Core Specification version 5.4
   *   7.8.5 LE Set Advertising Parameters command
   *   7.8.53 LE Set Extended Advertising Parameters command
   *   7.8.64 LE Set Extended Scan Parameters command
   *   7.8.12 LE Create Connection command
   *   7.8.66 LE Extended Create Connection command
   * Set all-zero set to resolving list to make controller generate RPA for
   * un-direct (broadcast) advertising RPA */
  if (bluetooth::shim::GetController()->IsRpaGenerationSupported()) {
    log::info("Support RPA offload, set all-zero set in resolving list");
    tBLE_BD_ADDR all_zero_address_with_type = {0};
    const Octet16 all_zero_peer_irk = {0};
    bluetooth::shim::ACL_AddToAddressResolution(all_zero_address_with_type, all_zero_peer_irk,
                                                ble_local_key_cb.id_keys.irk);
  }

  // Enable address consolidation.
  // Enable address consolidation.
  btif_storage_load_le_devices();
  btif_storage_load_le_devices();


+1 −1
Original line number Original line Diff line number Diff line
@@ -857,7 +857,7 @@ public:
      address_with_type = AddressWithType();
      address_with_type = AddressWithType();
    }
    }


    if (controller_->IsRpaOffloadSupported() &&
    if (controller_->IsRpaGenerationSupported() &&
        own_address_type != OwnAddressType::PUBLIC_DEVICE_ADDRESS) {
        own_address_type != OwnAddressType::PUBLIC_DEVICE_ADDRESS) {
      log::info("Support RPA offload, set own address type RESOLVABLE_OR_RANDOM_ADDRESS");
      log::info("Support RPA offload, set own address type RESOLVABLE_OR_RANDOM_ADDRESS");
      own_address_type = OwnAddressType::RESOLVABLE_OR_RANDOM_ADDRESS;
      own_address_type = OwnAddressType::RESOLVABLE_OR_RANDOM_ADDRESS;
+1 −1
Original line number Original line Diff line number Diff line
@@ -1546,7 +1546,7 @@ uint64_t Controller::MaskLeEventMask(HciVersion version, uint64_t mask) {
  }
  }
}
}


bool Controller::IsRpaOffloadSupported(void) {
bool Controller::IsRpaGenerationSupported(void) const {
  static const bool rpa_supported =
  static const bool rpa_supported =
          com::android::bluetooth::flags::rpa_offload_to_bt_controller() &&
          com::android::bluetooth::flags::rpa_offload_to_bt_controller() &&
          os::GetSystemPropertyBool(kPropertyRpaOffload, kDefaultRpaOffload) &&
          os::GetSystemPropertyBool(kPropertyRpaOffload, kDefaultRpaOffload) &&
+1 −1
Original line number Original line Diff line number Diff line
@@ -217,7 +217,7 @@ public:


  static uint64_t MaskLeEventMask(HciVersion version, uint64_t mask);
  static uint64_t MaskLeEventMask(HciVersion version, uint64_t mask);


  bool IsRpaOffloadSupported(void);
  virtual bool IsRpaGenerationSupported(void) const override;


protected:
protected:
  void ListDependencies(ModuleList* list) const override;
  void ListDependencies(ModuleList* list) const override;
+2 −0
Original line number Original line Diff line number Diff line
@@ -215,6 +215,8 @@ public:
  virtual VendorCapabilities GetVendorCapabilities() const = 0;
  virtual VendorCapabilities GetVendorCapabilities() const = 0;


  virtual bool IsSupported(OpCode op_code) const = 0;
  virtual bool IsSupported(OpCode op_code) const = 0;

  virtual bool IsRpaGenerationSupported(void) const = 0;
};
};


}  // namespace hci
}  // namespace hci
Loading