Function binder_ndk_sys::AIBinder_unlinkToDeath

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

Stops registration for the associated binder dying. Does not delete the recipient. This function may return a binder transaction failure and in case the death recipient cannot be found, it returns STATUS_NAME_NOT_FOUND.

This only ever needs to be called when the AIBinder_DeathRecipient remains for use with other AIBinder objects. If the death recipient is deleted, all binders will automatically be unlinked. If the binder dies, it will automatically unlink. If the binder is deleted, it will be automatically unlinked.

Be aware that it is not safe to immediately deallocate the cookie when this call returns. If you need to clean up the cookie, you should do so in the onUnlinked callback, which can be set using AIBinder_DeathRecipient_setOnUnlinked.

Available since API level 29.

\param binder the binder object to remove a previously linked death recipient from. \param recipient the callback to remove. \param cookie the cookie used to link to death.

\return STATUS_OK on success. STATUS_NAME_NOT_FOUND if the binder cannot be found to be unlinked.