Loading system/main/shim/btm_api.cc +12 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <mutex> #include "common/metric_id_allocator.h" #include "common/time_util.h" #include "device/include/controller.h" #include "gd/common/callback.h" Loading @@ -36,6 +37,8 @@ #include "stack/btm/btm_int_types.h" #include "types/raw_address.h" using bluetooth::common::MetricIdAllocator; #define BTIF_DM_DEFAULT_INQ_MAX_RESULTS 0 #define BTIF_DM_DEFAULT_INQ_MAX_DURATION 10 Loading Loading @@ -429,12 +432,21 @@ class ShimBondListener : public bluetooth::security::ISecurityManagerListener { bluetooth::ToRawAddress(device.GetAddress()), 0, name, BTM_SUCCESS); } } MetricIdAllocator::GetInstance().AllocateId( bluetooth::ToRawAddress(device.GetAddress())); if (!MetricIdAllocator::GetInstance().SaveDevice( bluetooth::ToRawAddress(device.GetAddress()))) { LOG(FATAL) << __func__ << ": Fail to save metric id for device " << bluetooth::ToRawAddress(device.GetAddress()); } } void OnDeviceUnbonded(bluetooth::hci::AddressWithType device) override { if (bta_callbacks_->p_bond_cancel_cmpl_callback) { (*bta_callbacks_->p_bond_cancel_cmpl_callback)(BTM_SUCCESS); } MetricIdAllocator::GetInstance().ForgetDevice( bluetooth::ToRawAddress(device.GetAddress())); } void OnDeviceBondFailed(bluetooth::hci::AddressWithType device) override { Loading Loading
system/main/shim/btm_api.cc +12 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <mutex> #include "common/metric_id_allocator.h" #include "common/time_util.h" #include "device/include/controller.h" #include "gd/common/callback.h" Loading @@ -36,6 +37,8 @@ #include "stack/btm/btm_int_types.h" #include "types/raw_address.h" using bluetooth::common::MetricIdAllocator; #define BTIF_DM_DEFAULT_INQ_MAX_RESULTS 0 #define BTIF_DM_DEFAULT_INQ_MAX_DURATION 10 Loading Loading @@ -429,12 +432,21 @@ class ShimBondListener : public bluetooth::security::ISecurityManagerListener { bluetooth::ToRawAddress(device.GetAddress()), 0, name, BTM_SUCCESS); } } MetricIdAllocator::GetInstance().AllocateId( bluetooth::ToRawAddress(device.GetAddress())); if (!MetricIdAllocator::GetInstance().SaveDevice( bluetooth::ToRawAddress(device.GetAddress()))) { LOG(FATAL) << __func__ << ": Fail to save metric id for device " << bluetooth::ToRawAddress(device.GetAddress()); } } void OnDeviceUnbonded(bluetooth::hci::AddressWithType device) override { if (bta_callbacks_->p_bond_cancel_cmpl_callback) { (*bta_callbacks_->p_bond_cancel_cmpl_callback)(BTM_SUCCESS); } MetricIdAllocator::GetInstance().ForgetDevice( bluetooth::ToRawAddress(device.GetAddress())); } void OnDeviceBondFailed(bluetooth::hci::AddressWithType device) override { Loading