summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Ulya Trafimovich <skvadrik@google.com> 2020-01-24 12:19:45 +0000
committer Ulya Trafimovich <skvadrik@google.com> 2020-01-27 10:19:10 +0000
commitf491dde8ea62e8a7e900eec62ff2bce7778a87d6 (patch)
tree5762e2519e90851f4929555c5845ee2fc3baec01 /java/java.go
parent8c94763bf785bd0f408e9bee8182d49ddc9528d4 (diff)
Store uncompressed and aligned DEX files for java libs in APEXes.
Test: aosp_walleye-userdebug boots. Test: In internal, cherry-picked this CL, walleye-userdebug boots. Test: In internal, ensure that DEX file wifi-service.jar in the com.android.wifi APEX is now stored uncompressed: $ zipinfo out/target/product/walleye/apex/com.android.wifi/javalib/wifi-service.jar Archive: out/target/product/walleye/apex/com.android.wifi/javalib/wifi-service.jar Zip file size: 3086879 bytes, number of entries: 3 -rw---- 2.0 fat 3086304 b- stor 08-Jan-01 00:00 classes.dex -rw---- 2.0 fat 339 b- defN 80-Feb-01 00:00 META-INF/proguard/androidx-annotations.pro -rw---- 2.0 fat 45 b- defN 08-Jan-01 00:00 META-INF/MANIFEST.MF 3 files, 3086688 bytes uncompressed, 3086480 bytes compressed: 0.0% Before the change it was: $ zipinfo out/target/product/walleye/apex/com.android.wifi/javalib/wifi-service.jar Archive: out/target/product/walleye/apex/com.android.wifi/javalib/wifi-service.jar Zip file size: 1241938 bytes, number of entries: 3 -rw---- 2.0 fat 3086304 bl defN 08-Jan-01 00:00 classes.dex -rw---- 2.0 fat 339 b- defN 80-Feb-01 00:00 META-INF/proguard/androidx-annotations.pro -rw---- 2.0 fat 45 b- defN 08-Jan-01 00:00 META-INF/MANIFEST.MF 3 files, 3086688 bytes uncompressed, 1241526 bytes compressed: 59.8% Bug: 148099857 Bug: 146984232 Change-Id: Ia302967b280be85665032cc870c5d5d2419586fc
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go
index 4c6a5a5ac..1007a979c 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1741,6 +1741,11 @@ type Library struct {
}
func shouldUncompressDex(ctx android.ModuleContext, dexpreopter *dexpreopter) bool {
+ // Store uncompressed (and aligned) any dex files from jars in APEXes.
+ if am, ok := ctx.Module().(android.ApexModule); ok && !am.IsForPlatform() {
+ return true
+ }
+
// Store uncompressed (and do not strip) dex files from boot class path jars.
if inList(ctx.ModuleName(), ctx.Config().BootJars()) {
return true