Allow building unsigned APEXs payload for testing.

Bug: 148447155
Test: built a testing apex with unsigned payload.
Merged-In: I95aa3f11ff1adc1421fcd7ed5a356ee531a0a818
Change-Id: I95aa3f11ff1adc1421fcd7ed5a356ee531a0a818
(cherry picked from commit 98410fd9d66a3717a1b0d52b68071821d11e6302)
diff --git a/apex/apex.go b/apex/apex.go
index 39968ab..043f1a9 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1073,6 +1073,10 @@
 	// Should be only used in tests#.
 	Test_only_no_hashtree *bool
 
+	// Whenever apex_payload.img of the APEX should not be dm-verity signed.
+	// Should be only used in tests#.
+	Test_only_unsigned_payload *bool
+
 	IsCoverageVariant bool `blueprint:"mutated"`
 
 	// Whether this APEX is considered updatable or not. When set to true, this will enforce additional
@@ -1562,6 +1566,10 @@
 	return proptools.Bool(a.properties.Test_only_no_hashtree)
 }
 
+func (a *apexBundle) testOnlyShouldSkipPayloadSign() bool {
+	return proptools.Bool(a.properties.Test_only_unsigned_payload)
+}
+
 func (a *apexBundle) getImageVariation(config android.DeviceConfig) string {
 	if a.vndkApex {
 		return cc.VendorVariationPrefix + a.vndkVersion(config)