pub unsafe extern "C" fn ABinderRpc_registerAccessorProvider(
provider: ABinderRpc_AccessorProvider_getAccessorCallback,
instances: *const *const c_char,
numInstances: usize,
data: *mut c_void,
onDelete: ABinderRpc_AccessorProviderUserData_deleteCallback,
) -> *mut ABinderRpc_AccessorProviderExpand description
Inject an ABinderRpc_AccessorProvider_getAccessorCallback into the process for the Service Manager APIs to use to retrieve ABinderRpc_Accessor objects associated with different RPC Binder services.
\param provider callback that returns ABinderRpc_Accessors for libbinder to set up
RPC clients with.
\param instances array of instances that are supported by this provider. It
will only be called if the client is looking for an instance that is
in this list. These instances must be unique per-process. If an
instance is being registered that was previously registered, this call
will fail and the ABinderRpc_AccessorProviderUserData_deleteCallback
will be called to clean up the data.
This array of strings must remain valid and unchanged for the duration
of this function call.
\param number of instances in the instances array.
\param data pointer that is passed to the ABinderRpc_AccessorProvider callback.
IMPORTANT: The ABinderRpc_AccessorProvider 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_AccessorProvider is guaranteed to never be
called again. Before this callback is called, data must remain
valid.
\return nullptr on error if the data pointer is non-null and the onDelete
callback is null or if an instance in the instances list was previously
registered. In the error case of duplicate instances, if data was
provided with a ABinderRpc_AccessorProviderUserData_deleteCallback,
the callback will be called to delete the data.
If nullptr is returned, ABinderRpc_AccessorProviderUserData_deleteCallback
will be called on data immediately.
Otherwise returns a pointer to the ABinderRpc_AccessorProvider that
can be used to remove with ABinderRpc_unregisterAccessorProvider.