Merge "Preopt APEX system server jars for java_import." am: 6f0c1a1e0c am: 3b54c2b055 am: 3c4cfc88ad

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1840056

Change-Id: I0f1ec42860bbcef6216c14ca281156ef72724eb0
This commit is contained in:
Treehugger Robot
2021-10-02 04:16:18 +00:00
committed by Automerger Merge Worker

View File

@@ -1398,10 +1398,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.