Pass along local resource fraction to reproxy am: dbc313375a am: 3f87c8cd8b

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

Change-Id: I79014a559f1c48fb34cc62381dc95ca763a0b672
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/android/api_levels.go b/android/api_levels.go
index 93583bc..a337371 100644
--- a/android/api_levels.go
+++ b/android/api_levels.go
@@ -290,6 +290,7 @@
 			"Q":     29,
 			"R":     30,
 			"S":     31,
+			"S-V2":  32,
 		}
 
 		// TODO: Differentiate "current" and "future".
@@ -333,6 +334,7 @@
 			"Q":     29,
 			"R":     30,
 			"S":     31,
+			"S-V2":  32,
 		}
 		for i, codename := range config.PlatformVersionActiveCodenames() {
 			apiLevelsMap[codename] = previewAPILevelBase + i
diff --git a/android/arch.go b/android/arch.go
index bb1b613..6af047c 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -1522,10 +1522,12 @@
 	return PrefixInList(arch.Abi, "arm")
 }
 
-// hasArmArch returns true if targets has at least non-native_bridge arm Android arch
+// hasArmAndroidArch returns true if targets has at least
+// one arm Android arch (possibly native bridged)
 func hasArmAndroidArch(targets []Target) bool {
 	for _, target := range targets {
-		if target.Os == Android && target.Arch.ArchType == Arm {
+		if target.Os == Android &&
+			(target.Arch.ArchType == Arm || target.Arch.ArchType == Arm64) {
 			return true
 		}
 	}
diff --git a/android/variable.go b/android/variable.go
index 0dc5262..741d9ae 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -101,6 +101,8 @@
 				Keep_symbols                 *bool
 				Keep_symbols_and_debug_frame *bool
 			}
+			Srcs         []string
+			Exclude_srcs []string
 		}
 
 		// eng is true for -eng builds, and can be used to turn on additionaly heavyweight debugging
diff --git a/apex/apex_singleton.go b/apex/apex_singleton.go
index 9823842..6faed70 100644
--- a/apex/apex_singleton.go
+++ b/apex/apex_singleton.go
@@ -59,8 +59,15 @@
 				echo "******************************";
 				echo "Detected changes to allowed dependencies in updatable modules.";
 				echo "To fix and update packages/modules/common/build/allowed_deps.txt, please run:";
-				echo "$$ (croot && packages/modules/common/build/update-apex-allowed-deps.sh)";
-				echo "Members of mainline-modularization@google.com will review the changes.";
+				echo -e "$$ (croot && packages/modules/common/build/update-apex-allowed-deps.sh)\n";
+				echo "When submitting the generated CL, you must include the following information";
+				echo "in the commit message if you are adding a new dependency:";
+				echo "Apex-Size-Increase:";
+				echo "Previous-Platform-Support:";
+				echo "Aosp-First:";
+				echo "Test-Info:";
+				echo "You do not need OWNERS approval to submit the change, but mainline-modularization@";
+				echo "will periodically review additions and may require changes.";
 				echo -e "******************************\n";
 				exit 1;
 			fi;
diff --git a/cc/config/arm64_device.go b/cc/config/arm64_device.go
index 864fba1..dbc9c38 100644
--- a/cc/config/arm64_device.go
+++ b/cc/config/arm64_device.go
@@ -33,7 +33,9 @@
 		},
 		"armv8-a-branchprot": []string{
 			"-march=armv8-a",
-			"-mbranch-protection=standard",
+			// Disable BTI until drm vendors stop using OS libraries as sources
+			// of gadgets (https://issuetracker.google.com/216395195).
+			"-mbranch-protection=pac-ret",
 		},
 		"armv8-2a": []string{
 			"-march=armv8.2-a",
diff --git a/cmd/multiproduct_kati/main.go b/cmd/multiproduct_kati/main.go
index 55a5470..c7adbbd 100644
--- a/cmd/multiproduct_kati/main.go
+++ b/cmd/multiproduct_kati/main.go
@@ -244,7 +244,7 @@
 		jobs = runtime.NumCPU() / 4
 
 		ramGb := int(config.TotalRAM() / 1024 / 1024 / 1024)
-		if ramJobs := ramGb / 25; ramGb > 0 && jobs > ramJobs {
+		if ramJobs := ramGb / 30; ramGb > 0 && jobs > ramJobs {
 			jobs = ramJobs
 		}
 
diff --git a/java/aar.go b/java/aar.go
index 04727e4..a5cf0fd 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -486,6 +486,18 @@
 	exportedStaticPackages    android.Paths
 }
 
+var _ android.OutputFileProducer = (*AndroidLibrary)(nil)
+
+// For OutputFileProducer interface
+func (a *AndroidLibrary) OutputFiles(tag string) (android.Paths, error) {
+	switch tag {
+	case ".aar":
+		return []android.Path{a.aarFile}, nil
+	default:
+		return a.Library.OutputFiles(tag)
+	}
+}
+
 func (a *AndroidLibrary) ExportedProguardFlagFiles() android.Paths {
 	return a.exportedProguardFlagFiles
 }
diff --git a/rust/benchmark.go b/rust/benchmark.go
index b89f5cd..0e84243 100644
--- a/rust/benchmark.go
+++ b/rust/benchmark.go
@@ -101,6 +101,7 @@
 func (benchmark *benchmarkDecorator) compilerDeps(ctx DepsContext, deps Deps) Deps {
 	deps = benchmark.binaryDecorator.compilerDeps(ctx, deps)
 
+	deps.Rustlibs = append(deps.Rustlibs, "libtest")
 	deps.Rustlibs = append(deps.Rustlibs, "libcriterion")
 
 	return deps
diff --git a/rust/config/global.go b/rust/config/global.go
index 43b49d1..1b56237 100644
--- a/rust/config/global.go
+++ b/rust/config/global.go
@@ -29,7 +29,6 @@
 	DefaultEdition     = "2018"
 	Stdlibs            = []string{
 		"libstd",
-		"libtest",
 	}
 
 	// Mapping between Soong internal arch types and std::env constants.
diff --git a/rust/test.go b/rust/test.go
index 6caa7b1..e95b47c 100644
--- a/rust/test.go
+++ b/rust/test.go
@@ -169,3 +169,11 @@
 func (test *testDecorator) stdLinkage(ctx *depsContext) RustLinkage {
 	return RlibLinkage
 }
+
+func (test *testDecorator) compilerDeps(ctx DepsContext, deps Deps) Deps {
+	deps = test.binaryDecorator.compilerDeps(ctx, deps)
+
+	deps.Rustlibs = append(deps.Rustlibs, "libtest")
+
+	return deps
+}
diff --git a/rust/testing.go b/rust/testing.go
index a0f86b2..1e0c5ab 100644
--- a/rust/testing.go
+++ b/rust/testing.go
@@ -162,12 +162,10 @@
 			name: "libtest",
 			crate_name: "test",
 			srcs: ["foo.rs"],
-			no_stdlibs: true,
 			host_supported: true,
 			vendor_available: true,
 			vendor_ramdisk_available: true,
 			native_coverage: false,
-			sysroot: true,
 			apex_available: ["//apex_available:platform", "//apex_available:anyapex"],
 			min_sdk_version: "29",
 		}