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

Commit 632114be authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "gd HCI: Remove device from LE connect list when unbond" am: 280bfc22

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

Change-Id: Ic3a8e6532e9548171f353aa1d56996aeb1ddb258
parents 5dd04285 280bfc22
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -159,6 +159,16 @@ void AclManager::CancelLeConnect(AddressWithType address_with_type) {
  GetHandler()->Post(BindOnce(&le_impl::cancel_connect, common::Unretained(pimpl_->le_impl_), address_with_type));
}

void AclManager::AddDeviceToConnectList(AddressWithType address_with_type) {
  GetHandler()->Post(
      BindOnce(&le_impl::add_device_to_connect_list, common::Unretained(pimpl_->le_impl_), address_with_type));
}

void AclManager::RemoveDeviceFromConnectList(AddressWithType address_with_type) {
  GetHandler()->Post(
      BindOnce(&le_impl::remove_device_from_connect_list, common::Unretained(pimpl_->le_impl_), address_with_type));
}

void AclManager::MasterLinkKey(KeyFlag key_flag) {
  GetHandler()->Post(BindOnce(&classic_impl::master_link_key, common::Unretained(pimpl_->classic_impl_), key_flag));
}
+2 −0
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@ class AclManager : public Module {
  virtual void CancelConnect(Address address);

  virtual void CancelLeConnect(AddressWithType address_with_type);
  virtual void AddDeviceToConnectList(AddressWithType address_with_type);
  virtual void RemoveDeviceFromConnectList(AddressWithType address_with_type);

  virtual void MasterLinkKey(KeyFlag key_flag);
  virtual void SwitchRole(Address address, Role role);
+8 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ from cert.py_security import PySecurity
from facade import common_pb2 as common
from google.protobuf import empty_pb2 as empty_proto
from hci.facade import controller_facade_pb2 as controller_facade
from hci.facade import le_initiator_address_facade_pb2 as le_initiator_address_facade
from l2cap.classic.facade_pb2 import ClassicSecurityPolicy
from neighbor.facade import facade_pb2 as neighbor_facade
from security.cert.cert_security import CertSecurity
@@ -59,6 +60,13 @@ class SecurityTest(GdBaseTestClass):
        self.dut_security = PySecurity(self.dut)
        self.cert_security = CertSecurity(self.cert)

        self.dut_address = common.BluetoothAddressWithType(
            address=common.BluetoothAddress(address=bytes(b'DD:05:04:03:02:01')), type=common.RANDOM_DEVICE_ADDRESS)
        privacy_policy = le_initiator_address_facade.PrivacyPolicy(
            address_policy=le_initiator_address_facade.AddressPolicy.USE_STATIC_ADDRESS,
            address_with_type=self.dut_address)
        self.dut.security.SetLeInitiatorAddressPolicy(privacy_policy)

    def teardown_test(self):
        self.dut_security.close()
        self.cert_security.close()
+1 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ void SecurityManagerImpl::NotifyDeviceUnbonded(hci::AddressWithType device) {
    iter.second->Post(
        common::Bind(&ISecurityManagerListener::OnDeviceUnbonded, common::Unretained(iter.first), device));
  }
  acl_manager_->RemoveDeviceFromConnectList(device);
}

void SecurityManagerImpl::NotifyEncryptionStateChanged(hci::EncryptionChangeView encryption_change_view) {