summaryrefslogtreecommitdiff
path: root/cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc')
-rw-r--r--cc/cc.go13
-rw-r--r--cc/library.go10
2 files changed, 13 insertions, 10 deletions
diff --git a/cc/cc.go b/cc/cc.go
index 802332426..e51cfcf05 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -3689,13 +3689,18 @@ func (c *Module) IsInstallableToApex() bool {
}
func (c *Module) AvailableFor(what string) bool {
+ return android.CheckAvailableForApex(what, c.ApexAvailableFor())
+}
+
+func (c *Module) ApexAvailableFor() []string {
+ list := c.ApexModuleBase.ApexAvailable()
if linker, ok := c.linker.(interface {
- availableFor(string) bool
+ apexAvailable() []string
}); ok {
- return c.ApexModuleBase.AvailableFor(what) || linker.availableFor(what)
- } else {
- return c.ApexModuleBase.AvailableFor(what)
+ list = append(list, linker.apexAvailable()...)
}
+
+ return android.FirstUniqueStrings(list)
}
func (c *Module) EverInstallable() bool {
diff --git a/cc/library.go b/cc/library.go
index 6485ea364..ebc65efbd 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -723,7 +723,7 @@ type libraryInterface interface {
// Write LOCAL_ADDITIONAL_DEPENDENCIES for ABI diff
androidMkWriteAdditionalDependenciesForSourceAbiDiff(w io.Writer)
- availableFor(string) bool
+ apexAvailable() []string
getAPIListCoverageXMLPath() android.ModuleOutPath
@@ -1959,17 +1959,15 @@ func (library *libraryDecorator) isLatestStubVersion() bool {
return library.MutatedProperties.IsLatestVersion
}
-func (library *libraryDecorator) availableFor(what string) bool {
+func (library *libraryDecorator) apexAvailable() []string {
var list []string
if library.static() {
list = library.StaticProperties.Static.Apex_available
} else if library.shared() {
list = library.SharedProperties.Shared.Apex_available
}
- if len(list) == 0 {
- return false
- }
- return android.CheckAvailableForApex(what, list)
+
+ return list
}
func (library *libraryDecorator) installable() *bool {