From 75ce9eccf3651991ccd2897bba03b8a9bba9b733 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 26 Feb 2021 16:20:32 -0800 Subject: Remove global state from sysprop libraries Sysprop libraries use a global list to rewrite dependencies from implementation libraries to public stub libraries when appropriate. Remove the global list, and instead add a dependency from the implementation to the public stub that forwards the JavaInfo. Bug: 181367697 Test: sysprop_test.go Change-Id: Ia7995feb3c079ca9bb6a403daaae3e3329fd7f6a --- java/sdk_library_external.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'java/sdk_library_external.go') diff --git a/java/sdk_library_external.go b/java/sdk_library_external.go index 293493685..0acaa13b2 100644 --- a/java/sdk_library_external.go +++ b/java/sdk_library_external.go @@ -75,10 +75,15 @@ func (j *Module) allowListedInterPartitionJavaLibrary(ctx android.EarlyModuleCon return inList(j.Name(), ctx.Config().InterPartitionJavaLibraryAllowList()) } +func (j *Module) syspropWithPublicStubs() bool { + return j.deviceProperties.SyspropPublicStub != "" +} + type javaSdkLibraryEnforceContext interface { Name() string allowListedInterPartitionJavaLibrary(ctx android.EarlyModuleContext) bool partitionGroup(ctx android.EarlyModuleContext) partitionGroup + syspropWithPublicStubs() bool } var _ javaSdkLibraryEnforceContext = (*Module)(nil) @@ -88,6 +93,10 @@ func (j *Module) checkPartitionsForJavaDependency(ctx android.EarlyModuleContext return } + if dep.syspropWithPublicStubs() { + return + } + // If product interface is not enforced, skip check between system and product partition. // But still need to check between product and vendor partition because product interface flag // just represents enforcement between product and system, and vendor interface enforcement -- cgit v1.2.3-59-g8ed1b