Merge "Remove PlatformVndkVersion property" into main am: 6954bd2337
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3000610 Change-Id: I3be0d70bbfc728ac1af8a23e063b5f5a81583865 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1448,10 +1448,6 @@ func (c *deviceConfig) CurrentApiLevelForVendorModules() string {
|
|||||||
return StringDefault(c.config.productVariables.DeviceCurrentApiLevelForVendorModules, "current")
|
return StringDefault(c.config.productVariables.DeviceCurrentApiLevelForVendorModules, "current")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *deviceConfig) PlatformVndkVersion() string {
|
|
||||||
return String(c.config.productVariables.Platform_vndk_version)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *deviceConfig) ExtraVndkVersions() []string {
|
func (c *deviceConfig) ExtraVndkVersions() []string {
|
||||||
return c.config.productVariables.ExtraVndkVersions
|
return c.config.productVariables.ExtraVndkVersions
|
||||||
}
|
}
|
||||||
|
@@ -209,7 +209,6 @@ type ProductVariables struct {
|
|||||||
Platform_base_sdk_extension_version *int `json:",omitempty"`
|
Platform_base_sdk_extension_version *int `json:",omitempty"`
|
||||||
Platform_version_active_codenames []string `json:",omitempty"`
|
Platform_version_active_codenames []string `json:",omitempty"`
|
||||||
Platform_version_all_preview_codenames []string `json:",omitempty"`
|
Platform_version_all_preview_codenames []string `json:",omitempty"`
|
||||||
Platform_vndk_version *string `json:",omitempty"`
|
|
||||||
Platform_systemsdk_versions []string `json:",omitempty"`
|
Platform_systemsdk_versions []string `json:",omitempty"`
|
||||||
Platform_security_patch *string `json:",omitempty"`
|
Platform_security_patch *string `json:",omitempty"`
|
||||||
Platform_preview_sdk_version *string `json:",omitempty"`
|
Platform_preview_sdk_version *string `json:",omitempty"`
|
||||||
@@ -597,7 +596,6 @@ func (v *ProductVariables) SetDefaultConfig() {
|
|||||||
Platform_sdk_final: boolPtr(false),
|
Platform_sdk_final: boolPtr(false),
|
||||||
Platform_version_active_codenames: []string{"S"},
|
Platform_version_active_codenames: []string{"S"},
|
||||||
Platform_version_all_preview_codenames: []string{"S"},
|
Platform_version_all_preview_codenames: []string{"S"},
|
||||||
Platform_vndk_version: stringPtr("S"),
|
|
||||||
|
|
||||||
HostArch: stringPtr("x86_64"),
|
HostArch: stringPtr("x86_64"),
|
||||||
HostSecondaryArch: stringPtr("x86"),
|
HostSecondaryArch: stringPtr("x86"),
|
||||||
|
@@ -739,7 +739,7 @@ func (a *apexBundle) combineProperties(ctx android.BottomUpMutatorContext) {
|
|||||||
// image variation name.
|
// image variation name.
|
||||||
func (a *apexBundle) getImageVariationPair(deviceConfig android.DeviceConfig) (string, string) {
|
func (a *apexBundle) getImageVariationPair(deviceConfig android.DeviceConfig) (string, string) {
|
||||||
if a.vndkApex {
|
if a.vndkApex {
|
||||||
return cc.VendorVariationPrefix, a.vndkVersion(deviceConfig)
|
return cc.VendorVariationPrefix, a.vndkVersion()
|
||||||
}
|
}
|
||||||
|
|
||||||
prefix := android.CoreVariation
|
prefix := android.CoreVariation
|
||||||
@@ -748,9 +748,6 @@ func (a *apexBundle) getImageVariationPair(deviceConfig android.DeviceConfig) (s
|
|||||||
if a.SocSpecific() || a.DeviceSpecific() {
|
if a.SocSpecific() || a.DeviceSpecific() {
|
||||||
prefix = cc.VendorVariationPrefix
|
prefix = cc.VendorVariationPrefix
|
||||||
vndkVersion = deviceConfig.VndkVersion()
|
vndkVersion = deviceConfig.VndkVersion()
|
||||||
} else if a.ProductSpecific() {
|
|
||||||
prefix = cc.ProductVariationPrefix
|
|
||||||
vndkVersion = deviceConfig.PlatformVndkVersion()
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if a.SocSpecific() || a.DeviceSpecific() {
|
if a.SocSpecific() || a.DeviceSpecific() {
|
||||||
@@ -759,9 +756,6 @@ func (a *apexBundle) getImageVariationPair(deviceConfig android.DeviceConfig) (s
|
|||||||
prefix = cc.ProductVariation
|
prefix = cc.ProductVariation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if vndkVersion == "current" {
|
|
||||||
vndkVersion = deviceConfig.PlatformVndkVersion()
|
|
||||||
}
|
|
||||||
|
|
||||||
return prefix, vndkVersion
|
return prefix, vndkVersion
|
||||||
}
|
}
|
||||||
|
@@ -277,7 +277,7 @@ func (a *apexBundle) buildManifest(ctx android.ModuleContext, provideNativeLibs,
|
|||||||
// VNDK APEX name is determined at runtime, so update "name" in apex_manifest
|
// VNDK APEX name is determined at runtime, so update "name" in apex_manifest
|
||||||
optCommands := []string{}
|
optCommands := []string{}
|
||||||
if a.vndkApex {
|
if a.vndkApex {
|
||||||
apexName := vndkApexNamePrefix + a.vndkVersion(ctx.DeviceConfig())
|
apexName := vndkApexNamePrefix + a.vndkVersion()
|
||||||
optCommands = append(optCommands, "-v name "+apexName)
|
optCommands = append(optCommands, "-v name "+apexName)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1043,7 +1043,7 @@ func (a *apexBundle) getOverrideManifestPackageName(ctx android.ModuleContext) s
|
|||||||
if a.vndkApex {
|
if a.vndkApex {
|
||||||
overrideName, overridden := ctx.DeviceConfig().OverrideManifestPackageNameFor(vndkApexName)
|
overrideName, overridden := ctx.DeviceConfig().OverrideManifestPackageNameFor(vndkApexName)
|
||||||
if overridden {
|
if overridden {
|
||||||
return overrideName + ".v" + a.vndkVersion(ctx.DeviceConfig())
|
return overrideName + ".v" + a.vndkVersion()
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
35
apex/vndk.go
35
apex/vndk.go
@@ -45,16 +45,12 @@ func vndkApexBundleFactory() android.Module {
|
|||||||
return bundle
|
return bundle
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *apexBundle) vndkVersion(config android.DeviceConfig) string {
|
func (a *apexBundle) vndkVersion() string {
|
||||||
vndkVersion := proptools.StringDefault(a.vndkProperties.Vndk_version, "current")
|
return proptools.StringDefault(a.vndkProperties.Vndk_version, "current")
|
||||||
if vndkVersion == "current" {
|
|
||||||
vndkVersion = config.PlatformVndkVersion()
|
|
||||||
}
|
|
||||||
return vndkVersion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type apexVndkProperties struct {
|
type apexVndkProperties struct {
|
||||||
// Indicates VNDK version of which this VNDK APEX bundles VNDK libs. Default is Platform VNDK Version.
|
// Indicates VNDK version of which this VNDK APEX bundles VNDK libs.
|
||||||
Vndk_version *string
|
Vndk_version *string
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +60,7 @@ func apexVndkMutator(mctx android.TopDownMutatorContext) {
|
|||||||
mctx.PropertyErrorf("native_bridge_supported", "%q doesn't support native bridge binary.", mctx.ModuleType())
|
mctx.PropertyErrorf("native_bridge_supported", "%q doesn't support native bridge binary.", mctx.ModuleType())
|
||||||
}
|
}
|
||||||
|
|
||||||
vndkVersion := ab.vndkVersion(mctx.DeviceConfig())
|
vndkVersion := ab.vndkVersion()
|
||||||
if vndkVersion != "" {
|
if vndkVersion != "" {
|
||||||
apiLevel, err := android.ApiLevelFromUser(mctx, vndkVersion)
|
apiLevel, err := android.ApiLevelFromUser(mctx, vndkVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -73,17 +69,9 @@ func apexVndkMutator(mctx android.TopDownMutatorContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
targets := mctx.MultiTargets()
|
targets := mctx.MultiTargets()
|
||||||
if len(targets) > 0 && apiLevel.LessThan(cc.MinApiForArch(mctx, targets[0].Arch.ArchType)) &&
|
if len(targets) > 0 && apiLevel.LessThan(cc.MinApiForArch(mctx, targets[0].Arch.ArchType)) {
|
||||||
vndkVersion != mctx.DeviceConfig().PlatformVndkVersion() {
|
|
||||||
// Disable VNDK APEXes for VNDK versions less than the minimum supported API
|
// Disable VNDK APEXes for VNDK versions less than the minimum supported API
|
||||||
// level for the primary architecture. This validation is skipped if the VNDK
|
// level for the primary architecture.
|
||||||
// version matches the platform VNDK version, which can occur when the device
|
|
||||||
// config targets the 'current' VNDK (see `vndkVersion`).
|
|
||||||
ab.Disable()
|
|
||||||
}
|
|
||||||
if proptools.String(ab.vndkProperties.Vndk_version) != "" &&
|
|
||||||
mctx.DeviceConfig().PlatformVndkVersion() != "" &&
|
|
||||||
apiLevel.GreaterThanOrEqualTo(android.ApiLevelOrPanic(mctx, mctx.DeviceConfig().PlatformVndkVersion())) {
|
|
||||||
ab.Disable()
|
ab.Disable()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,20 +81,11 @@ func apexVndkMutator(mctx android.TopDownMutatorContext) {
|
|||||||
func apexVndkDepsMutator(mctx android.BottomUpMutatorContext) {
|
func apexVndkDepsMutator(mctx android.BottomUpMutatorContext) {
|
||||||
if m, ok := mctx.Module().(*cc.Module); ok && cc.IsForVndkApex(mctx, m) {
|
if m, ok := mctx.Module().(*cc.Module); ok && cc.IsForVndkApex(mctx, m) {
|
||||||
vndkVersion := m.VndkVersion()
|
vndkVersion := m.VndkVersion()
|
||||||
// For VNDK-Lite device, we gather core-variants of VNDK-Sp libraries, which doesn't have VNDK version defined
|
|
||||||
if vndkVersion == "" {
|
|
||||||
vndkVersion = mctx.DeviceConfig().PlatformVndkVersion()
|
|
||||||
}
|
|
||||||
|
|
||||||
if vndkVersion == "" {
|
if vndkVersion == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
vndkVersion = "v" + vndkVersion
|
||||||
if vndkVersion == mctx.DeviceConfig().PlatformVndkVersion() {
|
|
||||||
vndkVersion = "current"
|
|
||||||
} else {
|
|
||||||
vndkVersion = "v" + vndkVersion
|
|
||||||
}
|
|
||||||
|
|
||||||
vndkApexName := "com.android.vndk." + vndkVersion
|
vndkApexName := "com.android.vndk." + vndkVersion
|
||||||
|
|
||||||
|
3
cc/cc.go
3
cc/cc.go
@@ -1897,9 +1897,6 @@ func getNameSuffixWithVndkVersion(ctx android.ModuleContext, c LinkableInterface
|
|||||||
vndkVersion = ctx.DeviceConfig().VndkVersion()
|
vndkVersion = ctx.DeviceConfig().VndkVersion()
|
||||||
nameSuffix = VendorSuffix
|
nameSuffix = VendorSuffix
|
||||||
}
|
}
|
||||||
if vndkVersion == "current" {
|
|
||||||
vndkVersion = ctx.DeviceConfig().PlatformVndkVersion()
|
|
||||||
}
|
|
||||||
if c.VndkVersion() != vndkVersion && c.VndkVersion() != "" {
|
if c.VndkVersion() != vndkVersion && c.VndkVersion() != "" {
|
||||||
// add version suffix only if the module is using different vndk version than the
|
// add version suffix only if the module is using different vndk version than the
|
||||||
// version in product or vendor partition.
|
// version in product or vendor partition.
|
||||||
|
@@ -121,18 +121,7 @@ func (g *GenruleExtraProperties) ExtraImageVariations(ctx android.BaseModuleCont
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if vendorVariantRequired {
|
if vendorVariantRequired {
|
||||||
// If vndkVersion is current, we can always use PlatformVndkVersion.
|
variants = append(variants, VendorVariationPrefix+vndkVersion)
|
||||||
// If not, we assume modules under proprietary paths are compatible for
|
|
||||||
// BOARD_VNDK_VERSION. The other modules are regarded as AOSP, that is
|
|
||||||
// PLATFORM_VNDK_VERSION.
|
|
||||||
if vndkVersion == "current" || !snapshot.IsVendorProprietaryModule(ctx) {
|
|
||||||
variants = append(variants, VendorVariationPrefix+ctx.DeviceConfig().PlatformVndkVersion())
|
|
||||||
} else {
|
|
||||||
variants = append(variants, VendorVariationPrefix+vndkVersion)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if productVariantRequired {
|
|
||||||
variants = append(variants, ProductVariationPrefix+ctx.DeviceConfig().PlatformVndkVersion())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
21
cc/image.go
21
cc/image.go
@@ -429,7 +429,6 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
|
|||||||
var vendorVariants []string
|
var vendorVariants []string
|
||||||
var productVariants []string
|
var productVariants []string
|
||||||
|
|
||||||
platformVndkVersion := mctx.DeviceConfig().PlatformVndkVersion()
|
|
||||||
boardVndkVersion := mctx.DeviceConfig().VndkVersion()
|
boardVndkVersion := mctx.DeviceConfig().VndkVersion()
|
||||||
recoverySnapshotVersion := mctx.DeviceConfig().RecoverySnapshotVersion()
|
recoverySnapshotVersion := mctx.DeviceConfig().RecoverySnapshotVersion()
|
||||||
usingRecoverySnapshot := recoverySnapshotVersion != "current" &&
|
usingRecoverySnapshot := recoverySnapshotVersion != "current" &&
|
||||||
@@ -444,17 +443,13 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
|
|||||||
needVndkVersionVendorVariantForLlndk = boardVndkApiLevel.LessThanOrEqualTo(android.ApiLevelOrPanic(mctx, "30"))
|
needVndkVersionVendorVariantForLlndk = boardVndkApiLevel.LessThanOrEqualTo(android.ApiLevelOrPanic(mctx, "30"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if boardVndkVersion == "current" {
|
|
||||||
boardVndkVersion = platformVndkVersion
|
|
||||||
}
|
|
||||||
|
|
||||||
if m.NeedsLlndkVariants() {
|
if m.NeedsLlndkVariants() {
|
||||||
// This is an LLNDK library. The implementation of the library will be on /system,
|
// This is an LLNDK library. The implementation of the library will be on /system,
|
||||||
// and vendor and product variants will be created with LLNDK stubs.
|
// and vendor and product variants will be created with LLNDK stubs.
|
||||||
// The LLNDK libraries need vendor variants even if there is no VNDK.
|
// The LLNDK libraries need vendor variants even if there is no VNDK.
|
||||||
coreVariantNeeded = true
|
coreVariantNeeded = true
|
||||||
vendorVariants = append(vendorVariants, platformVndkVersion)
|
vendorVariants = append(vendorVariants, "")
|
||||||
productVariants = append(productVariants, platformVndkVersion)
|
productVariants = append(productVariants, "")
|
||||||
// Generate vendor variants for boardVndkVersion only if the VNDK snapshot does not
|
// Generate vendor variants for boardVndkVersion only if the VNDK snapshot does not
|
||||||
// provide the LLNDK stub libraries.
|
// provide the LLNDK stub libraries.
|
||||||
if needVndkVersionVendorVariantForLlndk {
|
if needVndkVersionVendorVariantForLlndk {
|
||||||
@@ -465,7 +460,7 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
|
|||||||
// for system and product.
|
// for system and product.
|
||||||
coreVariantNeeded = true
|
coreVariantNeeded = true
|
||||||
vendorVariants = append(vendorVariants, boardVndkVersion)
|
vendorVariants = append(vendorVariants, boardVndkVersion)
|
||||||
productVariants = append(productVariants, platformVndkVersion)
|
productVariants = append(productVariants, "")
|
||||||
} else if m.IsSnapshotPrebuilt() {
|
} else if m.IsSnapshotPrebuilt() {
|
||||||
// Make vendor variants only for the versions in BOARD_VNDK_VERSION and
|
// Make vendor variants only for the versions in BOARD_VNDK_VERSION and
|
||||||
// PRODUCT_EXTRA_VNDK_VERSIONS.
|
// PRODUCT_EXTRA_VNDK_VERSIONS.
|
||||||
@@ -486,13 +481,13 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
|
|||||||
if snapshot.IsVendorProprietaryModule(mctx) {
|
if snapshot.IsVendorProprietaryModule(mctx) {
|
||||||
vendorVariants = append(vendorVariants, boardVndkVersion)
|
vendorVariants = append(vendorVariants, boardVndkVersion)
|
||||||
} else {
|
} else {
|
||||||
vendorVariants = append(vendorVariants, platformVndkVersion)
|
vendorVariants = append(vendorVariants, "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// product_available modules are available to /product.
|
// product_available modules are available to /product.
|
||||||
if m.HasProductVariant() {
|
if m.HasProductVariant() {
|
||||||
productVariants = append(productVariants, platformVndkVersion)
|
productVariants = append(productVariants, "")
|
||||||
}
|
}
|
||||||
} else if vendorSpecific && m.SdkVersion() == "" {
|
} else if vendorSpecific && m.SdkVersion() == "" {
|
||||||
// This will be available in /vendor (or /odm) only
|
// This will be available in /vendor (or /odm) only
|
||||||
@@ -505,13 +500,13 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
|
|||||||
// are regarded as AOSP, which is PLATFORM_VNDK_VERSION.
|
// are regarded as AOSP, which is PLATFORM_VNDK_VERSION.
|
||||||
if m.KernelHeadersDecorator() {
|
if m.KernelHeadersDecorator() {
|
||||||
vendorVariants = append(vendorVariants,
|
vendorVariants = append(vendorVariants,
|
||||||
platformVndkVersion,
|
"",
|
||||||
boardVndkVersion,
|
boardVndkVersion,
|
||||||
)
|
)
|
||||||
} else if snapshot.IsVendorProprietaryModule(mctx) {
|
} else if snapshot.IsVendorProprietaryModule(mctx) {
|
||||||
vendorVariants = append(vendorVariants, boardVndkVersion)
|
vendorVariants = append(vendorVariants, boardVndkVersion)
|
||||||
} else {
|
} else {
|
||||||
vendorVariants = append(vendorVariants, platformVndkVersion)
|
vendorVariants = append(vendorVariants, "")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// This is either in /system (or similar: /data), or is a
|
// This is either in /system (or similar: /data), or is a
|
||||||
@@ -523,7 +518,7 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
|
|||||||
if coreVariantNeeded && productSpecific && m.SdkVersion() == "" {
|
if coreVariantNeeded && productSpecific && m.SdkVersion() == "" {
|
||||||
// The module has "product_specific: true" that does not create core variant.
|
// The module has "product_specific: true" that does not create core variant.
|
||||||
coreVariantNeeded = false
|
coreVariantNeeded = false
|
||||||
productVariants = append(productVariants, platformVndkVersion)
|
productVariants = append(productVariants, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.RamdiskAvailable() {
|
if m.RamdiskAvailable() {
|
||||||
|
@@ -324,7 +324,7 @@ func (p *BaseSnapshotDecorator) SetSnapshotAndroidMkSuffix(ctx android.ModuleCon
|
|||||||
|
|
||||||
variations = append(ctx.Target().Variations(), blueprint.Variation{
|
variations = append(ctx.Target().Variations(), blueprint.Variation{
|
||||||
Mutator: "image",
|
Mutator: "image",
|
||||||
Variation: ProductVariationPrefix + ctx.DeviceConfig().PlatformVndkVersion()})
|
Variation: ProductVariation})
|
||||||
|
|
||||||
if ctx.OtherModuleFarDependencyVariantExists(variations, ctx.Module().(LinkableInterface).BaseModuleName()) {
|
if ctx.OtherModuleFarDependencyVariantExists(variations, ctx.Module().(LinkableInterface).BaseModuleName()) {
|
||||||
p.baseProperties.Androidmk_suffix = p.Image.moduleNameSuffix()
|
p.baseProperties.Androidmk_suffix = p.Image.moduleNameSuffix()
|
||||||
|
79
cc/vndk.go
79
cc/vndk.go
@@ -42,28 +42,6 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func VndkLibrariesTxtModules(vndkVersion string, ctx android.BaseModuleContext) []string {
|
func VndkLibrariesTxtModules(vndkVersion string, ctx android.BaseModuleContext) []string {
|
||||||
// Return the list of vndk txt files for the vndk apex of the vndkVersion.
|
|
||||||
if vndkVersion == "current" {
|
|
||||||
// We can assume all txt files are snapshotted if we find one of them.
|
|
||||||
currentVndkSnapshotted := ctx.OtherModuleExists(insertVndkVersion(llndkLibrariesTxt, ctx.DeviceConfig().PlatformVndkVersion()))
|
|
||||||
if currentVndkSnapshotted {
|
|
||||||
// If the current VNDK is already snapshotted (which can happen with
|
|
||||||
// the `next` config), use the prebuilt txt files in the snapshot.
|
|
||||||
// This is because the txt files built from source are probably be
|
|
||||||
// for the in-development version.
|
|
||||||
vndkVersion = ctx.DeviceConfig().PlatformVndkVersion()
|
|
||||||
} else {
|
|
||||||
// Use the txt files generated from the source
|
|
||||||
return []string{
|
|
||||||
llndkLibrariesTxtForApex,
|
|
||||||
vndkCoreLibrariesTxt,
|
|
||||||
vndkSpLibrariesTxt,
|
|
||||||
vndkPrivateLibrariesTxt,
|
|
||||||
vndkProductLibrariesTxt,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Snapshot vndks have their own *.libraries.VER.txt files.
|
// Snapshot vndks have their own *.libraries.VER.txt files.
|
||||||
// Note that snapshots don't have "vndkcorevariant.libraries.VER.txt"
|
// Note that snapshots don't have "vndkcorevariant.libraries.VER.txt"
|
||||||
result := []string{
|
result := []string{
|
||||||
@@ -376,15 +354,6 @@ func IsForVndkApex(mctx android.BottomUpMutatorContext, m *Module) bool {
|
|||||||
if !p.MatchesWithDevice(mctx.DeviceConfig()) {
|
if !p.MatchesWithDevice(mctx.DeviceConfig()) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
platformVndkVersion := mctx.DeviceConfig().PlatformVndkVersion()
|
|
||||||
if platformVndkVersion != "" {
|
|
||||||
// ignore prebuilt vndk modules that are newer than or equal to the platform vndk version
|
|
||||||
platformVndkApiLevel := android.ApiLevelOrPanic(mctx, platformVndkVersion)
|
|
||||||
if platformVndkApiLevel.LessThanOrEqualTo(android.ApiLevelOrPanic(mctx, p.Version())) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if lib, ok := m.linker.(libraryInterface); ok {
|
if lib, ok := m.linker.(libraryInterface); ok {
|
||||||
@@ -392,8 +361,7 @@ func IsForVndkApex(mctx android.BottomUpMutatorContext, m *Module) bool {
|
|||||||
if lib.buildStubs() {
|
if lib.buildStubs() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
useCoreVariant := m.VndkVersion() == mctx.DeviceConfig().PlatformVndkVersion() &&
|
useCoreVariant := mctx.DeviceConfig().VndkUseCoreVariant() && !m.MustUseVendorVariant()
|
||||||
mctx.DeviceConfig().VndkUseCoreVariant() && !m.MustUseVendorVariant()
|
|
||||||
return lib.shared() && m.InVendor() && m.IsVndk() && !m.IsVndkExt() && !useCoreVariant
|
return lib.shared() && m.InVendor() && m.IsVndk() && !m.IsVndkExt() && !useCoreVariant
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
@@ -548,22 +516,9 @@ func insertVndkVersion(filename string, vndkVersion string) string {
|
|||||||
return filename
|
return filename
|
||||||
}
|
}
|
||||||
|
|
||||||
func (txt *vndkLibrariesTxt) DepsMutator(mctx android.BottomUpMutatorContext) {
|
|
||||||
versionedName := insertVndkVersion(txt.Name(), mctx.DeviceConfig().PlatformVndkVersion())
|
|
||||||
if mctx.OtherModuleExists(versionedName) {
|
|
||||||
// If the prebuilt vndk libraries txt files exist, install them instead.
|
|
||||||
txt.HideFromMake()
|
|
||||||
mctx.AddDependency(txt, nil, versionedName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (txt *vndkLibrariesTxt) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
func (txt *vndkLibrariesTxt) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
filename := proptools.StringDefault(txt.properties.Stem, txt.Name())
|
filename := proptools.StringDefault(txt.properties.Stem, txt.Name())
|
||||||
|
|
||||||
if Bool(txt.properties.Insert_vndk_version) {
|
|
||||||
filename = insertVndkVersion(filename, ctx.DeviceConfig().PlatformVndkVersion())
|
|
||||||
}
|
|
||||||
|
|
||||||
txt.outputFile = android.PathForModuleOut(ctx, filename).OutputPath
|
txt.outputFile = android.PathForModuleOut(ctx, filename).OutputPath
|
||||||
|
|
||||||
installPath := android.PathForModuleInstall(ctx, "etc")
|
installPath := android.PathForModuleInstall(ctx, "etc")
|
||||||
@@ -639,34 +594,6 @@ type vndkSnapshotSingleton struct {
|
|||||||
|
|
||||||
func isVndkSnapshotAware(config android.DeviceConfig, m LinkableInterface,
|
func isVndkSnapshotAware(config android.DeviceConfig, m LinkableInterface,
|
||||||
apexInfo android.ApexInfo) (vndkType string, isVndkSnapshotLib bool) {
|
apexInfo android.ApexInfo) (vndkType string, isVndkSnapshotLib bool) {
|
||||||
|
|
||||||
if m.Target().NativeBridge == android.NativeBridgeEnabled {
|
|
||||||
return "", false
|
|
||||||
}
|
|
||||||
// !inVendor: There's product/vendor variants for VNDK libs. We only care about vendor variants.
|
|
||||||
// !installable: Snapshot only cares about "installable" modules.
|
|
||||||
// !m.IsLlndk: llndk stubs are required for building against snapshots.
|
|
||||||
// IsSnapshotPrebuilt: Snapshotting a snapshot doesn't make sense.
|
|
||||||
// !outputFile.Valid: Snapshot requires valid output file.
|
|
||||||
if !m.InVendor() || (!installable(m, apexInfo) && !m.IsLlndk()) || m.IsSnapshotPrebuilt() || !m.OutputFile().Valid() {
|
|
||||||
return "", false
|
|
||||||
}
|
|
||||||
if !m.IsSnapshotLibrary() || !m.Shared() {
|
|
||||||
return "", false
|
|
||||||
}
|
|
||||||
if m.VndkVersion() == config.PlatformVndkVersion() {
|
|
||||||
if m.IsVndk() && !m.IsVndkExt() {
|
|
||||||
if m.IsVndkSp() {
|
|
||||||
return "vndk-sp", true
|
|
||||||
} else {
|
|
||||||
return "vndk-core", true
|
|
||||||
}
|
|
||||||
} else if m.HasLlndkStubs() && m.StubsVersion() == "" {
|
|
||||||
// Use default version for the snapshot.
|
|
||||||
return "llndk-stub", true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -679,10 +606,6 @@ func (c *vndkSnapshotSingleton) GenerateBuildActions(ctx android.SingletonContex
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.DeviceConfig().PlatformVndkVersion() == "" {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var snapshotOutputs android.Paths
|
var snapshotOutputs android.Paths
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -131,16 +131,6 @@ func (p *vndkPrebuiltLibraryDecorator) singleSourcePath(ctx ModuleContext) andro
|
|||||||
|
|
||||||
func (p *vndkPrebuiltLibraryDecorator) link(ctx ModuleContext,
|
func (p *vndkPrebuiltLibraryDecorator) link(ctx ModuleContext,
|
||||||
flags Flags, deps PathDeps, objs Objects) android.Path {
|
flags Flags, deps PathDeps, objs Objects) android.Path {
|
||||||
platformVndkVersion := ctx.DeviceConfig().PlatformVndkVersion()
|
|
||||||
if platformVndkVersion != "" {
|
|
||||||
platformVndkApiLevel := android.ApiLevelOrPanic(ctx, platformVndkVersion)
|
|
||||||
if platformVndkApiLevel.LessThanOrEqualTo(android.ApiLevelOrPanic(ctx, p.Version())) {
|
|
||||||
// This prebuilt VNDK module is not required for the current build
|
|
||||||
ctx.Module().HideFromMake()
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !p.MatchesWithDevice(ctx.DeviceConfig()) {
|
if !p.MatchesWithDevice(ctx.DeviceConfig()) {
|
||||||
ctx.Module().HideFromMake()
|
ctx.Module().HideFromMake()
|
||||||
return nil
|
return nil
|
||||||
|
Reference in New Issue
Block a user