Revert "Promote NewApi to an error again"

This reverts commit c398be808e.

Reason for revert: Broken the build b/273624365

Change-Id: I87bb4ca7c561cfbc6643501f60b4c00a53201908
This commit is contained in:
Yuyang Huang 2023-03-15 02:35:55 +00:00
parent c398be808e
commit 2eb349a79b
2 changed files with 8 additions and 2 deletions

View file

@ -314,7 +314,12 @@ func (l *linter) writeLintProjectXML(ctx android.ModuleContext, rule *android.Ru
cmd.FlagWithInput("@",
android.PathForSource(ctx, "build/soong/java/lint_defaults.txt"))
cmd.FlagForEachArg("--error_check ", l.extraMainlineLintErrors)
if l.compileSdkKind == android.SdkPublic {
cmd.FlagForEachArg("--error_check ", l.extraMainlineLintErrors)
} else {
// TODO(b/268261262): Remove this branch. We're demoting NewApi to a warning due to pre-existing issues that need to be fixed.
cmd.FlagForEachArg("--warning_check ", l.extraMainlineLintErrors)
}
cmd.FlagForEachArg("--disable_check ", l.properties.Lint.Disabled_checks)
cmd.FlagForEachArg("--warning_check ", l.properties.Lint.Warning_checks)
cmd.FlagForEachArg("--error_check ", l.properties.Lint.Error_checks)

View file

@ -113,7 +113,8 @@ func TestJavaLintUsesCorrectBpConfig(t *testing.T) {
t.Error("did not use the correct file for baseline")
}
if !strings.Contains(*sboxProto.Commands[0].Command, "--error_check NewApi") {
if !strings.Contains(*sboxProto.Commands[0].Command, "--warning_check NewApi") {
// TODO(b/268261262): Change this to check for --error_check
t.Error("should check NewApi warnings")
}