summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Jiakai Zhang <jiakaiz@google.com> 2021-09-30 09:32:57 +0000
committer Jiakai Zhang <jiakaiz@google.com> 2021-09-30 13:31:28 +0000
commit5b24f721fd08c0d43f973167d21647caf2e56f39 (patch)
tree0da9a43279d0a227222d95b8f1c3d6b29da281ca /java/java.go
parent6a779a4b5026e4b693c0ca336eb09420c76262c8 (diff)
Preopt APEX system server jars for java_import.
Similar to aosp/1821985, but for java_import. Bug: 194150908 Test: See the next CL. Change-Id: Ied1cfb1a7e1c2eea502b74b0d6e2344bcd02155e
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/java/java.go b/java/java.go
index 94c12bdbb..73ba78b3a 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1360,10 +1360,19 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) {
if dexOutputPath := di.PrebuiltExportPath(apexRootRelativePathToJavaLib(j.BaseModuleName())); dexOutputPath != nil {
dexJarFile := makeDexJarPathFromPath(dexOutputPath)
j.dexJarFile = dexJarFile
- j.dexJarInstallFile = android.PathForModuleInPartitionInstall(ctx, "apex", ai.ApexVariationName, apexRootRelativePathToJavaLib(j.BaseModuleName()))
+ installPath := android.PathForModuleInPartitionInstall(ctx, "apex", ai.ApexVariationName, apexRootRelativePathToJavaLib(j.BaseModuleName()))
+ j.dexJarInstallFile = installPath
// Initialize the hiddenapi structure.
j.initHiddenAPI(ctx, dexJarFile, outputFile, nil)
+
+ j.dexpreopter.installPath = j.dexpreopter.getInstallPath(ctx, installPath)
+ if j.dexProperties.Uncompress_dex == nil {
+ // If the value was not force-set by the user, use reasonable default based on the module.
+ j.dexProperties.Uncompress_dex = proptools.BoolPtr(shouldUncompressDex(ctx, &j.dexpreopter))
+ }
+ j.dexpreopter.uncompressedDex = *j.dexProperties.Uncompress_dex
+ j.dexpreopt(ctx, dexOutputPath)
} else {
// This should never happen as a variant for a prebuilt_apex is only created if the
// prebuilt_apex has been configured to export the java library dex file.