Revert^2 "Add apex com.android.runtime.host artifact"

HOST_PREFER_32_BIT=true is incompatible with host apex artifacts due
to needing to know the multilib class of artifacts statically. For now
we will simply disable the com.android.runtime.host artifact with a
load-hook when HOST_PREFER_32_BIT=true.

This reverts commit 1047f1a2eba0221ba53c8991a96cd89e33f5f36f.

Reason for revert: Fixed issue with x86-only build

Test: HOST_PREFER_32_BIT=true m nothing
Test: m -j80 com.android.runtime.host

Bug: 120617876
Bug: 120436895

Change-Id: I35f2d219ec3ddb536ee0a86af7b861beafdd69d1
diff --git a/build/apex/Android.bp b/build/apex/Android.bp
index f1a21e8..b3c23b3 100644
--- a/build/apex/Android.bp
+++ b/build/apex/Android.bp
@@ -49,10 +49,13 @@
 ]
 
 // Modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk.
-art_tools_binaries = [
+art_tools_common_binaries = [
     "dexdiag",
     "dexdump",
     "dexlist",
+]
+
+art_tools_device_binaries = [
     "oatdump",
 ]
 
@@ -66,6 +69,8 @@
     // ...
 ]
 
+art_tools_binaries = art_tools_common_binaries + art_tools_device_binaries
+
 apex_key {
     name: "com.android.runtime.key",
     public_key: "com.android.runtime.avbpubkey",
@@ -135,3 +140,34 @@
     prebuilts: ["com.android.runtime.ld.config.txt"],
     key: "com.android.runtime.key",
 }
+
+// TODO: Do this better. art_apex will disable host builds when
+// HOST_PREFER_32_BIT is set. We cannot simply use com.android.runtime.debug
+// because binaries have different multilib classes and 'multilib: {}' isn't
+// supported by target: { ... }.
+// See b/120617876 for more information.
+art_apex {
+    name: "com.android.runtime.host",
+    compile_multilib: "both",
+    payload_type: "zip",
+    host_supported: true,
+    device_supported: false,
+    manifest: "manifest.json",
+    native_shared_libs: art_runtime_base_native_shared_libs
+        + art_runtime_fake_native_shared_libs
+        + art_runtime_debug_native_shared_libs,
+    multilib: {
+        both: {
+            // TODO: Add logic to create a `dalvikvm` symlink to `dalvikvm32` or `dalvikvm64`
+            // (see `symlink_preferred_arch` in art/dalvikvm/Android.bp).
+            binaries: art_runtime_base_binaries_both,
+        },
+        first: {
+            // TODO: oatdump cannot link with host linux_bionic due to not using clang ld
+            binaries: art_tools_common_binaries
+                + art_runtime_base_binaries_prefer32
+                + art_runtime_debug_binaries_prefer32,
+        }
+    },
+    key: "com.android.runtime.key",
+}