summaryrefslogtreecommitdiff
path: root/android/image.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/image.go')
-rw-r--r--android/image.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/android/image.go b/android/image.go
index 9cad05656..c278dcdf9 100644
--- a/android/image.go
+++ b/android/image.go
@@ -19,6 +19,12 @@ type ImageInterface interface {
// ImageMutatorBegin is called before any other method in the ImageInterface.
ImageMutatorBegin(ctx BaseModuleContext)
+ // VendorVariantNeeded should return true if the module needs a vendor variant (installed on the vendor image).
+ VendorVariantNeeded(ctx BaseModuleContext) bool
+
+ // ProductVariantNeeded should return true if the module needs a product variant (unstalled on the product image).
+ ProductVariantNeeded(ctx BaseModuleContext) bool
+
// CoreVariantNeeded should return true if the module needs a core variant (installed on the system image).
CoreVariantNeeded(ctx BaseModuleContext) bool
@@ -49,6 +55,14 @@ type ImageInterface interface {
}
const (
+ // VendorVariation is the variant name used for /vendor code that does not
+ // compile against the VNDK.
+ VendorVariation string = "vendor"
+
+ // ProductVariation is the variant name used for /product code that does not
+ // compile against the VNDK.
+ ProductVariation string = "product"
+
// CoreVariation is the variant used for framework-private libraries, or
// SDK libraries. (which framework-private libraries can use), which
// will be installed to the system image.
@@ -94,6 +108,12 @@ func imageMutator(ctx BottomUpMutatorContext) {
if m.RecoveryVariantNeeded(ctx) {
variations = append(variations, RecoveryVariation)
}
+ if m.VendorVariantNeeded(ctx) {
+ variations = append(variations, VendorVariation)
+ }
+ if m.ProductVariantNeeded(ctx) {
+ variations = append(variations, ProductVariation)
+ }
extraVariations := m.ExtraImageVariations(ctx)
variations = append(variations, extraVariations...)