Revert "Remove old-style support for translated second architectures"
This reverts commit fe6330c7d2d6102a0436da2892e71e3b490ac15c.
Reason for revert: this was accidentally propping up NDK builds
Bug: 141242600
Change-Id: Ie9f8e31479a74e8e9e14d720a5936da6b1d5d113
diff --git a/java/dexpreopt.go b/java/dexpreopt.go
index 8bc9b19..6214dac 100644
--- a/java/dexpreopt.go
+++ b/java/dexpreopt.go
@@ -126,6 +126,10 @@
archs = archs[:1]
}
}
+ if ctx.Config().SecondArchIsTranslated() {
+ // Only preopt primary arch for translated arch since there is only an image there.
+ archs = archs[:1]
+ }
var images android.Paths
var imagesDeps []android.Paths
diff --git a/java/dexpreopt_config.go b/java/dexpreopt_config.go
index 043f9da..8c699b8 100644
--- a/java/dexpreopt_config.go
+++ b/java/dexpreopt_config.go
@@ -87,7 +87,11 @@
// supported through native bridge.
func dexpreoptTargets(ctx android.PathContext) []android.Target {
var targets []android.Target
- for _, target := range ctx.Config().Targets[android.Android] {
+ for i, target := range ctx.Config().Targets[android.Android] {
+ if ctx.Config().SecondArchIsTranslated() && i > 0 {
+ break
+ }
+
if target.NativeBridge == android.NativeBridgeDisabled {
targets = append(targets, target)
}