Snap for 11111096 from 6d4cd402e4881e420873bd3def9ff05f03080c5c to 24Q1-release

Change-Id: I8d6d4a475b5c3e6166fdeb3967c1647f9969e2f7
diff --git a/Android.bp b/Android.bp
index 711fbf7..bf50beb 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,4 @@
-// This file is generated by cargo2android.py --config cargo2android.json.
+// This file is generated by cargo_embargo.
 // Do not modify this file as changes will be overridden on upgrade.
 
 package {
@@ -52,6 +52,26 @@
     min_sdk_version: "29",
 }
 
+rust_test {
+    name: "spin_test_src_lib",
+    host_supported: true,
+    crate_name: "spin",
+    cargo_env_compat: true,
+    cargo_pkg_version: "0.9.7",
+    srcs: ["src/lib.rs"],
+    test_suites: ["general-tests"],
+    auto_gen_config: true,
+    test_options: {
+        unit_test: true,
+    },
+    edition: "2015",
+    features: [
+        "once",
+        "std",
+    ],
+    rustlibs: ["libcriterion"],
+}
+
 rust_library_rlib {
     name: "libspin_nostd",
     crate_name: "spin",
@@ -78,25 +98,3 @@
     vendor_available: true,
     min_sdk_version: "29",
 }
-
-rust_test {
-    name: "spin_test_src_lib",
-    host_supported: true,
-    crate_name: "spin",
-    cargo_env_compat: true,
-    cargo_pkg_version: "0.9.7",
-    srcs: ["src/lib.rs"],
-    test_suites: ["general-tests"],
-    auto_gen_config: true,
-    test_options: {
-        unit_test: true,
-    },
-    edition: "2015",
-    features: [
-        "once",
-        "std",
-    ],
-    rustlibs: [
-        "libcriterion",
-    ],
-}
diff --git a/cargo2android.json b/cargo2android.json
deleted file mode 100644
index 7cf9c0e..0000000
--- a/cargo2android.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "dependencies": true,
-  "device": true,
-  "ignore-cargo-errors": true,
-  "min-sdk-version": "29",
-  "run": true,
-  "variants": [
-    {
-      "features": "once,std",
-      "tests": true
-    },
-    {
-      "features": "once,mutex,spin_mutex",
-      "force-rlib": true,
-      "no-host": true,
-      "suffix": "_nostd",
-      "no-std": true
-    }
-  ]
-}
diff --git a/cargo_embargo.json b/cargo_embargo.json
new file mode 100644
index 0000000..d3b04d4
--- /dev/null
+++ b/cargo_embargo.json
@@ -0,0 +1,30 @@
+{
+  "min_sdk_version": "29",
+  "run_cargo": false,
+  "variants": [
+    {
+      "features": [
+        "once",
+        "std"
+      ],
+      "tests": true
+    },
+    {
+      "features": [
+        "once",
+        "mutex",
+        "spin_mutex"
+      ],
+      "module_name_overrides": {
+        "libspin": "libspin_nostd"
+      },
+      "package": {
+        "spin": {
+          "force_rlib": true,
+          "host_supported": false,
+          "no_std": true
+        }
+      }
+    }
+  ]
+}