Function binder_ndk_sys::AIBinder_transact

source ·
pub unsafe extern "C" fn AIBinder_transact(
    binder: *mut AIBinder,
    code: transaction_code_t,
    in_: *mut *mut AParcel,
    out: *mut *mut AParcel,
    flags: binder_flags_t,
) -> binder_status_t
Expand description

Transact using a parcel created from AIBinder_prepareTransaction. This actually communicates with the object representing this binder object. This also passes out a parcel to be used for the return transaction. This takes ownership of the in parcel and automatically deletes it after it is sent to the remote process. The output parcel is the result of the transaction. If the transaction has FLAG_ONEWAY, the out parcel will be empty. Otherwise, this will block until the remote process has processed the transaction, and the out parcel will contain the output data from transaction.

This does not affect the ownership of binder. The out parcel’s ownership is passed to the caller and must be released with AParcel_delete when finished reading.

Available since API level 29.

\param binder the binder object to transact on. \param code the implementation-specific code representing which transaction should be taken. \param in the implementation-specific input data to this transaction. \param out the implementation-specific output data to this transaction. \param flags possible flags to alter the way in which the transaction is conducted or 0.

\return the result from the kernel or from the remote process. Usually, implementation-specific error codes are written to the output parcel, and the transaction code is reserved for kernel errors or error codes that have been repeated from subsequent transactions.