summaryrefslogtreecommitdiff
path: root/java/hiddenapi.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2024-07-18 15:36:32 -0700
committer Colin Cross <ccross@android.com> 2024-08-07 14:11:43 -0700
commit7727c7f0960886b4302d60256576b2daac56354f (patch)
treef38f9f93ea915bbeeae38ba883512b5fc06c29d5 /java/hiddenapi.go
parentd40aac13401a7826c31f50598bd1703ef3c75e67 (diff)
Convert JavaInfoProvider to *JavaInfo
Convert JavaInfoProvider to return a *JavaInfo instead of a JavaInfo. This will reduce copying when reading the provider, and also allows JavaInfo to recursively contain a depset of JavaInfos from dependencies. Bug: 308016794 Test: go test ./java/... Flag: EXEMPT refactor Change-Id: Ibf6d9b797f760ad1fe815d59839839fdfad91733
Diffstat (limited to 'java/hiddenapi.go')
-rw-r--r--java/hiddenapi.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/java/hiddenapi.go b/java/hiddenapi.go
index 689c78f6d..b1a9debe1 100644
--- a/java/hiddenapi.go
+++ b/java/hiddenapi.go
@@ -98,8 +98,9 @@ func (h *hiddenAPI) initHiddenAPI(ctx android.ModuleContext, dexJar OptionalDexJ
// processing.
classesJars := android.Paths{classesJar}
ctx.VisitDirectDepsWithTag(hiddenApiAnnotationsTag, func(dep android.Module) {
- javaInfo, _ := android.OtherModuleProvider(ctx, dep, JavaInfoProvider)
- classesJars = append(classesJars, javaInfo.ImplementationJars...)
+ if javaInfo, ok := android.OtherModuleProvider(ctx, dep, JavaInfoProvider); ok {
+ classesJars = append(classesJars, javaInfo.ImplementationJars...)
+ }
})
h.classesJarPaths = classesJars