Extract a library for common binder-related things
Initially this just unifies the various copies of we have of
new_binder_exception(), and adds a variation for service-specific
errors. (I thought this would help me solve my problem with missing
error info, but it turns out I was wrong.) I'm intending to move more
things here though to facilitate reuse.
Bug: 186126194
Test: atest -p
Change-Id: I82187903b55c4cd64307065761e1e03c4e6012f4
diff --git a/binder_common/Android.bp b/binder_common/Android.bp
new file mode 100644
index 0000000..789a891
--- /dev/null
+++ b/binder_common/Android.bp
@@ -0,0 +1,17 @@
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+rust_library {
+ name: "libbinder_common",
+ crate_name: "binder_common",
+ srcs: ["lib.rs"],
+ edition: "2018",
+ rustlibs: [
+ "libbinder_rs",
+ ],
+ apex_available: [
+ "com.android.compos",
+ "com.android.virt",
+ ],
+}