Specify partition_size argument for vendor_boot partition generation

Follows the similar logic for passing partition_size argument for boot
image generation.

This is the last remaining difference between the soong and make
generated vendor_boot partition, and with this topic the two images are
bit identical.

Test: diff soong and make generated vendor boot partition images
Bug: 379945468
Change-Id: I92b2035a3bc1847de97c7ac6fc370688b94fc2c3
diff --git a/fsgen/boot_imgs.go b/fsgen/boot_imgs.go
index c73c345..914d35b 100644
--- a/fsgen/boot_imgs.go
+++ b/fsgen/boot_imgs.go
@@ -109,12 +109,23 @@
 		vendorBootConfigImg = proptools.StringPtr(":" + name)
 	}
 
+	var partitionSize *int64
+	if partitionVariables.BoardVendorBootimagePartitionSize != "" {
+		// Base of zero will allow base 10 or base 16 if starting with 0x
+		parsed, err := strconv.ParseInt(partitionVariables.BoardVendorBootimagePartitionSize, 0, 64)
+		if err != nil {
+			ctx.ModuleErrorf("BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE must be an int, got %s", partitionVariables.BoardVendorBootimagePartitionSize)
+		}
+		partitionSize = &parsed
+	}
+
 	ctx.CreateModule(
 		filesystem.BootimgFactory,
 		&filesystem.BootimgProperties{
 			Boot_image_type:    proptools.StringPtr("vendor_boot"),
 			Ramdisk_module:     proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), "vendor_ramdisk")),
 			Header_version:     proptools.StringPtr(partitionVariables.BoardBootHeaderVersion),
+			Partition_size:     partitionSize,
 			Use_avb:            avbInfo.avbEnable,
 			Avb_mode:           avbInfo.avbMode,
 			Avb_private_key:    avbInfo.avbkeyFilegroup,