diff options
author | Colin Cross <ccross@android.com> | 2019-06-25 13:35:30 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2019-06-25 22:28:00 -0700 |
commit | 43377eeb3890dcdbc8d5a391c54c5b6062f9d807 (patch) | |
tree | f04c77278075025c7fec86b5f2c2b7930a04c608 /java/app.go | |
parent | d6585fe6e34b3181cdaec3892e5214dbf5d25d5e (diff) | |
download | build_soong-43377eeb3890dcdbc8d5a391c54c5b6062f9d807.tar.gz build_soong-43377eeb3890dcdbc8d5a391c54c5b6062f9d807.tar.bz2 build_soong-43377eeb3890dcdbc8d5a391c54c5b6062f9d807.zip |
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
Merged-In: I91da7116b779ae35c0617ef77dbcb9788902370c
(cherry picked from commit 53a87f523b75f86008c3e0971489a06a6450a670)
Diffstat (limited to 'java/app.go')
-rw-r--r-- | java/app.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/java/app.go b/java/app.go index 8d41b570..ad672ead 100644 --- a/java/app.go +++ b/java/app.go @@ -188,17 +188,18 @@ func (a *AndroidApp) shouldUncompressDex(ctx android.ModuleContext) bool { return true } - if ctx.Config().UnbundledBuild() { - return false - } - - // Uncompress dex in APKs of privileged apps, and modules used by privileged apps. + // Uncompress dex in APKs of privileged apps, and modules used by privileged apps + // (even for unbundled builds, they may be preinstalled as prebuilts). if ctx.Config().UncompressPrivAppDex() && (Bool(a.appProperties.Privileged) || inList(ctx.ModuleName(), ctx.Config().ModulesLoadedByPrivilegedModules())) { return true } + if ctx.Config().UnbundledBuild() { + return false + } + // Uncompress if the dex files is preopted on /system. if !a.dexpreopter.dexpreoptDisabled(ctx) && (ctx.Host() || !odexOnSystemOther(ctx, a.dexpreopter.installPath)) { return true |