Add TARGET_FLATTEN_APEX

TARGET_FLATTEN_APEX, when set to true, flattens APEXes that are on
/system. Flattening an APEX means files in it are not packaged as a mini
file system image, but exist in the /system partition as individual
files. This option is for devices where kernel does not support loopback
devices or the maximum number of loopback devices is too small (though
the threshold is TBD as of now).

Bug: 118485880
Test: TARGET_FLATTEN_APEX=true m apex.test; tree
out/target/product/.../system/apex/apex.test shows list of files in it.

Test; m apex.test, then a file out/target/product/.../system/apex/apex
.test.apex exists.

Change-Id: Ie13cb062c1387d55689692ba2b123e606ada8aa4
diff --git a/core/soong_config.mk b/core/soong_config.mk
index 6470d22..4328453 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -136,6 +136,8 @@
 $(call add_json_list, BoardPlatPublicSepolicyDirs,       $(BOARD_PLAT_PUBLIC_SEPOLICY_DIR))
 $(call add_json_list, BoardPlatPrivateSepolicyDirs,      $(BOARD_PLAT_PRIVATE_SEPOLICY_DIR))
 
+$(call add_json_bool, FlattenApex,                       $(filter true,$(TARGET_FLATTEN_APEX)))
+
 $(call add_json_map, VendorVars)
 $(foreach namespace,$(SOONG_CONFIG_NAMESPACES),\
   $(call add_json_map, $(namespace))\