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

Unified Diff: components/proximity_auth/bluetooth_connection.cc

Issue 1359043005: Fix BluetoothConnection to disconnect when the underlying device disconnects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proximity_auth_system2
Patch Set: 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: components/proximity_auth/bluetooth_connection.cc
diff --git a/components/proximity_auth/bluetooth_connection.cc b/components/proximity_auth/bluetooth_connection.cc
index f06d52f6d260d05e435a8ebc3a091ecfe8425271..fbd548d1ac7527a9598a1bcf6dfc296cccb40c32 100644
--- a/components/proximity_auth/bluetooth_connection.cc
+++ b/components/proximity_auth/bluetooth_connection.cc
@@ -88,6 +88,16 @@ void BluetoothConnection::SendMessageImpl(scoped_ptr<WireMessage> message) {
base::Bind(&BluetoothConnection::OnSendError, weak_this));
}
+void BluetoothConnection::DeviceChanged(device::BluetoothAdapter* adapter,
+ device::BluetoothDevice* device) {
+ DCHECK_EQ(adapter, adapter_.get());
+ if (device->GetAddress() == remote_device().bluetooth_address &&
+ IsConnected() && !device->IsConnected()) {
+ PA_LOG(INFO) << "Device disconnected...";
+ Disconnect();
+ }
+}
+
void BluetoothConnection::DeviceRemoved(device::BluetoothAdapter* adapter,
device::BluetoothDevice* device) {
DCHECK_EQ(adapter, adapter_.get());
« no previous file with comments | « components/proximity_auth/bluetooth_connection.h ('k') | components/proximity_auth/bluetooth_connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698