diff options
| -rw-r--r-- | aconfig/codegen/cc_aconfig_library.go | 2 | ||||
| -rw-r--r-- | android/config.go | 2 | ||||
| -rw-r--r-- | android/module.go | 23 | ||||
| -rw-r--r-- | android/module_test.go | 26 | ||||
| -rw-r--r-- | cc/generated_cc_library.go | 2 |
5 files changed, 51 insertions, 4 deletions
diff --git a/aconfig/codegen/cc_aconfig_library.go b/aconfig/codegen/cc_aconfig_library.go index b5cf68798..8c4bfe696 100644 --- a/aconfig/codegen/cc_aconfig_library.go +++ b/aconfig/codegen/cc_aconfig_library.go @@ -63,7 +63,7 @@ func CcAconfigLibraryFactory() android.Module { callbacks := &CcAconfigLibraryCallbacks{ properties: &CcAconfigLibraryProperties{}, } - return cc.GeneratedCcLibraryModuleFactory("cc_aconfig_library", callbacks) + return cc.GeneratedCcLibraryModuleFactory(callbacks) } func (this *CcAconfigLibraryCallbacks) GeneratorInit(ctx cc.BaseModuleContext) { diff --git a/android/config.go b/android/config.go index 3ef1470cc..ca20012df 100644 --- a/android/config.go +++ b/android/config.go @@ -1252,7 +1252,7 @@ func (c *config) TidyChecks() string { } func (c *config) LibartImgHostBaseAddress() string { - return "0x60000000" + return "0x70000000" } func (c *config) LibartImgDeviceBaseAddress() string { diff --git a/android/module.go b/android/module.go index e2b7e119a..d6c129ac8 100644 --- a/android/module.go +++ b/android/module.go @@ -1057,8 +1057,29 @@ var vintfDepTag = struct { }{} func addVintfFragmentDeps(ctx BottomUpMutatorContext) { + // Vintf manifests in the recovery partition will be ignored. + if !ctx.Device() || ctx.Module().InstallInRecovery() { + return + } + + deviceConfig := ctx.DeviceConfig() + mod := ctx.Module() - ctx.AddDependency(mod, vintfDepTag, mod.VintfFragmentModuleNames(ctx)...) + vintfModules := ctx.AddDependency(mod, vintfDepTag, mod.VintfFragmentModuleNames(ctx)...) + + modPartition := mod.PartitionTag(deviceConfig) + for _, vintf := range vintfModules { + if vintfModule, ok := vintf.(*vintfFragmentModule); ok { + vintfPartition := vintfModule.PartitionTag(deviceConfig) + if modPartition != vintfPartition { + ctx.ModuleErrorf("Module %q(%q) and Vintf_fragment %q(%q) are installed to different partitions.", + mod.Name(), modPartition, + vintfModule.Name(), vintfPartition) + } + } else { + ctx.ModuleErrorf("Only vintf_fragment type module should be listed in vintf_fragment_modules : %q", vintf.Name()) + } + } } // AddProperties "registers" the provided props diff --git a/android/module_test.go b/android/module_test.go index d64e3a591..d76d9b329 100644 --- a/android/module_test.go +++ b/android/module_test.go @@ -1080,3 +1080,29 @@ func TestOutputFileForModule(t *testing.T) { }) } } + +func TestVintfFragmentModulesChecksPartition(t *testing.T) { + bp := ` + vintf_fragment { + name: "vintfModA", + src: "test_vintf_file", + vendor: true, + } + deps { + name: "modA", + vintf_fragment_modules: [ + "vintfModA", + ] + } + ` + + testPreparer := GroupFixturePreparers( + PrepareForTestWithAndroidBuildComponents, + prepareForModuleTests, + ) + + testPreparer. + ExtendWithErrorHandler(FixtureExpectsOneErrorPattern( + "Module .+ and Vintf_fragment .+ are installed to different partitions.")). + RunTestWithBp(t, bp) +} diff --git a/cc/generated_cc_library.go b/cc/generated_cc_library.go index b1084e4e5..709586b13 100644 --- a/cc/generated_cc_library.go +++ b/cc/generated_cc_library.go @@ -18,7 +18,7 @@ import ( "android/soong/android" ) -func GeneratedCcLibraryModuleFactory(moduleName string, callbacks Generator) android.Module { +func GeneratedCcLibraryModuleFactory(callbacks Generator) android.Module { module, _ := NewLibrary(android.HostAndDeviceSupported) // Can be used as both a static and a shared library. |