Allow for dontwarn suppression on library/program duplications
This will make it easier to make progress towards making this an error in platform
Bug: b/359698938
Change-Id: Id01c88acb46a0686ef79e979d29a439e02ce8df9
diff --git a/src/main/java/com/android/tools/r8/utils/InternalOptions.java b/src/main/java/com/android/tools/r8/utils/InternalOptions.java
index a76e8b3..4e50c82 100644
--- a/src/main/java/com/android/tools/r8/utils/InternalOptions.java
+++ b/src/main/java/com/android/tools/r8/utils/InternalOptions.java
@@ -1186,6 +1186,10 @@
List<DexType> sortedKeys =
ListUtils.sort(warningLibraryProgramDuplicates.keySet(), DexType::compareTo);
for (DexType key : sortedKeys) {
+ // Allow for suppression of the duplicates with -dontwarn
+ if (appViewWithLiveness.getDontWarnConfiguration().matches(key)) {
+ continue;
+ }
// If the type has been pruned from the program then don't issue a diagnostic.
if (DexProgramClass.asProgramClassOrNull(
appViewWithLiveness.appInfo().definitionForWithoutExistenceAssert(key))