Snap for 10453938 from a08fc69b4b84fc4dbe28a07b268b42f86cb498fa to mainline-odp-release

Change-Id: Ic57dddb74a71db02d3f517b315d5eea48b143388
diff --git a/Android.bp b/Android.bp
index 6a4ccd3..2e835b2 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,8 +1,6 @@
-// This file is generated by cargo2android.py --run --device --dependencies.
+// 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_ciborium-ll_license"],
 }
@@ -20,6 +18,26 @@
     ],
 }
 
+rust_test {
+    name: "ciborium-ll_test_src_lib",
+    host_supported: true,
+    crate_name: "ciborium_ll",
+    cargo_env_compat: true,
+    cargo_pkg_version: "0.2.0",
+    srcs: ["src/lib.rs"],
+    test_suites: ["general-tests"],
+    auto_gen_config: true,
+    test_options: {
+        unit_test: true,
+    },
+    edition: "2021",
+    rustlibs: [
+        "libciborium_io",
+        "libhalf",
+        "libhex",
+    ],
+}
+
 rust_library {
     name: "libciborium_ll",
     host_supported: true,
@@ -32,4 +50,29 @@
         "libciborium_io",
         "libhalf",
     ],
+    apex_available: [
+        "//apex_available:platform",
+        "//apex_available:anyapex",
+    ],
+    product_available: true,
+    vendor_available: true,
+}
+
+rust_library_rlib {
+    name: "libciborium_ll_nostd",
+    crate_name: "ciborium_ll",
+    cargo_env_compat: true,
+    cargo_pkg_version: "0.2.0",
+    srcs: ["src/lib.rs"],
+    edition: "2021",
+    prefer_rlib: true,
+    no_stdlibs: true,
+    rustlibs: [
+        "libciborium_io_nostd",
+        "libhalf_nostd",
+    ],
+    apex_available: [
+        "//apex_available:platform",
+        "//apex_available:anyapex",
+    ],
 }
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 2f7de78..b797ccc 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,13 +1,24 @@
 // Generated by update_crate_tests.py for tests that depend on this crate.
 {
+  "imports": [
+    {
+      "path": "external/rust/crates/coset"
+    },
+    {
+      "path": "system/keymint/derive"
+    },
+    {
+      "path": "system/keymint/hal"
+    }
+  ],
   "presubmit": [
     {
-      "name": "libcert_request_validator_tests"
+      "name": "ciborium-ll_test_src_lib"
     }
   ],
   "presubmit-rust": [
     {
-      "name": "libcert_request_validator_tests"
+      "name": "ciborium-ll_test_src_lib"
     }
   ]
 }
diff --git a/cargo2android.json b/cargo2android.json
new file mode 100644
index 0000000..e7673ba
--- /dev/null
+++ b/cargo2android.json
@@ -0,0 +1,8 @@
+{
+  "add-toplevel-block": "cargo2android_nostd.bp",
+  "device": true,
+  "run": true,
+  "dependencies": true,
+  "vendor-available": true,
+  "tests": true
+}
diff --git a/cargo2android_nostd.bp b/cargo2android_nostd.bp
new file mode 100644
index 0000000..9912edd
--- /dev/null
+++ b/cargo2android_nostd.bp
@@ -0,0 +1,18 @@
+rust_library_rlib {
+    name: "libciborium_ll_nostd",
+    crate_name: "ciborium_ll",
+    cargo_env_compat: true,
+    cargo_pkg_version: "0.2.0",
+    srcs: ["src/lib.rs"],
+    edition: "2021",
+    prefer_rlib: true,
+    no_stdlibs: true,
+    rustlibs: [
+        "libciborium_io_nostd",
+        "libhalf_nostd",
+    ],
+    apex_available: [
+        "//apex_available:platform",
+        "//apex_available:anyapex",
+    ],
+}