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

Commit 3ee98f16 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

legacy: Remove main/shim/btm_api.cc::is_any_gd_enabled am: 8fea5b95 am: 187771c0

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1914575

Change-Id: I6f89e8cc37ab1b9ff8c36f8bc858e77a01d2cd3f
parents a257bb87 187771c0
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,