Merge "Generate info about the selected apex variant in platform builds" into main
diff --git a/android/apex_contributions.go b/android/apex_contributions.go
index c388aff..c76d9c2 100644
--- a/android/apex_contributions.go
+++ b/android/apex_contributions.go
@@ -27,11 +27,13 @@
 
 func RegisterApexContributionsBuildComponents(ctx RegistrationContext) {
 	ctx.RegisterModuleType("apex_contributions", apexContributionsFactory)
+	ctx.RegisterModuleType("apex_contributions_defaults", apexContributionsDefaultsFactory)
 	ctx.RegisterSingletonModuleType("all_apex_contributions", allApexContributionsFactory)
 }
 
 type apexContributions struct {
 	ModuleBase
+	DefaultableModuleBase
 	properties contributionProps
 }
 
@@ -61,6 +63,7 @@
 	module := &apexContributions{}
 	module.AddProperties(&module.properties)
 	InitAndroidModule(module)
+	InitDefaultableModule(module)
 	return module
 }
 
@@ -70,6 +73,18 @@
 func (m *apexContributions) GenerateAndroidBuildActions(ctx ModuleContext) {
 }
 
+type apexContributionsDefaults struct {
+	ModuleBase
+	DefaultsModuleBase
+}
+
+func apexContributionsDefaultsFactory() Module {
+	module := &apexContributionsDefaults{}
+	module.AddProperties(&contributionProps{})
+	InitDefaultsModule(module)
+	return module
+}
+
 // A container for apex_contributions.
 // Based on product_config, it will create a dependency on the selected
 // apex_contributions per mainline module
diff --git a/java/java.go b/java/java.go
index 794020d..6423eeb 100644
--- a/java/java.go
+++ b/java/java.go
@@ -680,10 +680,11 @@
 		return true
 	}
 
-	// Store uncompressed dex files that are preopted on /system.
-	if !dexpreopter.dexpreoptDisabled(ctx, libName) && (ctx.Host() || !dexpreopter.odexOnSystemOther(ctx, libName, dexpreopter.installPath)) {
+	// Store uncompressed dex files that are preopted on /system or /system_other.
+	if !dexpreopter.dexpreoptDisabled(ctx, libName) {
 		return true
 	}
+
 	if ctx.Config().UncompressPrivAppDex() &&
 		inList(ctx.ModuleName(), ctx.Config().ModulesLoadedByPrivilegedModules()) {
 		return true
diff --git a/sysprop/sysprop_library.go b/sysprop/sysprop_library.go
index 2258232..82abba4 100644
--- a/sysprop/sysprop_library.go
+++ b/sysprop/sysprop_library.go
@@ -154,10 +154,10 @@
 	})
 
 	for _, syspropFile := range android.PathsForModuleSrc(ctx, g.properties.Srcs) {
-		syspropDir := strings.TrimSuffix(syspropFile.String(), syspropFile.Ext())
-		outputDir := android.PathForModuleGen(ctx, syspropDir, "src")
-		libPath := android.PathForModuleGen(ctx, syspropDir, "src", "lib.rs")
-		parsersPath := android.PathForModuleGen(ctx, syspropDir, "src", "gen_parsers_and_formatters.rs")
+		syspropDir := android.GenPathWithExt(ctx, "sysprop", syspropFile, "srcrust")
+		outputDir := syspropDir.Join(ctx, "src")
+		libPath := syspropDir.Join(ctx, "src", "lib.rs")
+		parsersPath := syspropDir.Join(ctx, "src", "gen_parsers_and_formatters.rs")
 
 		ctx.Build(pctx, android.BuildParams{
 			Rule:        syspropRust,
diff --git a/ui/build/config.go b/ui/build/config.go
index 3143b6b..7426a78 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -1386,7 +1386,9 @@
 }
 
 func (c *configImpl) rbeSockAddr(dir string) (string, error) {
-	maxNameLen := len(syscall.RawSockaddrUnix{}.Path)
+	// Absolute path socket addresses have a prefix of //. This should
+	// be included in the length limit.
+	maxNameLen := len(syscall.RawSockaddrUnix{}.Path) - 2
 	base := fmt.Sprintf("reproxy_%v.sock", rbeRandPrefix)
 
 	name := filepath.Join(dir, base)