Generate apex_available from c2a instead of a patch am: 38038e844b

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/downcast-rs/+/1688687

Change-Id: Idf69457ff7e540451485daf2700b777bd479cade
diff --git a/Android.bp b/Android.bp
index a40bf1e..7f43e87 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,5 @@
-// This file is generated by cargo2android.py --run --dependencies --device --tests --patch=patches/Android.bp.patch.
+// This file is generated by cargo2android.py --config cargo2android.json.
+// Do not modify this file as changes will be overridden on upgrade.
 
 package {
     default_applicable_licenses: ["external_rust_crates_downcast-rs_license"],
@@ -39,6 +40,9 @@
 rust_test_host {
     name: "downcast-rs_host_test_src_lib",
     defaults: ["downcast-rs_defaults"],
+    test_options: {
+        unit_test: true,
+    },
 }
 
 rust_test {
@@ -65,6 +69,9 @@
     name: "downcast-rs_host_test_tests_import_via_macro_use",
     defaults: ["downcast-rs_defaults_downcast_rs"],
     srcs: ["tests/import_via_macro_use.rs"],
+    test_options: {
+        unit_test: true,
+    },
 }
 
 rust_test {
@@ -77,6 +84,9 @@
     name: "downcast-rs_host_test_tests_use_via_namespace",
     defaults: ["downcast-rs_defaults_downcast_rs"],
     srcs: ["tests/use_via_namespace.rs"],
+    test_options: {
+        unit_test: true,
+    },
 }
 
 rust_test {
diff --git a/cargo2android.json b/cargo2android.json
new file mode 100644
index 0000000..ac56e26
--- /dev/null
+++ b/cargo2android.json
@@ -0,0 +1,10 @@
+{
+  "apex-available": [
+    "//apex_available:platform",
+    "com.android.virt"
+  ],
+  "dependencies": true,
+  "device": true,
+  "run": true,
+  "tests": true
+}
\ No newline at end of file
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch
deleted file mode 100644
index 4efb413..0000000
--- a/patches/Android.bp.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/Android.bp b/Android.bp
-index f99bb24..48f54d8 100644
---- a/Android.bp
-+++ b/Android.bp
-@@ -72,4 +72,8 @@ rust_library {
-         "default",
-         "std",
-     ],
-+    apex_available: [
-+        "//apex_available:platform",
-+        "com.android.virt",
-+    ],
- }