Skip to content

Commit

Permalink
[chromecast] BLE: Silently ignore unrecognized disconnenect events
Browse files Browse the repository at this point in the history
- There may be other processes in the system which are
  connecting/disconnecting BLE devices.
- We may receive extra disconnect events

Bug: b/110965632
Test: Does not log if called with unrecognized device.
Change-Id: I3059435ea5df6919e12a87852c27e716a0f106b5
Reviewed-on: https://chromium-review.googlesource.com/1119657
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Commit-Queue: Bailey Forrest <bcf@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574436}
  • Loading branch information
Bailey Forrest authored and Commit Bot committed Jul 12, 2018
1 parent c1a4603 commit a3aa047
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chromecast/device/bluetooth/le/gatt_client_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ void GattClientManagerImpl::OnConnectChanged(
bool connected) {
MAKE_SURE_IO_THREAD(OnConnectChanged, addr, status, connected);
auto it = addr_to_device_.find(addr);
CHECK_DEVICE_EXISTS_IT(it);

// Silently ignore devices we aren't keeping track of.
if (it == addr_to_device_.end()) {
return;
}

it->second->SetConnected(connected);
if (connected) {
Expand Down

0 comments on commit a3aa047

Please sign in to comment.