From b5fdb2e966bf6e819677e266eda27a8cb0a86d0c Mon Sep 17 00:00:00 2001 From: Kiyoung Kim Date: Wed, 3 Jan 2024 14:24:34 +0900 Subject: Generate image variation without version Current CC/Rust Image variations are generated with target VNDK version. However, this is no longer valid if VNDK is deprecated. This change generates image variation without version ("vendor", "product") if VNDK is deprecated. Bug: 316829758 Test: m nothing --no-skip-soong-tests passed Test: aosp_cf_x86_64_phone build succeeded Change-Id: I2387ed8a2632bfd9462621f882a947695ae1653d --- apex/apex.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'apex/apex.go') diff --git a/apex/apex.go b/apex/apex.go index 45abbbacc..40c837d45 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -719,7 +719,7 @@ func (a *apexBundle) combineProperties(ctx android.BottomUpMutatorContext) { // getImageVariationPair returns a pair for the image variation name as its // prefix and suffix. The prefix indicates whether it's core/vendor/product and the -// suffix indicates the vndk version when it's vendor or product. +// suffix indicates the vndk version for vendor/product if vndk is enabled. // getImageVariation can simply join the result of this function to get the // image variation name. func (a *apexBundle) getImageVariationPair(deviceConfig android.DeviceConfig) (string, string) { @@ -727,8 +727,8 @@ func (a *apexBundle) getImageVariationPair(deviceConfig android.DeviceConfig) (s return cc.VendorVariationPrefix, a.vndkVersion(deviceConfig) } - var prefix string - var vndkVersion string + prefix := android.CoreVariation + vndkVersion := "" if deviceConfig.VndkVersion() != "" { if a.SocSpecific() || a.DeviceSpecific() { prefix = cc.VendorVariationPrefix @@ -737,15 +737,18 @@ func (a *apexBundle) getImageVariationPair(deviceConfig android.DeviceConfig) (s prefix = cc.ProductVariationPrefix vndkVersion = deviceConfig.PlatformVndkVersion() } + } else { + if a.SocSpecific() || a.DeviceSpecific() { + prefix = cc.VendorVariation + } else if a.ProductSpecific() { + prefix = cc.ProductVariation + } } if vndkVersion == "current" { vndkVersion = deviceConfig.PlatformVndkVersion() } - if vndkVersion != "" { - return prefix, vndkVersion - } - return android.CoreVariation, "" // The usual case + return prefix, vndkVersion } // getImageVariation returns the image variant name for this apexBundle. In most cases, it's simply -- cgit v1.2.3-59-g8ed1b