Only look for profiles when we have a profile dir
Right now, it's looking for *.prof files at the top of the source
directory.
For devices that don't specify the profile dir (everything on AOSP,
etc), this saves a couple percent of the globs that we check during
every build (and would re-execute if you add or remove files from the
top directory)
Bug: 159845846
Test: treehugger
Change-Id: I10d43422a2b5ae25e6557d435ecc89fe43536dd7
diff --git a/java/dexpreopt.go b/java/dexpreopt.go
index 7f1afd6..f1b7178 100644
--- a/java/dexpreopt.go
+++ b/java/dexpreopt.go
@@ -173,7 +173,7 @@
profileBootListing = android.ExistentPathForSource(ctx,
ctx.ModuleDir(), String(d.dexpreoptProperties.Dex_preopt.Profile)+"-boot")
profileIsTextListing = true
- } else {
+ } else if global.ProfileDir != "" {
profileClassListing = android.ExistentPathForSource(ctx,
global.ProfileDir, ctx.ModuleName()+".prof")
}