summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2010-01-21 15:53:32 -0800
committerSan Mehat <san@google.com>2010-01-21 15:53:32 -0800
commit0399710d9a7ee575104e7d76dc988afb7829ccb9 (patch)
tree68454d9bb56c84236bf433d3d2321e9a0359df60
parent1bdac9e98c1ef37ba568b6cf23bfbc09cfe6bf15 (diff)
downloadnetd-0399710d9a7ee575104e7d76dc988afb7829ccb9.tar.gz
netd: Don't break build if BT is not available for the target
Signed-off-by: San Mehat <san@google.com>
-rw-r--r--Android.mk6
-rw-r--r--PanController.cpp8
2 files changed, 13 insertions, 1 deletions
diff --git a/Android.mk b/Android.mk
index 4b9b6c9d..d62d1d06 100644
--- a/Android.mk
+++ b/Android.mk
@@ -28,8 +28,12 @@ LOCAL_C_INCLUDES := $(KERNEL_HEADERS) -I../../frameworks/base/include/ \
$(LOCAL_PATH)/../bluetooth/bluez-clean-headers
LOCAL_CFLAGS :=
+LOCAL_SHARED_LIBRARIES := libsysutils libcutils
-LOCAL_SHARED_LIBRARIES := libsysutils libcutils libbluedroid
+ifeq ($(BOARD_HdAVE_BLUETOOTH),true)
+ LOCAL_SHARED_LIBRARIES := $(LOCAL_SHARED_LIBRARIES) libbluedroid
+ LOCAL_CFLAGS := $(LOCAL_CFLAGS) -DHAVE_BLUETOOTH
+endif
include $(BUILD_EXECUTABLE)
diff --git a/PanController.cpp b/PanController.cpp
index f4ae8ee9..e613874f 100644
--- a/PanController.cpp
+++ b/PanController.cpp
@@ -33,7 +33,9 @@
#include "PanController.h"
+#ifdef HAVE_BLUETOOTH
extern "C" int bt_is_enabled();
+#endif
PanController::PanController() {
mPid = 0;
@@ -45,11 +47,17 @@ PanController::~PanController() {
int PanController::startPan() {
pid_t pid;
+#ifdef HAVE_BLUETOOTH
if (!bt_is_enabled()) {
LOGE("Cannot start PAN services - Bluetooth not running");
errno = ENODEV;
return -1;
}
+#else
+ LOGE("Cannot start PAN services - No Bluetooth support");
+ errno = ENODEV;
+ return -1;
+#endif
if (mPid) {
LOGE("PAN already started");