diff --git a/android/neverallow.go b/android/neverallow.go index 41105e6b4..24031ba39 100644 --- a/android/neverallow.go +++ b/android/neverallow.go @@ -258,10 +258,10 @@ func createProhibitFrameworkAccessRules() []Rule { func createJavaExcludeStaticLibsRule() Rule { return NeverAllow(). - NotIn("build/soong"). + NotIn("build/soong", "libcore", "frameworks/base/api"). ModuleType("java_library"). WithMatcher("exclude_static_libs", isSetMatcherInstance). - Because("exclude_static_libs property is only allowed for java modules defined in build/soong") + Because("exclude_static_libs property is only allowed for java modules defined in build/soong, libcore, and frameworks/base/api") } func neverallowMutator(ctx BottomUpMutatorContext) { diff --git a/android/neverallow_test.go b/android/neverallow_test.go index 1639bbf40..2a938b811 100644 --- a/android/neverallow_test.go +++ b/android/neverallow_test.go @@ -358,7 +358,7 @@ var neverallowTests = []struct { `), }, expectedErrors: []string{ - `exclude_static_libs property is only allowed for java modules defined in build/soong`, + `exclude_static_libs property is only allowed for java modules defined in build/soong, libcore, and frameworks/base/api`, }, }, }