Commit 2c1b7d65 authored by Jie Jiang's avatar Jie Jiang Committed by Commit Bot

arc: bluetooth: Avoid useless GATT disconnected log

Currently OnGattDisconnected() is called every time DeviceRemoved() is
triggered, and will output a warning log if we doesn't hold a GATT
connection for that device, but actually this should be a normal case.
This patch adds an early return to avoid the log in that case.

BUG=None
TEST=Running system for a while, no more "OnGattDisconnected called, but
  no gatt connection was found" in chrome log.

Change-Id: Ia3dcc4e65cbc1e66ef1f7c34d51d2940a28095ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2409660
Commit-Queue: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: default avatarHidehiko Abe <hidehiko@chromium.org>
Auto-Submit: Jie Jiang <jiejiang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806935}
parent c2d03227
......@@ -721,7 +721,8 @@ void ArcBluetoothBridge::DeviceRemoved(BluetoothAdapter* adapter,
DCHECK(device);
std::string address = device->GetAddress();
OnGattDisconnected(mojom::BluetoothAddress::From(address));
if (gatt_connections_.find(address) != gatt_connections_.end())
OnGattDisconnected(mojom::BluetoothAddress::From(address));
OnForgetDone(mojom::BluetoothAddress::From(address));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment