diff --git a/libselinux/src/android/android.c b/libselinux/src/android/android.c index 9c3564b7..393052ed 100644 --- a/libselinux/src/android/android.c +++ b/libselinux/src/android/android.c @@ -1,4 +1,14 @@ -#include "android_common.h" +#include +#include +#include +#include + +#include +#include +#include + +#include "android_internal.h" +#include "callbacks.h" #ifdef __ANDROID_VNDK__ #ifndef LOG_EVENT_STRING diff --git a/libselinux/src/android/android_common.h b/libselinux/src/android/android_common.h deleted file mode 100644 index f7a26c79..00000000 --- a/libselinux/src/android/android_common.h +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "policy.h" -#include "callbacks.h" -#include "selinux_internal.h" -#include "label_internal.h" -#include -#include -#include -#include -#include - -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) - -#define FC_DIGEST_SIZE SHA_DIGEST_LENGTH - -// Context files (file_contexts, service_contexts, etc) may be spread over -// multiple partitions: system, apex, system_ext, product, vendor and/or odm. -#define MAX_CONTEXT_PATHS 6 -// The maximum number of alternatives for a file on one partition. -#define MAX_ALT_CONTEXT_PATHS 2 diff --git a/libselinux/src/android/android_internal.h b/libselinux/src/android/android_internal.h index e2d238fb..40097d11 100644 --- a/libselinux/src/android/android_internal.h +++ b/libselinux/src/android/android_internal.h @@ -1,11 +1,18 @@ +#pragma once + #include -#include "android_common.h" +#include #ifdef __cplusplus extern "C" { #endif +// Context files (file_contexts, service_contexts, etc) may be spread over +// multiple partitions: system, apex, system_ext, product, vendor and/or odm. +#define MAX_CONTEXT_PATHS 6 +// The maximum number of alternatives for a file on one partition. +#define MAX_ALT_CONTEXT_PATHS 2 /* Within each set of files, adds the first file that is accessible to `paths`. * Returns the number of accessible files. */ diff --git a/libselinux/src/android/android_platform.c b/libselinux/src/android/android_platform.c index 342b4702..824167d5 100644 --- a/libselinux/src/android/android_platform.c +++ b/libselinux/src/android/android_platform.c @@ -1,11 +1,37 @@ -#include "android_internal.h" +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include #include +#include +#include +#include #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ #include +#include "android_internal.h" +#include "callbacks.h" +#include "label_internal.h" +#include "selinux_internal.h" + /* Locations for the file_contexts files. For each partition, only the first * existing entry will be used (for example, if * /system/etc/selinux/plat_file_contexts exists, /plat_file_contexts will be diff --git a/libselinux/src/android/android_unittest.cpp b/libselinux/src/android/android_unittest.cpp index 035a3115..fc4047fa 100644 --- a/libselinux/src/android/android_unittest.cpp +++ b/libselinux/src/android/android_unittest.cpp @@ -4,6 +4,7 @@ #include #include "android_internal.h" +#include "label_internal.h" using android::base::StringPrintf; using android::base::WriteStringToFile;