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

Unified Diff: device/bluetooth/bluetooth_device.cc

Issue 13933012: Bluetooth: Don't attempt a pairing for devices not supporting it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: todo added 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
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device.cc
diff --git a/device/bluetooth/bluetooth_device.cc b/device/bluetooth/bluetooth_device.cc
index f7bea9ed95422afe8618efb42474ce1d2d08f864..4a70627d4167f3f9aa07b8202da42a8e956d2005 100644
--- a/device/bluetooth/bluetooth_device.cc
+++ b/device/bluetooth/bluetooth_device.cc
@@ -158,6 +158,21 @@ BluetoothDevice::DeviceType BluetoothDevice::GetDeviceType() const {
return DEVICE_UNKNOWN;
}
+bool BluetoothDevice::IsPairable() const {
+ DeviceType type = GetDeviceType();
+
+ // Get the vendor part of the address: "00:11:22" for "00:11:22:33:44:55"
+ std::string vendor = GetAddress().substr(0, 8);
+
+ // Verbatim "Bluetooth Mouse", model 96674
+ if ((type == DEVICE_MOUSE && vendor == "00:12:A1") ||
+ // Microsoft "Microsoft Bluetooth Notebook Mouse 5000", model X807028-001
+ (type == DEVICE_MOUSE && vendor == "7C:ED:8D"))
+ return false;
+ // TODO: Move this database into a config file.
+
+ return true;
+}
bool BluetoothDevice::ProvidesServiceWithUUID(
const std::string& uuid) const {
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698