#include "device/bluetooth/floss/fake_floss_adapter_client.h"
#include <string>
#include <vector>
#include "base/containers/flat_map.h"
#include "base/logging.h"
#include "base/observer_list.h"
#include "base/task/single_thread_task_runner.h"
#include "device/bluetooth/floss/floss_dbus_client.h"
namespace floss {
namespace {
const int kDelayedTaskMs = …;
FlossDeviceId ConvertAddressToDevice(const std::string& address) { … }
uint32_t ConvertAddressToClassOfDevice(const std::string& address) { … }
}
FakeFlossAdapterClient::FakeFlossAdapterClient()
: … { … }
FakeFlossAdapterClient::~FakeFlossAdapterClient() = default;
const char FakeFlossAdapterClient::kBondedAddress1[] = …;
const char FakeFlossAdapterClient::kBondedAddress2[] = …;
const char FakeFlossAdapterClient::kPairedAddressBrEdr[] = …;
const char FakeFlossAdapterClient::kPairedAddressLE[] = …;
const uint32_t FakeFlossAdapterClient::kDefaultClassOfDevice = …;
const char FakeFlossAdapterClient::kClassicName[] = …;
const char FakeFlossAdapterClient::kClassicAddress[] = …;
const uint32_t FakeFlossAdapterClient::kClassicClassOfDevice = …;
const char FakeFlossAdapterClient::kPinCodeDisplayName[] = …;
const char FakeFlossAdapterClient::kPinCodeDisplayAddress[] = …;
const uint32_t FakeFlossAdapterClient::kPinCodeDisplayClassOfDevice = …;
const char FakeFlossAdapterClient::kPasskeyDisplayName[] = …;
const char FakeFlossAdapterClient::kPasskeyDisplayAddress[] = …;
const uint32_t FakeFlossAdapterClient::kPasskeyDisplayClassOfDevice = …;
const char FakeFlossAdapterClient::kPinCodeRequestName[] = …;
const char FakeFlossAdapterClient::kPinCodeRequestAddress[] = …;
const uint32_t FakeFlossAdapterClient::kPinCodeRequestClassOfDevice = …;
const char FakeFlossAdapterClient::kPhoneName[] = …;
const char FakeFlossAdapterClient::kPhoneAddress[] = …;
const uint32_t FakeFlossAdapterClient::kPhoneClassOfDevice = …;
const char FakeFlossAdapterClient::kPasskeyRequestName[] = …;
const char FakeFlossAdapterClient::kPasskeyRequestAddress[] = …;
const uint32_t FakeFlossAdapterClient::kPasskeyRequestClassOfDevice = …;
const char FakeFlossAdapterClient::kJustWorksName[] = …;
const char FakeFlossAdapterClient::kJustWorksAddress[] = …;
const uint32_t FakeFlossAdapterClient::kJustWorksClassOfDevice = …;
const uint32_t FakeFlossAdapterClient::kPasskey = …;
const char FakeFlossAdapterClient::kPinCode[] = …;
void FakeFlossAdapterClient::Init(dbus::Bus* bus,
const std::string& service_name,
const int adapter_index,
base::Version version,
base::OnceClosure on_ready) { … }
void FakeFlossAdapterClient::SetName(ResponseCallback<Void> callback,
const std::string& name) { … }
void FakeFlossAdapterClient::StartDiscovery(ResponseCallback<Void> callback) { … }
void FakeFlossAdapterClient::CancelDiscovery(ResponseCallback<Void> callback) { … }
void FakeFlossAdapterClient::CreateBond(ResponseCallback<bool> callback,
FlossDeviceId device,
BluetoothTransport transport) { … }
void FakeFlossAdapterClient::CreateBond(
ResponseCallback<FlossDBusClient::BtifStatus> callback,
FlossDeviceId device,
BluetoothTransport transport) { … }
void FakeFlossAdapterClient::CancelBondProcess(ResponseCallback<bool> callback,
FlossDeviceId device) { … }
void FakeFlossAdapterClient::RemoveBond(ResponseCallback<bool> callback,
FlossDeviceId device) { … }
void FakeFlossAdapterClient::GetRemoteType(
ResponseCallback<BluetoothDeviceType> callback,
FlossDeviceId device) { … }
void FakeFlossAdapterClient::GetRemoteClass(ResponseCallback<uint32_t> callback,
FlossDeviceId device) { … }
void FakeFlossAdapterClient::GetRemoteAppearance(
ResponseCallback<uint16_t> callback,
FlossDeviceId device) { … }
void FakeFlossAdapterClient::GetConnectionState(
ResponseCallback<uint32_t> callback,
const FlossDeviceId& device) { … }
void FakeFlossAdapterClient::GetRemoteUuids(
ResponseCallback<device::BluetoothDevice::UUIDList> callback,
FlossDeviceId device) { … }
void FakeFlossAdapterClient::GetRemoteVendorProductInfo(
ResponseCallback<FlossAdapterClient::VendorProductInfo> callback,
FlossDeviceId device) { … }
void FakeFlossAdapterClient::GetRemoteAddressType(
ResponseCallback<FlossAdapterClient::BtAddressType> callback,
FlossDeviceId device) { … }
void FakeFlossAdapterClient::GetBondState(ResponseCallback<uint32_t> callback,
const FlossDeviceId& device) { … }
void FakeFlossAdapterClient::ConnectAllEnabledProfiles(
ResponseCallback<Void> callback,
const FlossDeviceId& device) { … }
void FakeFlossAdapterClient::ConnectAllEnabledProfiles(
ResponseCallback<FlossDBusClient::BtifStatus> callback,
const FlossDeviceId& device) { … }
void FakeFlossAdapterClient::DisconnectAllEnabledProfiles(
ResponseCallback<Void> callback,
const FlossDeviceId& device) { … }
void FakeFlossAdapterClient::PostDelayedTask(base::OnceClosure callback) { … }
void FakeFlossAdapterClient::SetConnected(const std::string& address,
bool connected) { … }
void FakeFlossAdapterClient::NotifyObservers(
const base::RepeatingCallback<void(Observer*)>& notify) const { … }
void FakeFlossAdapterClient::FailNextDiscovery() { … }
void FakeFlossAdapterClient::FailNextBonding() { … }
void FakeFlossAdapterClient::SetPairingConfirmation(
ResponseCallback<Void> callback,
const FlossDeviceId& device,
bool accept) { … }
void FakeFlossAdapterClient::SetPin(ResponseCallback<Void> callback,
const FlossDeviceId& device,
bool accept,
const std::vector<uint8_t>& pin) { … }
void FakeFlossAdapterClient::GetBondedDevices() { … }
void FakeFlossAdapterClient::GetConnectedDevices() { … }
}