Commit c71286bf authored by ortuno's avatar ortuno Committed by Commit bot

bluetooth: Use BuildInfo to retrieve the Android version

__ANDROID_API__ is the minimum API supported by the NDK we are compiling
against, not the API level of the device we are running on. Because we
support 16+ we were always returning false.

BUG=714623

Review-Url: https://codereview.chromium.org/2841943003
Cr-Commit-Position: refs/heads/master@{#467319}
parent b8d34ab3
......@@ -19,6 +19,9 @@
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#endif
#if defined(ANDROID)
#include "base/android/build_info.h"
#endif
namespace device {
......@@ -77,8 +80,9 @@ bool BluetoothAdapterFactory::IsLowEnergySupported() {
if (default_adapter.Get())
return true;
#if defined(OS_ANDROID) && __ANDROID_API__ >= 23
return true;
#if defined(OS_ANDROID)
return base::android::BuildInfo::GetInstance()->sdk_int() >=
base::android::SDK_VERSION_MARSHMALLOW;
#elif defined(OS_WIN)
// Windows 8 supports Low Energy GATT operations but it does not support
// scanning, initiating connections and GATT Server. To keep the API
......
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