From 2fc72f66d06ecaa08b35a206db7fd8f0f2de5c39 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 21 Dec 2018 12:59:54 -0800 Subject: Remove duplicated shouldUncompressDex logic shouldUncompressDex has already been computed and stored in deviceProperties.UncompressDex, pass it to dexpreopter instead of recomputing it. Also add a stub for java libraries to set UncompressDex. Test: no change to build.ninja Change-Id: I663d9fbbe768a8dc9a97c7d456dd7a010f43162d --- java/java.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 5e67193f0..8b8e4ba50 100644 --- a/java/java.go +++ b/java/java.go @@ -1327,6 +1327,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path j.dexJarFile = dexOutputFile j.dexpreopter.isInstallable = Bool(j.properties.Installable) + j.dexpreopter.uncompressedDex = j.deviceProperties.UncompressDex dexOutputFile = j.dexpreopt(ctx, dexOutputFile) j.maybeStrippedDexJarFile = dexOutputFile @@ -1499,9 +1500,14 @@ type Library struct { Module } +func (j *Library) shouldUncompressDex(ctx android.ModuleContext) bool { + return false +} + func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) { j.dexpreopter.installPath = android.PathForModuleInstall(ctx, "framework", ctx.ModuleName()+".jar") j.dexpreopter.isSDKLibrary = j.deviceProperties.IsSDKLibrary + j.deviceProperties.UncompressDex = j.shouldUncompressDex(ctx) j.compile(ctx) if Bool(j.properties.Installable) || ctx.Host() { -- cgit v1.2.3-59-g8ed1b