binder_rs: add OwnedParcel
This adds a new binder::OwnedParcel type that exclusively
contains an owned parcel, and implements Send so it
can be sent between threads. Parcel cannot implement Send
because Parcel::Borrowed could point to thread-local
C++ values, e.g., a Parcel stored on the stack.
This change is a prerequisite for both async and
thread-safe ParcelableHolder.
Bug: 200676345
Test: atest aidl_integration_test
Change-Id: I1a7b965d26cb5350576450debd7d058a6451b1f0
diff --git a/libs/binder/rust/src/lib.rs b/libs/binder/rust/src/lib.rs
index d1d37d7..81b620e 100644
--- a/libs/binder/rust/src/lib.rs
+++ b/libs/binder/rust/src/lib.rs
@@ -113,7 +113,7 @@
};
pub use error::{status_t, ExceptionCode, Result, Status, StatusCode};
pub use native::{add_service, force_lazy_services_persist, register_lazy_service, Binder};
-pub use parcel::Parcel;
+pub use parcel::{OwnedParcel, Parcel};
pub use proxy::{get_interface, get_service, wait_for_interface, wait_for_service};
pub use proxy::{AssociateClass, DeathRecipient, Proxy, SpIBinder, WpIBinder};
pub use state::{ProcessState, ThreadState};