summaryrefslogtreecommitdiff
path: root/apex/apex.go
diff options
context:
space:
mode:
author Kiyoung Kim <kiyoungkim@google.com> 2024-01-03 14:24:34 +0900
committer Kiyoung Kim <kiyoungkim@google.com> 2024-01-05 11:15:23 +0900
commitb5fdb2e966bf6e819677e266eda27a8cb0a86d0c (patch)
tree95f3897c0e86ec61e05b053f8a21cbcaadd245e0 /apex/apex.go
parent202bc5b689ed7f5deaf997c78347f64bfc19dce5 (diff)
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
Diffstat (limited to 'apex/apex.go')
-rw-r--r--apex/apex.go17
1 files changed, 10 insertions, 7 deletions
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