Snap for 4545621 from 1bec39551a09bc6ada9477d1f79a72463df75719 to pi-release

Change-Id: Id0d4e21dd0ab651639747befd6931b7e66df5c07
diff --git a/libselinux/src/android/android_platform.c b/libselinux/src/android/android_platform.c
index 2dfbc93..539f317 100644
--- a/libselinux/src/android/android_platform.c
+++ b/libselinux/src/android/android_platform.c
@@ -149,11 +149,6 @@
     return sehandle;
 }
 
-static bool selinux_android_opts_file_exists(const struct selinux_opt *opt)
-{
-    return (access(opt[0].value, R_OK) != -1);
-}
-
 struct selabel_handle* selinux_android_file_context_handle(void)
 {
     struct selinux_opt seopts_file[MAX_FILE_CONTEXT_SIZE];
@@ -449,7 +444,7 @@
 	struct seapp_context *cur;
 	char *p, *name = NULL, *value = NULL, *saveptr;
 	size_t i, len, files_len = 0;
-	int n, ret;
+	int ret;
 	const char* seapp_contexts_files[MAX_FILE_CONTEXT_SIZE];
 	for (i = 0; i < ARRAY_SIZE(seapp_contexts_plat); i++) {
 		if (access(seapp_contexts_plat[i], R_OK) != -1) {
@@ -854,7 +849,6 @@
 	const char *username = NULL;
 	struct seapp_context *cur = NULL;
 	int i;
-	size_t n;
 	uid_t userid;
 	uid_t appid;
 	bool isPrivApp = false;
diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c
index b3b36bc..3a9fb3b 100644
--- a/libselinux/src/label_file.c
+++ b/libselinux/src/label_file.c
@@ -598,6 +598,7 @@
 	return NULL;
 }
 
+#if !defined(BUILD_HOST) && !defined(ANDROID)
 static int selabel_subs_init(const char *path, struct selabel_digest *digest,
 		       struct selabel_sub **out_subs)
 {
@@ -681,6 +682,7 @@
 	}
 	goto out;
 }
+#endif
 
 static char *selabel_sub_key(struct saved_data *data, const char *key)
 {