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

Unified Diff: components/proximity_auth/ble/bluetooth_low_energy_connection.cc

Issue 1351353002: Using the GATT connection address instead of cached remote_device(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_connection_address
Patch Set: Rebasing Created 5 years, 3 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 | « components/proximity_auth/ble/bluetooth_low_energy_connection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/proximity_auth/ble/bluetooth_low_energy_connection.cc
diff --git a/components/proximity_auth/ble/bluetooth_low_energy_connection.cc b/components/proximity_auth/ble/bluetooth_low_energy_connection.cc
index 8878585426e84b3919f8b64e260ed5b9b6f94fc9..e1e6209963077371042fc9ed55a01330106f248e 100644
--- a/components/proximity_auth/ble/bluetooth_low_energy_connection.cc
+++ b/components/proximity_auth/ble/bluetooth_low_energy_connection.cc
@@ -550,8 +550,13 @@ void BluetoothLowEnergyConnection::ClearWriteRequestsQueue() {
write_requests_queue_.pop();
}
-const std::string& BluetoothLowEnergyConnection::GetRemoteDeviceAddress() {
- return remote_device().bluetooth_address;
+std::string BluetoothLowEnergyConnection::GetRemoteDeviceAddress() {
+ // When the remote device is connected we should rely on the address given by
+ // |gatt_connection_|. As the device address may change if the device is
+ // paired. The address in |gatt_connection_| is automatically updated in this
+ // case.
+ return gatt_connection_ ? gatt_connection_->GetDeviceAddress()
+ : remote_device().bluetooth_address;
}
BluetoothDevice* BluetoothLowEnergyConnection::GetRemoteDevice() {
« no previous file with comments | « components/proximity_auth/ble/bluetooth_low_energy_connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698