Merge "Add macros for treble and non-treble only policy"
diff --git a/Android.mk b/Android.mk
index 7bfe1a7..fb2a602 100644
--- a/Android.mk
+++ b/Android.mk
@@ -138,6 +138,7 @@
 	$(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \
 		-D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
 		-D target_build_variant=$(TARGET_BUILD_VARIANT) \
+		-D target_build_treble=$(ENABLE_TREBLE) \
 		-s $^ > $@
 	$(hide) sed '/dontaudit/d' $@ > $@.dontaudit
 
@@ -154,6 +155,7 @@
 	$(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \
 		-D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
 		-D target_build_variant=$(TARGET_BUILD_VARIANT) \
+		-D target_build_treble=$(ENABLE_TREBLE) \
 		-D target_arch=$(LOCAL_TARGET_ARCH) \
 		-s $^ > $@
 	$(hide) sed '/dontaudit/d' $@ > $@.dontaudit
@@ -194,6 +196,7 @@
 	$(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \
 		-D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
 		-D target_build_variant=$(TARGET_BUILD_VARIANT) \
+		-D target_build_treble=$(ENABLE_TREBLE) \
 		-D target_recovery=true \
 		-s $^ > $@
 
@@ -229,6 +232,7 @@
 	mkdir -p $(dir $@)
 	$(hide) m4 -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
 		-D target_build_variant=user \
+		-D target_build_treble=$(ENABLE_TREBLE) \
 		-s $^ > $@
 	$(hide) sed '/dontaudit/d' $@ > $@.dontaudit
 
diff --git a/public/te_macros b/public/te_macros
index f22e009..1c4bb4b 100644
--- a/public/te_macros
+++ b/public/te_macros
@@ -282,6 +282,13 @@
 define(`eng', ifelse(target_build_variant, `eng', $1))
 
 #####################################
+# Treble or non-Treble builds
+# SELinux rules which only apply to Treble or non-Treble builds
+#
+define(`treble_only', ifelse(target_build_treble, `true', $1))
+define(`non_treble_only', ifelse(target_build_treble, `', $1))
+
+#####################################
 # write_logd(domain)
 # Ability to write to android log
 # daemon via sockets