#![cfg_attr(not(feature = "std"), no_std)]
#[macro_use]
extern crate alloc;
#[cfg(all(feature = "std", not(any(android_ndk, trusty))))]
mod accessor;
#[macro_use]
mod binder;
mod binder_async;
mod error;
mod native;
mod parcel;
#[cfg(not(trusty))]
mod persistable_bundle;
mod proxy;
#[cfg(all(feature = "kernel_ipc", not(android_ndk)))]
mod service;
#[cfg(all(feature = "kernel_ipc", not(android_ndk)))]
mod state;
#[macro_use]
mod sync_utils;
mod write_to;
use binder_ndk_sys as sys;
pub use crate::binder_async::{BinderAsyncPool, BoxFuture};
#[cfg(all(feature = "std", not(any(android_ndk, trusty))))]
pub use accessor::{Accessor, AccessorProvider, ConnectionInfo, delegate_accessor};
pub use binder::{BinderFeatures, FromIBinder, IBinder, Interface, Strong, Weak};
pub use error::{ExceptionCode, IntoBinderResult, Status, StatusCode};
pub use parcel::{ParcelFileDescriptor, Parcelable, ParcelableHolder};
#[cfg(not(trusty))]
pub use persistable_bundle::{PersistableBundle, ValueType};
pub use proxy::{DeathRecipient, SpIBinder, WpIBinder};
#[cfg(all(feature = "kernel_ipc", not(android_ndk)))]
pub use service::{
LazyServiceGuard, add_service, check_interface, check_service, force_lazy_services_persist,
get_declared_instances, is_declared, is_handling_transaction, register_lazy_service,
wait_for_interface, wait_for_service,
};
#[cfg(all(feature = "kernel_ipc", not(any(android_ndk, android_vendor, android_vndk))))]
pub use service::{
CHECK_ACCESS_PERMISSION_ADD, CHECK_ACCESS_PERMISSION_FIND, CHECK_ACCESS_PERMISSION_LIST,
check_service_access,
};
#[cfg(all(feature = "kernel_ipc", not(android_ndk)))]
#[allow(deprecated)]
pub use service::{get_interface, get_service};
#[cfg(all(feature = "kernel_ipc", not(android_ndk)))]
pub use state::{ProcessState, ThreadState};
pub use write_to::WriteTo;
pub type Result<T> = core::result::Result<T, Status>;
pub mod binder_impl {
pub use crate::binder::{
FIRST_CALL_TRANSACTION, FLAG_ONEWAY, FunctionNames, IBinderInternal, InterfaceClass,
LAST_CALL_TRANSACTION, LocalStabilityType, Remotable, Stability, StabilityType,
ToAsyncInterface, ToSyncInterface, TransactionCode, TransactionFlags, VintfStabilityType,
};
#[cfg(not(android_ndk))]
pub use crate::binder::{FLAG_CLEAR_BUF, FLAG_PRIVATE_LOCAL};
pub use crate::binder_async::BinderAsyncRuntime;
pub use crate::error::status_t;
pub use crate::native::Binder;
pub use crate::parcel::{
BorrowedParcel, Deserialize, DeserializeArray, DeserializeOption, NON_NULL_PARCELABLE_FLAG,
NULL_PARCELABLE_FLAG, Parcel, ParcelableMetadata, Serialize, SerializeArray,
SerializeOption, UnstructuredParcelable,
};
pub use crate::proxy::{AssociateClass, Proxy};
pub use crate::panic_if_poisoned;
#[cfg(single_threaded)]
pub use spin::Mutex;
#[cfg(all(feature = "std", not(single_threaded)))]
pub use std::sync::Mutex;
#[cfg(single_threaded)]
pub use spin::Once;
#[cfg(all(feature = "std", not(single_threaded)))]
pub use std::sync::Once;
}
#[doc(hidden)]
pub mod unstable_api {
pub use crate::binder::AsNative;
pub use crate::error::status_result;
pub use crate::proxy::unstable_api::new_spibinder;
pub use crate::sys::AIBinder;
pub use crate::sys::AParcel;
}