aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2016-01-19 17:59:14 -0800
committerAlex Deymo <deymo@google.com>2016-01-19 17:59:14 -0800
commit77edc5357e1ff2c507a07d4c97f943910609ee44 (patch)
treed7333405c45a0a0faf3a4de5be107202e7407b14
parentd671746a66d87edf9598cfbe077b3430e50a09d3 (diff)
downloadplatform_external_libbrillo-77edc5357e1ff2c507a07d4c97f943910609ee44.tar.gz
platform_external_libbrillo-77edc5357e1ff2c507a07d4c97f943910609ee44.tar.bz2
platform_external_libbrillo-77edc5357e1ff2c507a07d4c97f943910609ee44.zip
Disable binder detection for the host.
When building for the host, disable the binder file descriptor detection workaround since we don't use binder on the host and the required modules are not always available. Bug: None TEST=`mmma external/libbrillo` on linux and mac. Change-Id: I36e2786ff036bc3cd01780ae50c242baf407a0a8
-rw-r--r--Android.mk4
-rw-r--r--brillo/message_loops/base_message_loop.cc9
2 files changed, 11 insertions, 2 deletions
diff --git a/Android.mk b/Android.mk
index 89cbc73..d25d3fb 100644
--- a/Android.mk
+++ b/Android.mk
@@ -300,7 +300,9 @@ LOCAL_C_INCLUDES := $(libbrillo_includes)
LOCAL_SHARED_LIBRARIES := $(libbrillo_shared_libraries)
LOCAL_STATIC_LIBRARIES := libmodpb64-host
LOCAL_CFLAGS := $(libbrillo_CFLAGS)
-LOCAL_CPPFLAGS := $(libbrillo_CPPFLAGS)
+LOCAL_CPPFLAGS := \
+ -D__ANDROID_HOST__ \
+ $(libbrillo_CPPFLAGS)
LOCAL_CLANG := true
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
include $(BUILD_HOST_SHARED_LIBRARY)
diff --git a/brillo/message_loops/base_message_loop.cc b/brillo/message_loops/base_message_loop.cc
index 49dba40..1886569 100644
--- a/brillo/message_loops/base_message_loop.cc
+++ b/brillo/message_loops/base_message_loop.cc
@@ -5,11 +5,16 @@
#include <brillo/message_loops/base_message_loop.h>
#include <fcntl.h>
-#include <linux/major.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#ifndef __ANDROID_HOST__
+// Used for MISC_MAJOR. Only required for the target and not always available
+// for the host.
+#include <linux/major.h>
+#endif
+
#include <vector>
#include <base/bind.h>
@@ -128,6 +133,7 @@ MessageLoop::TaskId BaseMessageLoop::WatchFileDescriptor(
return MessageLoop::kTaskIdNull;
}
+#ifndef __ANDROID_HOST__
// Determine if the passed fd is the binder file descriptor. For that, we need
// to check that is a special char device and that the major and minor device
// numbers match. The binder file descriptor can't be removed and added back
@@ -143,6 +149,7 @@ MessageLoop::TaskId BaseMessageLoop::WatchFileDescriptor(
minor(buf.st_rdev) == GetBinderMinor()) {
it_bool.first->second.RunImmediately();
}
+#endif
return task_id;
}