Function binder_ndk_sys::AIBinder_linkToDeath

source ยท
pub unsafe extern "C" fn AIBinder_linkToDeath(
    binder: *mut AIBinder,
    recipient: *mut AIBinder_DeathRecipient,
    cookie: *mut c_void,
) -> binder_status_t
Expand description

Registers for notifications that the associated binder is dead. The same death recipient may be associated with multiple different binders. If the binder is local, then no death recipient will be given (since if the local process dies, then no recipient will exist to receive a transaction). The cookie is passed to recipient in the case that this binder dies and can be null. The exact cookie must also be used to unlink this transaction (see AIBinder_unlinkToDeath). This function may return a binder transaction failure. The cookie can be used both for identification and holding user data.

If binder is local, this will return STATUS_INVALID_OPERATION.

Available since API level 29.

\param binder the binder object you want to receive death notifications from. \param recipient the callback that will receive notifications when/if the binder dies. \param cookie the value that will be passed to the death recipient on death.

\return STATUS_OK on success.