Commit 96f79875 authored by James Hollyer's avatar James Hollyer Committed by Commit Bot

Only use bluez discovering property for testing

The discovering property in bluez is often delayed in updating.  This
has caused issues in the past. This change ensures that that property is
only used in testing so that it will no longer cause any bugs.

Bug: 1013678
Change-Id: I8afbdef6385189d62b1d47ceee16474da06d2caa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003355
Commit-Queue: James Hollyer <jameshollyer@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737061}
parent 6f0e010d
......@@ -448,6 +448,13 @@ bool BluetoothAdapterBlueZ::IsDiscovering() const {
if (!IsPresent())
return false;
return NumScanningDiscoverySessions() > 0;
}
bool BluetoothAdapterBlueZ::IsDiscoveringForTesting() const {
if (!IsPresent())
return false;
bluez::BluetoothAdapterClient::Properties* properties =
bluez::BluezDBusManager::Get()
->GetBluetoothAdapterClient()
......
......@@ -119,6 +119,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterBlueZ final
const ErrorCallback& error_callback) override;
uint32_t GetDiscoverableTimeout() const;
bool IsDiscovering() const override;
bool IsDiscoveringForTesting() const;
std::unordered_map<device::BluetoothDevice*, device::BluetoothDevice::UUIDSet>
RetrieveGattConnectedDevicesWithDiscoveryFilter(
const device::BluetoothDiscoveryFilter& discovery_filter) override;
......
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