Fix some issues with LOCAL_USES_LIBRARIES
Properly check the value of PRIVATE_ENFORCE_USES_LIBRARIES instead of
only checking that the variable is non-empty.
Change the logic to use product libraries instead of the common ones.
This is required so that dex2oat can find the oat files when stripping
is enabled.
Bug: 70934104
Bug: 67345922
Test: manual
Change-Id: Iee71c2b26f3c0e136a8971ab913725b2b6e100b8
diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk
index 45ec6ee..5495f62 100644
--- a/core/dex_preopt_libart.mk
+++ b/core/dex_preopt_libart.mk
@@ -175,7 +175,7 @@
stored_class_loader_context_arg="" && \
uses_library_names="$(PRIVATE_USES_LIBRARY_NAMES)" && \
optional_uses_library_names="$(PRIVATE_OPTIONAL_USES_LIBRARY_NAMES)" && \
-$(if $(PRIVATE_ENFORCE_USES_LIBRARIES), \
+$(if $(filter true,$(PRIVATE_ENFORCE_USES_LIBRARIES)), \
source build/make/core/verify_uses_libraries.sh "$(1)" && \
source build/make/core/construct_context.sh "$(PRIVATE_CONDITIONAL_USES_LIBRARIES_HOST)" "$(PRIVATE_CONDITIONAL_USES_LIBRARIES_TARGET)" && \
,) \