diff options
Diffstat (limited to 'dexpreopt/config.go')
-rw-r--r-- | dexpreopt/config.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/dexpreopt/config.go b/dexpreopt/config.go index 609a29c2d..0cc3bd63b 100644 --- a/dexpreopt/config.go +++ b/dexpreopt/config.go @@ -475,7 +475,16 @@ func RegisterToolDeps(ctx android.BottomUpMutatorContext) { ctx.AddFarVariationDependencies(v, Dex2oatDepTag, dex2oatBin) } +func IsDex2oatNeeded(ctx android.PathContext) bool { + global := GetGlobalConfig(ctx) + return !global.DisablePreopt || !global.DisablePreoptBootImages +} + func dex2oatPathFromDep(ctx android.ModuleContext) android.Path { + if !IsDex2oatNeeded(ctx) { + return nil + } + dex2oatBin := dex2oatModuleName(ctx.Config()) // Find the right dex2oat module, trying to follow PrebuiltDepTag from source |