Merge "Revert "Change test_module_config from copying files to symlink ..."" into main am: d5e16ac52b am: 43f3e5557e

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

Change-Id: I21723557018b278e5e87dc4eaccb34b4fa785a8d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/aconfig/codegen/cc_aconfig_library.go b/aconfig/codegen/cc_aconfig_library.go
index ec0a6b6..b5cf687 100644
--- a/aconfig/codegen/cc_aconfig_library.go
+++ b/aconfig/codegen/cc_aconfig_library.go
@@ -156,7 +156,7 @@
 		Args: map[string]string{
 			"gendir": this.generatedDir.String(),
 			"mode":   mode,
-			"debug":  strconv.FormatBool(ctx.Config().ReleaseReadFromNewStorageCc()),
+			"debug":  strconv.FormatBool(ctx.Config().ReleaseReadFromNewStorage()),
 		},
 	})
 
diff --git a/aconfig/codegen/init.go b/aconfig/codegen/init.go
index 6182e14..98d288f 100644
--- a/aconfig/codegen/init.go
+++ b/aconfig/codegen/init.go
@@ -64,11 +64,12 @@
 				` && ${aconfig} create-rust-lib` +
 				`    --mode ${mode}` +
 				`    --cache ${in}` +
+				`    --allow-instrumentation ${debug}` +
 				`    --out ${gendir}`,
 			CommandDeps: []string{
 				"$aconfig",
 			},
-		}, "gendir", "mode")
+		}, "gendir", "mode", "debug")
 )
 
 func init() {
diff --git a/aconfig/codegen/rust_aconfig_library.go b/aconfig/codegen/rust_aconfig_library.go
index ad8d632..4b896c3 100644
--- a/aconfig/codegen/rust_aconfig_library.go
+++ b/aconfig/codegen/rust_aconfig_library.go
@@ -2,6 +2,7 @@
 
 import (
 	"fmt"
+	"strconv"
 
 	"android/soong/android"
 	"android/soong/rust"
@@ -82,6 +83,7 @@
 		Args: map[string]string{
 			"gendir": generatedDir.String(),
 			"mode":   mode,
+			"debug":  strconv.FormatBool(ctx.Config().ReleaseReadFromNewStorage()),
 		},
 	})
 	a.BaseSourceProvider.OutputFiles = android.Paths{generatedSource}
diff --git a/android/api_levels.go b/android/api_levels.go
index fab5fc7..8f2ff17 100644
--- a/android/api_levels.go
+++ b/android/api_levels.go
@@ -442,26 +442,27 @@
 
 func getApiLevelsMapReleasedVersions() (map[string]int, error) {
 	return map[string]int{
-		"G":              9,
-		"I":              14,
-		"J":              16,
-		"J-MR1":          17,
-		"J-MR2":          18,
-		"K":              19,
-		"L":              21,
-		"L-MR1":          22,
-		"M":              23,
-		"N":              24,
-		"N-MR1":          25,
-		"O":              26,
-		"O-MR1":          27,
-		"P":              28,
-		"Q":              29,
-		"R":              30,
-		"S":              31,
-		"S-V2":           32,
-		"Tiramisu":       33,
-		"UpsideDownCake": 34,
+		"G":               9,
+		"I":               14,
+		"J":               16,
+		"J-MR1":           17,
+		"J-MR2":           18,
+		"K":               19,
+		"L":               21,
+		"L-MR1":           22,
+		"M":               23,
+		"N":               24,
+		"N-MR1":           25,
+		"O":               26,
+		"O-MR1":           27,
+		"P":               28,
+		"Q":               29,
+		"R":               30,
+		"S":               31,
+		"S-V2":            32,
+		"Tiramisu":        33,
+		"UpsideDownCake":  34,
+		"VanillaIceCream": 35,
 	}, nil
 }
 
diff --git a/android/config.go b/android/config.go
index 5a6d40f..b144a69 100644
--- a/android/config.go
+++ b/android/config.go
@@ -239,6 +239,11 @@
 		Bool(c.config.productVariables.HiddenapiExportableStubs)
 }
 
+// Enable read flag from new storage
+func (c Config) ReleaseReadFromNewStorage() bool {
+	return c.config.productVariables.GetBuildFlagBool("RELEASE_READ_FROM_NEW_STORAGE")
+}
+
 // A DeviceConfig object represents the configuration for a particular device
 // being built. For now there will only be one of these, but in the future there
 // may be multiple devices being built.
diff --git a/java/base.go b/java/base.go
index c70526b..b4f800b 100644
--- a/java/base.go
+++ b/java/base.go
@@ -94,9 +94,6 @@
 	// if not blank, used as prefix to generate repackage rule
 	Jarjar_prefix *string
 
-	// if set to true, skip the jarjar repackaging
-	Skip_jarjar_repackage *bool
-
 	// If not blank, set the java version passed to javac as -source and -target
 	Java_version *string
 
@@ -1112,13 +1109,11 @@
 	jarjarProviderData := j.collectJarJarRules(ctx)
 	if jarjarProviderData != nil {
 		android.SetProvider(ctx, JarJarProvider, *jarjarProviderData)
-		if !proptools.Bool(j.properties.Skip_jarjar_repackage) {
-			text := getJarJarRuleText(jarjarProviderData)
-			if text != "" {
-				ruleTextFile := android.PathForModuleOut(ctx, "repackaged-jarjar", "repackaging.txt")
-				android.WriteFileRule(ctx, ruleTextFile, text)
-				j.repackageJarjarRules = ruleTextFile
-			}
+		text := getJarJarRuleText(jarjarProviderData)
+		if text != "" {
+			ruleTextFile := android.PathForModuleOut(ctx, "repackaged-jarjar", "repackaging.txt")
+			android.WriteFileRule(ctx, ruleTextFile, text)
+			j.repackageJarjarRules = ruleTextFile
 		}
 	}
 
diff --git a/java/config/config.go b/java/config/config.go
index 2bb50f6..0d30fbd 100644
--- a/java/config/config.go
+++ b/java/config/config.go
@@ -51,6 +51,7 @@
 		"core-icu4j",
 		"core-oj",
 		"core-libart",
+		"wear-sdk.impl",
 	}
 )