fast_pair_support_utils.cc 828 B

123456789101112131415161718192021222324252627
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/quick_pair/feature_status_tracker/fast_pair_support_utils.h"
  5. #include "ash/constants/ash_features.h"
  6. #include "base/bind.h"
  7. #include "device/bluetooth/bluetooth_adapter.h"
  8. namespace ash {
  9. namespace quick_pair {
  10. bool HasHardwareSupport(scoped_refptr<device::BluetoothAdapter> adapter) {
  11. if (!adapter || !adapter->IsPresent())
  12. return false;
  13. if (features::IsFastPairSoftwareScanningEnabled())
  14. return true;
  15. return adapter->GetLowEnergyScanSessionHardwareOffloadingStatus() ==
  16. device::BluetoothAdapter::
  17. LowEnergyScanSessionHardwareOffloadingStatus::kSupported;
  18. }
  19. } // namespace quick_pair
  20. } // namespace ash