Add Gob support of ApiLevel and applicableLicensesPropertyImpl.
Bug: 358427516
Test: Manual tests.
Change-Id: I23ada602ee6c2e21238271b0b286a42ea8461a14
diff --git a/android/licenses.go b/android/licenses.go
index 55f46ae..3877921 100644
--- a/android/licenses.go
+++ b/android/licenses.go
@@ -22,6 +22,7 @@
"sync"
"github.com/google/blueprint"
+ "github.com/google/blueprint/gobtools"
)
// Adds cross-cutting licenses dependency to propagate license metadata through the build system.
@@ -67,6 +68,31 @@
licensesProperty *[]string
}
+type applicableLicensesPropertyImplGob struct {
+ Name string
+ LicensesProperty []string
+}
+
+func (a *applicableLicensesPropertyImpl) ToGob() *applicableLicensesPropertyImplGob {
+ return &applicableLicensesPropertyImplGob{
+ Name: a.name,
+ LicensesProperty: *a.licensesProperty,
+ }
+}
+
+func (a *applicableLicensesPropertyImpl) FromGob(data *applicableLicensesPropertyImplGob) {
+ a.name = data.Name
+ a.licensesProperty = &data.LicensesProperty
+}
+
+func (a applicableLicensesPropertyImpl) GobEncode() ([]byte, error) {
+ return gobtools.CustomGobEncode[applicableLicensesPropertyImplGob](&a)
+}
+
+func (a *applicableLicensesPropertyImpl) GobDecode(data []byte) error {
+ return gobtools.CustomGobDecode[applicableLicensesPropertyImplGob](data, a)
+}
+
func newApplicableLicensesProperty(name string, licensesProperty *[]string) applicableLicensesProperty {
return applicableLicensesPropertyImpl{
name: name,