summaryrefslogtreecommitdiff
path: root/cc/genrule.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/genrule.go')
-rw-r--r--cc/genrule.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/cc/genrule.go b/cc/genrule.go
index 82d7205da..2d9dd9458 100644
--- a/cc/genrule.go
+++ b/cc/genrule.go
@@ -67,9 +67,6 @@ func (g *GenruleExtraProperties) CoreVariantNeeded(ctx android.BaseModuleContext
return !(ctx.SocSpecific() || ctx.DeviceSpecific())
}
-func (g *GenruleExtraProperties) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
- return Bool(g.Ramdisk_available)
-}
func (g *GenruleExtraProperties) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
return Bool(g.Vendor_ramdisk_available)
@@ -91,6 +88,18 @@ func (g *GenruleExtraProperties) RecoveryVariantNeeded(ctx android.BaseModuleCon
}
}
+func (g *GenruleExtraProperties) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
+ // If the build is using a snapshot, the ramdisk variant under AOSP directories
+ // is not needed.
+ ramdiskSnapshotVersion := ctx.DeviceConfig().RamdiskSnapshotVersion()
+ if ramdiskSnapshotVersion != "current" && ramdiskSnapshotVersion != "" &&
+ !isRamdiskProprietaryModule(ctx) {
+ return false
+ } else {
+ return Bool(g.Ramdisk_available)
+ }
+}
+
func (g *GenruleExtraProperties) ExtraImageVariations(ctx android.BaseModuleContext) []string {
if ctx.DeviceConfig().VndkVersion() == "" {
return nil