Detect invalid arch specific properties in snapshot
Previously, the snapshot code did not know whether a specific property
could be arch specific or not and assumed that they all were which
meant that it could generate snapshots containing arch specific values
for properties that are not arch specific and so would fail when
unpacked.
This change requires arch specific fields in SdkMemberProperties to be
tagged as such using `android:"arch_variant"` (just as in module input
property structures). Any property without that must have properties
that are common across all variants.
Bug: 155628860
Test: m nothing
Change-Id: Ifc8116e11d987cfe7aec2eeaa964f3bbf36b5dc2
diff --git a/android/sdk.go b/android/sdk.go
index 873e089..36afc3d 100644
--- a/android/sdk.go
+++ b/android/sdk.go
@@ -342,9 +342,15 @@
//
// * The variant property structs are analysed to find exported (capitalized) fields which
// have common values. Those fields are cleared and the common value added to the common
- // properties. A field annotated with a tag of `sdk:"keep"` will be treated as if it
+ // properties.
+ //
+ // A field annotated with a tag of `sdk:"keep"` will be treated as if it
// was not capitalized, i.e. not optimized for common values.
//
+ // A field annotated with a tag of `android:"arch_variant"` will be allowed to have
+ // values that differ by arch, fields not tagged as such must have common values across
+ // all variants.
+ //
// * The sdk module type populates the BpModule structure, creating the arch specific
// structure and calls AddToPropertySet(...) on the properties struct to add the member
// specific properties in the correct place in the structure.