diff options
Diffstat (limited to 'android')
| -rw-r--r-- | android/config.go | 2 | ||||
| -rw-r--r-- | android/module.go | 23 | ||||
| -rw-r--r-- | android/module_test.go | 26 |
3 files changed, 49 insertions, 2 deletions
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) +} |