summaryrefslogtreecommitdiff
path: root/chromium/device/bluetooth/dbus
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/device/bluetooth/dbus
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/device/bluetooth/dbus')
-rw-r--r--chromium/device/bluetooth/dbus/bluetooth_gatt_application_service_provider.cc1
-rw-r--r--chromium/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc11
-rw-r--r--chromium/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h6
-rw-r--r--chromium/device/bluetooth/dbus/bluetooth_gatt_descriptor_client.cc1
-rw-r--r--chromium/device/bluetooth/dbus/bluetooth_gatt_service_client.cc1
-rw-r--r--chromium/device/bluetooth/dbus/bluez_dbus_manager.cc1
-rw-r--r--chromium/device/bluetooth/dbus/bluez_dbus_thread_manager.cc1
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_agent_manager_client.cc4
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_agent_service_provider.cc1
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_device_client.cc477
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_device_client.h2
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc2
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h1
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_gatt_service_client.cc1
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_le_advertisement_service_provider.cc1
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_media_client.cc1
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.cc1
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.h1
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_media_transport_client.cc1
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_profile_service_provider.cc1
20 files changed, 268 insertions, 248 deletions
diff --git a/chromium/device/bluetooth/dbus/bluetooth_gatt_application_service_provider.cc b/chromium/device/bluetooth/dbus/bluetooth_gatt_application_service_provider.cc
index 6ccfcc27914..611e810ffb6 100644
--- a/chromium/device/bluetooth/dbus/bluetooth_gatt_application_service_provider.cc
+++ b/chromium/device/bluetooth/dbus/bluetooth_gatt_application_service_provider.cc
@@ -7,6 +7,7 @@
#include <string>
#include <utility>
+#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "device/bluetooth/bluetooth_gatt_characteristic.h"
#include "device/bluetooth/bluez/bluetooth_gatt_service_bluez.h"
diff --git a/chromium/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc b/chromium/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc
index ec4a928cdb2..4ae1703db72 100644
--- a/chromium/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc
+++ b/chromium/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include "base/bind.h"
+#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
@@ -14,6 +15,7 @@
#include "dbus/bus.h"
#include "dbus/object_manager.h"
#include "dbus/values_util.h"
+#include "third_party/cros_system_api/dbus/bluetooth/dbus-constants.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
namespace bluez {
@@ -113,6 +115,7 @@ class BluetoothGattCharacteristicClientImpl
// BluetoothGattCharacteristicClient override.
void WriteValue(const dbus::ObjectPath& object_path,
const std::vector<uint8_t>& value,
+ base::StringPiece type_option,
base::OnceClosure callback,
ErrorCallback error_callback) override {
dbus::ObjectProxy* object_proxy =
@@ -128,8 +131,14 @@ class BluetoothGattCharacteristicClientImpl
dbus::MessageWriter writer(&method_call);
writer.AppendArrayOfBytes(value.data(), value.size());
- // Append empty option dict
+ // Append option dict
base::DictionaryValue dict;
+ if (!type_option.empty()) {
+ // NB: the "type" option was added in BlueZ 5.51. Older versions of BlueZ
+ // will ignore this option.
+ dict.SetStringKey(bluetooth_gatt_characteristic::kOptionType,
+ type_option);
+ }
dbus::AppendValueData(&writer, dict);
object_proxy->CallMethodWithErrorCallback(
diff --git a/chromium/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h b/chromium/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h
index b76a8317d39..93b4cc76c15 100644
--- a/chromium/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h
+++ b/chromium/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h
@@ -105,10 +105,12 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothGattCharacteristicClient
ErrorCallback error_callback) = 0;
// Issues a request to write the value of GATT characteristic with object path
- // |object_path| with value |value|. Invokes |callback| on success and
- // |error_callback| on failure.
+ // |object_path| with value |value| and |type_option|. |type_option| is
+ // bluetooth_gatt_characteristic::kTypeRequest or kTypeCommand, or "" to omit
+ // the option. Invokes |callback| on success and |error_callback| on failure.
virtual void WriteValue(const dbus::ObjectPath& object_path,
const std::vector<uint8_t>& value,
+ base::StringPiece type_option,
base::OnceClosure callback,
ErrorCallback error_callback) = 0;
diff --git a/chromium/device/bluetooth/dbus/bluetooth_gatt_descriptor_client.cc b/chromium/device/bluetooth/dbus/bluetooth_gatt_descriptor_client.cc
index ff3f0d53765..c2fbd87c6fd 100644
--- a/chromium/device/bluetooth/dbus/bluetooth_gatt_descriptor_client.cc
+++ b/chromium/device/bluetooth/dbus/bluetooth_gatt_descriptor_client.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include "base/bind.h"
+#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
diff --git a/chromium/device/bluetooth/dbus/bluetooth_gatt_service_client.cc b/chromium/device/bluetooth/dbus/bluetooth_gatt_service_client.cc
index 014f26f6ceb..2ea601b5c78 100644
--- a/chromium/device/bluetooth/dbus/bluetooth_gatt_service_client.cc
+++ b/chromium/device/bluetooth/dbus/bluetooth_gatt_service_client.cc
@@ -5,6 +5,7 @@
#include "device/bluetooth/dbus/bluetooth_gatt_service_client.h"
#include "base/bind.h"
+#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
diff --git a/chromium/device/bluetooth/dbus/bluez_dbus_manager.cc b/chromium/device/bluetooth/dbus/bluez_dbus_manager.cc
index 9edc0a39a1a..bd1df9bfe7b 100644
--- a/chromium/device/bluetooth/dbus/bluez_dbus_manager.cc
+++ b/chromium/device/bluetooth/dbus/bluez_dbus_manager.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/feature_list.h"
+#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/system/sys_info.h"
#include "base/threading/thread.h"
diff --git a/chromium/device/bluetooth/dbus/bluez_dbus_thread_manager.cc b/chromium/device/bluetooth/dbus/bluez_dbus_thread_manager.cc
index 31793710e2b..8b606656703 100644
--- a/chromium/device/bluetooth/dbus/bluez_dbus_thread_manager.cc
+++ b/chromium/device/bluetooth/dbus/bluez_dbus_thread_manager.cc
@@ -4,6 +4,7 @@
#include "device/bluetooth/dbus/bluez_dbus_thread_manager.h"
+#include "base/logging.h"
#include "base/message_loop/message_pump_type.h"
#include "base/threading/thread.h"
#include "dbus/bus.h"
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_agent_manager_client.cc b/chromium/device/bluetooth/dbus/fake_bluetooth_agent_manager_client.cc
index 4885352ee59..48107e1091d 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_agent_manager_client.cc
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_agent_manager_client.cc
@@ -11,7 +11,7 @@
namespace bluez {
FakeBluetoothAgentManagerClient::FakeBluetoothAgentManagerClient()
- : service_provider_(NULL) {}
+ : service_provider_(nullptr) {}
FakeBluetoothAgentManagerClient::~FakeBluetoothAgentManagerClient() = default;
@@ -81,7 +81,7 @@ void FakeBluetoothAgentManagerClient::RegisterAgentServiceProvider(
void FakeBluetoothAgentManagerClient::UnregisterAgentServiceProvider(
FakeBluetoothAgentServiceProvider* service_provider) {
if (service_provider_ == service_provider)
- service_provider_ = NULL;
+ service_provider_ = nullptr;
}
FakeBluetoothAgentServiceProvider*
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_agent_service_provider.cc b/chromium/device/bluetooth/dbus/fake_bluetooth_agent_service_provider.cc
index 2266c059d4f..edfe29d3b31 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_agent_service_provider.cc
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_agent_service_provider.cc
@@ -4,6 +4,7 @@
#include "device/bluetooth/dbus/fake_bluetooth_agent_service_provider.h"
+#include "base/logging.h"
#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "device/bluetooth/dbus/fake_bluetooth_agent_manager_client.h"
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_device_client.cc b/chromium/device/bluetooth/dbus/fake_bluetooth_device_client.cc
index 3f137c01978..23c5fe33b0b 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_device_client.cc
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_device_client.cc
@@ -650,6 +650,7 @@ void FakeBluetoothDeviceClient::ExecuteWrite(
bluez::BluezDBusManager::Get()
->GetBluetoothGattCharacteristicClient()
->WriteValue(prepare_write_request.first, prepare_write_request.second,
+ bluetooth_gatt_characteristic::kTypeRequest,
base::DoNothing(), base::DoNothing());
}
prepare_write_requests_.clear();
@@ -882,248 +883,242 @@ void FakeBluetoothDeviceClient::CreateDeviceWithProperties(
observer.DeviceAdded(device_path);
}
-std::unique_ptr<base::ListValue>
-FakeBluetoothDeviceClient::GetBluetoothDevicesAsDictionaries() const {
- std::unique_ptr<base::ListValue> predefined_devices(new base::ListValue);
- std::unique_ptr<base::DictionaryValue> pairedDevice(
- new base::DictionaryValue);
- pairedDevice->SetString("path", kPairedDevicePath);
- pairedDevice->SetString("address", kPairedDeviceAddress);
- pairedDevice->SetString("name", kPairedDeviceName);
- pairedDevice->SetString("alias", kPairedDeviceName);
- pairedDevice->SetString("pairingMethod", "");
- pairedDevice->SetString("pairingAuthToken", "");
- pairedDevice->SetString("pairingAction", "");
- pairedDevice->SetInteger("classValue", kPairedDeviceClass);
- pairedDevice->SetBoolean("discoverable", true);
- pairedDevice->SetBoolean("isTrusted", true);
- pairedDevice->SetBoolean("paired", true);
- pairedDevice->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(pairedDevice));
-
- std::unique_ptr<base::DictionaryValue> legacyDevice(
- new base::DictionaryValue);
- legacyDevice->SetString("path", kLegacyAutopairPath);
- legacyDevice->SetString("address", kLegacyAutopairAddress);
- legacyDevice->SetString("name", kLegacyAutopairName);
- legacyDevice->SetString("alias", kLegacyAutopairName);
- legacyDevice->SetString("pairingMethod", "");
- legacyDevice->SetString("pairingAuthToken", "");
- legacyDevice->SetString("pairingAction", "");
- legacyDevice->SetInteger("classValue", kLegacyAutopairClass);
- legacyDevice->SetBoolean("isTrusted", true);
- legacyDevice->SetBoolean("discoverable", false);
- legacyDevice->SetBoolean("paired", false);
- legacyDevice->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(legacyDevice));
-
- std::unique_ptr<base::DictionaryValue> pin(new base::DictionaryValue);
- pin->SetString("path", kDisplayPinCodePath);
- pin->SetString("address", kDisplayPinCodeAddress);
- pin->SetString("name", kDisplayPinCodeName);
- pin->SetString("alias", kDisplayPinCodeName);
- pin->SetString("pairingMethod", kPairingMethodPinCode);
- pin->SetString("pairingAuthToken", kTestPinCode);
- pin->SetString("pairingAction", kPairingActionDisplay);
- pin->SetInteger("classValue", kDisplayPinCodeClass);
- pin->SetBoolean("isTrusted", false);
- pin->SetBoolean("discoverable", false);
- pin->SetBoolean("paired", false);
- pin->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(pin));
-
- std::unique_ptr<base::DictionaryValue> vanishing(new base::DictionaryValue);
- vanishing->SetString("path", kVanishingDevicePath);
- vanishing->SetString("address", kVanishingDeviceAddress);
- vanishing->SetString("name", kVanishingDeviceName);
- vanishing->SetString("alias", kVanishingDeviceName);
- vanishing->SetString("pairingMethod", "");
- vanishing->SetString("pairingAuthToken", "");
- vanishing->SetString("pairingAction", "");
- vanishing->SetInteger("classValue", kVanishingDeviceClass);
- vanishing->SetBoolean("isTrusted", false);
- vanishing->SetBoolean("discoverable", false);
- vanishing->SetBoolean("paired", false);
- vanishing->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(vanishing));
-
- std::unique_ptr<base::DictionaryValue> connect_unpairable(
- new base::DictionaryValue);
- connect_unpairable->SetString("path", kConnectUnpairablePath);
- connect_unpairable->SetString("address", kConnectUnpairableAddress);
- connect_unpairable->SetString("name", kConnectUnpairableName);
- connect_unpairable->SetString("pairingMethod", "");
- connect_unpairable->SetString("pairingAuthToken", "");
- connect_unpairable->SetString("pairingAction", "");
- connect_unpairable->SetString("alias", kConnectUnpairableName);
- connect_unpairable->SetInteger("classValue", kConnectUnpairableClass);
- connect_unpairable->SetBoolean("isTrusted", false);
- connect_unpairable->SetBoolean("discoverable", false);
- connect_unpairable->SetBoolean("paired", false);
- connect_unpairable->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(connect_unpairable));
-
- std::unique_ptr<base::DictionaryValue> passkey(new base::DictionaryValue);
- passkey->SetString("path", kDisplayPasskeyPath);
- passkey->SetString("address", kDisplayPasskeyAddress);
- passkey->SetString("name", kDisplayPasskeyName);
- passkey->SetString("alias", kDisplayPasskeyName);
- passkey->SetString("pairingMethod", kPairingMethodPassKey);
- passkey->SetInteger("pairingAuthToken", kTestPassKey);
- passkey->SetString("pairingAction", kPairingActionDisplay);
- passkey->SetInteger("classValue", kDisplayPasskeyClass);
- passkey->SetBoolean("isTrusted", false);
- passkey->SetBoolean("discoverable", false);
- passkey->SetBoolean("paired", false);
- passkey->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(passkey));
-
- std::unique_ptr<base::DictionaryValue> request_pin(new base::DictionaryValue);
- request_pin->SetString("path", kRequestPinCodePath);
- request_pin->SetString("address", kRequestPinCodeAddress);
- request_pin->SetString("name", kRequestPinCodeName);
- request_pin->SetString("alias", kRequestPinCodeName);
- request_pin->SetString("pairingMethod", "");
- request_pin->SetString("pairingAuthToken", "");
- request_pin->SetString("pairingAction", kPairingActionRequest);
- request_pin->SetInteger("classValue", kRequestPinCodeClass);
- request_pin->SetBoolean("isTrusted", false);
- request_pin->SetBoolean("discoverable", false);
- request_pin->SetBoolean("paired", false);
- request_pin->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(request_pin));
-
- std::unique_ptr<base::DictionaryValue> confirm(new base::DictionaryValue);
- confirm->SetString("path", kConfirmPasskeyPath);
- confirm->SetString("address", kConfirmPasskeyAddress);
- confirm->SetString("name", kConfirmPasskeyName);
- confirm->SetString("alias", kConfirmPasskeyName);
- confirm->SetString("pairingMethod", "");
- confirm->SetInteger("pairingAuthToken", kTestPassKey);
- confirm->SetString("pairingAction", kPairingActionConfirmation);
- confirm->SetInteger("classValue", kConfirmPasskeyClass);
- confirm->SetBoolean("isTrusted", false);
- confirm->SetBoolean("discoverable", false);
- confirm->SetBoolean("paired", false);
- confirm->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(confirm));
-
- std::unique_ptr<base::DictionaryValue> request_passkey(
- new base::DictionaryValue);
- request_passkey->SetString("path", kRequestPasskeyPath);
- request_passkey->SetString("address", kRequestPasskeyAddress);
- request_passkey->SetString("name", kRequestPasskeyName);
- request_passkey->SetString("alias", kRequestPasskeyName);
- request_passkey->SetString("pairingMethod", kPairingMethodPassKey);
- request_passkey->SetString("pairingAction", kPairingActionRequest);
- request_passkey->SetInteger("pairingAuthToken", kTestPassKey);
- request_passkey->SetInteger("classValue", kRequestPasskeyClass);
- request_passkey->SetBoolean("isTrusted", false);
- request_passkey->SetBoolean("discoverable", false);
- request_passkey->SetBoolean("paired", false);
- request_passkey->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(request_passkey));
-
- std::unique_ptr<base::DictionaryValue> unconnectable(
- new base::DictionaryValue);
- unconnectable->SetString("path", kUnconnectableDevicePath);
- unconnectable->SetString("address", kUnconnectableDeviceAddress);
- unconnectable->SetString("name", kUnconnectableDeviceName);
- unconnectable->SetString("alias", kUnconnectableDeviceName);
- unconnectable->SetString("pairingMethod", "");
- unconnectable->SetString("pairingAuthToken", "");
- unconnectable->SetString("pairingAction", "");
- unconnectable->SetInteger("classValue", kUnconnectableDeviceClass);
- unconnectable->SetBoolean("isTrusted", true);
- unconnectable->SetBoolean("discoverable", false);
- unconnectable->SetBoolean("paired", false);
- unconnectable->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(unconnectable));
-
- std::unique_ptr<base::DictionaryValue> unpairable(new base::DictionaryValue);
- unpairable->SetString("path", kUnpairableDevicePath);
- unpairable->SetString("address", kUnpairableDeviceAddress);
- unpairable->SetString("name", kUnpairableDeviceName);
- unpairable->SetString("alias", kUnpairableDeviceName);
- unpairable->SetString("pairingMethod", "");
- unpairable->SetString("pairingAuthToken", "");
- unpairable->SetString("pairingAction", kPairingActionFail);
- unpairable->SetInteger("classValue", kUnpairableDeviceClass);
- unpairable->SetBoolean("isTrusted", false);
- unpairable->SetBoolean("discoverable", false);
- unpairable->SetBoolean("paired", false);
- unpairable->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(unpairable));
-
- std::unique_ptr<base::DictionaryValue> just_works(new base::DictionaryValue);
- just_works->SetString("path", kJustWorksPath);
- just_works->SetString("address", kJustWorksAddress);
- just_works->SetString("name", kJustWorksName);
- just_works->SetString("alias", kJustWorksName);
- just_works->SetString("pairingMethod", "");
- just_works->SetString("pairingAuthToken", "");
- just_works->SetString("pairingAction", "");
- just_works->SetInteger("classValue", kJustWorksClass);
- just_works->SetBoolean("isTrusted", false);
- just_works->SetBoolean("discoverable", false);
- just_works->SetBoolean("paired", false);
- just_works->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(just_works));
-
- std::unique_ptr<base::DictionaryValue> low_energy(new base::DictionaryValue);
- low_energy->SetString("path", kLowEnergyPath);
- low_energy->SetString("address", kLowEnergyAddress);
- low_energy->SetString("name", kLowEnergyName);
- low_energy->SetString("alias", kLowEnergyName);
- low_energy->SetString("pairingMethod", "");
- low_energy->SetString("pairingAuthToken", "");
- low_energy->SetString("pairingAction", "");
- low_energy->SetInteger("classValue", kLowEnergyClass);
- low_energy->SetBoolean("isTrusted", false);
- low_energy->SetBoolean("discoverable", false);
- low_energy->SetBoolean("paireed", false);
- low_energy->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(low_energy));
-
- std::unique_ptr<base::DictionaryValue> paired_unconnectable(
- new base::DictionaryValue);
- paired_unconnectable->SetString("path", kPairedUnconnectableDevicePath);
- paired_unconnectable->SetString("address", kPairedUnconnectableDeviceAddress);
- paired_unconnectable->SetString("name", kPairedUnconnectableDeviceName);
- paired_unconnectable->SetString("pairingMethod", "");
- paired_unconnectable->SetString("pairingAuthToken", "");
- paired_unconnectable->SetString("pairingAction", "");
- paired_unconnectable->SetString("alias", kPairedUnconnectableDeviceName);
- paired_unconnectable->SetInteger("classValue",
- kPairedUnconnectableDeviceClass);
- paired_unconnectable->SetBoolean("isTrusted", false);
- paired_unconnectable->SetBoolean("discoverable", true);
- paired_unconnectable->SetBoolean("paired", true);
- paired_unconnectable->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(paired_unconnectable));
-
- std::unique_ptr<base::DictionaryValue> connected_trusted_not_paired(
- new base::DictionaryValue);
- connected_trusted_not_paired->SetString("path",
- kConnectedTrustedNotPairedDevicePath);
- connected_trusted_not_paired->SetString(
+base::Value FakeBluetoothDeviceClient::GetBluetoothDevicesAsDictionaries()
+ const {
+ base::Value::ListStorage predefined_devices;
+
+ base::Value paired_device(base::Value::Type::DICTIONARY);
+ paired_device.SetStringKey("path", kPairedDevicePath);
+ paired_device.SetStringKey("address", kPairedDeviceAddress);
+ paired_device.SetStringKey("name", kPairedDeviceName);
+ paired_device.SetStringKey("alias", kPairedDeviceName);
+ paired_device.SetStringKey("pairingMethod", "");
+ paired_device.SetStringKey("pairingAuthToken", "");
+ paired_device.SetStringKey("pairingAction", "");
+ paired_device.SetIntKey("classValue", kPairedDeviceClass);
+ paired_device.SetBoolKey("discoverable", true);
+ paired_device.SetBoolKey("isTrusted", true);
+ paired_device.SetBoolKey("paired", true);
+ paired_device.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(paired_device));
+
+ base::Value legacy_device(base::Value::Type::DICTIONARY);
+ legacy_device.SetStringKey("path", kLegacyAutopairPath);
+ legacy_device.SetStringKey("address", kLegacyAutopairAddress);
+ legacy_device.SetStringKey("name", kLegacyAutopairName);
+ legacy_device.SetStringKey("alias", kLegacyAutopairName);
+ legacy_device.SetStringKey("pairingMethod", "");
+ legacy_device.SetStringKey("pairingAuthToken", "");
+ legacy_device.SetStringKey("pairingAction", "");
+ legacy_device.SetIntKey("classValue", kLegacyAutopairClass);
+ legacy_device.SetBoolKey("isTrusted", true);
+ legacy_device.SetBoolKey("discoverable", false);
+ legacy_device.SetBoolKey("paired", false);
+ legacy_device.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(legacy_device));
+
+ base::Value pin(base::Value::Type::DICTIONARY);
+ pin.SetStringKey("path", kDisplayPinCodePath);
+ pin.SetStringKey("address", kDisplayPinCodeAddress);
+ pin.SetStringKey("name", kDisplayPinCodeName);
+ pin.SetStringKey("alias", kDisplayPinCodeName);
+ pin.SetStringKey("pairingMethod", kPairingMethodPinCode);
+ pin.SetStringKey("pairingAuthToken", kTestPinCode);
+ pin.SetStringKey("pairingAction", kPairingActionDisplay);
+ pin.SetIntKey("classValue", kDisplayPinCodeClass);
+ pin.SetBoolKey("isTrusted", false);
+ pin.SetBoolKey("discoverable", false);
+ pin.SetBoolKey("paired", false);
+ pin.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(pin));
+
+ base::Value vanishing(base::Value::Type::DICTIONARY);
+ vanishing.SetStringKey("path", kVanishingDevicePath);
+ vanishing.SetStringKey("address", kVanishingDeviceAddress);
+ vanishing.SetStringKey("name", kVanishingDeviceName);
+ vanishing.SetStringKey("alias", kVanishingDeviceName);
+ vanishing.SetStringKey("pairingMethod", "");
+ vanishing.SetStringKey("pairingAuthToken", "");
+ vanishing.SetStringKey("pairingAction", "");
+ vanishing.SetIntKey("classValue", kVanishingDeviceClass);
+ vanishing.SetBoolKey("isTrusted", false);
+ vanishing.SetBoolKey("discoverable", false);
+ vanishing.SetBoolKey("paired", false);
+ vanishing.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(vanishing));
+
+ base::Value connect_unpairable(base::Value::Type::DICTIONARY);
+ connect_unpairable.SetStringKey("path", kConnectUnpairablePath);
+ connect_unpairable.SetStringKey("address", kConnectUnpairableAddress);
+ connect_unpairable.SetStringKey("name", kConnectUnpairableName);
+ connect_unpairable.SetStringKey("pairingMethod", "");
+ connect_unpairable.SetStringKey("pairingAuthToken", "");
+ connect_unpairable.SetStringKey("pairingAction", "");
+ connect_unpairable.SetStringKey("alias", kConnectUnpairableName);
+ connect_unpairable.SetIntKey("classValue", kConnectUnpairableClass);
+ connect_unpairable.SetBoolKey("isTrusted", false);
+ connect_unpairable.SetBoolKey("discoverable", false);
+ connect_unpairable.SetBoolKey("paired", false);
+ connect_unpairable.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(connect_unpairable));
+
+ base::Value passkey(base::Value::Type::DICTIONARY);
+ passkey.SetStringKey("path", kDisplayPasskeyPath);
+ passkey.SetStringKey("address", kDisplayPasskeyAddress);
+ passkey.SetStringKey("name", kDisplayPasskeyName);
+ passkey.SetStringKey("alias", kDisplayPasskeyName);
+ passkey.SetStringKey("pairingMethod", kPairingMethodPassKey);
+ passkey.SetIntKey("pairingAuthToken", kTestPassKey);
+ passkey.SetStringKey("pairingAction", kPairingActionDisplay);
+ passkey.SetIntKey("classValue", kDisplayPasskeyClass);
+ passkey.SetBoolKey("isTrusted", false);
+ passkey.SetBoolKey("discoverable", false);
+ passkey.SetBoolKey("paired", false);
+ passkey.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(passkey));
+
+ base::Value request_pin(base::Value::Type::DICTIONARY);
+ request_pin.SetStringKey("path", kRequestPinCodePath);
+ request_pin.SetStringKey("address", kRequestPinCodeAddress);
+ request_pin.SetStringKey("name", kRequestPinCodeName);
+ request_pin.SetStringKey("alias", kRequestPinCodeName);
+ request_pin.SetStringKey("pairingMethod", "");
+ request_pin.SetStringKey("pairingAuthToken", "");
+ request_pin.SetStringKey("pairingAction", kPairingActionRequest);
+ request_pin.SetIntKey("classValue", kRequestPinCodeClass);
+ request_pin.SetBoolKey("isTrusted", false);
+ request_pin.SetBoolKey("discoverable", false);
+ request_pin.SetBoolKey("paired", false);
+ request_pin.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(request_pin));
+
+ base::Value confirm(base::Value::Type::DICTIONARY);
+ confirm.SetStringKey("path", kConfirmPasskeyPath);
+ confirm.SetStringKey("address", kConfirmPasskeyAddress);
+ confirm.SetStringKey("name", kConfirmPasskeyName);
+ confirm.SetStringKey("alias", kConfirmPasskeyName);
+ confirm.SetStringKey("pairingMethod", "");
+ confirm.SetIntKey("pairingAuthToken", kTestPassKey);
+ confirm.SetStringKey("pairingAction", kPairingActionConfirmation);
+ confirm.SetIntKey("classValue", kConfirmPasskeyClass);
+ confirm.SetBoolKey("isTrusted", false);
+ confirm.SetBoolKey("discoverable", false);
+ confirm.SetBoolKey("paired", false);
+ confirm.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(confirm));
+
+ base::Value request_passkey(base::Value::Type::DICTIONARY);
+ request_passkey.SetStringKey("path", kRequestPasskeyPath);
+ request_passkey.SetStringKey("address", kRequestPasskeyAddress);
+ request_passkey.SetStringKey("name", kRequestPasskeyName);
+ request_passkey.SetStringKey("alias", kRequestPasskeyName);
+ request_passkey.SetStringKey("pairingMethod", kPairingMethodPassKey);
+ request_passkey.SetStringKey("pairingAction", kPairingActionRequest);
+ request_passkey.SetIntKey("pairingAuthToken", kTestPassKey);
+ request_passkey.SetIntKey("classValue", kRequestPasskeyClass);
+ request_passkey.SetBoolKey("isTrusted", false);
+ request_passkey.SetBoolKey("discoverable", false);
+ request_passkey.SetBoolKey("paired", false);
+ request_passkey.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(request_passkey));
+
+ base::Value unconnectable(base::Value::Type::DICTIONARY);
+ unconnectable.SetStringKey("path", kUnconnectableDevicePath);
+ unconnectable.SetStringKey("address", kUnconnectableDeviceAddress);
+ unconnectable.SetStringKey("name", kUnconnectableDeviceName);
+ unconnectable.SetStringKey("alias", kUnconnectableDeviceName);
+ unconnectable.SetStringKey("pairingMethod", "");
+ unconnectable.SetStringKey("pairingAuthToken", "");
+ unconnectable.SetStringKey("pairingAction", "");
+ unconnectable.SetIntKey("classValue", kUnconnectableDeviceClass);
+ unconnectable.SetBoolKey("isTrusted", true);
+ unconnectable.SetBoolKey("discoverable", false);
+ unconnectable.SetBoolKey("paired", false);
+ unconnectable.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(unconnectable));
+
+ base::Value unpairable(base::Value::Type::DICTIONARY);
+ unpairable.SetStringKey("path", kUnpairableDevicePath);
+ unpairable.SetStringKey("address", kUnpairableDeviceAddress);
+ unpairable.SetStringKey("name", kUnpairableDeviceName);
+ unpairable.SetStringKey("alias", kUnpairableDeviceName);
+ unpairable.SetStringKey("pairingMethod", "");
+ unpairable.SetStringKey("pairingAuthToken", "");
+ unpairable.SetStringKey("pairingAction", kPairingActionFail);
+ unpairable.SetIntKey("classValue", kUnpairableDeviceClass);
+ unpairable.SetBoolKey("isTrusted", false);
+ unpairable.SetBoolKey("discoverable", false);
+ unpairable.SetBoolKey("paired", false);
+ unpairable.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(unpairable));
+
+ base::Value just_works(base::Value::Type::DICTIONARY);
+ just_works.SetStringKey("path", kJustWorksPath);
+ just_works.SetStringKey("address", kJustWorksAddress);
+ just_works.SetStringKey("name", kJustWorksName);
+ just_works.SetStringKey("alias", kJustWorksName);
+ just_works.SetStringKey("pairingMethod", "");
+ just_works.SetStringKey("pairingAuthToken", "");
+ just_works.SetStringKey("pairingAction", "");
+ just_works.SetIntKey("classValue", kJustWorksClass);
+ just_works.SetBoolKey("isTrusted", false);
+ just_works.SetBoolKey("discoverable", false);
+ just_works.SetBoolKey("paired", false);
+ just_works.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(just_works));
+
+ base::Value low_energy(base::Value::Type::DICTIONARY);
+ low_energy.SetStringKey("path", kLowEnergyPath);
+ low_energy.SetStringKey("address", kLowEnergyAddress);
+ low_energy.SetStringKey("name", kLowEnergyName);
+ low_energy.SetStringKey("alias", kLowEnergyName);
+ low_energy.SetStringKey("pairingMethod", "");
+ low_energy.SetStringKey("pairingAuthToken", "");
+ low_energy.SetStringKey("pairingAction", "");
+ low_energy.SetIntKey("classValue", kLowEnergyClass);
+ low_energy.SetBoolKey("isTrusted", false);
+ low_energy.SetBoolKey("discoverable", false);
+ low_energy.SetBoolKey("paireed", false);
+ low_energy.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(low_energy));
+
+ base::Value paired_unconnectable(base::Value::Type::DICTIONARY);
+ paired_unconnectable.SetStringKey("path", kPairedUnconnectableDevicePath);
+ paired_unconnectable.SetStringKey("address",
+ kPairedUnconnectableDeviceAddress);
+ paired_unconnectable.SetStringKey("name", kPairedUnconnectableDeviceName);
+ paired_unconnectable.SetStringKey("pairingMethod", "");
+ paired_unconnectable.SetStringKey("pairingAuthToken", "");
+ paired_unconnectable.SetStringKey("pairingAction", "");
+ paired_unconnectable.SetStringKey("alias", kPairedUnconnectableDeviceName);
+ paired_unconnectable.SetIntKey("classValue", kPairedUnconnectableDeviceClass);
+ paired_unconnectable.SetBoolKey("isTrusted", false);
+ paired_unconnectable.SetBoolKey("discoverable", true);
+ paired_unconnectable.SetBoolKey("paired", true);
+ paired_unconnectable.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(paired_unconnectable));
+
+ base::Value connected_trusted_not_paired(base::Value::Type::DICTIONARY);
+ connected_trusted_not_paired.SetStringKey(
+ "path", kConnectedTrustedNotPairedDevicePath);
+ connected_trusted_not_paired.SetStringKey(
"address", kConnectedTrustedNotPairedDeviceAddress);
- connected_trusted_not_paired->SetString("name",
- kConnectedTrustedNotPairedDeviceName);
- connected_trusted_not_paired->SetString("pairingMethod", "");
- connected_trusted_not_paired->SetString("pairingAuthToken", "");
- connected_trusted_not_paired->SetString("pairingAction", "");
- connected_trusted_not_paired->SetString("alias",
- kConnectedTrustedNotPairedDeviceName);
- connected_trusted_not_paired->SetInteger(
- "classValue", kConnectedTrustedNotPairedDeviceClass);
- connected_trusted_not_paired->SetBoolean("isTrusted", true);
- connected_trusted_not_paired->SetBoolean("discoverable", true);
- connected_trusted_not_paired->SetBoolean("paired", false);
- connected_trusted_not_paired->SetBoolean("incoming", false);
- predefined_devices->Append(std::move(connected_trusted_not_paired));
-
- return predefined_devices;
+ connected_trusted_not_paired.SetStringKey(
+ "name", kConnectedTrustedNotPairedDeviceName);
+ connected_trusted_not_paired.SetStringKey("pairingMethod", "");
+ connected_trusted_not_paired.SetStringKey("pairingAuthToken", "");
+ connected_trusted_not_paired.SetStringKey("pairingAction", "");
+ connected_trusted_not_paired.SetStringKey(
+ "alias", kConnectedTrustedNotPairedDeviceName);
+ connected_trusted_not_paired.SetIntKey("classValue",
+ kConnectedTrustedNotPairedDeviceClass);
+ connected_trusted_not_paired.SetBoolKey("isTrusted", true);
+ connected_trusted_not_paired.SetBoolKey("discoverable", true);
+ connected_trusted_not_paired.SetBoolKey("paired", false);
+ connected_trusted_not_paired.SetBoolKey("incoming", false);
+ predefined_devices.push_back(std::move(connected_trusted_not_paired));
+
+ return base::Value(std::move(predefined_devices));
}
void FakeBluetoothDeviceClient::RemoveDevice(
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_device_client.h b/chromium/device/bluetooth/dbus/fake_bluetooth_device_client.h
index 66db5320ea0..98a9676382a 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_device_client.h
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_device_client.h
@@ -140,7 +140,7 @@ class DEVICE_BLUETOOTH_EXPORT FakeBluetoothDeviceClient
// Creates and returns a list of std::unique_ptr<base::DictionaryValue>
// objects, which contain all the data from the constants for devices with
// predefined behavior.
- std::unique_ptr<base::ListValue> GetBluetoothDevicesAsDictionaries() const;
+ base::Value GetBluetoothDevicesAsDictionaries() const;
SimulatedPairingOptions* GetPairingOptions(
const dbus::ObjectPath& object_path);
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc b/chromium/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc
index ab1c641f56b..41e00e93a88 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/location.h"
+#include "base/logging.h"
#include "base/rand_util.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -206,6 +207,7 @@ void FakeBluetoothGattCharacteristicClient::ReadValue(
void FakeBluetoothGattCharacteristicClient::WriteValue(
const dbus::ObjectPath& object_path,
const std::vector<uint8_t>& value,
+ base::StringPiece type_option,
base::OnceClosure callback,
ErrorCallback error_callback) {
if (!authenticated_) {
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h b/chromium/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h
index 217636c5389..bb17ba3f958 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h
@@ -57,6 +57,7 @@ class DEVICE_BLUETOOTH_EXPORT FakeBluetoothGattCharacteristicClient
ErrorCallback error_callback) override;
void WriteValue(const dbus::ObjectPath& object_path,
const std::vector<uint8_t>& value,
+ base::StringPiece type_option,
base::OnceClosure callback,
ErrorCallback error_callback) override;
void PrepareWriteValue(const dbus::ObjectPath& object_path,
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_gatt_service_client.cc b/chromium/device/bluetooth/dbus/fake_bluetooth_gatt_service_client.cc
index 5441071b4bd..1dfd30aa534 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_gatt_service_client.cc
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_gatt_service_client.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/location.h"
+#include "base/logging.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_le_advertisement_service_provider.cc b/chromium/device/bluetooth/dbus/fake_bluetooth_le_advertisement_service_provider.cc
index 52d3239f925..a4a3ba97129 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_le_advertisement_service_provider.cc
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_le_advertisement_service_provider.cc
@@ -4,6 +4,7 @@
#include "device/bluetooth/dbus/fake_bluetooth_le_advertisement_service_provider.h"
+#include "base/logging.h"
#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "device/bluetooth/dbus/fake_bluetooth_le_advertising_manager_client.h"
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_media_client.cc b/chromium/device/bluetooth/dbus/fake_bluetooth_media_client.cc
index 7e67ac7a86e..fd693399dd6 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_media_client.cc
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_media_client.cc
@@ -6,6 +6,7 @@
#include <string>
+#include "base/logging.h"
#include "base/stl_util.h"
#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "device/bluetooth/dbus/fake_bluetooth_adapter_client.h"
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.cc b/chromium/device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.cc
index faf04dc0363..4a0b7c33695 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.cc
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.cc
@@ -4,6 +4,7 @@
#include "device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.h"
+#include "base/logging.h"
#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "device/bluetooth/dbus/fake_bluetooth_media_client.h"
#include "device/bluetooth/dbus/fake_bluetooth_media_transport_client.h"
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.h b/chromium/device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.h
index f907e4da732..43b72422101 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.h
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.h
@@ -9,7 +9,6 @@
#include <vector>
-#include "base/logging.h"
#include "base/macros.h"
#include "dbus/object_path.h"
#include "device/bluetooth/bluetooth_export.h"
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_media_transport_client.cc b/chromium/device/bluetooth/dbus/fake_bluetooth_media_transport_client.cc
index d7b267d8cc7..7d4c63a468e 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_media_transport_client.cc
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_media_transport_client.cc
@@ -13,6 +13,7 @@
#include "base/bind.h"
#include "base/file_descriptor_posix.h"
+#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "device/bluetooth/dbus/bluetooth_media_client.h"
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_profile_service_provider.cc b/chromium/device/bluetooth/dbus/fake_bluetooth_profile_service_provider.cc
index f684ecb112a..508e833fb3e 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_profile_service_provider.cc
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_profile_service_provider.cc
@@ -7,6 +7,7 @@
#include <memory>
#include <utility>
+#include "base/logging.h"
#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "device/bluetooth/dbus/fake_bluetooth_profile_manager_client.h"