binder_ndk_sys

Function ABinderRpc_Accessor_new

Source
pub unsafe extern "C" fn ABinderRpc_Accessor_new(
    instance: *const c_char,
    provider: ABinderRpc_ConnectionInfoProvider,
    data: *mut c_void,
    onDelete: ABinderRpc_ConnectionInfoProviderUserData_delete,
) -> *mut ABinderRpc_Accessor
Expand description

Create a new ABinderRpc_Accessor. This creates an IAccessor object in libbinder that can use the info from the ABinderRpc_ConnectionInfoProvider to connect to a socket that the service with instance name is listening to.

\param instance name of the service that is listening on the socket. This string must remain valid and unchanged for the duration of this function call. \param provider callback that can get the socket connection information for the instance. This connection information may be dynamic, so the provider will be called any time a new connection is required. \param data pointer that is passed to the ABinderRpc_ConnectionInfoProvider callback. IMPORTANT: The ABinderRpc_ConnectionInfoProvider now OWNS that object that data points to. It can be used as necessary in the callback. The data MUST remain valid for the lifetime of the provider callback. Do not attempt to give ownership of the same object to different providers through multiple calls to this function because the first one to be deleted will call the onDelete callback. \param onDelete callback used to delete the objects that data points to. This is called after ABinderRpc_ConnectionInfoProvider is guaranteed to never be called again. Before this callback is called, data must remain valid. \return an ABinderRpc_Accessor instance. This is deleted by the caller once it is no longer needed.