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/dexpreopt.go b/java/dexpreopt.go
index 1dc3e9f..ce51aba 100644
--- a/java/dexpreopt.go
+++ b/java/dexpreopt.go
@@ -28,11 +28,11 @@
type dexpreopter struct {
dexpreoptProperties DexpreoptProperties
- installPath android.OutputPath
- isPrivApp bool
- isSDKLibrary bool
- isTest bool
- isInstallable bool
+ installPath android.OutputPath
+ uncompressedDex bool
+ isSDKLibrary bool
+ isTest bool
+ isInstallable bool
builtInstalled []string
}
@@ -145,19 +145,13 @@
deps = append(deps, profileClassListing.Path())
}
- uncompressedDex := false
- if ctx.Config().UncompressPrivAppDex() &&
- (d.isPrivApp || inList(ctx.ModuleName(), ctx.Config().ModulesLoadedByPrivilegedModules())) {
- uncompressedDex = true
- }
-
dexpreoptConfig := dexpreopt.ModuleConfig{
Name: ctx.ModuleName(),
DexLocation: dexLocation,
BuildPath: android.PathForModuleOut(ctx, "dexpreopt", ctx.ModuleName()+".jar").String(),
DexPath: dexJarFile.String(),
PreferCodeIntegrity: false,
- UncompressedDex: uncompressedDex,
+ UncompressedDex: d.uncompressedDex,
HasApkLibraries: false,
PreoptFlags: nil,