summaryrefslogtreecommitdiff
path: root/android/module_context.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2023-11-29 16:00:16 -0800
committer Colin Cross <ccross@android.com> 2023-12-18 15:07:05 -0800
commitea30d85a65e0b9881ff03228609766ed549d90b4 (patch)
tree01a955c7d97375e67e9926025230bccaf8cfacd1 /android/module_context.go
parent51428c451a73d9d246ccecd045b0b8c76a417df1 (diff)
Remove cc.moduleContext override of android.ModuleContext.*Specific
Overriding android.ModuleContext's implementations of *Specific() methods in cc.moduleContext and then passing that back to android.PathForModuleInstall to affect the install path causes problems if android.ModuleBase.GenerateBuildActions also tries to call android.PathForModuleInstall directly with the android.ModuleContext as it gets a different result. Add InstallIn* methods to the android.Module interface, implement default versions in android.ModuleBase, and override them in cc.Module and rust.Module. Use them in android.PathsForModuleInstall to allow the module to customize the behavior directly. Test: TestInstallPartition Change-Id: I7840e07eae34ac4f4d3490b021143d5f33a83626
Diffstat (limited to 'android/module_context.go')
-rw-r--r--android/module_context.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/android/module_context.go b/android/module_context.go
index 39986df87..81692d5a2 100644
--- a/android/module_context.go
+++ b/android/module_context.go
@@ -181,6 +181,8 @@ type ModuleContext interface {
InstallInDebugRamdisk() bool
InstallInRecovery() bool
InstallInRoot() bool
+ InstallInOdm() bool
+ InstallInProduct() bool
InstallInVendor() bool
InstallForceOS() (*OsType, *ArchType)
@@ -438,6 +440,14 @@ func (m *moduleContext) InstallForceOS() (*OsType, *ArchType) {
return m.module.InstallForceOS()
}
+func (m *moduleContext) InstallInOdm() bool {
+ return m.module.InstallInOdm()
+}
+
+func (m *moduleContext) InstallInProduct() bool {
+ return m.module.InstallInProduct()
+}
+
func (m *moduleContext) InstallInVendor() bool {
return m.module.InstallInVendor()
}