Snap for 8188146 from 3377465e6d0e39b4d45f1f043d3ab84c038d3d94 to tm-frc-media-swcodec-release

Change-Id: I9da3ff22f406b47fca7be0e65465dac14396165d
diff --git a/Android.bp b/Android.bp
index 7013de3..846786d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -41,13 +41,10 @@
     name: "libpin_utils",
     host_supported: true,
     crate_name: "pin_utils",
-    cargo_env_compat: true,
-    cargo_pkg_version: "0.1.0",
     srcs: ["src/lib.rs"],
     edition: "2018",
     apex_available: [
         "//apex_available:platform",
-        "com.android.bluetooth",
         "com.android.resolv",
         "com.android.virt",
     ],
@@ -55,10 +52,30 @@
 }
 
 rust_defaults {
-    name: "pin-utils_test_defaults",
+    name: "pin-utils_defaults",
     crate_name: "pin_utils",
-    cargo_env_compat: true,
-    cargo_pkg_version: "0.1.0",
+    srcs: ["src/lib.rs"],
+    test_suites: ["general-tests"],
+    auto_gen_config: true,
+    edition: "2018",
+}
+
+rust_test_host {
+    name: "pin-utils_host_test_src_lib",
+    defaults: ["pin-utils_defaults"],
+    test_options: {
+        unit_test: true,
+    },
+}
+
+rust_test {
+    name: "pin-utils_device_test_src_lib",
+    defaults: ["pin-utils_defaults"],
+}
+
+rust_defaults {
+    name: "pin-utils_defaults_pin_utils",
+    crate_name: "pin_utils",
     test_suites: ["general-tests"],
     auto_gen_config: true,
     edition: "2018",
@@ -67,10 +84,9 @@
     ],
 }
 
-rust_test {
-    name: "pin-utils_test_tests_projection",
-    defaults: ["pin-utils_test_defaults"],
-    host_supported: true,
+rust_test_host {
+    name: "pin-utils_host_test_tests_projection",
+    defaults: ["pin-utils_defaults_pin_utils"],
     srcs: ["tests/projection.rs"],
     test_options: {
         unit_test: true,
@@ -78,11 +94,22 @@
 }
 
 rust_test {
-    name: "pin-utils_test_tests_stack_pin",
-    defaults: ["pin-utils_test_defaults"],
-    host_supported: true,
+    name: "pin-utils_device_test_tests_projection",
+    defaults: ["pin-utils_defaults_pin_utils"],
+    srcs: ["tests/projection.rs"],
+}
+
+rust_test_host {
+    name: "pin-utils_host_test_tests_stack_pin",
+    defaults: ["pin-utils_defaults_pin_utils"],
     srcs: ["tests/stack_pin.rs"],
     test_options: {
         unit_test: true,
     },
 }
+
+rust_test {
+    name: "pin-utils_device_test_tests_stack_pin",
+    defaults: ["pin-utils_defaults_pin_utils"],
+    srcs: ["tests/stack_pin.rs"],
+}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index e517942..c19c652 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,57 +1,17 @@
-// Generated by update_crate_tests.py for tests that depend on this crate.
+// Generated by cargo2android.py for tests in Android.bp
 {
-  "imports": [
-    {
-      "path": "external/rust/crates/anyhow"
-    },
-    {
-      "path": "external/rust/crates/futures-util"
-    },
-    {
-      "path": "external/rust/crates/tokio"
-    },
-    {
-      "path": "external/rust/crates/tokio-test"
-    }
-  ],
   "presubmit": [
     {
-      "name": "ZipFuseTest"
+      "name": "pin-utils_device_test_src_lib"
     },
     {
-      "name": "authfs_device_test_src_lib"
+      "name": "pin-utils_device_test_tests_projection"
     },
     {
-      "name": "doh_unit_test"
+      "name": "pin-utils_device_test_tests_stack_pin"
     },
     {
-      "name": "pin-utils_test_tests_projection"
-    },
-    {
-      "name": "pin-utils_test_tests_stack_pin"
-    },
-    {
-      "name": "virtualizationservice_device_test"
-    }
-  ],
-  "presubmit-rust": [
-    {
-      "name": "ZipFuseTest"
-    },
-    {
-      "name": "authfs_device_test_src_lib"
-    },
-    {
-      "name": "doh_unit_test"
-    },
-    {
-      "name": "pin-utils_test_tests_projection"
-    },
-    {
-      "name": "pin-utils_test_tests_stack_pin"
-    },
-    {
-      "name": "virtualizationservice_device_test"
+      "name": "futures-util_device_test_src_lib"
     }
   ]
 }
diff --git a/cargo2android.json b/cargo2android.json
index 5b266a6..44e747c 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,13 +1,12 @@
 {
   "apex-available": [
     "//apex_available:platform",
-    "com.android.bluetooth",
     "com.android.resolv",
     "com.android.virt"
   ],
+  "min_sdk_version": "29",
   "dependencies": true,
   "device": true,
-  "min-sdk-version": "29",
   "run": true,
   "tests": true
-}
+}
\ No newline at end of file