Autogenerate a vendor/ partition

If BUILDING_VENDOR_IMAGE is true

Bug: 374371755
Test: verified that vendor module is not created for aosp_x86_64
Test: verified that vendor module is created for aosp_cf_x86_64_phone
Change-Id: Idb9c017b933be966e3aa4f863d15e837346a1f82
diff --git a/android/config.go b/android/config.go
index 5132c62..b70f6ac 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1524,6 +1524,10 @@
 	return "vendor"
 }
 
+func (c *deviceConfig) BuildingVendorImage() bool {
+	return proptools.Bool(c.config.productVariables.BuildingVendorImage)
+}
+
 func (c *deviceConfig) CurrentApiLevelForVendorModules() string {
 	return StringDefault(c.config.productVariables.DeviceCurrentApiLevelForVendorModules, "current")
 }
diff --git a/android/variable.go b/android/variable.go
index 73c0d0e..f7392d1 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -337,10 +337,11 @@
 	HWASanIncludePaths []string `json:",omitempty"`
 	HWASanExcludePaths []string `json:",omitempty"`
 
-	VendorPath    *string `json:",omitempty"`
-	OdmPath       *string `json:",omitempty"`
-	ProductPath   *string `json:",omitempty"`
-	SystemExtPath *string `json:",omitempty"`
+	VendorPath          *string `json:",omitempty"`
+	BuildingVendorImage *bool   `json:",omitempty"`
+	OdmPath             *string `json:",omitempty"`
+	ProductPath         *string `json:",omitempty"`
+	SystemExtPath       *string `json:",omitempty"`
 
 	ClangTidy  *bool   `json:",omitempty"`
 	TidyChecks *string `json:",omitempty"`