Android uses functions and defines from sys/capability.h which
requires additional include. However file capability.h shows up
in bionic in version Android 4.3, therefore we do check
PLATFORM_SDK_VERSION to no break builds of previous Android versions.
In previous Android version unistd.h contain this functionality.
$(LOCAL_PATH)/../src \
$(LOCAL_PATH)/../lib \
-LOCAL_CFLAGS := -DVERSION=\"$(BLUEZ_VERSION)\"
+LOCAL_CFLAGS := -DVERSION=\"$(BLUEZ_VERSION)\" \
+ -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
LOCAL_SHARED_LIBRARIES := \
libglib \
#include "hal-msg.h"
#include "ipc.h"
+/* TODO: Consider to remove PLATFORM_SDKVERSION check if requirement
+* for minimal Android platform version increases. */
+#if defined(ANDROID) && PLATFORM_SDK_VERSION >= 18
+#include <sys/capability.h>
+#endif
+
static GMainLoop *event_loop;
static struct mgmt *mgmt_if = NULL;