Revert "Never strip and store dex files uncompressed when they are preopted on system."

This reverts commit 4bb0106759.

Reason for revert: b/123436620

Change-Id: Ia7595ace4b76abaa99dbb651e7d2f088dec5bad9
This commit is contained in:
Colin Cross
2019-02-11 19:30:46 +00:00
parent 4bb0106759
commit 67e8ec1973
6 changed files with 19 additions and 68 deletions

View File

@@ -1239,6 +1239,8 @@ 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
@@ -1415,13 +1417,10 @@ type Library struct {
}
func (j *Library) shouldUncompressDex(ctx android.ModuleContext) bool {
// 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)) {
// 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()) {
return true
}
if ctx.Config().UncompressPrivAppDex() &&
@@ -1435,9 +1434,7 @@ 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.dexpreopter.isInstallable = Bool(j.properties.Installable)
j.dexpreopter.uncompressedDex = j.shouldUncompressDex(ctx)
j.deviceProperties.UncompressDex = j.dexpreopter.uncompressedDex
j.deviceProperties.UncompressDex = j.shouldUncompressDex(ctx)
j.compile(ctx)
if (Bool(j.properties.Installable) || ctx.Host()) && !android.DirectlyInAnyApex(ctx, ctx.ModuleName()) {