summaryrefslogtreecommitdiffstats
path: root/device
diff options
context:
space:
mode:
authordeymo@chromium.org <deymo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-26 06:06:16 +0000
committerdeymo@chromium.org <deymo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-26 06:06:16 +0000
commit2fdf5a366e20cab5aa7bc19dec5f2ba57d15c6c5 (patch)
tree97508f587fda04fcf1536e01a72917e2399c684f /device
parent03532905307c27b2dbaa7d8ae96bdc618f9e3667 (diff)
downloadchromium_src-2fdf5a366e20cab5aa7bc19dec5f2ba57d15c6c5.zip
chromium_src-2fdf5a366e20cab5aa7bc19dec5f2ba57d15c6c5.tar.gz
chromium_src-2fdf5a366e20cab5aa7bc19dec5f2ba57d15c6c5.tar.bz2
Bluetooth: Disable "IsConnectable" property for ChromeOS implementation.
The IsConnectable property tells if a given device can be re-connected later once paired. If it is false, the device is not supposed to respond to a connection attempt from the host, and since we know it, we don't show the connect button for this kind of devices. This fix rollbacks the IsConnectable implementation in ChromeOS and default its value to true because some mice don't support pairing and should be possible to connect to them regardless the value of this property. BUG=chromium:220553 TEST=Pair to Microsoft mouse 5000, disconnect and try to connect again. Review URL: https://chromiumcodereview.appspot.com/12917023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190559 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'device')
-rw-r--r--device/bluetooth/bluetooth_device_chromeos.cc26
-rw-r--r--device/bluetooth/bluetooth_device_chromeos.h5
2 files changed, 0 insertions, 31 deletions
diff --git a/device/bluetooth/bluetooth_device_chromeos.cc b/device/bluetooth/bluetooth_device_chromeos.cc
index bef006f..45756fa 100644
--- a/device/bluetooth/bluetooth_device_chromeos.cc
+++ b/device/bluetooth/bluetooth_device_chromeos.cc
@@ -457,36 +457,10 @@ void BluetoothDeviceChromeOS::CollectServiceRecordsCallback(
new BluetoothServiceRecordChromeOS(address(), i->second));
}
service_records_loaded_ = true;
- OnServiceRecordsChanged();
callback.Run(service_records_);
}
-void BluetoothDeviceChromeOS::OnServiceRecordsChanged(void) {
- // Update the BluetoothDevice::connectable_ property.
- bool hid_normally_connectable = true;
- bool hid_reconnect_initiate = true;
- for (ServiceRecordList::const_iterator it = service_records_.begin();
- it != service_records_.end(); ++it) {
- if ((*it)->SupportsHid()) {
- // If there are several HID profiles, we assume the device is connectable
- // if all them are connectable.
- hid_normally_connectable =
- hid_normally_connectable && (*it)->hid_normally_connectable();
- hid_reconnect_initiate =
- hid_reconnect_initiate && (*it)->hid_reconnect_initiate();
- }
- }
- // The Bluetooth HID spec states that if HIDNormallyConnectable or
- // HIDReconnectInitiate are not present in a HID profile, the value is false.
- // Nevertheless, a device with both properties in false can't reconnect to the
- // adapter and can't be reconnected from the adapter. To avoid problems with
- // devices that don't export this properties we asume they are connectable.
- connectable_ = hid_normally_connectable || !hid_reconnect_initiate;
- VLOG(1) << "ServiceRecordsChanged for " << address_
- << ": connectable = " << connectable_;
-}
-
void BluetoothDeviceChromeOS::OnSetTrusted(bool success) {
LOG_IF(WARNING, !success) << "Failed to set device as trusted: " << address_;
}
diff --git a/device/bluetooth/bluetooth_device_chromeos.h b/device/bluetooth/bluetooth_device_chromeos.h
index 824eadd..32e8984 100644
--- a/device/bluetooth/bluetooth_device_chromeos.h
+++ b/device/bluetooth/bluetooth_device_chromeos.h
@@ -124,11 +124,6 @@ class BluetoothDeviceChromeOS
const BluetoothDeviceClient::ServiceMap& service_map,
bool success);
- // Called by CollectServiceRecordsCallback() every time |service_records_| is
- // updated. |OnServiceRecordsChanged| updates the derived properties that
- // depend on |service_records_|.
- void OnServiceRecordsChanged(void);
-
// Called by BluetoothProperty when the call to Set() for the Trusted
// property completes. |success| indicates whether or not the request
// succeeded.