Add $(PRODUCT_OUT)/apex to the artifact path whitelist

$(PRODUCT_OUT)/apex is where shared libraries in APEXes get installed
into. The path can be considered as a fake path as the shared libraries
are installed there just to have symbol files for them under
$(PRODUCT_OUT)/symbols/apex for debugging purpose. Shared libraries in
APEXes are made available to the path at runtime by mounting APEXes via
apexd. The files under $(PRODUCT_OUT)/apex are never compiled into a
file system image (e.g. system.img)

Bug: 120846816
Test: build/soong/build_test.bash -dist -products mainline_system_arm64
Change-Id: I3727091214f08f945559fa5f0f1450e74c1a5c9b
diff --git a/core/main.mk b/core/main.mk
index 282821c..0a99e7c 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -1089,6 +1089,12 @@
   static_whitelist_patterns := $(TARGET_OUT_FAKE)/% $(HOST_OUT)/%
   # RROs become REQUIRED by the source module, but are always placed on the vendor partition.
   static_whitelist_patterns += %__auto_generated_rro.apk
+  # $(PRODUCT_OUT)/apex is where shared libraries in APEXes get installed.
+  # The path can be considered as a fake path, as the shared libraries
+  # are installed there just to have symbols files for them under
+  # $(PRODUCT_OUT)/symbols/apex for debugging purpose. The /apex directory
+  # is never compiled into a filesystem image.
+  static_whitelist_patterns += $(PRODUCT_OUT)/apex/%
   ifeq (true,$(BOARD_USES_SYSTEM_OTHER_ODEX))
     # Allow system_other odex space optimization.
     static_whitelist_patterns += \