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

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: aura shell impl 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.cc
diff --git a/device/bluetooth/bluetooth_device.cc b/device/bluetooth/bluetooth_device.cc
index f7bea9ed95422afe8618efb42474ce1d2d08f864..12c748c2c1b1e36354abcab8d09b3f49ba5621a4 100644
--- a/device/bluetooth/bluetooth_device.cc
+++ b/device/bluetooth/bluetooth_device.cc
@@ -158,6 +158,20 @@ 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;
stevenjb 2013/04/17 21:19:20 Add a TODO item to put this into a config file (si
+
+ return true;
+}
bool BluetoothDevice::ProvidesServiceWithUUID(
const std::string& uuid) const {

Powered by Google App Engine
This is Rietveld 408576698