diff options
author | 2022-08-19 14:32:57 +0000 | |
---|---|---|
committer | 2022-08-19 14:32:57 +0000 | |
commit | e29d230b752d11abca3bb558a04c6d57eef9104e (patch) | |
tree | 659cda6d1e986420e5dbf51abfe40dc35d9c9858 | |
parent | 3651a5dccb8361b261bc6cebd6d8f991e856416a (diff) | |
parent | b816652ee0175b279c2bb83c7ca4e16df6daa6ff (diff) |
Merge "Allow libcore to have NewApi warnings"
-rw-r--r-- | java/lint.go | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/java/lint.go b/java/lint.go index 67746204e..931820d74 100644 --- a/java/lint.go +++ b/java/lint.go @@ -331,12 +331,18 @@ func (l *linter) lint(ctx android.ModuleContext) { if l.minSdkVersion != l.compileSdkVersion { l.extraMainlineLintErrors = append(l.extraMainlineLintErrors, updatabilityChecks...) - _, filtered := android.FilterList(l.properties.Lint.Warning_checks, updatabilityChecks) - if len(filtered) != 0 { - ctx.PropertyErrorf("lint.warning_checks", - "Can't treat %v checks as warnings if min_sdk_version is different from sdk_version.", filtered) + // Skip lint warning checks for NewApi warnings for libcore where they come from source + // files that reference the API they are adding (b/208656169). + if ctx.ModuleDir() != "libcore" { + _, filtered := android.FilterList(l.properties.Lint.Warning_checks, updatabilityChecks) + + if len(filtered) != 0 { + ctx.PropertyErrorf("lint.warning_checks", + "Can't treat %v checks as warnings if min_sdk_version is different from sdk_version.", filtered) + } } - _, filtered = android.FilterList(l.properties.Lint.Disabled_checks, updatabilityChecks) + + _, filtered := android.FilterList(l.properties.Lint.Disabled_checks, updatabilityChecks) if len(filtered) != 0 { ctx.PropertyErrorf("lint.disabled_checks", "Can't disable %v checks if min_sdk_version is different from sdk_version.", filtered) |