Merge "Only get dexpreopt config for device modules" am: c01a5cd705

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1908170

Change-Id: I6dd649e6da6300f5e7be78c2760a559b22d7494b
This commit is contained in:
Colin Cross 2021-12-02 05:51:14 +00:00 committed by Automerger Merge Worker
commit ceb543994b

View file

@ -122,13 +122,7 @@ func moduleName(ctx android.BaseModuleContext) string {
}
func (d *dexpreopter) dexpreoptDisabled(ctx android.BaseModuleContext) bool {
global := dexpreopt.GetGlobalConfig(ctx)
if global.DisablePreopt {
return true
}
if inList(moduleName(ctx), global.DisablePreoptModules) {
if !ctx.Device() {
return true
}
@ -144,7 +138,17 @@ func (d *dexpreopter) dexpreoptDisabled(ctx android.BaseModuleContext) bool {
return true
}
if ctx.Host() {
if !android.IsModulePreferred(ctx.Module()) {
return true
}
global := dexpreopt.GetGlobalConfig(ctx)
if global.DisablePreopt {
return true
}
if inList(moduleName(ctx), global.DisablePreoptModules) {
return true
}
@ -161,10 +165,6 @@ func (d *dexpreopter) dexpreoptDisabled(ctx android.BaseModuleContext) bool {
}
}
if !android.IsModulePreferred(ctx.Module()) {
return true
}
// TODO: contains no java code
return false