Implement `host_required` and `target_required` properties.
They are counterparts of LOCAL_HOST_REQUIRED_MODULES and
LOCAL_TARGET_REQUIRED_MODULES respectively.
Fixes: 128693436
Test: treehugger, convert cts/hostsidetests/devicepolicy/Android.bp
Change-Id: Id66ffca6edffe18993ac51e8930f1d0e78178249
diff --git a/android/module.go b/android/module.go
index 201c27a..93966e1 100644
--- a/android/module.go
+++ b/android/module.go
@@ -133,6 +133,8 @@
InstallInRecovery() bool
RequiredModuleNames() []string
+ HostRequiredModuleNames() []string
+ TargetRequiredModuleNames() []string
// android.ModuleContext methods
// These are duplicated instead of embedded so that can eventually be wrapped to take an
@@ -269,6 +271,12 @@
// names of other modules to install if this module is installed
Required []string `android:"arch_variant"`
+ // names of other modules to install on host if this module is installed
+ Host_required []string `android:"arch_variant"`
+
+ // names of other modules to install on target if this module is installed
+ Target_required []string `android:"arch_variant"`
+
// relative path to a file to include in the list of notices for the device
Notice *string `android:"path"`
@@ -1459,6 +1467,14 @@
return ctx.module.base().commonProperties.Required
}
+func (ctx *androidModuleContext) HostRequiredModuleNames() []string {
+ return ctx.module.base().commonProperties.Host_required
+}
+
+func (ctx *androidModuleContext) TargetRequiredModuleNames() []string {
+ return ctx.module.base().commonProperties.Target_required
+}
+
func (ctx *androidModuleContext) Glob(globPattern string, excludes []string) Paths {
ret, err := ctx.GlobWithDeps(globPattern, excludes)
if err != nil {