diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go index 9237e89b4..b3faae895 100644 --- a/java/dexpreopt_bootjars.go +++ b/java/dexpreopt_bootjars.go @@ -803,10 +803,15 @@ func buildBootImageVariant(ctx android.ModuleContext, image *bootImageVariant, p rule.Build(image.name+"JarsDexpreopt_"+image.target.String(), "dexpreopt "+image.name+" jars "+arch.String()) // save output and installed files for makevars + // TODO - these are always the same and so should be initialized in genBootImageConfigs image.installs = rule.Installs() image.vdexInstalls = vdexInstalls image.unstrippedInstalls = unstrippedInstalls - image.licenseMetadataFile = android.OptionalPathForPath(ctx.LicenseMetadataFile()) + + // Only set the licenseMetadataFile from the active module. + if isActiveModule(ctx.Module()) { + image.licenseMetadataFile = android.OptionalPathForPath(ctx.LicenseMetadataFile()) + } return bootImageVariantOutputs{ image, diff --git a/sdk/bootclasspath_fragment_sdk_test.go b/sdk/bootclasspath_fragment_sdk_test.go index 6faa0c5b9..1b64130ce 100644 --- a/sdk/bootclasspath_fragment_sdk_test.go +++ b/sdk/bootclasspath_fragment_sdk_test.go @@ -215,8 +215,7 @@ java_import { // Check the behavior of the snapshot when it is preferred. snapshotTestChecker(checkSnapshotPreferredWithSource, func(t *testing.T, result *android.TestResult) { - // TODO - the expectedLicenseMetadataFile passed here is incorrect as it is for the source module not the prebuilt module. - java.CheckMutatedArtBootImageConfig(t, result, "out/soong/.intermediates/mybootclasspathfragment/android_common_apex10000/meta_lic") + java.CheckMutatedArtBootImageConfig(t, result, "out/soong/.intermediates/snapshot/prebuilt_mybootclasspathfragment/android_common_com.android.art/meta_lic") java.CheckMutatedFrameworkBootImageConfig(t, result, "out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/meta_lic") }), )