Add an allowlist for modules that have broken optional_uses_libs.

Bug: 282877248
Test: m nothing
Change-Id: I6f0e76a6f147de1e6043b5abc4630342d46bafcc
diff --git a/core/config.mk b/core/config.mk
index 5457fd2..1285628 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -1267,6 +1267,9 @@
 
 .KATI_READONLY := JAVAC_NINJA_POOL R8_NINJA_POOL D8_NINJA_POOL
 
+# Soong modules that are known to have broken optional_uses_libs dependencies.
+BUILD_WARNING_BAD_OPTIONAL_USES_LIBS_ALLOWLIST := LegacyCamera Gallery2
+
 # These goals don't need to collect and include Android.mks/CleanSpec.mks
 # in the source tree.
 dont_bother_goals := out product-graph