Loading system/gd/security/internal/security_manager_impl.cc +2 −0 Original line number Diff line number Diff line Loading @@ -22,10 +22,12 @@ #include "os/log.h" #include "security/pairing/classic_pairing_handler.h" #include "security/security_manager.h" using namespace bluetooth::security::internal; using bluetooth::hci::Device; using bluetooth::hci::DeviceType; using bluetooth::security::ISecurityManagerListener; using bluetooth::security::pairing::PairingHandler; namespace { Loading system/gd/security/internal/security_manager_impl.h +2 −35 Original line number Diff line number Diff line Loading @@ -24,43 +24,10 @@ namespace bluetooth { namespace security { namespace internal { /** * Interface for listening to the channel for SMP commands. */ class ISecurityManagerListener { public: ISecurityManagerListener(os::Handler* handler) : handler_(handler) {} virtual ~ISecurityManagerListener() = default; /** * Called when a device is successfully bonded. * * @param device pointer to the bonded device */ virtual void OnDeviceBonded(std::shared_ptr<bluetooth::hci::Device> device); class ISecurityManagerListener; /** * Called when a device is successfully un-bonded. * * @param device pointer to the device that is no longer bonded */ virtual void OnDeviceUnbonded(std::shared_ptr<bluetooth::hci::Device> device); /** * Called as a result of a failure during the bonding process. * * @param device pointer to the device that is no longer bonded */ virtual void OnDeviceBondFailed(std::shared_ptr<bluetooth::hci::Device> device); bool operator==(const ISecurityManagerListener& rhs) const { return &*this == &rhs; } os::Handler* handler_ = nullptr; }; namespace internal { class SecurityManagerImpl /*: public channel::ISecurityManagerChannelListener*/ { public: Loading system/gd/security/security_manager.cc +4 −4 Original line number Diff line number Diff line Loading @@ -44,14 +44,14 @@ void SecurityManager::RemoveBond(std::shared_ptr<hci::ClassicDevice> device) { std::forward<std::shared_ptr<hci::ClassicDevice>>(device))); } void SecurityManager::RegisterCallbackListener(internal::ISecurityManagerListener* listener) { void SecurityManager::RegisterCallbackListener(ISecurityManagerListener* listener) { security_handler_->Post(common::BindOnce(&internal::SecurityManagerImpl::RegisterCallbackListener, common::Unretained(security_manager_impl_), std::forward<internal::ISecurityManagerListener*>(listener))); std::forward<ISecurityManagerListener*>(listener))); } void SecurityManager::UnregisterCallbackListener(internal::ISecurityManagerListener* listener) { void SecurityManager::UnregisterCallbackListener(ISecurityManagerListener* listener) { security_handler_->Post(common::BindOnce(&internal::SecurityManagerImpl::UnregisterCallbackListener, common::Unretained(security_manager_impl_), std::forward<internal::ISecurityManagerListener*>(listener))); std::forward<ISecurityManagerListener*>(listener))); } system/gd/security/security_manager.h +38 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,42 @@ namespace bluetooth { namespace security { /** * Callback interface from SecurityManager. */ class ISecurityManagerListener { public: ISecurityManagerListener(os::Handler* handler) : handler_(handler) {} virtual ~ISecurityManagerListener() = default; /** * Called when a device is successfully bonded. * * @param device pointer to the bonded device */ virtual void OnDeviceBonded(std::shared_ptr<bluetooth::hci::Device> device); /** * Called when a device is successfully un-bonded. * * @param device pointer to the device that is no longer bonded */ virtual void OnDeviceUnbonded(std::shared_ptr<bluetooth::hci::Device> device); /** * Called as a result of a failure during the bonding process. * * @param device pointer to the device that is no longer bonded */ virtual void OnDeviceBondFailed(std::shared_ptr<bluetooth::hci::Device> device); bool operator==(const ISecurityManagerListener& rhs) const { return &*this == &rhs; } os::Handler* handler_ = nullptr; }; /** * Manages the security attributes, pairing, bonding of devices, and the * encryption/decryption of communications. Loading Loading @@ -67,14 +103,14 @@ class SecurityManager { * * @param listener ISecurityManagerListener instance to handle callbacks */ void RegisterCallbackListener(internal::ISecurityManagerListener* listener); void RegisterCallbackListener(ISecurityManagerListener* listener); /** * Unregister listener for callback events from SecurityManager * * @param listener ISecurityManagerListener instance to unregister */ void UnregisterCallbackListener(internal::ISecurityManagerListener* listener); void UnregisterCallbackListener(ISecurityManagerListener* listener); protected: SecurityManager(os::Handler* security_handler, internal::SecurityManagerImpl* security_manager_impl) Loading Loading
system/gd/security/internal/security_manager_impl.cc +2 −0 Original line number Diff line number Diff line Loading @@ -22,10 +22,12 @@ #include "os/log.h" #include "security/pairing/classic_pairing_handler.h" #include "security/security_manager.h" using namespace bluetooth::security::internal; using bluetooth::hci::Device; using bluetooth::hci::DeviceType; using bluetooth::security::ISecurityManagerListener; using bluetooth::security::pairing::PairingHandler; namespace { Loading
system/gd/security/internal/security_manager_impl.h +2 −35 Original line number Diff line number Diff line Loading @@ -24,43 +24,10 @@ namespace bluetooth { namespace security { namespace internal { /** * Interface for listening to the channel for SMP commands. */ class ISecurityManagerListener { public: ISecurityManagerListener(os::Handler* handler) : handler_(handler) {} virtual ~ISecurityManagerListener() = default; /** * Called when a device is successfully bonded. * * @param device pointer to the bonded device */ virtual void OnDeviceBonded(std::shared_ptr<bluetooth::hci::Device> device); class ISecurityManagerListener; /** * Called when a device is successfully un-bonded. * * @param device pointer to the device that is no longer bonded */ virtual void OnDeviceUnbonded(std::shared_ptr<bluetooth::hci::Device> device); /** * Called as a result of a failure during the bonding process. * * @param device pointer to the device that is no longer bonded */ virtual void OnDeviceBondFailed(std::shared_ptr<bluetooth::hci::Device> device); bool operator==(const ISecurityManagerListener& rhs) const { return &*this == &rhs; } os::Handler* handler_ = nullptr; }; namespace internal { class SecurityManagerImpl /*: public channel::ISecurityManagerChannelListener*/ { public: Loading
system/gd/security/security_manager.cc +4 −4 Original line number Diff line number Diff line Loading @@ -44,14 +44,14 @@ void SecurityManager::RemoveBond(std::shared_ptr<hci::ClassicDevice> device) { std::forward<std::shared_ptr<hci::ClassicDevice>>(device))); } void SecurityManager::RegisterCallbackListener(internal::ISecurityManagerListener* listener) { void SecurityManager::RegisterCallbackListener(ISecurityManagerListener* listener) { security_handler_->Post(common::BindOnce(&internal::SecurityManagerImpl::RegisterCallbackListener, common::Unretained(security_manager_impl_), std::forward<internal::ISecurityManagerListener*>(listener))); std::forward<ISecurityManagerListener*>(listener))); } void SecurityManager::UnregisterCallbackListener(internal::ISecurityManagerListener* listener) { void SecurityManager::UnregisterCallbackListener(ISecurityManagerListener* listener) { security_handler_->Post(common::BindOnce(&internal::SecurityManagerImpl::UnregisterCallbackListener, common::Unretained(security_manager_impl_), std::forward<internal::ISecurityManagerListener*>(listener))); std::forward<ISecurityManagerListener*>(listener))); }
system/gd/security/security_manager.h +38 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,42 @@ namespace bluetooth { namespace security { /** * Callback interface from SecurityManager. */ class ISecurityManagerListener { public: ISecurityManagerListener(os::Handler* handler) : handler_(handler) {} virtual ~ISecurityManagerListener() = default; /** * Called when a device is successfully bonded. * * @param device pointer to the bonded device */ virtual void OnDeviceBonded(std::shared_ptr<bluetooth::hci::Device> device); /** * Called when a device is successfully un-bonded. * * @param device pointer to the device that is no longer bonded */ virtual void OnDeviceUnbonded(std::shared_ptr<bluetooth::hci::Device> device); /** * Called as a result of a failure during the bonding process. * * @param device pointer to the device that is no longer bonded */ virtual void OnDeviceBondFailed(std::shared_ptr<bluetooth::hci::Device> device); bool operator==(const ISecurityManagerListener& rhs) const { return &*this == &rhs; } os::Handler* handler_ = nullptr; }; /** * Manages the security attributes, pairing, bonding of devices, and the * encryption/decryption of communications. Loading Loading @@ -67,14 +103,14 @@ class SecurityManager { * * @param listener ISecurityManagerListener instance to handle callbacks */ void RegisterCallbackListener(internal::ISecurityManagerListener* listener); void RegisterCallbackListener(ISecurityManagerListener* listener); /** * Unregister listener for callback events from SecurityManager * * @param listener ISecurityManagerListener instance to unregister */ void UnregisterCallbackListener(internal::ISecurityManagerListener* listener); void UnregisterCallbackListener(ISecurityManagerListener* listener); protected: SecurityManager(os::Handler* security_handler, internal::SecurityManagerImpl* security_manager_impl) Loading