binder_ndk_sys

Function AIBinder_Class_setTransactionCodeToFunctionNameMap

Source
pub unsafe extern "C" fn AIBinder_Class_setTransactionCodeToFunctionNameMap(
    clazz: *mut AIBinder_Class,
    transactionCodeToFunctionMap: *mut *const c_char,
    length: usize,
)
Expand description

Associates a mapping of transaction codes(transaction_code_t) to function names for the given class.

Trace messages will use the provided names instead of bare integer codes when set. If not set by this function, trace messages will only be identified by the bare code. This should be called one time during clazz initialization. clazz is defined using AIBinder_Class_define and transactionCodeToFunctionMap should have same scope as clazz. Resetting/clearing the transactionCodeToFunctionMap is not allowed. Passing null for either clazz or transactionCodeToFunctionMap will abort.

Available since API level 36.

\param clazz class which should use this transaction to code function map. \param transactionCodeToFunctionMap array of function names indexed by transaction code. Transaction codes start from 1, functions with transaction code 1 will correspond to index 0 in transactionCodeToFunctionMap. When defining methods, transaction codes are expected to be contiguous, and this is required for maximum memory efficiency. You can use nullptr if certain transaction codes are not used. Lifetime should be same as clazz. \param length number of elements in the transactionCodeToFunctionMap