| Index: device/bluetooth/bluetooth_adapter_factory.h
|
| diff --git a/device/bluetooth/bluetooth_adapter_factory.h b/device/bluetooth/bluetooth_adapter_factory.h
|
| index ab800db0b63e3366f7c99b0a00a25d2bec2c5072..43cf6865fc1ea840793ab8e34384ec4e44fc02d2 100644
|
| --- a/device/bluetooth/bluetooth_adapter_factory.h
|
| +++ b/device/bluetooth/bluetooth_adapter_factory.h
|
| @@ -6,6 +6,7 @@
|
| #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_H_
|
|
|
| #include "base/callback.h"
|
| +#include "base/lazy_instance.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "build/build_config.h"
|
| #include "device/bluetooth/bluetooth_adapter.h"
|
| @@ -20,13 +21,17 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterFactory {
|
| typedef base::Callback<void(scoped_refptr<BluetoothAdapter> adapter)>
|
| AdapterCallback;
|
|
|
| + ~BluetoothAdapterFactory();
|
| +
|
| + static BluetoothAdapterFactory& Get();
|
| +
|
| // Returns true if the Bluetooth adapter is available for the current
|
| // platform.
|
| static bool IsBluetoothAdapterAvailable();
|
|
|
| // Returns true if Bluetooth Low Energy is available for the current
|
| // platform.
|
| - static bool IsLowEnergyAvailable();
|
| + bool IsLowEnergyAvailable();
|
|
|
| // Returns the shared instance of the default adapter, creating and
|
| // initializing it if necessary. |callback| is called with the adapter
|
| @@ -48,6 +53,17 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterFactory {
|
| // Returns true iff the implementation has a (non-NULL) shared instance of the
|
| // adapter. Exposed for testing.
|
| static bool HasSharedInstanceForTesting();
|
| +
|
| + // Sets the return value for IsLowEnergyAvailable() to |available|.
|
| + void SetLowEnergyAvailableForTesting(bool available);
|
| +
|
| + private:
|
| + // Friend LazyInstance to permit access to private constructor.
|
| + friend base::LazyInstanceTraitsBase<BluetoothAdapterFactory>;
|
| +
|
| + BluetoothAdapterFactory();
|
| +
|
| + base::Optional<bool> le_available_for_testing_;
|
| };
|
|
|
| } // namespace device
|
|
|