From 4d24a77551d30369542ac15e48e02f3ae582d0e6 Mon Sep 17 00:00:00 2001
From: Dan Cashman <dcashman@google.com>
Date: Wed, 12 Apr 2017 14:28:34 -0700
Subject: [PATCH] Fix build part 2.  Always create platform_mapping_file.

commit 552fb537129e9b446e79af53216c08d15e69144e fixed an undefined
module error by removing the module when not defined (on non-treble
devices), but the sepolicy build on non-treble devices was changed
to rely on the split treble files, even though the split is not used.
Change this so that the file is always present, to allow policy
compilation.

Test: policy fully builds.
Change-Id: Ia0934c739336cea54228bbff8d6644aa3ae501e5
---
 Android.mk | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/Android.mk b/Android.mk
index 0cd642caf..7c75f9d62 100644
--- a/Android.mk
+++ b/Android.mk
@@ -95,6 +95,9 @@ $(warning BOARD_SEPOLICY_VERS not specified, assuming current platform version)
 BOARD_SEPOLICY_VERS := $(PLATFORM_SEPOLICY_VERSION)
 endif
 
+
+platform_mapping_file := $(BOARD_SEPOLICY_VERS).cil
+
 ###########################################################
 # Compute policy files to be used in policy build.
 # $(1): files to include
@@ -166,8 +169,6 @@ LOCAL_MODULE_TAGS := optional
 # inside init/init.cpp for loading SELinux policy from files.
 ifeq ($(PRODUCT_FULL_TREBLE),true)
 
-platform_mapping_file := $(BOARD_SEPOLICY_VERS).cil
-
 # Use split SELinux policy
 LOCAL_REQUIRED_MODULES += \
     $(platform_mapping_file) \
@@ -343,7 +344,6 @@ $(LOCAL_BUILT_MODULE) :
 	echo $(PRIVATE_PLAT_SEPOL_VERS) > $@
 
 #################################
-ifeq ($(PRODUCT_FULL_TREBLE),true)
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := $(platform_mapping_file)
@@ -377,7 +377,6 @@ $(LOCAL_BUILT_MODULE): $(mapping_policy_nvr)
 built_mapping_cil := $(LOCAL_BUILT_MODULE)
 current_mapping.cil :=
 
-endif # ifeq ($(PRODUCT_FULL_TREBLE),true)
 #################################
 include $(CLEAR_VARS)
 
-- 
GitLab