From c9b88c9ffeca0669e0e413ec153f80be3881d54f Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Thu, 6 Feb 2025 17:58:26 -0800 Subject: Remove configurable values from providers Providers are data exported from one module to another. Configurable properties are the collection of all possible values of a property, to be resolved under the module's configuration. If you export a configurable from one module to another and then resolve it there, it will be evaluated with the wrong configuration. Bug: 394967253 Test: m nothing Change-Id: I934b08538bcc3267b3ec44925591f16a1c59292c --- java/java.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 900f0e32f..c204476b1 100644 --- a/java/java.go +++ b/java/java.go @@ -373,7 +373,7 @@ type JavaInfo struct { ProvidesUsesLibInfo *ProvidesUsesLibInfo - ModuleWithUsesLibraryInfo *ModuleWithUsesLibraryInfo + MissingOptionalUsesLibs []string ModuleWithSdkDepInfo *ModuleWithSdkDepInfo @@ -3679,11 +3679,11 @@ func addMissingOptionalUsesLibsFromDep(ctx android.ModuleContext, depModule andr usesLibrary *usesLibrary) { dep, ok := android.OtherModuleProvider(ctx, depModule, JavaInfoProvider) - if !ok || dep.ModuleWithUsesLibraryInfo == nil { + if !ok { return } - for _, lib := range dep.ModuleWithUsesLibraryInfo.UsesLibrary.usesLibraryProperties.Missing_optional_uses_libs { + for _, lib := range dep.MissingOptionalUsesLibs { if !android.InList(lib, usesLibrary.usesLibraryProperties.Missing_optional_uses_libs) { usesLibrary.usesLibraryProperties.Missing_optional_uses_libs = append(usesLibrary.usesLibraryProperties.Missing_optional_uses_libs, lib) @@ -3771,9 +3771,7 @@ func setExtraJavaInfo(ctx android.ModuleContext, module android.Module, javaInfo } if mwul, ok := module.(ModuleWithUsesLibrary); ok { - javaInfo.ModuleWithUsesLibraryInfo = &ModuleWithUsesLibraryInfo{ - UsesLibrary: mwul.UsesLibrary(), - } + javaInfo.MissingOptionalUsesLibs = mwul.UsesLibrary().usesLibraryProperties.Missing_optional_uses_libs } if mwsd, ok := module.(moduleWithSdkDep); ok { -- cgit v1.2.3-59-g8ed1b