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

Commit 8fea5b95 authored by Chris Manton's avatar Chris Manton
Browse files

legacy: Remove main/shim/btm_api.cc::is_any_gd_enabled

Bug: 199945370
Tag: #refactor
Test: gd/cert/run

Change-Id: Ic3682207fdbee1472a48837c48f8422bff70fdf6
parent 8db86064
Loading
Loading
Loading
Loading
+6 −20
Original line number Diff line number Diff line
@@ -465,18 +465,9 @@ class ShimBondListener : public bluetooth::security::ISecurityManagerListener {
            bluetooth::ToRawAddress(device.GetAddress()), 0, name, HCI_SUCCESS);
      }
    }
    bool is_gd_enabled = bluetooth::shim::is_any_gd_enabled();
    if (is_gd_enabled) {
    bluetooth::shim::AllocateIdFromMetricIdAllocator(
        bluetooth::ToRawAddress(device.GetAddress()));
    } else {
      MetricIdAllocator::GetInstance().AllocateId(
          bluetooth::ToRawAddress(device.GetAddress()));
    }
    bool is_saving_successful =
        is_gd_enabled ? bluetooth::shim::SaveDeviceOnMetricIdAllocator(
                            bluetooth::ToRawAddress(device.GetAddress()))
                      : MetricIdAllocator::GetInstance().SaveDevice(
    bool is_saving_successful = bluetooth::shim::SaveDeviceOnMetricIdAllocator(
        bluetooth::ToRawAddress(device.GetAddress()));
    if (!is_saving_successful) {
      LOG(FATAL) << __func__ << ": Fail to save metric id for device "
@@ -488,13 +479,8 @@ class ShimBondListener : public bluetooth::security::ISecurityManagerListener {
    if (bta_callbacks_->p_bond_cancel_cmpl_callback) {
      (*bta_callbacks_->p_bond_cancel_cmpl_callback)(BTM_SUCCESS);
    }
    if (bluetooth::shim::is_any_gd_enabled()) {
    bluetooth::shim::ForgetDeviceFromMetricIdAllocator(
        bluetooth::ToRawAddress(device.GetAddress()));
    } else {
      MetricIdAllocator::GetInstance().ForgetDevice(
          bluetooth::ToRawAddress(device.GetAddress()));
    }
  }

  void OnDeviceBondFailed(bluetooth::hci::AddressWithType device,