Merge "Fix incorrect flag in Android.bp and migrate to config file"
diff --git a/Android.bp b/Android.bp
index 70de83d..5edfe0d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,5 @@
-// This file is generated by cargo2android.py --device --run --dependencies --test --features=std.
+// 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: [
@@ -39,26 +40,27 @@
 }
 
 rust_defaults {
-    name: "fallible-streaming-iterator_defaults",
+    name: "fallible-streaming-iterator_test_defaults",
     crate_name: "fallible_streaming_iterator",
     // has rustc warnings
     srcs: ["src/lib.rs"],
     test_suites: ["general-tests"],
     auto_gen_config: true,
     edition: "2015",
-    features: [
-        "std",
-    ],
+    features: ["std"],
 }
 
 rust_test_host {
     name: "fallible-streaming-iterator_host_test_src_lib",
-    defaults: ["fallible-streaming-iterator_defaults"],
+    defaults: ["fallible-streaming-iterator_test_defaults"],
+    test_options: {
+        unit_test: true,
+    },
 }
 
 rust_test {
     name: "fallible-streaming-iterator_device_test_src_lib",
-    defaults: ["fallible-streaming-iterator_defaults"],
+    defaults: ["fallible-streaming-iterator_test_defaults"],
 }
 
 rust_library {
@@ -66,9 +68,9 @@
     // has rustc warnings
     host_supported: true,
     crate_name: "fallible_streaming_iterator",
+    cargo_env_compat: true,
+    cargo_pkg_version: "0.1.9",
     srcs: ["src/lib.rs"],
     edition: "2015",
-    features: [
-        "std",
-    ],
+    features: ["std"],
 }
diff --git a/cargo2android.json b/cargo2android.json
new file mode 100644
index 0000000..fba20cf
--- /dev/null
+++ b/cargo2android.json
@@ -0,0 +1,6 @@
+{
+  "device": true,
+  "features": "std",
+  "run": true,
+  "tests": true
+}
\ No newline at end of file