aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2016-01-20 02:31:39 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-01-20 02:31:39 +0000
commitac45dcc6ab3e2f7d1e522b3e997363515ca41e20 (patch)
treed7333405c45a0a0faf3a4de5be107202e7407b14
parent96b56e5786f8f026c6294d06570d8d4d153021d6 (diff)
parent77edc5357e1ff2c507a07d4c97f943910609ee44 (diff)
downloadplatform_external_libbrillo-ac45dcc6ab3e2f7d1e522b3e997363515ca41e20.tar.gz
platform_external_libbrillo-ac45dcc6ab3e2f7d1e522b3e997363515ca41e20.tar.bz2
platform_external_libbrillo-ac45dcc6ab3e2f7d1e522b3e997363515ca41e20.zip
Disable binder detection for the host.
am: 77edc5357e * commit '77edc5357e1ff2c507a07d4c97f943910609ee44': Disable binder detection for the host.
-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;
}