Snap for 8570526 from 712738507c95237f69c0cf56e7d7e5282c2db9b8 to mainline-networking-release

Change-Id: I8ffa0b37b71829b28ff186318ce998d1c0579d05
diff --git a/Android.bp b/Android.bp
index 290f0b5..850e6fd 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,4 @@
-// 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 {
@@ -41,6 +41,8 @@
     name: "libtinytemplate",
     host_supported: true,
     crate_name: "tinytemplate",
+    cargo_env_compat: true,
+    cargo_pkg_version: "1.2.1",
     srcs: ["src/lib.rs"],
     edition: "2015",
     rustlibs: [
@@ -49,8 +51,23 @@
     ],
 }
 
-// dependent_library ["feature_list"]
-//   itoa-0.4.7 "default,std"
-//   ryu-1.0.5
-//   serde-1.0.125 "default,std"
-//   serde_json-1.0.64 "default,std"
+rust_test {
+    name: "tinytemplate_test_src_lib",
+    host_supported: true,
+    crate_name: "tinytemplate",
+    cargo_env_compat: true,
+    cargo_pkg_version: "1.2.1",
+    srcs: ["src/lib.rs"],
+    test_suites: ["general-tests"],
+    auto_gen_config: true,
+    test_options: {
+        unit_test: true,
+    },
+    edition: "2015",
+    rustlibs: [
+        "libcriterion",
+        "libserde",
+        "libserde_json",
+    ],
+    proc_macros: ["libserde_derive"],
+}
diff --git a/TEST_MAPPING b/TEST_MAPPING
new file mode 100644
index 0000000..9a60ded
--- /dev/null
+++ b/TEST_MAPPING
@@ -0,0 +1,24 @@
+// Generated by update_crate_tests.py for tests that depend on this crate.
+{
+  "imports": [
+    {
+      "path": "external/rust/crates/base64"
+    },
+    {
+      "path": "external/rust/crates/tinyvec"
+    },
+    {
+      "path": "external/rust/crates/unicode-xid"
+    }
+  ],
+  "presubmit": [
+    {
+      "name": "tinytemplate_test_src_lib"
+    }
+  ],
+  "presubmit-rust": [
+    {
+      "name": "tinytemplate_test_src_lib"
+    }
+  ]
+}
diff --git a/cargo2android.json b/cargo2android.json
new file mode 100644
index 0000000..d36fb44
--- /dev/null
+++ b/cargo2android.json
@@ -0,0 +1,5 @@
+{
+  "device": true,
+  "run": true,
+  "tests": true
+}
\ No newline at end of file