diff options
Diffstat (limited to 'android/apex.go')
| -rw-r--r-- | android/apex.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/android/apex.go b/android/apex.go index c54809547..d3c071056 100644 --- a/android/apex.go +++ b/android/apex.go @@ -140,14 +140,18 @@ const ( availableToAnyApex = "//apex_available:anyapex" ) -func (m *ApexModuleBase) AvailableFor(what string) bool { - if len(m.ApexProperties.Apex_available) == 0 { +func CheckAvailableForApex(what string, apex_available []string) bool { + if len(apex_available) == 0 { // apex_available defaults to ["//apex_available:platform", "//apex_available:anyapex"], // which means 'available to everybody'. return true } - return InList(what, m.ApexProperties.Apex_available) || - (what != availableToPlatform && InList(availableToAnyApex, m.ApexProperties.Apex_available)) + return InList(what, apex_available) || + (what != availableToPlatform && InList(availableToAnyApex, apex_available)) +} + +func (m *ApexModuleBase) AvailableFor(what string) bool { + return CheckAvailableForApex(what, m.ApexProperties.Apex_available) } func (m *ApexModuleBase) checkApexAvailableProperty(mctx BaseModuleContext) { @@ -166,7 +170,7 @@ func (m *ApexModuleBase) CreateApexVariations(mctx BottomUpMutatorContext) []blu m.checkApexAvailableProperty(mctx) sort.Strings(m.apexVariations) variations := []string{} - availableForPlatform := m.AvailableFor(availableToPlatform) + availableForPlatform := mctx.Module().(ApexModule).AvailableFor(availableToPlatform) if availableForPlatform { variations = append(variations, "") // Original variation for platform } |