Revert^2 "[binder] Expose public Rust API at crate top level"
Previously the public API for the binder Rust crate was nested in a
`public_api` module and re-exported by AIDL interface crates. This
caused confusion, when using multiple AIDL interfaces in the same file,
as there were multiple options to import the binder API.
Moves the public API to the top level of the binder crate and nests the
AIDL implementation API into a submodule.
Original change: I811426fa715a324ebb09f5ce04ee539a1c3b9dfd
Test: atest -p --include-subdirs frameworks/native/binder
Bug: 196056781
Change-Id: I7aa0aa41e4162bb25720974065ae3ac8069e6598
diff --git a/libs/binder/rust/tests/serialization.rs b/libs/binder/rust/tests/serialization.rs
index 1fc761e..b62da7b 100644
--- a/libs/binder/rust/tests/serialization.rs
+++ b/libs/binder/rust/tests/serialization.rs
@@ -18,11 +18,12 @@
//! access.
use binder::declare_binder_interface;
-use binder::parcel::ParcelFileDescriptor;
use binder::{
- Binder, BinderFeatures, BorrowedParcel, ExceptionCode, Interface, Result, SpIBinder, Status,
- StatusCode, TransactionCode,
+ BinderFeatures, ExceptionCode, Interface, ParcelFileDescriptor, SpIBinder, Status, StatusCode,
};
+// Import from impl API for testing only, should not be necessary as long as you
+// are using AIDL.
+use binder::binder_impl::{BorrowedParcel, Binder, TransactionCode};
use std::ffi::{c_void, CStr, CString};
use std::sync::Once;
@@ -113,7 +114,7 @@
code: TransactionCode,
parcel: &BorrowedParcel<'_>,
reply: &mut BorrowedParcel<'_>,
-) -> Result<()> {
+) -> Result<(), StatusCode> {
match code {
bindings::Transaction_TEST_BOOL => {
assert_eq!(parcel.read::<bool>()?, true);