summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2019-02-12 13:12:16 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2019-02-13 11:59:20 +0000
commitfa6e9ec003d733006be10978599f62869ef2c6bd (patch)
treea9160e6ec00d7c73f29c18de7f744a9149d9d19a /java/java.go
parent40e26a2a995dabed6129f774d84c6363c833f192 (diff)
Revert "Revert "Never strip and store dex files uncompressed when they are preopted on system.""
This reverts commit 67e8ec1973700bbdbc4cd68b3493d56d270ca377. Test: build && atest android.text.cts.EmojiTest#testEmojiGlyphWebView on Cuttlefish Exempt-From-Owner-Approval: Got +2 from Colin, latest PS is a rebase across conflicts. Change-Id: I99faf0f2ec698d70c107516bd43756b9ddcb90d0
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/java/java.go b/java/java.go
index 2c7c1f638..76b41ca9e 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1239,8 +1239,6 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path
j.dexJarFile = dexOutputFile
// Dexpreopting
- j.dexpreopter.isInstallable = Bool(j.properties.Installable)
- j.dexpreopter.uncompressedDex = j.deviceProperties.UncompressDex
dexOutputFile = j.dexpreopt(ctx, dexOutputFile)
j.maybeStrippedDexJarFile = dexOutputFile
@@ -1417,10 +1415,13 @@ type Library struct {
}
func (j *Library) shouldUncompressDex(ctx android.ModuleContext) bool {
- // Store uncompressed (and do not strip) dex files from boot class path jars that are
- // in an apex.
- if inList(ctx.ModuleName(), ctx.Config().BootJars()) &&
- android.DirectlyInAnyApex(ctx, ctx.ModuleName()) {
+ // Store uncompressed (and do not strip) dex files from boot class path jars.
+ if inList(ctx.ModuleName(), ctx.Config().BootJars()) {
+ return true
+ }
+
+ // Store uncompressed dex files that are preopted on /system.
+ if !j.dexpreopter.dexpreoptDisabled(ctx) && (ctx.Host() || !odexOnSystemOther(ctx, j.dexpreopter.installPath)) {
return true
}
if ctx.Config().UncompressPrivAppDex() &&
@@ -1434,7 +1435,9 @@ func (j *Library) shouldUncompressDex(ctx android.ModuleContext) bool {
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.dexpreopter.isInstallable = Bool(j.properties.Installable)
+ j.dexpreopter.uncompressedDex = j.shouldUncompressDex(ctx)
+ j.deviceProperties.UncompressDex = j.dexpreopter.uncompressedDex
j.compile(ctx)
if (Bool(j.properties.Installable) || ctx.Host()) && !android.DirectlyInAnyApex(ctx, ctx.ModuleName()) {