Chromium Code Reviews| Index: device/bluetooth/bluetooth_adapter_factory.cc |
| diff --git a/device/bluetooth/bluetooth_adapter_factory.cc b/device/bluetooth/bluetooth_adapter_factory.cc |
| index ed64ecd2ee670bd91ed4328924455edf5de60f8b..c981200f304d6cbc43c00a1077a7ad5c44a85599 100644 |
| --- a/device/bluetooth/bluetooth_adapter_factory.cc |
| +++ b/device/bluetooth/bluetooth_adapter_factory.cc |
| @@ -16,6 +16,9 @@ |
| #if defined(OS_MACOSX) |
| #include "base/mac/mac_util.h" |
| #endif |
| +#if defined(OS_WIN) |
| +#include "base/win/windows_version.h" |
| +#endif |
| namespace device { |
| @@ -54,7 +57,7 @@ void RunAdapterCallbacks() { |
| } // namespace |
| // static |
| -bool BluetoothAdapterFactory::IsBluetoothAdapterAvailable() { |
| +bool BluetoothAdapterFactory::IsBluetoothSupported() { |
| // SetAdapterForTesting() may be used to provide a test or mock adapter |
| // instance even on platforms that would otherwise not support it. |
| if (default_adapter.Get()) |
| @@ -68,27 +71,28 @@ bool BluetoothAdapterFactory::IsBluetoothAdapterAvailable() { |
| } |
| // static |
| -bool BluetoothAdapterFactory::IsLowEnergyAvailable() { |
| - DCHECK(IsBluetoothAdapterAvailable()); |
| - |
| +bool BluetoothAdapterFactory::IsLowEnergySupported() { |
| // SetAdapterForTesting() may be used to provide a test or mock adapter |
| // instance even on platforms that would otherwise not support it. |
| if (default_adapter.Get()) |
| return true; |
| -#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN) || \ |
| - defined(OS_LINUX) |
| + |
| +#if defined(OS_ANDROID) && __ANDROID_API__ >= 23 |
| return true; |
| +#elif defined(OS_WIN) |
| + return base::win::GetVersion() >= base::win::VERSION_WIN8; |
|
scheib
2017/04/13 05:06:25
Will we get in trouble with 8 level being supporte
ortuno
2017/04/18 01:25:42
And scanning! I kept the support at 8 to reflect o
scheib
2017/04/18 03:38:41
/shrug/ I would go with 10 now. But, your call.
ortuno
2017/04/18 07:05:34
Increased to win 10 and added a note as to why we
|
| #elif defined(OS_MACOSX) |
| return base::mac::IsAtLeastOS10_10(); |
| +#elif defined(OS_LINUX) || defined(OS_CHROMEOS) |
| + return true; |
| #else |
| return false; |
| -#endif // defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN) || |
| - // defined(OS_LINUX) |
| +#endif |
| } |
| // static |
| void BluetoothAdapterFactory::GetAdapter(const AdapterCallback& callback) { |
| - DCHECK(IsBluetoothAdapterAvailable()); |
| + DCHECK(IsBluetoothSupported()); |
| #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) |
| if (!default_adapter.Get()) { |