Always set apex_available in SDK snapshots.
Also fix //apex_available:platform that could get lost in the generated apex_available properties. It only happened if a module didn't specify an apex_available setting and then got extra entries from apex.BaselineApexAvailable. Test: Build ART SDK with libnativeloader_lazy in the SDK, and check that the generated prebuilt module has //apex_available:platform (before https://r.android.com/1480559). Change-Id: I9df20aee63455932a7e558993f0f26769cb02792
This commit is contained in:
@@ -735,6 +735,24 @@ func (s *snapshotBuilder) AddPrebuiltModule(member android.SdkMember, moduleType
|
||||
}
|
||||
}
|
||||
|
||||
// Where available copy apex_available properties from the member.
|
||||
if apexAware, ok := variant.(interface{ ApexAvailable() []string }); ok {
|
||||
apexAvailable := apexAware.ApexAvailable()
|
||||
if len(apexAvailable) == 0 {
|
||||
// //apex_available:platform is the default.
|
||||
apexAvailable = []string{android.AvailableToPlatform}
|
||||
}
|
||||
|
||||
// Add in any baseline apex available settings.
|
||||
apexAvailable = append(apexAvailable, apex.BaselineApexAvailable(member.Name())...)
|
||||
|
||||
// Remove duplicates and sort.
|
||||
apexAvailable = android.FirstUniqueStrings(apexAvailable)
|
||||
sort.Strings(apexAvailable)
|
||||
|
||||
m.AddProperty("apex_available", apexAvailable)
|
||||
}
|
||||
|
||||
deviceSupported := false
|
||||
hostSupported := false
|
||||
|
||||
@@ -749,22 +767,6 @@ func (s *snapshotBuilder) AddPrebuiltModule(member android.SdkMember, moduleType
|
||||
|
||||
addHostDeviceSupportedProperties(deviceSupported, hostSupported, m)
|
||||
|
||||
// Where available copy apex_available properties from the member.
|
||||
if apexAware, ok := variant.(interface{ ApexAvailable() []string }); ok {
|
||||
apexAvailable := apexAware.ApexAvailable()
|
||||
|
||||
// Add in any baseline apex available settings.
|
||||
apexAvailable = append(apexAvailable, apex.BaselineApexAvailable(member.Name())...)
|
||||
|
||||
if len(apexAvailable) > 0 {
|
||||
// Remove duplicates and sort.
|
||||
apexAvailable = android.FirstUniqueStrings(apexAvailable)
|
||||
sort.Strings(apexAvailable)
|
||||
|
||||
m.AddProperty("apex_available", apexAvailable)
|
||||
}
|
||||
}
|
||||
|
||||
// Disable installation in the versioned module of those modules that are ever installable.
|
||||
if installable, ok := variant.(interface{ EverInstallable() bool }); ok {
|
||||
if installable.EverInstallable() {
|
||||
|
Reference in New Issue
Block a user