Chromium Code Reviews| 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); |