Merge "Only get dexpreopt config for device modules"

This commit is contained in:
Colin Cross
2021-12-02 05:28:36 +00:00
committed by Gerrit Code Review

View File

@@ -122,13 +122,7 @@ func moduleName(ctx android.BaseModuleContext) string {
} }
func (d *dexpreopter) dexpreoptDisabled(ctx android.BaseModuleContext) bool { func (d *dexpreopter) dexpreoptDisabled(ctx android.BaseModuleContext) bool {
global := dexpreopt.GetGlobalConfig(ctx) if !ctx.Device() {
if global.DisablePreopt {
return true
}
if inList(moduleName(ctx), global.DisablePreoptModules) {
return true return true
} }
@@ -144,7 +138,17 @@ func (d *dexpreopter) dexpreoptDisabled(ctx android.BaseModuleContext) bool {
return true 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 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 // TODO: contains no java code
return false return false