diff options
author | sacomoto <sacomoto@chromium.org> | 2015-07-07 02:58:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-07 09:59:21 +0000 |
commit | 2f1d9f268f8e22455606df7efe5207d2cbe68a9a (patch) | |
tree | 63c3d9d758634e3521cf3bc9a326ff49fd1fc4e1 /components/proximity_auth | |
parent | 7a488959b8dc39bc610ce0dbd736a20de96786e3 (diff) | |
download | chromium_src-2f1d9f268f8e22455606df7efe5207d2cbe68a9a.zip chromium_src-2f1d9f268f8e22455606df7efe5207d2cbe68a9a.tar.gz chromium_src-2f1d9f268f8e22455606df7efe5207d2cbe68a9a.tar.bz2 |
Workaround for already notfitying characteristics in BLE connection.
This CL is a workaround for crbug.com/507325. When a characteristic is
already notifying and |BluetoothGattCharacteristic::StartnotifySession|
is called again, the error callback will be called with the error code
|GATT_ERROR_FAILED|.
BUG=
Review URL: https://codereview.chromium.org/1225823002
Cr-Commit-Position: refs/heads/master@{#337577}
Diffstat (limited to 'components/proximity_auth')
-rw-r--r-- | components/proximity_auth/ble/bluetooth_low_energy_connection.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/components/proximity_auth/ble/bluetooth_low_energy_connection.cc b/components/proximity_auth/ble/bluetooth_low_energy_connection.cc index 11b4a2f..550cbf2 100644 --- a/components/proximity_auth/ble/bluetooth_low_energy_connection.cc +++ b/components/proximity_auth/ble/bluetooth_low_energy_connection.cc @@ -321,6 +321,17 @@ void BluetoothLowEnergyConnection::StartNotifySession() { GetGattCharacteristic(from_peripheral_char_.id); DCHECK(characteristic); + // This is a workaround for crbug.com/507325. If |characteristic| is already + // notifying |characteristic->StartNotifySession()| will fail with + // GATT_ERROR_FAILED. + if (characteristic->IsNotifying()) { + PA_LOG(INFO) << characteristic->GetUUID().canonical_value() + << " already notifying."; + SetSubStatus(SubStatus::NOTIFY_SESSION_READY); + SendInviteToConnectSignal(); + return; + } + SetSubStatus(SubStatus::WAITING_NOTIFY_SESSION); characteristic->StartNotifySession( base::Bind(&BluetoothLowEnergyConnection::OnNotifySessionStarted, |