Handle property structs and BpPropertySets as values to AddProperty.
Both will create a nested property set, that may be merged with an
existing one.
Test: m nothing
Bug: 151303681
Change-Id: I30696ba3eb8960ca6fa54c9ee2cf6229ab9f5da9
diff --git a/android/sdk.go b/android/sdk.go
index 9ea7ff4..f2cdc88 100644
--- a/android/sdk.go
+++ b/android/sdk.go
@@ -237,9 +237,25 @@
// * string
// * array of the above
// * bool
+ // For these types it is an error if multiple properties with the same name
+ // are added.
+ //
+ // * pointer to a struct
// * BpPropertySet
//
- // It is an error if multiple properties with the same name are added.
+ // A pointer to a Blueprint-style property struct is first converted into a
+ // BpPropertySet by traversing the fields and adding their values as
+ // properties in a BpPropertySet. A field with a struct value is itself
+ // converted into a BpPropertySet before adding.
+ //
+ // Adding a BpPropertySet is done as follows:
+ // * If no property with the name exists then the BpPropertySet is added
+ // directly to this property. Care must be taken to ensure that it does not
+ // introduce a cycle.
+ // * If a property exists with the name and the current value is a
+ // BpPropertySet then every property of the new BpPropertySet is added to
+ // the existing BpPropertySet.
+ // * Otherwise, if a property exists with the name then it is an error.
AddProperty(name string, value interface{})
// Add a property with an associated tag