Make relative path for native_bridge binaries configurable
This change introduces NativeBridgeRelativePath and
NativeBridgeSecondaryRelativePath product variables to
make relative path to native_bridge binaries configurable.
It also removes moves information about native bridge
host architecture to Target and sets it during decodeTargetProductVariables
Test: make PRODUCT-cf_x86_phone-userdebug dist
Change-Id: Ie736e81eae507e1775566ce9f29135011b12af27
diff --git a/android/androidmk.go b/android/androidmk.go
index 9bc2692..5b677dd 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -191,15 +191,7 @@
// Make cannot identify LOCAL_MODULE_TARGET_ARCH:= common.
if archStr != "common" {
if amod.Target().NativeBridge {
- // TODO: Unhardcode these rules.
- guestArchStr := archStr
- hostArchStr := ""
- if guestArchStr == "arm" {
- hostArchStr = "x86"
- } else if guestArchStr == "arm64" {
- hostArchStr = "x86_64"
- }
-
+ hostArchStr := amod.Target().NativeBridgeHostArchName
if hostArchStr != "" {
a.SetString("LOCAL_MODULE_TARGET_ARCH", hostArchStr)
}