Merge changes I898a94ba,I654c8eb7 into main
* changes:
Skip recovery.img in Soong target_files.zip
Get filesystemInfo from Super_image dep
diff --git a/android/config.go b/android/config.go
index 87aacd5..407156d 100644
--- a/android/config.go
+++ b/android/config.go
@@ -2175,6 +2175,10 @@
return c.productVariables.GetBuildFlagBool("RELEASE_USE_TRANSITIVE_JARS_IN_CLASSPATH")
}
+func (c *config) UseR8OnlyRuntimeVisibleAnnotations() bool {
+ return c.productVariables.GetBuildFlagBool("RELEASE_R8_ONLY_RUNTIME_VISIBLE_ANNOTATIONS")
+}
+
func (c *config) UseR8StoreStoreFenceConstructorInlining() bool {
return c.productVariables.GetBuildFlagBool("RELEASE_R8_STORE_STORE_FENCE_CONSTRUCTOR_INLINING")
}
diff --git a/apex/apex_test.go b/apex/apex_test.go
index e1a9582..c123d03 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -7090,6 +7090,34 @@
`)
}
+func TestApexValidation_UsesProperPartitionTag(t *testing.T) {
+ t.Parallel()
+ ctx := testApex(t, `
+ apex {
+ name: "myapex",
+ key: "myapex.key",
+ updatable: false,
+ vendor: true,
+ }
+ apex_key {
+ name: "myapex.key",
+ public_key: "testkey.avbpubkey",
+ private_key: "testkey.pem",
+ }
+ `, android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
+ // vendor path should not affect "partition tag"
+ variables.VendorPath = proptools.StringPtr("system/vendor")
+ }))
+
+ module := ctx.ModuleForTests("myapex", "android_common_myapex")
+ android.AssertStringEquals(t, "partition tag for host_apex_verifier",
+ "vendor",
+ module.Output("host_apex_verifier.timestamp").Args["partition_tag"])
+ android.AssertStringEquals(t, "partition tag for apex_sepolicy_tests",
+ "vendor",
+ module.Output("apex_sepolicy_tests.timestamp").Args["partition_tag"])
+}
+
func TestApexValidation_TestApexCanSkipInitRcCheck(t *testing.T) {
t.Parallel()
ctx := testApex(t, `
diff --git a/apex/builder.go b/apex/builder.go
index d9348c5..daba6f1 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -1202,6 +1202,22 @@
return timestamp
}
+// Can't use PartitionTag() because PartitionTag() returns the partition this module is actually
+// installed (e.g. PartitionTag() may return "system" for vendor apex when vendor is linked to /system/vendor)
+func (a *apexBundle) partition() string {
+ if a.SocSpecific() {
+ return "vendor"
+ } else if a.DeviceSpecific() {
+ return "odm"
+ } else if a.ProductSpecific() {
+ return "product"
+ } else if a.SystemExtSpecific() {
+ return "system_ext"
+ } else {
+ return "system"
+ }
+}
+
// Runs apex_sepolicy_tests
//
// $ apex-ls -Z {apex_file} > {file_contexts}
@@ -1213,7 +1229,7 @@
Input: apexFile,
Output: timestamp,
Args: map[string]string{
- "partition_tag": a.PartitionTag(ctx.DeviceConfig()),
+ "partition_tag": a.partition(),
},
})
return timestamp
@@ -1240,7 +1256,7 @@
Input: apexFile,
Output: timestamp,
Args: map[string]string{
- "partition_tag": a.PartitionTag(ctx.DeviceConfig()),
+ "partition_tag": a.partition(),
},
})
return timestamp
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 993c46e..a315160 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -218,6 +218,10 @@
// Name of the output. Default is $(module_name).img
Stem *string
+
+ // The size of the partition on the device. It will be a build error if this built partition
+ // image exceeds this size.
+ Partition_size *int64
}
type AndroidFilesystemDeps struct {
@@ -672,6 +676,10 @@
copyImageFileToProductOut(ctx, builder, f.partitionName(), output)
}
+ if f.properties.Partition_size != nil {
+ assertMaxImageSize(builder, output, *f.properties.Partition_size, false)
+ }
+
// rootDir is not deleted. Might be useful for quick inspection.
builder.Build("build_filesystem_image", fmt.Sprintf("Creating filesystem %s", f.BaseModuleName()))
@@ -809,6 +817,10 @@
}
f.checkFsTypePropertyError(ctx, fst, fsTypeStr(fst))
+ if f.properties.Partition_size != nil {
+ addStr("partition_size", strconv.FormatInt(*f.properties.Partition_size, 10))
+ }
+
propFilePreProcessing := android.PathForModuleOut(ctx, "prop_pre_processing")
android.WriteFileRuleVerbatim(ctx, propFilePreProcessing, propFileString.String())
propFile := android.PathForModuleOut(ctx, "prop")
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go
index 9d61a60..8dfbd64 100644
--- a/fsgen/filesystem_creator.go
+++ b/fsgen/filesystem_creator.go
@@ -374,8 +374,14 @@
fsProps.Security_patch = proptools.StringPtr(partitionVars.OdmSecurityPatch)
fsProps.Stem = proptools.StringPtr("odm.img")
case "userdata":
- fsProps.Base_dir = proptools.StringPtr("data")
fsProps.Stem = proptools.StringPtr("userdata.img")
+ if vars, ok := partitionVars.PartitionQualifiedVariables["userdata"]; ok {
+ parsed, err := strconv.ParseInt(vars.BoardPartitionSize, 10, 64)
+ if err != nil {
+ panic(fmt.Sprintf("Partition size must be an int, got %s", vars.BoardPartitionSize))
+ }
+ fsProps.Partition_size = &parsed
+ }
case "ramdisk":
// Following the logic in https://cs.android.com/android/platform/superproject/main/+/c3c5063df32748a8806ce5da5dd0db158eab9ad9:build/make/core/Makefile;l=1307
fsProps.Dirs = android.NewSimpleConfigurable([]string{
@@ -822,7 +828,13 @@
fsProps.Is_auto_generated = proptools.BoolPtr(true)
if partitionType != "system" {
- fsProps.Mount_point = proptools.StringPtr(partitionType)
+ mountPoint := proptools.StringPtr(partitionType)
+ // https://cs.android.com/android/platform/superproject/main/+/main:build/make/tools/releasetools/build_image.py;l=1012;drc=3f576a753594bad3fc838ccb8b1b72f7efac1d50
+ if partitionType == "userdata" {
+ mountPoint = proptools.StringPtr("data")
+ }
+ fsProps.Mount_point = mountPoint
+
}
partitionSpecificFsProps(ctx, fsProps, partitionVars, partitionType)
diff --git a/java/dex.go b/java/dex.go
index 7b99549..4a7e9dc 100644
--- a/java/dex.go
+++ b/java/dex.go
@@ -49,6 +49,16 @@
// Whether to continue building even if warnings are emitted. Defaults to true.
Ignore_warnings *bool
+ // Whether runtime invisible annotations should be kept by R8. Defaults to false.
+ // This is equivalent to:
+ // -keepattributes RuntimeInvisibleAnnotations,
+ // RuntimeInvisibleParameterAnnotations,
+ // RuntimeInvisibleTypeAnnotations
+ // This is only applicable when RELEASE_R8_ONLY_RUNTIME_VISIBLE_ANNOTATIONS is
+ // enabled and will be used to migrate away from keeping runtime invisible
+ // annotations (b/387958004).
+ Keep_runtime_invisible_annotations *bool
+
// If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
// Defaults to false for apps and tests, true for libraries.
Proguard_compatibility *bool
@@ -364,6 +374,10 @@
r8Flags = append(r8Flags, "--ignore-library-extends-program")
}
+ if BoolDefault(opt.Keep_runtime_invisible_annotations, false) {
+ r8Flags = append(r8Flags, "--keep-runtime-invisible-annotations")
+ }
+
if BoolDefault(opt.Proguard_compatibility, true) {
r8Flags = append(r8Flags, "--force-proguard-compatibility")
}
diff --git a/rust/config/global.go b/rust/config/global.go
index 0a4b314..2623a5c 100644
--- a/rust/config/global.go
+++ b/rust/config/global.go
@@ -25,7 +25,7 @@
var (
pctx = android.NewPackageContext("android/soong/rust/config")
- RustDefaultVersion = "1.81.0"
+ RustDefaultVersion = "1.82.0"
RustDefaultBase = "prebuilts/rust/"
DefaultEdition = "2021"
Stdlibs = []string{