Add defaults modules for avb modules

Bug: 302465542
Test: build
Change-Id: I5bb5a0241d40cf142ed8bbefb76bc8a3709c3e34
diff --git a/filesystem/avb_add_hash_footer.go b/filesystem/avb_add_hash_footer.go
index dabbc46..ead579f 100644
--- a/filesystem/avb_add_hash_footer.go
+++ b/filesystem/avb_add_hash_footer.go
@@ -25,6 +25,7 @@
 
 type avbAddHashFooter struct {
 	android.ModuleBase
+	android.DefaultableModuleBase
 
 	properties avbAddHashFooterProperties
 
@@ -80,6 +81,7 @@
 	module := &avbAddHashFooter{}
 	module.AddProperties(&module.properties)
 	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
+	android.InitDefaultableModule(module)
 	return module
 }
 
@@ -206,3 +208,19 @@
 func (a *avbAddHashFooter) Srcs() android.Paths {
 	return append(android.Paths{}, a.output)
 }
+
+type avbAddHashFooterDefaults struct {
+	android.ModuleBase
+	android.DefaultsModuleBase
+}
+
+// avb_add_hash_footer_defaults provides a set of properties that can be inherited by other
+// avb_add_hash_footer modules. A module can use the properties from an avb_add_hash_footer_defaults
+// using `defaults: ["<:default_module_name>"]`. Properties of both modules are erged (when
+// possible) by prepending the default module's values to the depending module's values.
+func avbAddHashFooterDefaultsFactory() android.Module {
+	module := &avbAddHashFooterDefaults{}
+	module.AddProperties(&avbAddHashFooterProperties{})
+	android.InitDefaultsModule(module)
+	return module
+}