Fix build on aosp-master/mainline_modules

Apply the same default as crosvm to avoid inconsistency. libp9 depends
on libchromeos.

Previous error:
  error: external/libchromeos-rs/Android.bp:35:1: module "liblibchromeos"
  variant "linux_bionic_x86_64_rlib_rlib-std": depends on disabled module
  "libdata_model"

Bug: 174797066
Test: build/soong/scripts/build-mainline-modules.sh
Change-Id: I997c0a6ae2bd69935de1b0ded066942d1e7a1fa6
diff --git a/Android.bp b/Android.bp
index 2372a15..b3e3501 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,7 +1,8 @@
-// This file is generated by cargo2android.py --run --device --tests --dependencies --patch=patches/Android.bp.patch.
+// This file is generated by cargo2android.py --run --device --tests --dependencies --global_defaults=crosvm_defaults.
 
 rust_library {
     name: "libp9",
+    defaults: ["crosvm_defaults"],
     host_supported: true,
     crate_name: "p9",
     srcs: ["src/lib.rs"],
@@ -10,23 +11,12 @@
         "liblibc",
         "liblibchromeos",
     ],
-    proc_macros: [
-        "libwire_format_derive",
-    ],
-    apex_available: [
-        "//apex_available:platform",
-        "com.android.virt",
-    ],
-    // This library depends on libdata_model that is is part of crosvm project.
-    // Projects within crosvm on Android have only 64-bit target build enabled.
-    // As a result, we need to manually limit this build to 64-bit only, too.
-    // This is fine because this library is only used by crosvm now (thus 64-bit
-    // only).
-    compile_multilib: "64",
+    proc_macros: ["libwire_format_derive"],
 }
 
 rust_defaults {
     name: "p9_defaults",
+    defaults: ["crosvm_defaults"],
     crate_name: "p9",
     srcs: ["src/lib.rs"],
     test_suites: ["general-tests"],
@@ -47,9 +37,6 @@
 rust_test {
     name: "p9_device_test_src_lib",
     defaults: ["p9_defaults"],
-    // Manually limit to 64-bit to avoid depending on non-existing 32-bit build
-    // of libdata_model currently.
-    compile_multilib: "64",
 }
 
 // dependent_library ["feature_list"]
@@ -58,22 +45,21 @@
 //   ../../libchromeos-rs/src/lib.rs
 //   autocfg-1.0.1
 //   cfg-if-0.1.10
-//   futures-0.3.8 "alloc"
-//   futures-channel-0.3.8 "alloc,futures-sink,sink"
-//   futures-core-0.3.8 "alloc"
-//   futures-io-0.3.8
-//   futures-sink-0.3.8 "alloc"
-//   futures-task-0.3.8 "alloc"
-//   futures-util-0.3.8 "alloc,futures-sink,sink"
+//   futures-0.3.9 "alloc"
+//   futures-channel-0.3.9 "alloc,futures-sink,sink"
+//   futures-core-0.3.9 "alloc"
+//   futures-io-0.3.9
+//   futures-sink-0.3.9 "alloc"
+//   futures-task-0.3.9 "alloc"
+//   futures-util-0.3.9 "alloc,futures-sink,sink"
 //   intrusive-collections-0.9.0 "alloc,default"
-//   libc-0.2.81 "default,std"
+//   libc-0.2.82 "default,std"
 //   log-0.4.11
 //   memoffset-0.5.6 "default"
-//   pin-project-1.0.2
-//   pin-project-internal-1.0.2
+//   pin-project-lite-0.2.1
 //   pin-utils-0.1.0
 //   proc-macro2-1.0.24 "default,proc-macro"
-//   protobuf-2.18.1
-//   quote-1.0.7 "default,proc-macro"
-//   syn-1.0.54 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote,visit-mut"
+//   protobuf-2.20.0
+//   quote-1.0.8 "default,proc-macro"
+//   syn-1.0.58 "clone-impls,default,derive,parsing,printing,proc-macro,quote"
 //   unicode-xid-0.2.1 "default"
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch
deleted file mode 100644
index ccc2338..0000000
--- a/patches/Android.bp.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff --git a/Android.bp b/Android.bp
-index 0b5bcde..2372a15 100644
---- a/Android.bp
-+++ b/Android.bp
-@@ -17,6 +17,12 @@ rust_library {
-         "//apex_available:platform",
-         "com.android.virt",
-     ],
-+    // This library depends on libdata_model that is is part of crosvm project.
-+    // Projects within crosvm on Android have only 64-bit target build enabled.
-+    // As a result, we need to manually limit this build to 64-bit only, too.
-+    // This is fine because this library is only used by crosvm now (thus 64-bit
-+    // only).
-+    compile_multilib: "64",
- }
- 
- rust_defaults {
-@@ -41,6 +47,9 @@ rust_test_host {
- rust_test {
-     name: "p9_device_test_src_lib",
-     defaults: ["p9_defaults"],
-+    // Manually limit to 64-bit to avoid depending on non-existing 32-bit build
-+    // of libdata_model currently.
-+    compile_multilib: "64",
- }
- 
- // dependent_library ["feature_list"]