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
diff --git a/java/java.go b/java/java.go
index 5e67193..8b8e4ba 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1327,6 +1327,7 @@
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 @@
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() {