Disable $OUT/symbols/apex/com.android.art symlink

Disable the $OUT/symbols/apex/com.android.art symlink is because the
$OUT/symbols/apex/com.android.art name is taken by the
com.android.art apex even when com.android.art.debug is selected by
TARGET_ART_APEX.
Disabling the symlink means that symbols for the com.android.art.debug
apex will not be found.

Cherry-picked from http://ag/12896257.

Fixes: 171406631
Bug: 171419613
Test: manual
Change-Id: I1c297cd44ebb345af7707630529b4777393a6782
Merged-In: I1c297cd44ebb345af7707630529b4777393a6782
diff --git a/Android.mk b/Android.mk
index a5c6804..6f5db23 100644
--- a/Android.mk
+++ b/Android.mk
@@ -349,6 +349,11 @@
 # of the symlink is triggered by the apex_manifest.pb file which is the file
 # that is guaranteed to be created regardless of the value of
 # TARGET_FLATTEN_APEX.
+# TODO(b/171419613): the symlink is disabled because the
+# $OUT/symbols/apex/com.android.art name is taken by the com.android.art apex
+# even when com.android.art.debug is selected by TARGET_ART_APEX.
+# Disabling the symlink means that symbols for the com.android.art.debug apex
+# will not be found.
 ifeq ($(TARGET_FLATTEN_APEX),true)
 art_apex_manifest_file := $(PRODUCT_OUT)/system/apex/$(TARGET_ART_APEX)/apex_manifest.pb
 else
@@ -359,13 +364,13 @@
 $(art_apex_manifest_file): $(art_apex_symlink_timestamp)
 $(art_apex_manifest_file): PRIVATE_LINK_NAME := $(TARGET_OUT_UNSTRIPPED)/apex/com.android.art
 $(art_apex_symlink_timestamp):
-ifeq ($(TARGET_ART_APEX),com.android.art)
-	$(hide) if [ -L $(PRIVATE_LINK_NAME) ]; then rm -f $(PRIVATE_LINK_NAME); fi
-else
-	$(hide) mkdir -p $(dir $(PRIVATE_LINK_NAME))
-	$(hide) rm -rf $(PRIVATE_LINK_NAME)
-	$(hide) ln -sf $(TARGET_ART_APEX) $(PRIVATE_LINK_NAME)
-endif
+#ifeq ($(TARGET_ART_APEX),com.android.art)
+#	$(hide) if [ -L $(PRIVATE_LINK_NAME) ]; then rm -f $(PRIVATE_LINK_NAME); fi
+#else
+#	$(hide) mkdir -p $(dir $(PRIVATE_LINK_NAME))
+#	$(hide) rm -rf $(PRIVATE_LINK_NAME)
+#	$(hide) ln -sf $(TARGET_ART_APEX) $(PRIVATE_LINK_NAME)
+#endif
 	$(hide) touch $@
 $(art_apex_symlink_timestamp): .KATI_SYMLINK_OUTPUTS := $(PRIVATE_LINK_NAME)
 
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 04b2662..2e6bf1e 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -108,6 +108,9 @@
 # Remove 'libart[d]?-simulator-container.so' which was briefly in the ART AREX.
 $(call add-clean-step, find $(OUT_DIR)/soong/.intermediates/art -name 'libart*-simulator-container.so' -type f | xargs rm -f)
 
+# Remove symbols/apex/com.android.art symlink (b/171406631)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/symbols/apex/com.android.art)
+
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
 # ************************************************