diff --git a/src/tools/android/java/com/google/devtools/build/android/r8/Desugar.java b/src/tools/android/java/com/google/devtools/build/android/r8/Desugar.java index 0e66cf96bb005f..726b109783221d 100644 --- a/src/tools/android/java/com/google/devtools/build/android/r8/Desugar.java +++ b/src/tools/android/java/com/google/devtools/build/android/r8/Desugar.java @@ -25,7 +25,9 @@ import com.android.tools.r8.D8Command; import com.android.tools.r8.Diagnostic; import com.android.tools.r8.DiagnosticsHandler; +import com.android.tools.r8.DiagnosticsLevel; import com.android.tools.r8.StringResource; +import com.android.tools.r8.errors.DesugaredLibraryMismatchDiagnostic; import com.android.tools.r8.errors.InterfaceDesugarMissingTypeDiagnostic; import com.google.common.collect.ImmutableList; import com.google.devtools.build.android.Converters.ExistingPathConverter; @@ -424,6 +426,14 @@ public void warning(Diagnostic warning) { } DiagnosticsHandler.super.warning(warning); } + + @Override + public DiagnosticsLevel modifyDiagnosticsLevel(DiagnosticsLevel level, Diagnostic diagnostic) { + if (diagnostic instanceof DesugaredLibraryMismatchDiagnostic) { + return DiagnosticsLevel.WARNING; + } + return level; + } } private void desugar(