Merge "Remove HAVE_SELINUX guards"
diff --git a/vm/ReconfigureDvm.mk b/vm/ReconfigureDvm.mk
index 34eb0a4..6e161c9 100644
--- a/vm/ReconfigureDvm.mk
+++ b/vm/ReconfigureDvm.mk
@@ -21,13 +21,14 @@
include $(LOCAL_PATH)/Dvm.mk
-LOCAL_SHARED_LIBRARIES += liblog libcutils libnativehelper libz libdl libcorkscrew
-
-ifeq ($(HAVE_SELINUX),true)
-LOCAL_C_INCLUDES += external/libselinux/include
-LOCAL_SHARED_LIBRARIES += libselinux
-LOCAL_CFLAGS += -DHAVE_SELINUX
-endif # HAVE_SELINUX
+LOCAL_SHARED_LIBRARIES += \
+ libcorkscrew \
+ libcutils \
+ libdl \
+ liblog \
+ libnativehelper \
+ libselinux \
+ libz
LOCAL_STATIC_LIBRARIES += libdex
diff --git a/vm/native/dalvik_system_Zygote.cpp b/vm/native/dalvik_system_Zygote.cpp
index 28d8d2d..00ffaf2 100644
--- a/vm/native/dalvik_system_Zygote.cpp
+++ b/vm/native/dalvik_system_Zygote.cpp
@@ -20,9 +20,7 @@
#include "Dalvik.h"
#include "native/InternalNativePriv.h"
-#ifdef HAVE_SELINUX
#include <selinux/android.h>
-#endif
#include <signal.h>
#include <sys/types.h>
@@ -361,7 +359,6 @@
return 0;
}
-#ifdef HAVE_SELINUX
/*
* Set SELinux security context.
*
@@ -376,7 +373,6 @@
return 0;
#endif
}
-#endif
/*
* Utility routine to fork zygote and specialize the child process.
@@ -391,10 +387,8 @@
u4 debugFlags = args[3];
ArrayObject *rlimits = (ArrayObject *)args[4];
int64_t permittedCapabilities, effectiveCapabilities;
-#ifdef HAVE_SELINUX
char *seInfo = NULL;
char *niceName = NULL;
-#endif
if (isSystemServer) {
/*
@@ -408,7 +402,6 @@
effectiveCapabilities = args[7] | (int64_t) args[8] << 32;
} else {
permittedCapabilities = effectiveCapabilities = 0;
-#ifdef HAVE_SELINUX
StringObject* seInfoObj = (StringObject*)args[5];
if (seInfoObj) {
seInfo = dvmCreateCstrFromString(seInfoObj);
@@ -425,7 +418,6 @@
dvmAbort();
}
}
-#endif
}
if (!gDvm.zygote) {
@@ -510,7 +502,6 @@
dvmAbort();
}
-#ifdef HAVE_SELINUX
err = setSELinuxContext(uid, isSystemServer, seInfo, niceName);
if (err < 0) {
ALOGE("cannot set SELinux context: %s\n", strerror(errno));
@@ -521,7 +512,6 @@
// lock when we forked.
free(seInfo);
free(niceName);
-#endif
/*
* Our system thread ID has changed. Get the new one.
@@ -540,10 +530,8 @@
}
} else if (pid > 0) {
/* the parent process */
-#ifdef HAVE_SELINUX
free(seInfo);
free(niceName);
-#endif
}
return pid;