bootclasspath_fragment: Always output contents property in snapshot
Bug: 177892522
Test: m art-module-sdk
- check generated snapshot contains contents property
Change-Id: I122dedba6600a199bfd83b01988da36ddfd09d63
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index 5c6a7b8..2e33c06 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -428,12 +428,7 @@
module := variant.(*BootclasspathFragmentModule)
b.Image_name = module.properties.Image_name
- if b.Image_name == nil {
- // Only one of image_name or contents can be specified. However, if image_name is set then the
- // contents property is updated to match the configuration used to create the corresponding
- // boot image. Therefore, contents property is only copied if the image name is not specified.
- b.Contents = module.properties.Contents
- }
+ b.Contents = module.properties.Contents
// Get the flag file information from the module.
mctx := ctx.SdkModuleContext()
diff --git a/sdk/bootclasspath_fragment_sdk_test.go b/sdk/bootclasspath_fragment_sdk_test.go
index 6fb4141..dcdf852 100644
--- a/sdk/bootclasspath_fragment_sdk_test.go
+++ b/sdk/bootclasspath_fragment_sdk_test.go
@@ -113,6 +113,7 @@
visibility: ["//visibility:public"],
apex_available: ["com.android.art"],
image_name: "art",
+ contents: ["mybootlib"],
}
java_import {
@@ -132,6 +133,7 @@
visibility: ["//visibility:public"],
apex_available: ["com.android.art"],
image_name: "art",
+ contents: ["mysdk_mybootlib@current"],
}
java_import {