Merge "link type of recovery variant of a vendor module should not be native:vendor"

This commit is contained in:
Treehugger Robot
2018-08-28 14:20:14 +00:00
committed by Gerrit Code Review
3 changed files with 27 additions and 2 deletions

View File

@@ -1067,6 +1067,16 @@ func (a *androidBaseContextImpl) ProductServicesSpecific() bool {
return a.kind == productServicesSpecificModule return a.kind == productServicesSpecificModule
} }
// Makes this module a platform module, i.e. not specific to soc, device,
// product, or product_services.
func (a *ModuleBase) MakeAsPlatform() {
a.commonProperties.Vendor = boolPtr(false)
a.commonProperties.Proprietary = boolPtr(false)
a.commonProperties.Soc_specific = boolPtr(false)
a.commonProperties.Product_specific = boolPtr(false)
a.commonProperties.Product_services_specific = boolPtr(false)
}
func (a *androidModuleContext) InstallInData() bool { func (a *androidModuleContext) InstallInData() bool {
return a.module.InstallInData() return a.module.InstallInData()
} }

View File

@@ -1741,6 +1741,7 @@ func imageMutator(mctx android.BottomUpMutatorContext) {
} else if v == recoveryMode { } else if v == recoveryMode {
m := mod[i].(*Module) m := mod[i].(*Module)
m.Properties.InRecovery = true m.Properties.InRecovery = true
m.MakeAsPlatform()
squashRecoverySrcs(m) squashRecoverySrcs(m)
} }
} }

View File

@@ -158,11 +158,13 @@ func createTestContext(t *testing.T, config android.Config, bp string) *android.
cc_object { cc_object {
name: "crtbegin_so", name: "crtbegin_so",
recovery_available: true, recovery_available: true,
vendor_available: true,
} }
cc_object { cc_object {
name: "crtend_so", name: "crtend_so",
recovery_available: true, recovery_available: true,
vendor_available: true,
} }
cc_library { cc_library {
@@ -236,8 +238,9 @@ func testCcError(t *testing.T, pattern string, bp string) {
} }
const ( const (
coreVariant = "android_arm64_armv8-a_core_shared" coreVariant = "android_arm64_armv8-a_core_shared"
vendorVariant = "android_arm64_armv8-a_vendor_shared" vendorVariant = "android_arm64_armv8-a_vendor_shared"
recoveryVariant = "android_arm64_armv8-a_recovery_shared"
) )
func TestVendorSrc(t *testing.T) { func TestVendorSrc(t *testing.T) {
@@ -1674,6 +1677,11 @@ func TestRecovery(t *testing.T) {
recovery: true, recovery: true,
compile_multilib:"32", compile_multilib:"32",
} }
cc_library_shared {
name: "libHalInRecovery",
recovery_available: true,
vendor: true,
}
`) `)
variants := ctx.ModuleVariantsForTests("librecovery") variants := ctx.ModuleVariantsForTests("librecovery")
@@ -1686,4 +1694,10 @@ func TestRecovery(t *testing.T) {
if android.InList(arm64, variants) { if android.InList(arm64, variants) {
t.Errorf("multilib was set to 32 for librecovery32, but its variants has %s.", arm64) t.Errorf("multilib was set to 32 for librecovery32, but its variants has %s.", arm64)
} }
recoveryModule := ctx.ModuleForTests("libHalInRecovery", recoveryVariant).Module().(*Module)
if !recoveryModule.Platform() {
t.Errorf("recovery variant of libHalInRecovery must not specific to device, soc, or product")
}
} }