diff options
author | San Mehat <san@google.com> | 2010-01-21 15:53:32 -0800 |
---|---|---|
committer | San Mehat <san@google.com> | 2010-01-21 15:53:32 -0800 |
commit | 0399710d9a7ee575104e7d76dc988afb7829ccb9 (patch) | |
tree | 68454d9bb56c84236bf433d3d2321e9a0359df60 | |
parent | 1bdac9e98c1ef37ba568b6cf23bfbc09cfe6bf15 (diff) | |
download | netd-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.mk | 6 | ||||
-rw-r--r-- | PanController.cpp | 8 |
2 files changed, 13 insertions, 1 deletions
@@ -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"); |