APEX certificates can be overriden by PRODUCT_CERTIFICATE_OVERRIDES

Test: m (apex_test amended)
Change-Id: I9b66a250c9ca20ad754e12455de2b444cf19b1fa
This commit is contained in:
Jiyong Park
2019-02-11 11:38:15 +09:00
parent 1151247c29
commit b2742fdec9
2 changed files with 45 additions and 18 deletions

View File

@@ -517,12 +517,20 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
}
ctx.AddDependency(ctx.Module(), keyTag, String(a.properties.Key))
cert := android.SrcIsModule(String(a.properties.Certificate))
cert := android.SrcIsModule(a.getCertString(ctx))
if cert != "" {
ctx.AddDependency(ctx.Module(), certificateTag, cert)
}
}
func (a *apexBundle) getCertString(ctx android.BaseContext) string {
certificate, overridden := ctx.DeviceConfig().OverrideCertificateFor(ctx.ModuleName())
if overridden {
return ":" + certificate
}
return String(a.properties.Certificate)
}
func (a *apexBundle) Srcs() android.Paths {
if file, ok := a.outputFiles[imageApex]; ok {
return android.Paths{file}