Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: chromeos/dbus/fake_bluetooth_device_client.cc

Issue 273953002: Hook up RSSI and host transmit power Bluetooth device properties for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix clang warnings, test flakiness, and bluetooth.connect should succeed even if monitor fails Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/fake_bluetooth_device_client.h ('k') | device/bluetooth/bluetooth_adapter_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/fake_bluetooth_device_client.cc
diff --git a/chromeos/dbus/fake_bluetooth_device_client.cc b/chromeos/dbus/fake_bluetooth_device_client.cc
index 44b9a0b5a407c01a8cab726157522e528e16cbc0..2dd5aaea70e64f4f77cf7c374829b0e723dc14bf 100644
--- a/chromeos/dbus/fake_bluetooth_device_client.cc
+++ b/chromeos/dbus/fake_bluetooth_device_client.cc
@@ -220,7 +220,8 @@ FakeBluetoothDeviceClient::FakeBluetoothDeviceClient()
: simulation_interval_ms_(kSimulationIntervalMs),
discovery_simulation_step_(0),
incoming_pairing_simulation_step_(0),
- pairing_cancelled_(false) {
+ pairing_cancelled_(false),
+ connection_monitor_started_(false) {
Properties* properties = new Properties(base::Bind(
&FakeBluetoothDeviceClient::OnPropertyChanged,
base::Unretained(this),
@@ -459,6 +460,22 @@ void FakeBluetoothDeviceClient::CancelPairing(
callback.Run();
}
+void FakeBluetoothDeviceClient::StartConnectionMonitor(
+ const dbus::ObjectPath& object_path,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
+ VLOG(1) << "StartConnectionMonitor: " << object_path.value();
+ connection_monitor_started_ = true;
+ callback.Run();
+}
+
+void FakeBluetoothDeviceClient::StopConnectionMonitor(
+ const dbus::ObjectPath& object_path,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
+ connection_monitor_started_ = false;
+ callback.Run();
+}
void FakeBluetoothDeviceClient::BeginDiscoverySimulation(
const dbus::ObjectPath& adapter_path) {
@@ -677,12 +694,12 @@ void FakeBluetoothDeviceClient::DiscoverySimulationTimer() {
dbus::ObjectPath(kLowEnergyPath));
} else if (discovery_simulation_step_ == 4) {
+ UpdateDeviceRSSI(dbus::ObjectPath(kLowEnergyPath),
+ base::RandInt(kMinRSSI, kMaxRSSI));
CreateDevice(dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
dbus::ObjectPath(kDisplayPinCodePath));
CreateDevice(dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
dbus::ObjectPath(kVanishingDevicePath));
- UpdateDeviceRSSI(dbus::ObjectPath(kLowEnergyPath),
- base::RandInt(kMinRSSI, kMaxRSSI));
} else if (discovery_simulation_step_ == 7) {
CreateDevice(dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
@@ -713,10 +730,10 @@ void FakeBluetoothDeviceClient::DiscoverySimulationTimer() {
base::RandInt(kMinRSSI, kMaxRSSI));
} else if (discovery_simulation_step_ == 13) {
- RemoveDevice(dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
- dbus::ObjectPath(kVanishingDevicePath));
UpdateDeviceRSSI(dbus::ObjectPath(kLowEnergyPath),
base::RandInt(kMinRSSI, kMaxRSSI));
+ RemoveDevice(dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
+ dbus::ObjectPath(kVanishingDevicePath));
} else if (discovery_simulation_step_ == 14) {
UpdateDeviceRSSI(dbus::ObjectPath(kLowEnergyPath),
« no previous file with comments | « chromeos/dbus/fake_bluetooth_device_client.h ('k') | device/bluetooth/bluetooth_adapter_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698