Add InstallForceOS, fix testcases for host
Robolectric tests compile against device modules but are installed
and run as host modules. Allow a module to override its install
OS.
Test: TestPathForModuleInstall
Change-Id: Icf37bb3d4cc1222a9b079602c6a5fdb8b51c86ed
diff --git a/android/module.go b/android/module.go
index 96c2e1e..2a2f5ad 100644
--- a/android/module.go
+++ b/android/module.go
@@ -172,6 +172,7 @@
InstallInRecovery() bool
InstallInRoot() bool
InstallBypassMake() bool
+ InstallForceOS() *OsType
RequiredModuleNames() []string
HostRequiredModuleNames() []string
@@ -213,6 +214,7 @@
InstallInRecovery() bool
InstallInRoot() bool
InstallBypassMake() bool
+ InstallForceOS() *OsType
SkipInstall()
ExportedToMake() bool
NoticeFile() OptionalPath
@@ -893,6 +895,10 @@
return false
}
+func (m *ModuleBase) InstallForceOS() *OsType {
+ return nil
+}
+
func (m *ModuleBase) Owner() string {
return String(m.commonProperties.Owner)
}
@@ -1683,6 +1689,10 @@
return m.module.InstallBypassMake()
}
+func (m *moduleContext) InstallForceOS() *OsType {
+ return m.module.InstallForceOS()
+}
+
func (m *moduleContext) skipInstall(fullInstallPath InstallPath) bool {
if m.module.base().commonProperties.SkipInstall {
return true