Add vintf info and userdata size to Soong's misc_info.txt

- vintf info will be read from the global productVariables struct. This
  will likely need to be revisited when we have multiple
android_device's in the tree
- userdata has been special-cased to create a `userdata_size` entry in
  addition to $(filesystem)_partition_size entry. This special case
matches the make misc_info.txt implementation.

Bug: 398036609
Test: Built Soong's misc_info.txt locally
Change-Id: I9f312c8022c5faf84442cb51f1e13043768aed53
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index cb54f78..443e80e 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -819,6 +819,14 @@
 	// TODO: Add support for TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS which can be used to override the default
 	builder.Command().Textf("echo recovery_mount_options=%s >> %s", defaultTargetRecoveryFstypeMountOptions, miscInfo)
 
+	// vintf information
+	if proptools.Bool(ctx.Config().ProductVariables().Enforce_vintf_manifest) {
+		builder.Command().Textf("echo vintf_enforce=true >> %s", miscInfo)
+	}
+	if len(ctx.Config().DeviceManifestFiles()) > 0 {
+		builder.Command().Textf("echo vintf_include_empty_vendor_sku=true >> %s", miscInfo)
+	}
+
 	if a.partitionProps.Recovery_partition_name == nil {
 		builder.Command().Textf("echo no_recovery=true >> %s", miscInfo)
 	}
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 3d8477d..af14e81 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -1175,6 +1175,10 @@
 	// effect as <partition name>_disable_sparse.
 	if f.properties.Partition_size == nil {
 		addStr(f.partitionName()+"_disable_sparse", "true")
+	} else if f.partitionName() == "userdata" {
+		// Add userdata's partition size to misc_info.txt.
+		// userdata has been special-cased to make the make packaging misc_info.txt implementation
+		addStr("userdata_size", strconv.FormatInt(*f.properties.Partition_size, 10))
 	}
 
 	fst := f.fsType(ctx)