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

Unified Diff: device/bluetooth/bluetooth_device_experimental_chromeos.cc

Issue 14048007: Bluetooth: D-Bus client interface for org.bluez.Input1 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: interface deletion order fixed. Created 7 years, 8 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
Index: device/bluetooth/bluetooth_device_experimental_chromeos.cc
diff --git a/device/bluetooth/bluetooth_device_experimental_chromeos.cc b/device/bluetooth/bluetooth_device_experimental_chromeos.cc
index 0f3e478149067c30e1252efede7191447f003163..9e510a6c2d198941b326302c5fb42e666a4d6e98 100644
--- a/device/bluetooth/bluetooth_device_experimental_chromeos.cc
+++ b/device/bluetooth/bluetooth_device_experimental_chromeos.cc
@@ -10,6 +10,7 @@
#include "chromeos/dbus/experimental_bluetooth_agent_manager_client.h"
#include "chromeos/dbus/experimental_bluetooth_agent_service_provider.h"
#include "chromeos/dbus/experimental_bluetooth_device_client.h"
+#include "chromeos/dbus/experimental_bluetooth_input_client.h"
#include "dbus/bus.h"
#include "device/bluetooth/bluetooth_adapter_experimental_chromeos.h"
#include "device/bluetooth/bluetooth_socket.h"
@@ -90,8 +91,15 @@ bool BluetoothDeviceExperimentalChromeOS::IsConnected() const {
}
bool BluetoothDeviceExperimentalChromeOS::IsConnectable() const {
- // TODO(deymo): implement
- return false;
+ ExperimentalBluetoothInputClient::Properties* input_properties =
+ DBusThreadManager::Get()->GetExperimentalBluetoothInputClient()->
+ GetProperties(object_path_);
+ // GetProperties returns NULL when the device does not implement the given
+ // interface. Non HID devices are normally connectable.
+ if (!input_properties)
+ return true;
+
+ return input_properties->reconnect_mode.value() != "device";
}
bool BluetoothDeviceExperimentalChromeOS::IsConnecting() const {
« no previous file with comments | « chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc ('k') | device/bluetooth/bluetooth_experimental_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698