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

Unified Diff: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc

Issue 1341103004: Handle change of BLE address after pairing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased onto latest master 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
Index: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
index 32bfdd14ada7a04342c8a9803c11a06cafdb9ef3..b54d4e2d84039fb6a96b5d1c3ab59ac2080c1861 100644
--- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
+++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
@@ -890,6 +890,19 @@ void BluetoothLowEnergyEventRouter::GattDiscoveryCompleteForService(
EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass());
}
+void BluetoothLowEnergyEventRouter::DeviceAddressChanged(
+ BluetoothAdapter* adapter,
+ BluetoothDevice* device,
+ const std::string& old_address) {
+ InstanceIdMap::const_iterator iter;
+
+ for (iter = service_id_to_device_address_.begin();
+ iter != service_id_to_device_address_.end(); iter++) {
armansito 2015/09/25 18:42:30 nit: for (auto iter : service_id_to_device_address
jpawlowski1 2015/09/25 19:25:45 Done.
+ if (iter->second == old_address)
+ service_id_to_device_address_[iter->first] = device->GetAddress();
+ }
+}
+
void BluetoothLowEnergyEventRouter::GattServiceChanged(
BluetoothAdapter* adapter,
BluetoothGattService* service) {

Powered by Google App Engine
This is Rietveld 408576698