OSDN Git Service

L2cap: Depend on Advertising to set privacy
authorHansong Zhang <hsz@google.com>
Fri, 22 Jan 2021 08:34:55 +0000 (00:34 -0800)
committerHansong Zhang <hsz@google.com>
Fri, 29 Jan 2021 23:12:55 +0000 (23:12 +0000)
Test: cert/run
Tag: #gd-refactor
Bug: 141555841
Change-Id: I71a842c24d2f3ecb4e8640f6a3247f20524e6f1d

main/shim/l2c_api.cc
main/shim/stack.cc

index 987b3b1..20ba08a 100644 (file)
@@ -663,23 +663,6 @@ void L2CA_UseLegacySecurityModule() {
   GetL2capLeModule()->InjectSecurityEnforcementInterface(
       &le_security_enforcement_shim_);
 
-  // TODO(b/161543441): read the privacy policy from device-specific
-  // configuration, and IRK from config file.
-  hci::LeAddressManager::AddressPolicy address_policy =
-      hci::LeAddressManager::AddressPolicy::USE_RESOLVABLE_ADDRESS;
-  hci::AddressWithType empty_address_with_type(
-      hci::Address{}, hci::AddressType::RANDOM_DEVICE_ADDRESS);
-  crypto_toolbox::Octet16 rotation_irk = {0x44, 0xfb, 0x4b, 0x8d, 0x6c, 0x58,
-                                          0x21, 0x0c, 0xf9, 0x3d, 0xda, 0xf1,
-                                          0x64, 0xa3, 0xbb, 0x7f};
-  /* 7 minutes minimum, 15 minutes maximum for random address refreshing */
-  auto minimum_rotation_time = std::chrono::minutes(7);
-  auto maximum_rotation_time = std::chrono::minutes(15);
-
-  GetAclManager()->SetPrivacyPolicyForInitiatorAddress(
-      address_policy, empty_address_with_type, rotation_irk,
-      minimum_rotation_time, maximum_rotation_time);
-
   GetAclManager()->HACK_SetScoDisconnectCallback(on_sco_disconnect);
 }
 
index d5fe1a2..94e272e 100644 (file)
@@ -103,6 +103,7 @@ void Stack::StartEverything() {
   if (common::init_flags::gd_l2cap_is_enabled()) {
     modules.add<l2cap::classic::L2capClassicModule>();
     modules.add<l2cap::le::L2capLeModule>();
+    modules.add<hci::LeAdvertisingManager>();
   }
   if (common::init_flags::gd_security_is_enabled()) {
     modules.add<security::SecurityModule>();