Uncompress dex in unbundled privileged apps
Mainline builds privileged apps unbundled and then uses them as
prebuilts, so they need to respect the privileged flag when
deciding whether or not to uncompress the dex.
Bug: 135772877
Test: TestUncompressDex
Change-Id: I91da7116b779ae35c0617ef77dbcb9788902370c
diff --git a/java/app.go b/java/app.go
index 42f8bad..f58b0f8 100644
--- a/java/app.go
+++ b/java/app.go
@@ -229,15 +229,16 @@
return true
}
- if ctx.Config().UnbundledBuild() {
- return false
- }
-
- // Uncompress dex in APKs of privileged apps
+ // Uncompress dex in APKs of privileged apps (even for unbundled builds, they may
+ // be preinstalled as prebuilts).
if ctx.Config().UncompressPrivAppDex() && Bool(a.appProperties.Privileged) {
return true
}
+ if ctx.Config().UnbundledBuild() {
+ return false
+ }
+
return shouldUncompressDex(ctx, &a.dexpreopter)
}