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

Unified Diff: components/arc/bluetooth/arc_bluetooth_bridge.cc

Issue 2189183002: arc: bluetooth: Always acquire a NotifySession (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/bluetooth/arc_bluetooth_bridge.cc
diff --git a/components/arc/bluetooth/arc_bluetooth_bridge.cc b/components/arc/bluetooth/arc_bluetooth_bridge.cc
index 29b92d8ec94873772774a9f6a54966bd295babc2..897d8cd0d17822e24a3e39bbdc63258508537184 100644
--- a/components/arc/bluetooth/arc_bluetooth_bridge.cc
+++ b/components/arc/bluetooth/arc_bluetooth_bridge.cc
@@ -1099,11 +1099,6 @@ void ArcBluetoothBridge::RegisterForGattNotification(
return;
}
- if (characteristic->IsNotifying()) {
- callback.Run(mojom::BluetoothGattStatus::GATT_SUCCESS);
- return;
- }
-
characteristic->StartNotifySession(
puthik_chromium 2016/07/28 22:40:31 The notifying session is always acquire here.
base::Bind(&ArcBluetoothBridge::OnGattNotifyStartDone,
weak_factory_.GetWeakPtr(), callback,
@@ -1126,12 +1121,16 @@ void ArcBluetoothBridge::DeregisterForGattNotification(
return;
}
+ std::string char_id_str = characteristic->GetIdentifier();
+
if (!characteristic->IsNotifying()) {
ortuno 2016/07/28 22:56:00 IsNotifying() will always be true as long as there
puthik_chromium 2016/07/28 23:11:12 Since this is always true. Changed to DCHECK.
callback.Run(mojom::BluetoothGattStatus::GATT_SUCCESS);
+ LOG(WARNING) << __func__ << ("Notification is stopped");
ortuno 2016/07/28 22:21:06 I don't think this solves the problem. You are sti
puthik_chromium 2016/07/28 22:40:31 This is the Deregister function. I think delete th
ortuno 2016/07/28 22:56:00 Ah my bad. You are right.
+ if (notification_session_.find(char_id_str) != notification_session_.end())
+ notification_session_.erase(char_id_str);
return;
}
- std::string char_id_str = characteristic->GetIdentifier();
std::unique_ptr<BluetoothGattNotifySession> notify =
std::move(notification_session_[char_id_str]);
notification_session_.erase(char_id_str);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698