Host can send required infos to the guest for performing forwarding.

Since forwarder_guest_launcher is not implemented in 100%, we should
manually run forwarder_guest_launcher with `--host-addr 192.168.0.1`,
and accessing `http://localhost:12345` to check the log printed at
forwarder_guest_launcher.

Bug: 340126051
Test: Manual test described above.

Change-Id: If3a7784fb29febc3fed8653297fa6c840ef22b49
diff --git a/android/forwarder_host/Android.bp b/android/forwarder_host/Android.bp
index 35c478e..e8d0184 100644
--- a/android/forwarder_host/Android.bp
+++ b/android/forwarder_host/Android.bp
@@ -2,12 +2,14 @@
     default_applicable_licenses: ["Android-Apache-2.0"],
 }
 
-rust_binary {
-    name: "forwarder_host",
+rust_ffi_shared {
+    name: "libforwarder_host_jni",
+    crate_name: "forwarder_host",
     edition: "2021",
-    srcs: ["src/main.rs"],
+    srcs: ["src/forwarder_host.rs"],
     rustlibs: [
         "libforwarder",
+        "libjni",
         "liblog_rust",
         "libnix",
         "libvmm_sys_util",
@@ -17,5 +19,8 @@
         "libpoll_token_derive",
         "libremain",
     ],
-    static_executable: true,
+    apex_available: [
+        "com.android.virt",
+    ],
+    prefer_rlib: true,
 }