Move uwb-service into VAPEX

Bug: 296487624
Test: launch cuttlefish / uwb-service runs
Change-Id: I5436d9215ad396fe6cd151690d299dd345c56cb0
diff --git a/uwb/aidl/default/Android.bp b/uwb/aidl/default/Android.bp
index f585de9..c6d1a52 100644
--- a/uwb/aidl/default/Android.bp
+++ b/uwb/aidl/default/Android.bp
@@ -11,9 +11,8 @@
     name: "android.hardware.uwb-service",
     crate_name: "uwb_default_hal",
     relative_install_path: "hw",
-    init_rc: ["uwb-service.rc"],
-    vintf_fragments: ["uwb-service.xml"],
     vendor: true,
+    prefer_rlib: true,
     rustlibs: [
         "android.hardware.uwb-V1-rust",
         "liblogger",
@@ -31,3 +30,47 @@
         "src/service.rs",
     ],
 }
+
+prebuilt_etc {
+    name: "uwb-service.rc",
+    src: "uwb-service.rc",
+    vendor: true,
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "uwb-service.xml",
+    src: "uwb-service.xml",
+    sub_dir: "vintf",
+    vendor: true,
+    installable: false,
+}
+
+apex_key {
+    name: "com.android.hardware.uwb.key",
+    public_key: "com.android.hardware.uwb.avbpubkey",
+    private_key: "com.android.hardware.uwb.pem",
+}
+
+android_app_certificate {
+    name: "com.android.hardware.uwb.certificate",
+    certificate: "com.android.hardware.uwb",
+}
+
+apex {
+    name: "com.android.hardware.uwb",
+    manifest: "manifest.json",
+    file_contexts: "file_contexts",
+    key: "com.android.hardware.uwb.key",
+    certificate: ":com.android.hardware.uwb.certificate",
+    updatable: false,
+    vendor: true,
+
+    binaries: [
+        "android.hardware.uwb-service",
+    ],
+    prebuilts: [
+        "uwb-service.rc", // init_rc
+        "uwb-service.xml", // vintf_fragments
+    ],
+}