diff options
| author | 2019-02-13 11:59:39 +0000 | |
|---|---|---|
| committer | 2019-02-13 11:59:39 +0000 | |
| commit | 59d15c192d29d59ca1247e99a8b656e9d15ec1cf (patch) | |
| tree | 84c08bf383e9e6065323b03b517ce1bf037e8d6f /java/dexpreopt.go | |
| parent | 1151247c2926d9e916099cf121fa6b50cbe23c6a (diff) | |
| parent | fa6e9ec003d733006be10978599f62869ef2c6bd (diff) | |
Merge "Revert "Revert "Never strip and store dex files uncompressed when they are preopted on system."""
Diffstat (limited to 'java/dexpreopt.go')
| -rw-r--r-- | java/dexpreopt.go | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/java/dexpreopt.go b/java/dexpreopt.go index cb6427b8d..a89731ac8 100644 --- a/java/dexpreopt.go +++ b/java/dexpreopt.go @@ -83,11 +83,7 @@ func (d *dexpreopter) dexpreoptDisabled(ctx android.ModuleContext) bool { var dexpreoptGlobalConfigKey = android.NewOnceKey("DexpreoptGlobalConfig") -func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.ModuleOutPath) android.ModuleOutPath { - if d.dexpreoptDisabled(ctx) { - return dexJarFile - } - +func getGlobalConfig(ctx android.ModuleContext) dexpreopt.GlobalConfig { globalConfig := ctx.Config().Once(dexpreoptGlobalConfigKey, func() interface{} { if f := ctx.Config().DexpreoptGlobalConfig(); f != "" { ctx.AddNinjaFileDeps(f) @@ -99,6 +95,19 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo } return dexpreopt.GlobalConfig{} }).(dexpreopt.GlobalConfig) + return globalConfig +} + +func odexOnSystemOther(ctx android.ModuleContext, installPath android.OutputPath) bool { + return dexpreopt.OdexOnSystemOtherByName(ctx.ModuleName(), android.InstallPathToOnDevicePath(ctx, installPath), getGlobalConfig(ctx)) +} + +func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.ModuleOutPath) android.ModuleOutPath { + if d.dexpreoptDisabled(ctx) { + return dexJarFile + } + + globalConfig := getGlobalConfig(ctx) var archs []android.ArchType for _, a := range ctx.MultiTargets() { |