fake_bluetooth_adapter.cc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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/fake_bluetooth_adapter.h"
  5. namespace ash {
  6. namespace quick_pair {
  7. void FakeBluetoothAdapter::NotifyPoweredChanged(bool powered) {
  8. device::BluetoothAdapter::NotifyAdapterPoweredChanged(powered);
  9. }
  10. bool FakeBluetoothAdapter::IsPowered() const {
  11. return is_bluetooth_powered_;
  12. }
  13. bool FakeBluetoothAdapter::IsPresent() const {
  14. return is_bluetooth_present_;
  15. }
  16. void FakeBluetoothAdapter::SetBluetoothIsPowered(bool powered) {
  17. is_bluetooth_powered_ = powered;
  18. NotifyPoweredChanged(powered);
  19. }
  20. void FakeBluetoothAdapter::SetBluetoothIsPresent(bool present) {
  21. is_bluetooth_present_ = present;
  22. }
  23. device::BluetoothAdapter::LowEnergyScanSessionHardwareOffloadingStatus
  24. FakeBluetoothAdapter::GetLowEnergyScanSessionHardwareOffloadingStatus() {
  25. return hardware_offloading_status_;
  26. }
  27. void FakeBluetoothAdapter::SetHardwareOffloadingStatus(
  28. device::BluetoothAdapter::LowEnergyScanSessionHardwareOffloadingStatus
  29. hardware_offloading_status) {
  30. hardware_offloading_status_ = hardware_offloading_status;
  31. NotifyLowEnergyScanSessionHardwareOffloadingStatusChanged(
  32. hardware_offloading_status);
  33. }
  34. } // namespace quick_pair
  35. } // namespace ash