1use libc::sockaddr;
20
21extern "C" {
22 pub fn android_get_application_target_sdk_version() -> ::std::os::raw::c_int;
23}
24extern "C" {
25 pub fn android_get_device_api_level() -> ::std::os::raw::c_int;
26}
27pub type __kernel_ulong_t = ::std::os::raw::c_ulong;
28pub type __kernel_pid_t = ::std::os::raw::c_int;
29pub type __kernel_uid32_t = ::std::os::raw::c_uint;
30pub type __kernel_size_t = __kernel_ulong_t;
31pub type __uid_t = __kernel_uid32_t;
32pub type uid_t = __uid_t;
33pub type __pid_t = __kernel_pid_t;
34pub type pid_t = __pid_t;
35pub type __socklen_t = u32;
36pub type socklen_t = __socklen_t;
37extern "C" {
38 pub fn __assert(
39 __file: *const ::std::os::raw::c_char,
40 __line: ::std::os::raw::c_int,
41 __msg: *const ::std::os::raw::c_char,
42 ) -> !;
43}
44extern "C" {
45 pub fn __assert2(
46 __file: *const ::std::os::raw::c_char,
47 __line: ::std::os::raw::c_int,
48 __function: *const ::std::os::raw::c_char,
49 __msg: *const ::std::os::raw::c_char,
50 ) -> !;
51}
52extern "C" {
53 pub fn __errno() -> *mut ::std::os::raw::c_int;
54}
55#[doc = " One of the STATUS_* values.\n\n All unrecognized values are coerced into STATUS_UNKNOWN_ERROR."]
56pub type binder_status_t = i32;
57#[doc = " One of the EX_* enumerators.\n\n All unrecognized values are coerced into EX_TRANSACTION_FAILED.\n\n These exceptions values are used by the SDK for parcelables. Also see Parcel.java."]
58pub type binder_exception_t = i32;
59#[doc = " This is a helper class that encapsulates a standard way to keep track of and chain binder errors\n along with service specific errors.\n\n It is not required to be used in order to parcel/receive transactions, but it is required in\n order to be compatible with standard AIDL transactions since it is written as the header to the\n out parcel for transactions which get executed (don't fail during unparceling of input arguments\n or sooner)."]
60#[repr(C)]
61#[derive(Debug, Copy, Clone)]
62pub struct AStatus {
63 _unused: [u8; 0],
64}
65extern "C" {
66 #[doc = " New status which is considered a success.\n\n Available since API level 29.\n\n \\return a newly constructed status object that the caller owns."]
67 pub fn AStatus_newOk() -> *mut AStatus;
68}
69extern "C" {
70 #[doc = " New status with exception code.\n\n Available since API level 29.\n\n \\param exception the code that this status should represent. If this is EX_NONE, then this\n constructs an non-error status object.\n\n \\return a newly constructed status object that the caller owns."]
71 pub fn AStatus_fromExceptionCode(exception: binder_exception_t) -> *mut AStatus;
72}
73extern "C" {
74 #[doc = " New status with exception code and message.\n\n Available since API level 29.\n\n \\param exception the code that this status should represent. If this is EX_NONE, then this\n constructs an non-error status object.\n \\param message the error message to associate with this status object.\n\n \\return a newly constructed status object that the caller owns."]
75 pub fn AStatus_fromExceptionCodeWithMessage(
76 exception: binder_exception_t,
77 message: *const ::std::os::raw::c_char,
78 ) -> *mut AStatus;
79}
80extern "C" {
81 #[doc = " New status with a service speciic error.\n\n This is considered to be EX_TRANSACTION_FAILED with extra information.\n\n Available since API level 29.\n\n \\param serviceSpecific an implementation defined error code.\n\n \\return a newly constructed status object that the caller owns."]
82 pub fn AStatus_fromServiceSpecificError(serviceSpecific: i32) -> *mut AStatus;
83}
84extern "C" {
85 #[doc = " New status with a service specific error and message.\n\n This is considered to be EX_TRANSACTION_FAILED with extra information.\n\n Available since API level 29.\n\n \\param serviceSpecific an implementation defined error code.\n \\param message the error message to associate with this status object.\n\n \\return a newly constructed status object that the caller owns."]
86 pub fn AStatus_fromServiceSpecificErrorWithMessage(
87 serviceSpecific: i32,
88 message: *const ::std::os::raw::c_char,
89 ) -> *mut AStatus;
90}
91extern "C" {
92 #[doc = " New status with binder_status_t. This is typically for low level failures when a binder_status_t\n is returned by an API on AIBinder or AParcel, and that is to be returned from a method returning\n an AStatus instance. This is the least preferable way to return errors.\n Prefer exceptions (particularly service-specific errors) when possible.\n\n Available since API level 29.\n\n \\param status a low-level error to associate with this status object.\n\n \\return a newly constructed status object that the caller owns."]
93 pub fn AStatus_fromStatus(status: binder_status_t) -> *mut AStatus;
94}
95extern "C" {
96 #[doc = " Whether this object represents a successful transaction. If this function returns true, then\n AStatus_getExceptionCode will return EX_NONE.\n\n Available since API level 29.\n\n \\param status the status being queried.\n\n \\return whether the status represents a successful transaction. For more details, see below."]
97 pub fn AStatus_isOk(status: *const AStatus) -> bool;
98}
99extern "C" {
100 #[doc = " The exception that this status object represents.\n\n Available since API level 29.\n\n \\param status the status being queried.\n\n \\return the exception code that this object represents."]
101 pub fn AStatus_getExceptionCode(status: *const AStatus) -> binder_exception_t;
102}
103extern "C" {
104 #[doc = " The service specific error if this object represents one. This function will only ever return a\n non-zero result if AStatus_getExceptionCode returns EX_SERVICE_SPECIFIC. If this function returns\n 0, the status object may still represent a different exception or status. To find out if this\n transaction as a whole is okay, use AStatus_isOk instead.\n\n Available since API level 29.\n\n \\param status the status being queried.\n\n \\return the service-specific error code if the exception code is EX_SERVICE_SPECIFIC or 0."]
105 pub fn AStatus_getServiceSpecificError(status: *const AStatus) -> i32;
106}
107extern "C" {
108 #[doc = " The status if this object represents one. This function will only ever return a non-zero result\n if AStatus_getExceptionCode returns EX_TRANSACTION_FAILED. If this function return 0, the status\n object may represent a different exception or a service specific error. To find out if this\n transaction as a whole is okay, use AStatus_isOk instead.\n\n Available since API level 29.\n\n \\param status the status being queried.\n\n \\return the status code if the exception code is EX_TRANSACTION_FAILED or 0."]
109 pub fn AStatus_getStatus(status: *const AStatus) -> binder_status_t;
110}
111extern "C" {
112 #[doc = " If there is a message associated with this status, this will return that message. If there is no\n message, this will return an empty string.\n\n The returned string has the lifetime of the status object passed into this function.\n\n Available since API level 29.\n\n \\param status the status being queried.\n\n \\return the message associated with this error."]
113 pub fn AStatus_getMessage(status: *const AStatus) -> *const ::std::os::raw::c_char;
114}
115extern "C" {
116 #[doc = " Get human-readable description for debugging.\n\n Available since API level 30.\n\n \\param status the status being queried.\n\n \\return a description, must be deleted with AStatus_deleteDescription."]
117 pub fn AStatus_getDescription(status: *const AStatus) -> *const ::std::os::raw::c_char;
118}
119extern "C" {
120 #[doc = " Delete description.\n\n \\param description value from AStatus_getDescription"]
121 pub fn AStatus_deleteDescription(description: *const ::std::os::raw::c_char);
122}
123extern "C" {
124 #[doc = " Deletes memory associated with the status instance.\n\n Available since API level 29.\n\n \\param status the status to delete, returned from AStatus_newOk or one of the AStatus_from* APIs."]
125 pub fn AStatus_delete(status: *mut AStatus);
126}
127#[repr(C)]
128#[derive(Debug, Copy, Clone)]
129pub struct mbstate_t {
130 pub __seq: [::std::os::raw::c_uchar; 4usize],
131 pub __reserved: [::std::os::raw::c_uchar; 4usize],
132}
133#[test]
134fn bindgen_test_layout_mbstate_t() {
135 const UNINIT: ::std::mem::MaybeUninit<mbstate_t> = ::std::mem::MaybeUninit::uninit();
136 let ptr = UNINIT.as_ptr();
137 assert_eq!(
138 ::std::mem::size_of::<mbstate_t>(),
139 8usize,
140 concat!("Size of: ", stringify!(mbstate_t))
141 );
142 assert_eq!(
143 ::std::mem::align_of::<mbstate_t>(),
144 1usize,
145 concat!("Alignment of ", stringify!(mbstate_t))
146 );
147 assert_eq!(
148 unsafe { ::std::ptr::addr_of!((*ptr).__seq) as usize - ptr as usize },
149 0usize,
150 concat!("Offset of field: ", stringify!(mbstate_t), "::", stringify!(__seq))
151 );
152 assert_eq!(
153 unsafe { ::std::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize },
154 4usize,
155 concat!("Offset of field: ", stringify!(mbstate_t), "::", stringify!(__reserved))
156 );
157}
158extern "C" {
159 pub fn c16rtomb(__buf: *mut ::std::os::raw::c_char, __ch16: u16, __ps: *mut mbstate_t)
160 -> usize;
161}
162extern "C" {
163 pub fn c32rtomb(__buf: *mut ::std::os::raw::c_char, __ch32: u32, __ps: *mut mbstate_t)
164 -> usize;
165}
166extern "C" {
167 pub fn mbrtoc16(
168 __ch16: *mut u16,
169 __s: *const ::std::os::raw::c_char,
170 __n: usize,
171 __ps: *mut mbstate_t,
172 ) -> usize;
173}
174extern "C" {
175 pub fn mbrtoc32(
176 __ch32: *mut u32,
177 __s: *const ::std::os::raw::c_char,
178 __n: usize,
179 __ps: *mut mbstate_t,
180 ) -> usize;
181}
182#[doc = " Represents a local or remote object which can be used for IPC or which can itself be sent.\n\n This object has a refcount associated with it and will be deleted when its refcount reaches zero.\n How methods interactive with this refcount is described below. When using this API, it is\n intended for a client of a service to hold a strong reference to that service. This also means\n that user data typically should hold a strong reference to a local AIBinder object. A remote\n AIBinder object automatically holds a strong reference to the AIBinder object in the server's\n process. A typically memory layout looks like this:\n\n Key:\n ---> Ownership/a strong reference\n ...> A weak reference\n\n (process boundary)\n |\n MyInterface ---> AIBinder_Weak | ProxyForMyInterface\n ^ . | |\n | . | |\n | v | v\n UserData <--- AIBinder <-|- AIBinder\n |\n\n In this way, you'll notice that a proxy for the interface holds a strong reference to the\n implementation and that in the server process, the AIBinder object which was sent can be resent\n so that the same AIBinder object always represents the same object. This allows, for instance, an\n implementation (usually a callback) to transfer all ownership to a remote process and\n automatically be deleted when the remote process is done with it or dies. Other memory models are\n possible, but this is the standard one.\n\n If the process containing an AIBinder dies, it is possible to be holding a strong reference to\n an object which does not exist. In this case, transactions to this binder will return\n STATUS_DEAD_OBJECT. See also AIBinder_linkToDeath, AIBinder_unlinkToDeath, and AIBinder_isAlive.\n\n Once an AIBinder is created, anywhere it is passed (remotely or locally), there is a 1-1\n correspondence between the address of an AIBinder and the object it represents. This means that\n when two AIBinder pointers point to the same address, they represent the same object (whether\n that object is local or remote). This correspondance can be broken accidentally if AIBinder_new\n is erronesouly called to create the same object multiple times."]
183#[repr(C)]
184#[derive(Debug, Copy, Clone)]
185pub struct AIBinder {
186 _unused: [u8; 0],
187}
188#[doc = " This object represents a package of data that can be sent between processes. When transacting, an\n instance of it is automatically created to be used for the transaction. When two processes use\n binder to communicate, they must agree on a format of this parcel to be used in order to transfer\n data. This is usually done in an IDL (see AIDL, specificially)."]
189#[repr(C)]
190#[derive(Debug, Copy, Clone)]
191pub struct AParcel {
192 _unused: [u8; 0],
193}
194extern "C" {
195 #[doc = " Cleans up a parcel.\n\n Available since API level 29.\n\n \\param parcel A parcel returned by AIBinder_prepareTransaction or AIBinder_transact when a\n transaction is being aborted."]
196 pub fn AParcel_delete(parcel: *mut AParcel);
197}
198extern "C" {
199 #[doc = " Sets the position within the parcel.\n\n This must be called with a position that has been previously returned from\n AParcel_getDataPosition. If writes are made after setting the data position, they must\n be made in the exact same sequence used before resetting data position. Writing over\n objects such as binders or file descriptors is not supported.\n\n Available since API level 29.\n\n \\param parcel The parcel of which to set the position.\n \\param position Position of the parcel to set. This must be a value returned by\n AParcel_getDataPosition. Positions are constant for a given parcel between processes.\n\n \\return STATUS_OK on success. If position is negative, then STATUS_BAD_VALUE will be returned."]
200 pub fn AParcel_setDataPosition(parcel: *const AParcel, position: i32) -> binder_status_t;
201}
202extern "C" {
203 #[doc = " Gets the current position within the parcel.\n\n Available since API level 29.\n\n \\param parcel The parcel of which to get the position.\n\n \\return The size of the parcel. This will always be greater than 0. The values returned by this\n function before and after calling various reads and writes are not defined. Only the delta\n between two positions between a specific sequence of calls is defined. For instance, if position\n is X, writeBool is called, and then position is Y, readBool can be called from position X will\n return the same value, and then position will be Y."]
204 pub fn AParcel_getDataPosition(parcel: *const AParcel) -> i32;
205}
206#[doc = " This is called to allocate a buffer for a C-style string (null-terminated). The returned buffer\n should be at least length bytes. This includes space for a null terminator. For a string, length\n will always be strictly less than or equal to the maximum size that can be held in a size_t and\n will always be greater than 0. However, if a 'null' string is being read, length will be -1.\n\n See also AParcel_readString.\n\n If allocation fails, null should be returned.\n\n \\param stringData some external representation of a string\n \\param length the length of the buffer needed to fill (including the null-terminator)\n \\param buffer a buffer of size 'length' or null if allocation failed.\n\n \\return true if the allocation succeeded, false otherwise. If length is -1, a true return here\n means that a 'null' value (or equivalent) was successfully stored."]
207pub type AParcel_stringAllocator = ::std::option::Option<
208 unsafe extern "C" fn(
209 stringData: *mut ::std::os::raw::c_void,
210 length: i32,
211 buffer: *mut *mut ::std::os::raw::c_char,
212 ) -> bool,
213>;
214#[doc = " This is called to allocate an array of size 'length'. If length is -1, then a 'null' array (or\n equivalent) should be created.\n\n See also AParcel_readStringArray\n\n \\param arrayData some external representation of an array\n \\param length the length to allocate this array to\n\n \\return true if allocation succeeded. If length is -1, a true return here means that a 'null'\n value (or equivalent) was successfully stored."]
215pub type AParcel_stringArrayAllocator = ::std::option::Option<
216 unsafe extern "C" fn(arrayData: *mut ::std::os::raw::c_void, length: i32) -> bool,
217>;
218#[doc = " This is called to allocate a string inside of an array that was allocated by an\n AParcel_stringArrayAllocator.\n\n The index returned will always be within the range [0, length of arrayData). The returned buffer\n should be at least length bytes. This includes space for a null-terminator. For a string, length\n will always be strictly less than or equal to the maximum size that can be held in a size_t and\n will always be greater than 0. However, if a 'null' string is being read, length will be -1.\n\n See also AParcel_readStringArray\n\n \\param arrayData some external representation of an array.\n \\param index the index at which a string should be allocated.\n \\param length the length of the string to be allocated at this index. See also\n AParcel_stringAllocator. This includes the length required for a null-terminator.\n \\param buffer a buffer of size 'length' or null if allocation failed.\n\n \\return true if the allocation succeeded, false otherwise. If length is -1, a true return here\n means that a 'null' value (or equivalent) was successfully stored."]
219pub type AParcel_stringArrayElementAllocator = ::std::option::Option<
220 unsafe extern "C" fn(
221 arrayData: *mut ::std::os::raw::c_void,
222 index: usize,
223 length: i32,
224 buffer: *mut *mut ::std::os::raw::c_char,
225 ) -> bool,
226>;
227#[doc = " This returns the length and buffer of an array at a specific index in an arrayData object.\n\n See also AParcel_writeStringArray\n\n \\param arrayData some external representation of an array.\n \\param index the index at which a string should be allocated.\n \\param outLength an out parameter for the length of the string at the specified index. This\n should not include the length for a null-terminator if there is one. If the object at this index\n is 'null', then this should be set to -1.\n\n \\param a buffer of size outLength or more representing the string at the provided index. This is\n not required to be null-terminated. If the object at index is null, then this should be null."]
228pub type AParcel_stringArrayElementGetter = ::std::option::Option<
229 unsafe extern "C" fn(
230 arrayData: *const ::std::os::raw::c_void,
231 index: usize,
232 outLength: *mut i32,
233 ) -> *const ::std::os::raw::c_char,
234>;
235#[doc = " This is called to allocate an array of size 'length'. If length is -1, then a 'null' array (or\n equivalent) should be created.\n\n See also AParcel_readParcelableArray\n\n \\param arrayData some external representation of an array\n \\param length the length to allocate this array to\n\n \\return true if allocation succeeded. If length is -1, a true return here means that a 'null'\n value (or equivalent) was successfully stored."]
236pub type AParcel_parcelableArrayAllocator = ::std::option::Option<
237 unsafe extern "C" fn(arrayData: *mut ::std::os::raw::c_void, length: i32) -> bool,
238>;
239#[doc = " This is called to parcel the underlying data from an arrayData object at index.\n\n See also AParcel_writeParcelableArray\n\n \\param parcel parcel to write the parcelable to\n \\param arrayData some external representation of an array of parcelables (a user-defined type).\n \\param index the index of the value to be retrieved.\n\n \\return status (usually returned from other parceling functions). STATUS_OK for success."]
240pub type AParcel_writeParcelableElement = ::std::option::Option<
241 unsafe extern "C" fn(
242 parcel: *mut AParcel,
243 arrayData: *const ::std::os::raw::c_void,
244 index: usize,
245 ) -> binder_status_t,
246>;
247#[doc = " This is called to set an underlying value in an arrayData object at index.\n\n See also AParcel_readParcelableArray\n\n \\param parcel parcel to read the parcelable from\n \\param arrayData some external representation of an array of parcelables (a user-defined type).\n \\param index the index of the value to be set.\n\n \\return status (usually returned from other parceling functions). STATUS_OK for success."]
248pub type AParcel_readParcelableElement = ::std::option::Option<
249 unsafe extern "C" fn(
250 parcel: *const AParcel,
251 arrayData: *mut ::std::os::raw::c_void,
252 index: usize,
253 ) -> binder_status_t,
254>;
255#[doc = " This is called to get the underlying data from an arrayData object.\n\n The implementation of this function should allocate a contiguous array of size 'length' and\n return that underlying buffer to be filled out. If there is an error or length is 0, null may be\n returned. If length is -1, this should allocate some representation of a null array.\n\n See also AParcel_readInt32Array\n\n \\param arrayData some external representation of an array of int32_t.\n \\param length the length to allocate arrayData to.\n \\param outBuffer a buffer of int32_t of size 'length' (if length is >= 0, if length is 0, this\n may be nullptr).\n\n \\return whether or not the allocation was successful (or whether a null array is represented when\n length is -1)."]
256pub type AParcel_int32ArrayAllocator = ::std::option::Option<
257 unsafe extern "C" fn(
258 arrayData: *mut ::std::os::raw::c_void,
259 length: i32,
260 outBuffer: *mut *mut i32,
261 ) -> bool,
262>;
263#[doc = " This is called to get the underlying data from an arrayData object.\n\n The implementation of this function should allocate a contiguous array of size 'length' and\n return that underlying buffer to be filled out. If there is an error or length is 0, null may be\n returned. If length is -1, this should allocate some representation of a null array.\n\n See also AParcel_readUint32Array\n\n \\param arrayData some external representation of an array of uint32_t.\n \\param length the length to allocate arrayData to.\n \\param outBuffer a buffer of uint32_t of size 'length' (if length is >= 0, if length is 0, this\n may be nullptr).\n\n \\return whether or not the allocation was successful (or whether a null array is represented when\n length is -1)."]
264pub type AParcel_uint32ArrayAllocator = ::std::option::Option<
265 unsafe extern "C" fn(
266 arrayData: *mut ::std::os::raw::c_void,
267 length: i32,
268 outBuffer: *mut *mut u32,
269 ) -> bool,
270>;
271#[doc = " This is called to get the underlying data from an arrayData object.\n\n The implementation of this function should allocate a contiguous array of size 'length' and\n return that underlying buffer to be filled out. If there is an error or length is 0, null may be\n returned. If length is -1, this should allocate some representation of a null array.\n\n See also AParcel_readInt64Array\n\n \\param arrayData some external representation of an array of int64_t.\n \\param length the length to allocate arrayData to.\n \\param outBuffer a buffer of int64_t of size 'length' (if length is >= 0, if length is 0, this\n may be nullptr).\n\n \\return whether or not the allocation was successful (or whether a null array is represented when\n length is -1)."]
272pub type AParcel_int64ArrayAllocator = ::std::option::Option<
273 unsafe extern "C" fn(
274 arrayData: *mut ::std::os::raw::c_void,
275 length: i32,
276 outBuffer: *mut *mut i64,
277 ) -> bool,
278>;
279#[doc = " This is called to get the underlying data from an arrayData object.\n\n The implementation of this function should allocate a contiguous array of size 'length' and\n return that underlying buffer to be filled out. If there is an error or length is 0, null may be\n returned. If length is -1, this should allocate some representation of a null array.\n\n See also AParcel_readUint64Array\n\n \\param arrayData some external representation of an array of uint64_t.\n \\param length the length to allocate arrayData to.\n \\param outBuffer a buffer of uint64_t of size 'length' (if length is >= 0, if length is 0, this\n may be nullptr).\n\n \\return whether or not the allocation was successful (or whether a null array is represented when\n length is -1)."]
280pub type AParcel_uint64ArrayAllocator = ::std::option::Option<
281 unsafe extern "C" fn(
282 arrayData: *mut ::std::os::raw::c_void,
283 length: i32,
284 outBuffer: *mut *mut u64,
285 ) -> bool,
286>;
287#[doc = " This is called to get the underlying data from an arrayData object.\n\n The implementation of this function should allocate a contiguous array of size 'length' and\n return that underlying buffer to be filled out. If there is an error or length is 0, null may be\n returned. If length is -1, this should allocate some representation of a null array.\n\n See also AParcel_readFloatArray\n\n \\param arrayData some external representation of an array of float.\n \\param length the length to allocate arrayData to.\n \\param outBuffer a buffer of float of size 'length' (if length is >= 0, if length is 0, this may\n be nullptr).\n\n \\return whether or not the allocation was successful (or whether a null array is represented when\n length is -1)."]
288pub type AParcel_floatArrayAllocator = ::std::option::Option<
289 unsafe extern "C" fn(
290 arrayData: *mut ::std::os::raw::c_void,
291 length: i32,
292 outBuffer: *mut *mut f32,
293 ) -> bool,
294>;
295#[doc = " This is called to get the underlying data from an arrayData object.\n\n The implementation of this function should allocate a contiguous array of size 'length' and\n return that underlying buffer to be filled out. If there is an error or length is 0, null may be\n returned. If length is -1, this should allocate some representation of a null array.\n\n See also AParcel_readDoubleArray\n\n \\param arrayData some external representation of an array of double.\n \\param length the length to allocate arrayData to.\n \\param outBuffer a buffer of double of size 'length' (if length is >= 0, if length is 0, this may\n be nullptr).\n\n \\return whether or not the allocation was successful (or whether a null array is represented when\n length is -1)."]
296pub type AParcel_doubleArrayAllocator = ::std::option::Option<
297 unsafe extern "C" fn(
298 arrayData: *mut ::std::os::raw::c_void,
299 length: i32,
300 outBuffer: *mut *mut f64,
301 ) -> bool,
302>;
303#[doc = " This allocates an array of size 'length' inside of arrayData and returns whether or not there was\n a success. If length is -1, then this should allocate some representation of a null array.\n\n See also AParcel_readBoolArray\n\n \\param arrayData some external representation of an array of bool.\n \\param length the length to allocate arrayData to (or -1 if this represents a null array).\n\n \\return whether the allocation succeeded."]
304pub type AParcel_boolArrayAllocator = ::std::option::Option<
305 unsafe extern "C" fn(arrayData: *mut ::std::os::raw::c_void, length: i32) -> bool,
306>;
307#[doc = " This is called to get the underlying data from an arrayData object at index.\n\n See also AParcel_writeBoolArray\n\n \\param arrayData some external representation of an array of bool.\n \\param index the index of the value to be retrieved.\n\n \\return the value of the array at index index."]
308pub type AParcel_boolArrayGetter = ::std::option::Option<
309 unsafe extern "C" fn(arrayData: *const ::std::os::raw::c_void, index: usize) -> bool,
310>;
311#[doc = " This is called to set an underlying value in an arrayData object at index.\n\n See also AParcel_readBoolArray\n\n \\param arrayData some external representation of an array of bool.\n \\param index the index of the value to be set.\n \\param value the value to set at index index."]
312pub type AParcel_boolArraySetter = ::std::option::Option<
313 unsafe extern "C" fn(arrayData: *mut ::std::os::raw::c_void, index: usize, value: bool),
314>;
315#[doc = " This is called to get the underlying data from an arrayData object.\n\n The implementation of this function should allocate a contiguous array of size 'length' and\n return that underlying buffer to be filled out. If there is an error or length is 0, null may be\n returned. If length is -1, this should allocate some representation of a null array.\n\n See also AParcel_readCharArray\n\n \\param arrayData some external representation of an array of char16_t.\n \\param length the length to allocate arrayData to.\n \\param outBuffer a buffer of char16_t of size 'length' (if length is >= 0, if length is 0, this\n may be nullptr).\n\n \\return whether or not the allocation was successful (or whether a null array is represented when\n length is -1)."]
316pub type AParcel_charArrayAllocator = ::std::option::Option<
317 unsafe extern "C" fn(
318 arrayData: *mut ::std::os::raw::c_void,
319 length: i32,
320 outBuffer: *mut *mut u16,
321 ) -> bool,
322>;
323#[doc = " This is called to get the underlying data from an arrayData object.\n\n The implementation of this function should allocate a contiguous array of size 'length' and\n return that underlying buffer to be filled out. If there is an error or length is 0, null may be\n returned. If length is -1, this should allocate some representation of a null array.\n\n See also AParcel_readByteArray\n\n \\param arrayData some external representation of an array of int8_t.\n \\param length the length to allocate arrayData to.\n \\param outBuffer a buffer of int8_t of size 'length' (if length is >= 0, if length is 0, this may\n be nullptr).\n\n \\return whether or not the allocation was successful (or whether a null array is represented when\n length is -1)."]
324pub type AParcel_byteArrayAllocator = ::std::option::Option<
325 unsafe extern "C" fn(
326 arrayData: *mut ::std::os::raw::c_void,
327 length: i32,
328 outBuffer: *mut *mut i8,
329 ) -> bool,
330>;
331extern "C" {
332 #[doc = " Writes an AIBinder to the next location in a non-null parcel. Can be null. This does not take any\n refcounts of ownership of the binder from the client.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param binder the value to write to the parcel.\n\n \\return STATUS_OK on successful write."]
333 pub fn AParcel_writeStrongBinder(
334 parcel: *mut AParcel,
335 binder: *mut AIBinder,
336 ) -> binder_status_t;
337}
338extern "C" {
339 #[doc = " Reads an AIBinder from the next location in a non-null parcel. One strong ref-count of ownership\n is passed to the caller of this function.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param binder the out parameter for what is read from the parcel. This may be null.\n\n \\return STATUS_OK on successful write."]
340 pub fn AParcel_readStrongBinder(
341 parcel: *const AParcel,
342 binder: *mut *mut AIBinder,
343 ) -> binder_status_t;
344}
345extern "C" {
346 #[doc = " Writes a file descriptor to the next location in a non-null parcel. This does not take ownership\n of fd.\n\n This corresponds to the SDK's android.os.ParcelFileDescriptor.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param fd the value to write to the parcel (-1 to represent a null ParcelFileDescriptor).\n\n \\return STATUS_OK on successful write."]
347 pub fn AParcel_writeParcelFileDescriptor(
348 parcel: *mut AParcel,
349 fd: ::std::os::raw::c_int,
350 ) -> binder_status_t;
351}
352extern "C" {
353 #[doc = " Reads an int from the next location in a non-null parcel.\n\n The returned fd must be closed.\n\n This corresponds to the SDK's android.os.ParcelFileDescriptor.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param fd the out parameter for what is read from the parcel (or -1 to represent a null\n ParcelFileDescriptor)\n\n \\return STATUS_OK on successful write."]
354 pub fn AParcel_readParcelFileDescriptor(
355 parcel: *const AParcel,
356 fd: *mut ::std::os::raw::c_int,
357 ) -> binder_status_t;
358}
359extern "C" {
360 #[doc = " Writes an AStatus object to the next location in a non-null parcel.\n\n If the status is considered to be a low-level status and has no additional information other\n than a binder_status_t (for instance, if it is created with AStatus_fromStatus), then that\n status will be returned from this method and nothing will be written to the parcel. If either\n this happens or if writing the status object itself fails, the return value from this function\n should be propagated to the client, and AParcel_readStatusHeader shouldn't be called.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param status the value to write to the parcel.\n\n \\return STATUS_OK on successful write."]
361 pub fn AParcel_writeStatusHeader(
362 parcel: *mut AParcel,
363 status: *const AStatus,
364 ) -> binder_status_t;
365}
366extern "C" {
367 #[doc = " Reads an AStatus from the next location in a non-null parcel. Ownership is passed to the caller\n of this function.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param status the out parameter for what is read from the parcel.\n\n \\return STATUS_OK on successful write."]
368 pub fn AParcel_readStatusHeader(
369 parcel: *const AParcel,
370 status: *mut *mut AStatus,
371 ) -> binder_status_t;
372}
373extern "C" {
374 #[doc = " Writes utf-8 string value to the next location in a non-null parcel.\n\n If length is -1, and string is nullptr, this will write a 'null' string to the parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param string the null-terminated string to write to the parcel, at least of size 'length'.\n \\param length the length of the string to be written.\n\n \\return STATUS_OK on successful write."]
375 pub fn AParcel_writeString(
376 parcel: *mut AParcel,
377 string: *const ::std::os::raw::c_char,
378 length: i32,
379 ) -> binder_status_t;
380}
381extern "C" {
382 #[doc = " Reads and allocates utf-8 string value from the next location in a non-null parcel.\n\n Data is passed to the string allocator once the string size is known. This size includes the\n space for the null-terminator of this string. This allocator returns a buffer which is used as\n the output buffer from this read. If there is a 'null' string on the binder buffer, the allocator\n will be called with length -1.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param stringData some external representation of a string.\n \\param allocator allocator that will be called once the size of the string is known.\n\n \\return STATUS_OK on successful write."]
383 pub fn AParcel_readString(
384 parcel: *const AParcel,
385 stringData: *mut ::std::os::raw::c_void,
386 allocator: AParcel_stringAllocator,
387 ) -> binder_status_t;
388}
389extern "C" {
390 #[doc = " Writes utf-8 string array data to the next location in a non-null parcel.\n\n length is the length of the array. AParcel_stringArrayElementGetter will be called for all\n indices in range [0, length) with the arrayData provided here. The string length and buffer\n returned from this function will be used to fill out the data from the parcel. If length is -1,\n this will write a 'null' string array to the binder buffer.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param arrayData some external representation of an array.\n \\param length the length of the array to be written.\n \\param getter the callback that will be called for every index of the array to retrieve the\n corresponding string buffer.\n\n \\return STATUS_OK on successful write."]
391 pub fn AParcel_writeStringArray(
392 parcel: *mut AParcel,
393 arrayData: *const ::std::os::raw::c_void,
394 length: i32,
395 getter: AParcel_stringArrayElementGetter,
396 ) -> binder_status_t;
397}
398extern "C" {
399 #[doc = " Reads and allocates utf-8 string array value from the next location in a non-null parcel.\n\n First, AParcel_stringArrayAllocator will be called with the size of the array to be read where\n length is the length of the array to be read from the parcel. Then, for each index i in [0,\n length), AParcel_stringArrayElementAllocator will be called with the length of the string to be\n read from the parcel. The resultant buffer from each of these calls will be filled according to\n the contents of the string that is read. If the string array being read is 'null', this will\n instead just pass -1 to AParcel_stringArrayAllocator.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param arrayData some external representation of an array.\n \\param allocator the callback that will be called with arrayData once the size of the output\n array is known.\n \\param elementAllocator the callback that will be called on every index of arrayData to allocate\n the string at that location.\n\n \\return STATUS_OK on successful read."]
400 pub fn AParcel_readStringArray(
401 parcel: *const AParcel,
402 arrayData: *mut ::std::os::raw::c_void,
403 allocator: AParcel_stringArrayAllocator,
404 elementAllocator: AParcel_stringArrayElementAllocator,
405 ) -> binder_status_t;
406}
407extern "C" {
408 #[doc = " Writes an array of parcelables (user-defined types) to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param arrayData an array of size 'length' (or null if length is -1, may be null if length is 0).\n \\param length the length of arrayData or -1 if this represents a null array.\n \\param elementWriter function to be called for every array index to write the user-defined type\n at that location.\n\n \\return STATUS_OK on successful write."]
409 pub fn AParcel_writeParcelableArray(
410 parcel: *mut AParcel,
411 arrayData: *const ::std::os::raw::c_void,
412 length: i32,
413 elementWriter: AParcel_writeParcelableElement,
414 ) -> binder_status_t;
415}
416extern "C" {
417 #[doc = " Reads an array of parcelables (user-defined types) from the next location in a non-null parcel.\n\n First, allocator will be called with the length of the array. If the allocation succeeds and the\n length is greater than zero, elementReader will be called for every index to read the\n corresponding parcelable.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param arrayData some external representation of an array.\n \\param allocator the callback that will be called to allocate the array.\n \\param elementReader the callback that will be called to fill out individual elements.\n\n \\return STATUS_OK on successful read."]
418 pub fn AParcel_readParcelableArray(
419 parcel: *const AParcel,
420 arrayData: *mut ::std::os::raw::c_void,
421 allocator: AParcel_parcelableArrayAllocator,
422 elementReader: AParcel_readParcelableElement,
423 ) -> binder_status_t;
424}
425extern "C" {
426 #[doc = " Writes int32_t value to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param value the value to write to the parcel.\n\n \\return STATUS_OK on successful write."]
427 pub fn AParcel_writeInt32(parcel: *mut AParcel, value: i32) -> binder_status_t;
428}
429extern "C" {
430 #[doc = " Writes uint32_t value to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param value the value to write to the parcel.\n\n \\return STATUS_OK on successful write."]
431 pub fn AParcel_writeUint32(parcel: *mut AParcel, value: u32) -> binder_status_t;
432}
433extern "C" {
434 #[doc = " Writes int64_t value to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param value the value to write to the parcel.\n\n \\return STATUS_OK on successful write."]
435 pub fn AParcel_writeInt64(parcel: *mut AParcel, value: i64) -> binder_status_t;
436}
437extern "C" {
438 #[doc = " Writes uint64_t value to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param value the value to write to the parcel.\n\n \\return STATUS_OK on successful write."]
439 pub fn AParcel_writeUint64(parcel: *mut AParcel, value: u64) -> binder_status_t;
440}
441extern "C" {
442 #[doc = " Writes float value to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param value the value to write to the parcel.\n\n \\return STATUS_OK on successful write."]
443 pub fn AParcel_writeFloat(parcel: *mut AParcel, value: f32) -> binder_status_t;
444}
445extern "C" {
446 #[doc = " Writes double value to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param value the value to write to the parcel.\n\n \\return STATUS_OK on successful write."]
447 pub fn AParcel_writeDouble(parcel: *mut AParcel, value: f64) -> binder_status_t;
448}
449extern "C" {
450 #[doc = " Writes bool value to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param value the value to write to the parcel.\n\n \\return STATUS_OK on successful write."]
451 pub fn AParcel_writeBool(parcel: *mut AParcel, value: bool) -> binder_status_t;
452}
453extern "C" {
454 #[doc = " Writes char16_t value to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param value the value to write to the parcel.\n\n \\return STATUS_OK on successful write."]
455 pub fn AParcel_writeChar(parcel: *mut AParcel, value: u16) -> binder_status_t;
456}
457extern "C" {
458 #[doc = " Writes int8_t value to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param value the value to write to the parcel.\n\n \\return STATUS_OK on successful write."]
459 pub fn AParcel_writeByte(parcel: *mut AParcel, value: i8) -> binder_status_t;
460}
461extern "C" {
462 #[doc = " Reads into int32_t value from the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param value the value to read from the parcel.\n\n \\return STATUS_OK on successful read."]
463 pub fn AParcel_readInt32(parcel: *const AParcel, value: *mut i32) -> binder_status_t;
464}
465extern "C" {
466 #[doc = " Reads into uint32_t value from the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param value the value to read from the parcel.\n\n \\return STATUS_OK on successful read."]
467 pub fn AParcel_readUint32(parcel: *const AParcel, value: *mut u32) -> binder_status_t;
468}
469extern "C" {
470 #[doc = " Reads into int64_t value from the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param value the value to read from the parcel.\n\n \\return STATUS_OK on successful read."]
471 pub fn AParcel_readInt64(parcel: *const AParcel, value: *mut i64) -> binder_status_t;
472}
473extern "C" {
474 #[doc = " Reads into uint64_t value from the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param value the value to read from the parcel.\n\n \\return STATUS_OK on successful read."]
475 pub fn AParcel_readUint64(parcel: *const AParcel, value: *mut u64) -> binder_status_t;
476}
477extern "C" {
478 #[doc = " Reads into float value from the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param value the value to read from the parcel.\n\n \\return STATUS_OK on successful read."]
479 pub fn AParcel_readFloat(parcel: *const AParcel, value: *mut f32) -> binder_status_t;
480}
481extern "C" {
482 #[doc = " Reads into double value from the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param value the value to read from the parcel.\n\n \\return STATUS_OK on successful read."]
483 pub fn AParcel_readDouble(parcel: *const AParcel, value: *mut f64) -> binder_status_t;
484}
485extern "C" {
486 #[doc = " Reads into bool value from the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param value the value to read from the parcel.\n\n \\return STATUS_OK on successful read."]
487 pub fn AParcel_readBool(parcel: *const AParcel, value: *mut bool) -> binder_status_t;
488}
489extern "C" {
490 #[doc = " Reads into char16_t value from the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param value the value to read from the parcel.\n\n \\return STATUS_OK on successful read."]
491 pub fn AParcel_readChar(parcel: *const AParcel, value: *mut u16) -> binder_status_t;
492}
493extern "C" {
494 #[doc = " Reads into int8_t value from the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param value the value to read from the parcel.\n\n \\return STATUS_OK on successful read."]
495 pub fn AParcel_readByte(parcel: *const AParcel, value: *mut i8) -> binder_status_t;
496}
497extern "C" {
498 #[doc = " Writes an array of int32_t to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param arrayData an array of size 'length' (or null if length is -1, may be null if length is 0).\n \\param length the length of arrayData or -1 if this represents a null array.\n\n \\return STATUS_OK on successful write."]
499 pub fn AParcel_writeInt32Array(
500 parcel: *mut AParcel,
501 arrayData: *const i32,
502 length: i32,
503 ) -> binder_status_t;
504}
505extern "C" {
506 #[doc = " Writes an array of uint32_t to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param arrayData an array of size 'length' (or null if length is -1, may be null if length is 0).\n \\param length the length of arrayData or -1 if this represents a null array.\n\n \\return STATUS_OK on successful write."]
507 pub fn AParcel_writeUint32Array(
508 parcel: *mut AParcel,
509 arrayData: *const u32,
510 length: i32,
511 ) -> binder_status_t;
512}
513extern "C" {
514 #[doc = " Writes an array of int64_t to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param arrayData an array of size 'length' (or null if length is -1, may be null if length is 0).\n \\param length the length of arrayData or -1 if this represents a null array.\n\n \\return STATUS_OK on successful write."]
515 pub fn AParcel_writeInt64Array(
516 parcel: *mut AParcel,
517 arrayData: *const i64,
518 length: i32,
519 ) -> binder_status_t;
520}
521extern "C" {
522 #[doc = " Writes an array of uint64_t to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param arrayData an array of size 'length' (or null if length is -1, may be null if length is 0).\n \\param length the length of arrayData or -1 if this represents a null array.\n\n \\return STATUS_OK on successful write."]
523 pub fn AParcel_writeUint64Array(
524 parcel: *mut AParcel,
525 arrayData: *const u64,
526 length: i32,
527 ) -> binder_status_t;
528}
529extern "C" {
530 #[doc = " Writes an array of float to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param arrayData an array of size 'length' (or null if length is -1, may be null if length is 0).\n \\param length the length of arrayData or -1 if this represents a null array.\n\n \\return STATUS_OK on successful write."]
531 pub fn AParcel_writeFloatArray(
532 parcel: *mut AParcel,
533 arrayData: *const f32,
534 length: i32,
535 ) -> binder_status_t;
536}
537extern "C" {
538 #[doc = " Writes an array of double to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param arrayData an array of size 'length' (or null if length is -1, may be null if length is 0).\n \\param length the length of arrayData or -1 if this represents a null array.\n\n \\return STATUS_OK on successful write."]
539 pub fn AParcel_writeDoubleArray(
540 parcel: *mut AParcel,
541 arrayData: *const f64,
542 length: i32,
543 ) -> binder_status_t;
544}
545extern "C" {
546 #[doc = " Writes an array of bool to the next location in a non-null parcel.\n\n getter(arrayData, i) will be called for each i in [0, length) in order to get the underlying\n values to write to the parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param arrayData some external representation of an array.\n \\param length the length of arrayData (or -1 if this represents a null array).\n \\param getter the callback to retrieve data at specific locations in the array.\n\n \\return STATUS_OK on successful write."]
547 pub fn AParcel_writeBoolArray(
548 parcel: *mut AParcel,
549 arrayData: *const ::std::os::raw::c_void,
550 length: i32,
551 getter: AParcel_boolArrayGetter,
552 ) -> binder_status_t;
553}
554extern "C" {
555 #[doc = " Writes an array of char16_t to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param arrayData an array of size 'length' (or null if length is -1, may be null if length is 0).\n \\param length the length of arrayData or -1 if this represents a null array.\n\n \\return STATUS_OK on successful write."]
556 pub fn AParcel_writeCharArray(
557 parcel: *mut AParcel,
558 arrayData: *const u16,
559 length: i32,
560 ) -> binder_status_t;
561}
562extern "C" {
563 #[doc = " Writes an array of int8_t to the next location in a non-null parcel.\n\n Available since API level 29.\n\n \\param parcel the parcel to write to.\n \\param arrayData an array of size 'length' (or null if length is -1, may be null if length is 0).\n \\param length the length of arrayData or -1 if this represents a null array.\n\n \\return STATUS_OK on successful write."]
564 pub fn AParcel_writeByteArray(
565 parcel: *mut AParcel,
566 arrayData: *const i8,
567 length: i32,
568 ) -> binder_status_t;
569}
570extern "C" {
571 #[doc = " Reads an array of int32_t from the next location in a non-null parcel.\n\n First, allocator will be called with the length of the array. If the allocation succeeds and the\n length is greater than zero, the buffer returned by the allocator will be filled with the\n corresponding data\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param arrayData some external representation of an array.\n \\param allocator the callback that will be called to allocate the array.\n\n \\return STATUS_OK on successful read."]
572 pub fn AParcel_readInt32Array(
573 parcel: *const AParcel,
574 arrayData: *mut ::std::os::raw::c_void,
575 allocator: AParcel_int32ArrayAllocator,
576 ) -> binder_status_t;
577}
578extern "C" {
579 #[doc = " Reads an array of uint32_t from the next location in a non-null parcel.\n\n First, allocator will be called with the length of the array. If the allocation succeeds and the\n length is greater than zero, the buffer returned by the allocator will be filled with the\n corresponding data\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param arrayData some external representation of an array.\n \\param allocator the callback that will be called to allocate the array.\n\n \\return STATUS_OK on successful read."]
580 pub fn AParcel_readUint32Array(
581 parcel: *const AParcel,
582 arrayData: *mut ::std::os::raw::c_void,
583 allocator: AParcel_uint32ArrayAllocator,
584 ) -> binder_status_t;
585}
586extern "C" {
587 #[doc = " Reads an array of int64_t from the next location in a non-null parcel.\n\n First, allocator will be called with the length of the array. If the allocation succeeds and the\n length is greater than zero, the buffer returned by the allocator will be filled with the\n corresponding data\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param arrayData some external representation of an array.\n \\param allocator the callback that will be called to allocate the array.\n\n \\return STATUS_OK on successful read."]
588 pub fn AParcel_readInt64Array(
589 parcel: *const AParcel,
590 arrayData: *mut ::std::os::raw::c_void,
591 allocator: AParcel_int64ArrayAllocator,
592 ) -> binder_status_t;
593}
594extern "C" {
595 #[doc = " Reads an array of uint64_t from the next location in a non-null parcel.\n\n First, allocator will be called with the length of the array. If the allocation succeeds and the\n length is greater than zero, the buffer returned by the allocator will be filled with the\n corresponding data\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param arrayData some external representation of an array.\n \\param allocator the callback that will be called to allocate the array.\n\n \\return STATUS_OK on successful read."]
596 pub fn AParcel_readUint64Array(
597 parcel: *const AParcel,
598 arrayData: *mut ::std::os::raw::c_void,
599 allocator: AParcel_uint64ArrayAllocator,
600 ) -> binder_status_t;
601}
602extern "C" {
603 #[doc = " Reads an array of float from the next location in a non-null parcel.\n\n First, allocator will be called with the length of the array. If the allocation succeeds and the\n length is greater than zero, the buffer returned by the allocator will be filled with the\n corresponding data\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param arrayData some external representation of an array.\n \\param allocator the callback that will be called to allocate the array.\n\n \\return STATUS_OK on successful read."]
604 pub fn AParcel_readFloatArray(
605 parcel: *const AParcel,
606 arrayData: *mut ::std::os::raw::c_void,
607 allocator: AParcel_floatArrayAllocator,
608 ) -> binder_status_t;
609}
610extern "C" {
611 #[doc = " Reads an array of double from the next location in a non-null parcel.\n\n First, allocator will be called with the length of the array. If the allocation succeeds and the\n length is greater than zero, the buffer returned by the allocator will be filled with the\n corresponding data\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param arrayData some external representation of an array.\n \\param allocator the callback that will be called to allocate the array.\n\n \\return STATUS_OK on successful read."]
612 pub fn AParcel_readDoubleArray(
613 parcel: *const AParcel,
614 arrayData: *mut ::std::os::raw::c_void,
615 allocator: AParcel_doubleArrayAllocator,
616 ) -> binder_status_t;
617}
618extern "C" {
619 #[doc = " Reads an array of bool from the next location in a non-null parcel.\n\n First, allocator will be called with the length of the array. Then, for every i in [0, length),\n setter(arrayData, i, x) will be called where x is the value at the associated index.\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param arrayData some external representation of an array.\n \\param allocator the callback that will be called to allocate the array.\n \\param setter the callback that will be called to set a value at a specific location in the\n array.\n\n \\return STATUS_OK on successful read."]
620 pub fn AParcel_readBoolArray(
621 parcel: *const AParcel,
622 arrayData: *mut ::std::os::raw::c_void,
623 allocator: AParcel_boolArrayAllocator,
624 setter: AParcel_boolArraySetter,
625 ) -> binder_status_t;
626}
627extern "C" {
628 #[doc = " Reads an array of char16_t from the next location in a non-null parcel.\n\n First, allocator will be called with the length of the array. If the allocation succeeds and the\n length is greater than zero, the buffer returned by the allocator will be filled with the\n corresponding data\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param arrayData some external representation of an array.\n \\param allocator the callback that will be called to allocate the array.\n\n \\return STATUS_OK on successful read."]
629 pub fn AParcel_readCharArray(
630 parcel: *const AParcel,
631 arrayData: *mut ::std::os::raw::c_void,
632 allocator: AParcel_charArrayAllocator,
633 ) -> binder_status_t;
634}
635extern "C" {
636 #[doc = " Reads an array of int8_t from the next location in a non-null parcel.\n\n First, allocator will be called with the length of the array. If the allocation succeeds and the\n length is greater than zero, the buffer returned by the allocator will be filled with the\n corresponding data\n\n Available since API level 29.\n\n \\param parcel the parcel to read from.\n \\param arrayData some external representation of an array.\n \\param allocator the callback that will be called to allocate the array.\n\n \\return STATUS_OK on successful read."]
637 pub fn AParcel_readByteArray(
638 parcel: *const AParcel,
639 arrayData: *mut ::std::os::raw::c_void,
640 allocator: AParcel_byteArrayAllocator,
641 ) -> binder_status_t;
642}
643extern "C" {
644 #[doc = " Reset the parcel to the initial status.\n\n Available since API level 31.\n\n \\param parcel The parcel of which to be reset.\n\n \\return STATUS_OK on success."]
645 pub fn AParcel_reset(parcel: *mut AParcel) -> binder_status_t;
646}
647extern "C" {
648 #[doc = " Gets the size of the parcel.\n\n Available since API level 31.\n\n \\param parcel The parcel of which to get the size.\n\n \\return The size of the parcel."]
649 pub fn AParcel_getDataSize(parcel: *const AParcel) -> i32;
650}
651extern "C" {
652 #[doc = " Copy the data of a parcel to other parcel.\n\n Available since API level 31.\n\n \\param from The source\n \\param to The detination\n \\param start The position where the copied data starts.\n \\param size The amount of data which will be copied.\n\n \\return STATUS_OK on success."]
653 pub fn AParcel_appendFrom(
654 from: *const AParcel,
655 to: *mut AParcel,
656 start: i32,
657 size: i32,
658 ) -> binder_status_t;
659}
660extern "C" {
661 #[doc = " Creates a parcel.\n\n Available since API level 31.\n\n \\return A parcel which is not related to any IBinder objects."]
662 pub fn AParcel_create() -> *mut AParcel;
663}
664extern "C" {
665 #[doc = " Marshals the raw bytes of the Parcel to a buffer.\n\n Available since API level 33.\n\n The parcel must not contain any binders or file descriptors.\n\n The data you retrieve here must not be placed in any kind of persistent storage. (on local disk,\n across a network, etc). For that, you should use standard serialization or another kind of\n general serialization mechanism. The Parcel marshalled representation is highly optimized for\n local IPC, and as such does not attempt to maintain compatibility with data created in different\n versions of the platform.\n\n \\param parcel The parcel of which to get the data.\n \\param buffer The buffer to copy the raw bytes to.\n \\param start The start position in the buffer to copy from.\n \\param len The size of the data to copy, buffer size must be larger or equal to this.\n\n \\return STATUS_OK on success, STATUS_INVALID_OPERATION if parcel contains binders or file\n descriptors. STATUS_BAD_VALUE if the buffer size is less than parcel size."]
666 pub fn AParcel_marshal(
667 parcel: *const AParcel,
668 buffer: *mut u8,
669 start: usize,
670 len: usize,
671 ) -> binder_status_t;
672}
673extern "C" {
674 #[doc = " Set the data in the parcel to the raw bytes from the buffer.\n\n Available since API level 33.\n\n \\param parcel The parcel to set data.\n \\param buffer The data buffer to set.\n \\param len The size of the data to set.\n\n \\return STATUS_OK on success."]
675 pub fn AParcel_unmarshal(
676 parcel: *mut AParcel,
677 buffer: *const u8,
678 len: usize,
679 ) -> binder_status_t;
680}
681#[doc = " Flags for AIBinder_transact."]
682pub type binder_flags_t = u32;
683#[doc = " Codes for AIBinder_transact. This defines the range of codes available for\n usage. Other codes are used or reserved by the Android system."]
684pub type transaction_code_t = u32;
685#[doc = " Represents a type of AIBinder object which can be sent out."]
686#[repr(C)]
687#[derive(Debug, Copy, Clone)]
688pub struct AIBinder_Class {
689 _unused: [u8; 0],
690}
691#[doc = " The AIBinder object associated with this can be retrieved if it is still alive so that it can be\n re-used. The intention of this is to enable the same AIBinder object to always represent the same\n object."]
692#[repr(C)]
693#[derive(Debug, Copy, Clone)]
694pub struct AIBinder_Weak {
695 _unused: [u8; 0],
696}
697#[doc = " Represents a handle on a death notification. See AIBinder_linkToDeath/AIBinder_unlinkToDeath."]
698#[repr(C)]
699#[derive(Debug, Copy, Clone)]
700pub struct AIBinder_DeathRecipient {
701 _unused: [u8; 0],
702}
703#[doc = " This is called whenever a new AIBinder object is needed of a specific class.\n\n \\param args these can be used to construct a new class. These are passed from AIBinder_new.\n \\return this is the userdata representing the class. It can be retrieved using\n AIBinder_getUserData."]
704pub type AIBinder_Class_onCreate = ::std::option::Option<
705 unsafe extern "C" fn(args: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void,
706>;
707#[doc = " This is called whenever an AIBinder object is no longer referenced and needs destroyed.\n\n Typically, this just deletes whatever the implementation is.\n\n \\param userData this is the same object returned by AIBinder_Class_onCreate"]
708pub type AIBinder_Class_onDestroy =
709 ::std::option::Option<unsafe extern "C" fn(userData: *mut ::std::os::raw::c_void)>;
710#[doc = " This is called whenever a transaction needs to be processed by a local implementation.\n\n This method will be called after the equivalent of\n android.os.Parcel#enforceInterface is called. That is, the interface\n descriptor associated with the AIBinder_Class descriptor will already be\n checked.\n\n \\param binder the object being transacted on.\n \\param code implementation-specific code representing which transaction should be taken.\n \\param in the implementation-specific input data to this transaction.\n \\param out the implementation-specific output data to this transaction.\n\n \\return the implementation-specific output code. This may be forwarded from another service, the\n result of a parcel read or write, or another error as is applicable to the specific\n implementation. Usually, implementation-specific error codes are written to the output parcel,\n and the transaction code is reserved for kernel errors or error codes that have been repeated\n from subsequent transactions."]
711pub type AIBinder_Class_onTransact = ::std::option::Option<
712 unsafe extern "C" fn(
713 binder: *mut AIBinder,
714 code: transaction_code_t,
715 in_: *const AParcel,
716 out: *mut AParcel,
717 ) -> binder_status_t,
718>;
719extern "C" {
720 #[doc = " This creates a new instance of a class of binders which can be instantiated. This is called one\n time during library initialization and cleaned up when the process exits or execs.\n\n None of these parameters can be null.\n\n Available since API level 29.\n\n \\param interfaceDescriptor this is a unique identifier for the class. This is used internally for\n validity checks on transactions. This should be utf-8.\n \\param onCreate see AIBinder_Class_onCreate.\n \\param onDestroy see AIBinder_Class_onDestroy.\n \\param onTransact see AIBinder_Class_onTransact.\n\n \\return the class object representing these parameters or null on error."]
721 pub fn AIBinder_Class_define(
722 interfaceDescriptor: *const ::std::os::raw::c_char,
723 onCreate: AIBinder_Class_onCreate,
724 onDestroy: AIBinder_Class_onDestroy,
725 onTransact: AIBinder_Class_onTransact,
726 ) -> *mut AIBinder_Class;
727}
728#[doc = " Dump information about an AIBinder (usually for debugging).\n\n When no arguments are provided, a brief overview of the interview should be given.\n\n \\param binder interface being dumped\n \\param fd file descriptor to be dumped to, should be flushed, ownership is not passed.\n \\param args array of null-terminated strings for dump (may be null if numArgs is 0)\n \\param numArgs number of args to be sent\n\n \\return binder_status_t result of transaction (if remote, for instance)"]
729pub type AIBinder_onDump = ::std::option::Option<
730 unsafe extern "C" fn(
731 binder: *mut AIBinder,
732 fd: ::std::os::raw::c_int,
733 args: *mut *const ::std::os::raw::c_char,
734 numArgs: u32,
735 ) -> binder_status_t,
736>;
737extern "C" {
738 #[doc = " This sets the implementation of the dump method for a class.\n\n If this isn't set, nothing will be dumped when dump is called (for instance with\n android.os.Binder#dump). Must be called before any instance of the class is created.\n\n Available since API level 29.\n\n \\param clazz class which should use this dump function\n \\param onDump function to call when an instance of this binder class is being dumped."]
739 pub fn AIBinder_Class_setOnDump(clazz: *mut AIBinder_Class, onDump: AIBinder_onDump);
740}
741extern "C" {
742 #[doc = " Associates a mapping of transaction codes(transaction_code_t) to function names for the given\n class.\n\n Trace messages will use the provided names instead of bare integer codes when set. If not set by\n this function, trace messages will only be identified by the bare code. This should be called one\n time during clazz initialization. clazz is defined using AIBinder_Class_define and\n transactionCodeToFunctionMap should have same scope as clazz. Resetting/clearing the\n transactionCodeToFunctionMap is not allowed. Passing null for either clazz or\n transactionCodeToFunctionMap will abort.\n\n Available since API level 36.\n\n \\param clazz class which should use this transaction to code function map.\n \\param transactionCodeToFunctionMap array of function names indexed by transaction code.\n Transaction codes start from 1, functions with transaction code 1 will correspond to index 0 in\n transactionCodeToFunctionMap. When defining methods, transaction codes are expected to be\n contiguous, and this is required for maximum memory efficiency.\n You can use nullptr if certain transaction codes are not used. Lifetime should be same as clazz.\n \\param length number of elements in the transactionCodeToFunctionMap"]
743 pub fn AIBinder_Class_setTransactionCodeToFunctionNameMap(
744 clazz: *mut AIBinder_Class,
745 transactionCodeToFunctionMap: *mut *const ::std::os::raw::c_char,
746 length: usize,
747 );
748}
749extern "C" {
750 #[doc = " Get function name associated with transaction code for given class\n\n This function returns function name associated with provided transaction code for given class.\n AIBinder_Class_setTransactionCodeToFunctionNameMap should be called first to associate function\n to transaction code mapping.\n\n Available since API level 36.\n\n \\param clazz class for which function name is requested\n \\param transactionCode transaction_code_t for which function name is requested.\n\n \\return function name in form of const char* if transaction code is valid for given class.\n The value returned is valid for the lifetime of clazz. if transaction code is invalid or\n transactionCodeToFunctionMap is not set, nullptr is returned."]
751 pub fn AIBinder_Class_getFunctionName(
752 clazz: *mut AIBinder_Class,
753 code: transaction_code_t,
754 ) -> *const ::std::os::raw::c_char;
755}
756extern "C" {
757 #[doc = " This tells users of this class not to use a transaction header. By default, libbinder_ndk users\n read/write transaction headers implicitly (in the SDK, this must be manually written by\n android.os.Parcel#writeInterfaceToken, and it is read/checked with\n android.os.Parcel#enforceInterface). This method is provided in order to talk to legacy code\n which does not write an interface token. When this is disabled, type safety is reduced, so you\n must have a separate way of determining the binder you are talking to is the right type. Must\n be called before any instance of the class is created.\n\n Available since API level 33.\n\n WARNING: this API interacts badly with linkernamespaces. For correct behavior, you must\n use it on all instances of a class in the same process which share the same interface\n descriptor. In general, it is recommended you do not use this API, because it is disabling\n type safety.\n\n \\param clazz class to disable interface header on."]
758 pub fn AIBinder_Class_disableInterfaceTokenHeader(clazz: *mut AIBinder_Class);
759}
760extern "C" {
761 #[doc = " Creates a new binder object of the appropriate class.\n\n Ownership of args is passed to this object. The lifecycle is implemented with AIBinder_incStrong\n and AIBinder_decStrong. When the reference count reaches zero, onDestroy is called.\n\n When this is called, the refcount is implicitly 1. So, calling decStrong exactly one time is\n required to delete this object.\n\n Once an AIBinder object is created using this API, re-creating that AIBinder for the same\n instance of the same class will break pointer equality for that specific AIBinder object. For\n instance, if someone erroneously created two AIBinder instances representing the same callback\n object and passed one to a hypothetical addCallback function and then later another one to a\n hypothetical removeCallback function, the remote process would have no way to determine that\n these two objects are actually equal using the AIBinder pointer alone (which they should be able\n to do). Also see the suggested memory ownership model suggested above.\n\n Available since API level 29.\n\n \\param clazz the type of the object to be created.\n \\param args the args to pass to AIBinder_onCreate for that class.\n\n \\return a binder object representing the newly instantiated object."]
762 pub fn AIBinder_new(
763 clazz: *const AIBinder_Class,
764 args: *mut ::std::os::raw::c_void,
765 ) -> *mut AIBinder;
766}
767extern "C" {
768 #[doc = " If this is hosted in a process other than the current one.\n\n Available since API level 29.\n\n \\param binder the binder being queried.\n\n \\return true if the AIBinder represents an object in another process."]
769 pub fn AIBinder_isRemote(binder: *const AIBinder) -> bool;
770}
771extern "C" {
772 #[doc = " If this binder is known to be alive. This will not send a transaction to a remote process and\n returns a result based on the last known information. That is, whenever a transaction is made,\n this is automatically updated to reflect the current alive status of this binder. This will be\n updated as the result of a transaction made using AIBinder_transact, but it will also be updated\n based on the results of bookkeeping or other transactions made internally.\n\n Available since API level 29.\n\n \\param binder the binder being queried.\n\n \\return true if the binder is alive."]
773 pub fn AIBinder_isAlive(binder: *const AIBinder) -> bool;
774}
775extern "C" {
776 #[doc = " Built-in transaction for all binder objects. This sends a transaction that will immediately\n return. Usually this is used to make sure that a binder is alive, as a placeholder call, or as a\n consistency check.\n\n Available since API level 29.\n\n \\param binder the binder being queried.\n\n \\return STATUS_OK if the ping succeeds."]
777 pub fn AIBinder_ping(binder: *mut AIBinder) -> binder_status_t;
778}
779extern "C" {
780 #[doc = " Built-in transaction for all binder objects. This dumps information about a given binder.\n\n See also AIBinder_Class_setOnDump, AIBinder_onDump.\n\n Available since API level 29.\n\n \\param binder the binder to dump information about\n \\param fd where information should be dumped to\n \\param args null-terminated arguments to pass (may be null if numArgs is 0)\n \\param numArgs number of args to send\n\n \\return STATUS_OK if dump succeeds (or if there is nothing to dump)"]
781 pub fn AIBinder_dump(
782 binder: *mut AIBinder,
783 fd: ::std::os::raw::c_int,
784 args: *mut *const ::std::os::raw::c_char,
785 numArgs: u32,
786 ) -> binder_status_t;
787}
788extern "C" {
789 #[doc = " Registers for notifications that the associated binder is dead. The same death recipient may be\n associated with multiple different binders. If the binder is local, then no death recipient will\n be given (since if the local process dies, then no recipient will exist to receive a\n transaction). The cookie is passed to recipient in the case that this binder dies and can be\n null. The exact cookie must also be used to unlink this transaction (see AIBinder_unlinkToDeath).\n This function may return a binder transaction failure. The cookie can be used both for\n identification and holding user data.\n\n If binder is local, this will return STATUS_INVALID_OPERATION.\n\n Available since API level 29.\n\n \\param binder the binder object you want to receive death notifications from.\n \\param recipient the callback that will receive notifications when/if the binder dies.\n \\param cookie the value that will be passed to the death recipient on death.\n\n \\return STATUS_OK on success."]
790 pub fn AIBinder_linkToDeath(
791 binder: *mut AIBinder,
792 recipient: *mut AIBinder_DeathRecipient,
793 cookie: *mut ::std::os::raw::c_void,
794 ) -> binder_status_t;
795}
796extern "C" {
797 #[doc = " Stops registration for the associated binder dying. Does not delete the recipient. This function\n may return a binder transaction failure and in case the death recipient cannot be found, it\n returns STATUS_NAME_NOT_FOUND.\n\n This only ever needs to be called when the AIBinder_DeathRecipient remains for use with other\n AIBinder objects. If the death recipient is deleted, all binders will automatically be unlinked.\n If the binder dies, it will automatically unlink. If the binder is deleted, it will be\n automatically unlinked.\n\n Be aware that it is not safe to immediately deallocate the cookie when this call returns. If you\n need to clean up the cookie, you should do so in the onUnlinked callback, which can be set using\n AIBinder_DeathRecipient_setOnUnlinked.\n\n Available since API level 29.\n\n \\param binder the binder object to remove a previously linked death recipient from.\n \\param recipient the callback to remove.\n \\param cookie the cookie used to link to death.\n\n \\return STATUS_OK on success. STATUS_NAME_NOT_FOUND if the binder cannot be found to be unlinked."]
798 pub fn AIBinder_unlinkToDeath(
799 binder: *mut AIBinder,
800 recipient: *mut AIBinder_DeathRecipient,
801 cookie: *mut ::std::os::raw::c_void,
802 ) -> binder_status_t;
803}
804extern "C" {
805 #[doc = " This returns the calling UID assuming that this thread is called from a thread that is processing\n a binder transaction (for instance, in the implementation of AIBinder_Class_onTransact).\n\n This can be used with higher-level system services to determine the caller's identity and check\n permissions.\n\n Available since API level 29.\n\n \\return calling uid or the current process's UID if this thread isn't processing a transaction."]
806 pub fn AIBinder_getCallingUid() -> uid_t;
807}
808extern "C" {
809 #[doc = " This returns the calling PID assuming that this thread is called from a thread that is processing\n a binder transaction (for instance, in the implementation of AIBinder_Class_onTransact).\n\n This can be used with higher-level system services to determine the caller's identity and check\n permissions. However, when doing this, one should be aware of possible TOCTOU problems when the\n calling process dies and is replaced with another process with elevated permissions and the same\n PID.\n\n Warning: oneway transactions do not receive PID. Even if you expect\n a transaction to be synchronous, a misbehaving client could send it\n as a synchronous call and result in a 0 PID here. Additionally, if\n there is a race and the calling process dies, the PID may still be\n 0 for a synchronous call.\n\n Available since API level 29.\n\n \\return calling pid or the current process's PID if this thread isn't processing a transaction.\n If the transaction being processed is a oneway transaction, then this method will return 0."]
810 pub fn AIBinder_getCallingPid() -> pid_t;
811}
812extern "C" {
813 #[doc = " Determine whether the current thread is currently executing an incoming transaction.\n\n \\return true if the current thread is currently executing an incoming transaction, and false\n otherwise."]
814 pub fn AIBinder_isHandlingTransaction() -> bool;
815}
816extern "C" {
817 #[doc = " This can only be called if a strong reference to this object already exists in process.\n\n Available since API level 29.\n\n \\param binder the binder object to add a refcount to."]
818 pub fn AIBinder_incStrong(binder: *mut AIBinder);
819}
820extern "C" {
821 #[doc = " This will delete the object and call onDestroy once the refcount reaches zero.\n\n Available since API level 29.\n\n \\param binder the binder object to remove a refcount from."]
822 pub fn AIBinder_decStrong(binder: *mut AIBinder);
823}
824extern "C" {
825 #[doc = " For debugging only!\n\n Available since API level 29.\n\n \\param binder the binder object to retrieve the refcount of.\n\n \\return the number of strong-refs on this binder in this process. If binder is null, this will be\n -1."]
826 pub fn AIBinder_debugGetRefCount(binder: *mut AIBinder) -> i32;
827}
828extern "C" {
829 #[doc = " This sets the class of an AIBinder object. This checks to make sure the remote object is of\n the expected class. A class must be set in order to use transactions on an AIBinder object.\n However, if an object is just intended to be passed through to another process or used as a\n handle this need not be called.\n\n This returns true if the class association succeeds. If it fails, no change is made to the\n binder object.\n\n Warning: this may fail if the binder is dead.\n\n Available since API level 29.\n\n \\param binder the object to attach the class to.\n \\param clazz the clazz to attach to binder.\n\n \\return true if the binder has the class clazz and if the association was successful."]
830 pub fn AIBinder_associateClass(binder: *mut AIBinder, clazz: *const AIBinder_Class) -> bool;
831}
832extern "C" {
833 #[doc = " Returns the class that this binder was constructed with or associated with.\n\n Available since API level 29.\n\n \\param binder the object that is being queried.\n\n \\return the class that this binder is associated with. If this binder wasn't created with\n AIBinder_new, and AIBinder_associateClass hasn't been called, then this will return null."]
834 pub fn AIBinder_getClass(binder: *mut AIBinder) -> *const AIBinder_Class;
835}
836extern "C" {
837 #[doc = " Value returned by onCreate for a local binder. For stateless classes (if onCreate returns\n null), this also returns null. For a remote binder, this will always return null.\n\n Available since API level 29.\n\n \\param binder the object that is being queried.\n\n \\return the userdata returned from AIBinder_onCreate when this object was created. This may be\n null for stateless objects. For remote objects, this is always null."]
838 pub fn AIBinder_getUserData(binder: *mut AIBinder) -> *mut ::std::os::raw::c_void;
839}
840extern "C" {
841 #[doc = " Creates a parcel to start filling out for a transaction. This will add a header to the\n transaction that corresponds to android.os.Parcel#writeInterfaceToken. This may add debugging\n or other information to the transaction for platform use or to enable other features to work. The\n contents of this header is a platform implementation detail, and it is required to use\n libbinder_ndk. This parcel is to be sent via AIBinder_transact and it represents the input data\n to the transaction. It is recommended to check if the object is local and call directly into its\n user data before calling this as the parceling and unparceling cost can be avoided. This AIBinder\n must be either built with a class or associated with a class before using this API.\n\n This does not affect the ownership of binder. When this function succeeds, the in parcel's\n ownership is passed to the caller. At this point, the parcel can be filled out and passed to\n AIBinder_transact. Alternatively, if there is an error while filling out the parcel, it can be\n deleted with AParcel_delete.\n\n Available since API level 29.\n\n \\param binder the binder object to start a transaction on.\n \\param in out parameter for input data to the transaction.\n\n \\return STATUS_OK on success. This will return STATUS_INVALID_OPERATION if the binder has not yet\n been associated with a class (see AIBinder_new and AIBinder_associateClass)."]
842 pub fn AIBinder_prepareTransaction(
843 binder: *mut AIBinder,
844 in_: *mut *mut AParcel,
845 ) -> binder_status_t;
846}
847extern "C" {
848 #[doc = " Transact using a parcel created from AIBinder_prepareTransaction. This actually communicates with\n the object representing this binder object. This also passes out a parcel to be used for the\n return transaction. This takes ownership of the in parcel and automatically deletes it after it\n is sent to the remote process. The output parcel is the result of the transaction. If the\n transaction has FLAG_ONEWAY, the out parcel will be empty. Otherwise, this will block until the\n remote process has processed the transaction, and the out parcel will contain the output data\n from transaction.\n\n This does not affect the ownership of binder. The out parcel's ownership is passed to the caller\n and must be released with AParcel_delete when finished reading.\n\n Available since API level 29.\n\n \\param binder the binder object to transact on.\n \\param code the implementation-specific code representing which transaction should be taken.\n \\param in the implementation-specific input data to this transaction.\n \\param out the implementation-specific output data to this transaction.\n \\param flags possible flags to alter the way in which the transaction is conducted or 0.\n\n \\return the result from the kernel or from the remote process. Usually, implementation-specific\n error codes are written to the output parcel, and the transaction code is reserved for kernel\n errors or error codes that have been repeated from subsequent transactions."]
849 pub fn AIBinder_transact(
850 binder: *mut AIBinder,
851 code: transaction_code_t,
852 in_: *mut *mut AParcel,
853 out: *mut *mut AParcel,
854 flags: binder_flags_t,
855 ) -> binder_status_t;
856}
857extern "C" {
858 #[doc = " This does not take any ownership of the input binder, but it can be used to retrieve it if\n something else in some process still holds a reference to it.\n\n Available since API level 29.\n\n \\param binder object to create a weak pointer to.\n\n \\return object representing a weak pointer to binder (or null if binder is null)."]
859 pub fn AIBinder_Weak_new(binder: *mut AIBinder) -> *mut AIBinder_Weak;
860}
861extern "C" {
862 #[doc = " Deletes the weak reference. This will have no impact on the lifetime of the binder.\n\n Available since API level 29.\n\n \\param weakBinder object created with AIBinder_Weak_new."]
863 pub fn AIBinder_Weak_delete(weakBinder: *mut AIBinder_Weak);
864}
865extern "C" {
866 #[doc = " If promotion succeeds, result will have one strong refcount added to it. Otherwise, this returns\n null.\n\n Available since API level 29.\n\n \\param weakBinder weak pointer to attempt retrieving the original object from.\n\n \\return an AIBinder object with one refcount given to the caller or null."]
867 pub fn AIBinder_Weak_promote(weakBinder: *mut AIBinder_Weak) -> *mut AIBinder;
868}
869#[doc = " This function is executed on death receipt. See AIBinder_linkToDeath/AIBinder_unlinkToDeath.\n\n Available since API level 29.\n\n \\param cookie the cookie passed to AIBinder_linkToDeath."]
870pub type AIBinder_DeathRecipient_onBinderDied =
871 ::std::option::Option<unsafe extern "C" fn(cookie: *mut ::std::os::raw::c_void)>;
872#[doc = " This function is intended for cleaning up the data in the provided cookie, and it is executed\n when the DeathRecipient is unlinked. When the DeathRecipient is unlinked due to a death receipt,\n this method is called after the call to onBinderDied.\n\n This method is called once for each binder that is unlinked. Hence, if the same cookie is passed\n to multiple binders, then the caller is responsible for reference counting the cookie.\n\n See also AIBinder_linkToDeath/AIBinder_unlinkToDeath.\n\n WARNING: Make sure the lifetime of this cookie is long enough. If it is dynamically\n allocated, it should be deleted with AIBinder_DeathRecipient_setOnUnlinked.\n\n Available since API level 33.\n\n \\param cookie the cookie passed to AIBinder_linkToDeath."]
873pub type AIBinder_DeathRecipient_onBinderUnlinked =
874 ::std::option::Option<unsafe extern "C" fn(cookie: *mut ::std::os::raw::c_void)>;
875extern "C" {
876 #[doc = " Creates a new binder death recipient. This can be attached to multiple different binder objects.\n\n Available since API level 29.\n\n WARNING: Make sure the lifetime of this cookie is long enough. If it is dynamically\n allocated, it should be deleted with AIBinder_DeathRecipient_setOnUnlinked.\n\n \\param onBinderDied the callback to call when this death recipient is invoked.\n\n \\return the newly constructed object (or null if onBinderDied is null)."]
877 pub fn AIBinder_DeathRecipient_new(
878 onBinderDied: AIBinder_DeathRecipient_onBinderDied,
879 ) -> *mut AIBinder_DeathRecipient;
880}
881extern "C" {
882 #[doc = " Set the callback to be called when this DeathRecipient is unlinked from a binder. The callback is\n called in the following situations:\n\n 1. If the binder died, shortly after the call to onBinderDied.\n 2. If the binder is explicitly unlinked with AIBinder_unlinkToDeath or\n AIBinder_DeathRecipient_delete, after any pending onBinderDied calls\n finish.\n 3. During or shortly after the AIBinder_linkToDeath call if it returns an error.\n\n It is guaranteed that the callback is called exactly once for each call to linkToDeath unless the\n process is aborted before the binder is unlinked.\n\n Be aware that when the binder is explicitly unlinked, it is not guaranteed that onUnlinked has\n been called before the call to AIBinder_unlinkToDeath or AIBinder_DeathRecipient_delete returns.\n For example, if the binder dies concurrently with a call to AIBinder_unlinkToDeath, the binder is\n not unlinked until after the death notification is delivered, even if AIBinder_unlinkToDeath\n returns before that happens.\n\n This method should be called before linking the DeathRecipient to a binder because the function\n pointer is cached. If you change it after linking to a binder, it is unspecified whether the old\n binder will call the old or new onUnlinked callback.\n\n The onUnlinked argument may be null. In this case, no notification is given when the binder is\n unlinked.\n\n Available since API level 33.\n\n \\param recipient the DeathRecipient to set the onUnlinked callback for.\n \\param onUnlinked the callback to call when a binder is unlinked from recipient."]
883 pub fn AIBinder_DeathRecipient_setOnUnlinked(
884 recipient: *mut AIBinder_DeathRecipient,
885 onUnlinked: AIBinder_DeathRecipient_onBinderUnlinked,
886 );
887}
888extern "C" {
889 #[doc = " Deletes a binder death recipient. It is not necessary to call AIBinder_unlinkToDeath before\n calling this as these will all be automatically unlinked.\n\n Be aware that it is not safe to immediately deallocate the cookie when this call returns. If you\n need to clean up the cookie, you should do so in the onUnlinked callback, which can be set using\n AIBinder_DeathRecipient_setOnUnlinked.\n\n Available since API level 29.\n\n \\param recipient the binder to delete (previously created with AIBinder_DeathRecipient_new)."]
890 pub fn AIBinder_DeathRecipient_delete(recipient: *mut AIBinder_DeathRecipient);
891}
892extern "C" {
893 #[doc = " Gets the extension registered with AIBinder_setExtension.\n\n See AIBinder_setExtension.\n\n Available since API level 30.\n\n \\param binder the object to get the extension of.\n \\param outExt the returned extension object. Will be null if there is no extension set or\n non-null with one strong ref count.\n\n \\return error of getting the interface (may be a transaction error if this is\n remote binder). STATUS_UNEXPECTED_NULL if binder is null."]
894 pub fn AIBinder_getExtension(
895 binder: *mut AIBinder,
896 outExt: *mut *mut AIBinder,
897 ) -> binder_status_t;
898}
899extern "C" {
900 #[doc = " Gets the extension of a binder interface. This allows a downstream developer to add\n an extension to an interface without modifying its interface file. This should be\n called immediately when the object is created before it is passed to another thread.\n No thread safety is required.\n\n For instance, imagine if we have this interface:\n interface IFoo { void doFoo(); }\n\n A). Historical option that has proven to be BAD! Only the original\n author of an interface should change an interface. If someone\n downstream wants additional functionality, they should not ever\n change the interface or use this method.\n\n BAD TO DO: interface IFoo { BAD TO DO\n BAD TO DO: void doFoo(); BAD TO DO\n BAD TO DO: + void doBar(); // adding a method BAD TO DO\n BAD TO DO: } BAD TO DO\n\n B). Option that this method enables.\n Leave the original interface unchanged (do not change IFoo!).\n Instead, create a new interface in a downstream package:\n\n package com.<name>; // new functionality in a new package\n interface IBar { void doBar(); }\n\n When registering the interface, add:\n std::shared_ptr<MyFoo> foo = new MyFoo; // class in AOSP codebase\n std::shared_ptr<MyBar> bar = new MyBar; // custom extension class\n SpAIBinder binder = foo->asBinder(); // target binder to extend\n ... = AIBinder_setExtension(binder.get(), bar->asBinder().get());\n ... = AServiceManager_addService(binder.get(), instanceName);\n // handle error\n\n Do not use foo->asBinder().get() as the target binder argument to\n AIBinder_setExtensions because asBinder it creates a new binder\n object that will be destroyed after the function is called. The same\n binder object must be used for AIBinder_setExtension and\n AServiceManager_addService to register the service with an extension.\n\n Then, clients of IFoo can get this extension:\n SpAIBinder binder = ...;\n std::shared_ptr<IFoo> foo = IFoo::fromBinder(binder); // handle if null\n SpAIBinder barBinder;\n ... = AIBinder_getExtension(barBinder.get());\n // handle error\n std::shared_ptr<IBar> bar = IBar::fromBinder(barBinder);\n // type is checked with AIBinder_associateClass\n // if bar is null, then there is no extension or a different\n // type of extension\n\n Available since API level 30.\n\n \\param binder the object to get the extension on. Must be local.\n \\param ext the extension to set (binder will hold a strong reference to this)\n\n \\return OK on success, STATUS_INVALID_OPERATION if binder is not local, STATUS_UNEXPECTED_NULL\n if either binder is null."]
901 pub fn AIBinder_setExtension(binder: *mut AIBinder, ext: *mut AIBinder) -> binder_status_t;
902}
903extern "C" {
904 #[doc = " Retrieve the class descriptor for the class.\n\n Available since API level 31.\n\n \\param clazz the class to fetch the descriptor from\n\n \\return the class descriptor string. This pointer will never be null; a\n descriptor is required to define a class. The pointer is owned by the class\n and will remain valid as long as the class does. For a local class, this will\n be the same value (not necessarily pointer equal) as is passed into\n AIBinder_Class_define. Format is utf-8."]
905 pub fn AIBinder_Class_getDescriptor(
906 clazz: *const AIBinder_Class,
907 ) -> *const ::std::os::raw::c_char;
908}
909extern "C" {
910 #[doc = " Whether AIBinder is less than another.\n\n This provides a per-process-unique total ordering of binders where a null\n AIBinder* object is considered to be before all other binder objects.\n For instance, two binders refer to the same object in a local or remote\n process when both AIBinder_lt(a, b) and AIBinder_lt(b, a) are false. This API\n might be used to insert and lookup binders in binary search trees.\n\n AIBinder* pointers themselves actually also create a per-process-unique total\n ordering. However, this ordering is inconsistent with AIBinder_Weak_lt for\n remote binders. So, in general, this function should be preferred.\n\n Available since API level 31.\n\n \\param lhs comparison object\n \\param rhs comparison object\n\n \\return whether \"lhs < rhs\" is true"]
911 pub fn AIBinder_lt(lhs: *const AIBinder, rhs: *const AIBinder) -> bool;
912}
913extern "C" {
914 #[doc = " Clone an AIBinder_Weak. Useful because even if a weak binder promotes to a\n null value, after further binder transactions, it may no longer promote to a\n null value.\n\n Available since API level 31.\n\n \\param weak Object to clone\n\n \\return clone of the input parameter. This must be deleted with\n AIBinder_Weak_delete. Null if weak input parameter is also null."]
915 pub fn AIBinder_Weak_clone(weak: *const AIBinder_Weak) -> *mut AIBinder_Weak;
916}
917extern "C" {
918 #[doc = " Whether AIBinder_Weak is less than another.\n\n This provides a per-process-unique total ordering of binders which is exactly\n the same as AIBinder_lt. Similarly, a null AIBinder_Weak* is considered to be\n ordered before all other weak references.\n\n This function correctly distinguishes binders even if one is deallocated. So,\n for instance, an AIBinder_Weak* entry representing a deleted binder will\n never compare as equal to an AIBinder_Weak* entry which represents a\n different allocation of a binder, even if the two binders were originally\n allocated at the same address. That is:\n\n AIBinder* a = ...; // imagine this has address 0x8\n AIBinder_Weak* bWeak = AIBinder_Weak_new(a);\n AIBinder_decStrong(a); // a may be deleted, if this is the last reference\n AIBinder* b = ...; // imagine this has address 0x8 (same address as b)\n AIBinder_Weak* bWeak = AIBinder_Weak_new(b);\n\n Then when a/b are compared with other binders, their order will be preserved,\n and it will either be the case that AIBinder_Weak_lt(aWeak, bWeak) OR\n AIBinder_Weak_lt(bWeak, aWeak), but not both.\n\n Unlike AIBinder*, the AIBinder_Weak* addresses themselves have nothing to do\n with the underlying binder.\n\n Available since API level 31.\n\n \\param lhs comparison object\n \\param rhs comparison object\n\n \\return whether \"lhs < rhs\" is true"]
919 pub fn AIBinder_Weak_lt(lhs: *const AIBinder_Weak, rhs: *const AIBinder_Weak) -> bool;
920}
921extern "C" {
922 #[doc = " Makes calls to AIBinder_getCallingSid work if the kernel supports it. This\n must be called on a local binder server before it is sent out to any othe\n process. If this is a remote binder, it will abort. If the kernel doesn't\n support this feature, you'll always get null from AIBinder_getCallingSid.\n\n \\param binder local server binder to request security contexts on"]
923 pub fn AIBinder_setRequestingSid(binder: *mut AIBinder, requestingSid: bool);
924}
925extern "C" {
926 #[doc = " Returns the selinux context of the callee.\n\n In order for this to work, the following conditions must be met:\n - The kernel must be new enough to support this feature.\n - The server must have called AIBinder_setRequestingSid.\n - The callee must be a remote process.\n\n \\return security context or null if unavailable. The lifetime of this context\n is the lifetime of the transaction."]
927 pub fn AIBinder_getCallingSid() -> *const ::std::os::raw::c_char;
928}
929extern "C" {
930 #[doc = " Sets a minimum scheduler policy for all transactions coming into this\n AIBinder.\n\n This must be called before the object is sent to another process.\n Aborts on invalid values. Not thread safe.\n\n \\param binder local server binder to set the policy for\n \\param policy scheduler policy as defined in linux UAPI\n \\param priority priority. [-20..19] for SCHED_NORMAL, [1..99] for RT"]
931 pub fn AIBinder_setMinSchedulerPolicy(
932 binder: *mut AIBinder,
933 policy: ::std::os::raw::c_int,
934 priority: ::std::os::raw::c_int,
935 );
936}
937extern "C" {
938 #[doc = " Allow the binder to inherit realtime scheduling policies from its caller.\n\n This must be called before the object is sent to another process. Not thread\n safe.\n\n \\param binder local server binder to set the policy for\n \\param inheritRt whether to inherit realtime scheduling policies (default is\n false)."]
939 pub fn AIBinder_setInheritRt(binder: *mut AIBinder, inheritRt: bool);
940}
941#[repr(u32)]
942#[non_exhaustive]
943#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
944pub enum AServiceManager_AddServiceFlag {
945 #[doc = " This allows processes with AID_ISOLATED to get the binder of the service added.\n\n Services with methods that perform file IO, web socket creation or ways to egress data must\n not be added with this flag for privacy concerns."]
946 ADD_SERVICE_ALLOW_ISOLATED = 1,
947 #[doc = " This allows processes with AID_ISOLATED to get the binder of the service added.\n\n Services with methods that perform file IO, web socket creation or ways to egress data must\n not be added with this flag for privacy concerns."]
948 ADD_SERVICE_DUMP_FLAG_PRIORITY_CRITICAL = 2,
949 #[doc = " This allows processes with AID_ISOLATED to get the binder of the service added.\n\n Services with methods that perform file IO, web socket creation or ways to egress data must\n not be added with this flag for privacy concerns."]
950 ADD_SERVICE_DUMP_FLAG_PRIORITY_HIGH = 4,
951 #[doc = " This allows processes with AID_ISOLATED to get the binder of the service added.\n\n Services with methods that perform file IO, web socket creation or ways to egress data must\n not be added with this flag for privacy concerns."]
952 ADD_SERVICE_DUMP_FLAG_PRIORITY_NORMAL = 8,
953 #[doc = " This allows processes with AID_ISOLATED to get the binder of the service added.\n\n Services with methods that perform file IO, web socket creation or ways to egress data must\n not be added with this flag for privacy concerns."]
954 ADD_SERVICE_DUMP_FLAG_PRIORITY_DEFAULT = 16,
955}
956extern "C" {
957 #[doc = " This registers the service with the default service manager under this instance name. This does\n not take ownership of binder.\n\n WARNING: when using this API across an APEX boundary, do not use with unstable\n AIDL services. TODO(b/139325195)\n\n \\param binder object to register globally with the service manager.\n \\param instance identifier of the service. This will be used to lookup the service.\n\n \\return EX_NONE on success."]
958 pub fn AServiceManager_addService(
959 binder: *mut AIBinder,
960 instance: *const ::std::os::raw::c_char,
961 ) -> binder_exception_t;
962}
963extern "C" {
964 #[doc = " This registers the service with the default service manager under this instance name. This does\n not take ownership of binder.\n\n WARNING: when using this API across an APEX boundary, do not use with unstable\n AIDL services. TODO(b/139325195)\n\n \\param binder object to register globally with the service manager.\n \\param instance identifier of the service. This will be used to lookup the service.\n \\param flags an AServiceManager_AddServiceFlag enum to denote how the service should be added.\n\n \\return EX_NONE on success."]
965 pub fn AServiceManager_addServiceWithFlags(
966 binder: *mut AIBinder,
967 instance: *const ::std::os::raw::c_char,
968 flags: AServiceManager_AddServiceFlag,
969 ) -> binder_exception_t;
970}
971extern "C" {
972 #[doc = " Gets a binder object with this specific instance name. Will return nullptr immediately if the\n service is not available This also implicitly calls AIBinder_incStrong (so the caller of this\n function is responsible for calling AIBinder_decStrong).\n\n WARNING: when using this API across an APEX boundary, do not use with unstable\n AIDL services. TODO(b/139325195)\n\n \\param instance identifier of the service used to lookup the service."]
973 pub fn AServiceManager_checkService(instance: *const ::std::os::raw::c_char) -> *mut AIBinder;
974}
975extern "C" {
976 #[doc = " Gets a binder object with this specific instance name. Blocks for a couple of seconds waiting on\n it. This also implicitly calls AIBinder_incStrong (so the caller of this function is responsible\n for calling AIBinder_decStrong). This does polling. A more efficient way to make sure you\n unblock as soon as the service is available is to use AIBinder_waitForService.\n\n WARNING: when using this API across an APEX boundary, do not use with unstable\n AIDL services. TODO(b/139325195)\n\n WARNING: when using this API, typically, you should call it in a loop. It's dangerous to\n assume that nullptr could mean that the service is not available. The service could just\n be starting. Generally, whether a service exists, this information should be declared\n externally (for instance, an Android feature might imply the existence of a service,\n a system property, or in the case of services in the VINTF manifest, it can be checked\n with AServiceManager_isDeclared).\n\n \\param instance identifier of the service used to lookup the service."]
977 pub fn AServiceManager_getService(instance: *const ::std::os::raw::c_char) -> *mut AIBinder;
978}
979extern "C" {
980 #[doc = " Registers a lazy service with the default service manager under the 'instance' name.\n Does not take ownership of binder.\n The service must be configured statically with init so it can be restarted with\n ctl.interface.* messages from servicemanager.\n AServiceManager_registerLazyService cannot safely be used with AServiceManager_addService\n in the same process. If one service is registered with AServiceManager_registerLazyService,\n the entire process will have its lifetime controlled by servicemanager.\n Instead, all services in the process should be registered using\n AServiceManager_registerLazyService.\n\n \\param binder object to register globally with the service manager.\n \\param instance identifier of the service. This will be used to lookup the service.\n\n \\return STATUS_OK on success."]
981 pub fn AServiceManager_registerLazyService(
982 binder: *mut AIBinder,
983 instance: *const ::std::os::raw::c_char,
984 ) -> binder_status_t;
985}
986extern "C" {
987 #[doc = " Gets a binder object with this specific instance name. Efficiently waits for the service.\n If the service is not ever registered, it will wait indefinitely. Requires the threadpool\n to be started in the service.\n This also implicitly calls AIBinder_incStrong (so the caller of this function is responsible\n for calling AIBinder_decStrong).\n\n WARNING: when using this API across an APEX boundary, do not use with unstable\n AIDL services. TODO(b/139325195)\n\n \\param instance identifier of the service used to lookup the service.\n\n \\return service if registered, null if not."]
988 pub fn AServiceManager_waitForService(instance: *const ::std::os::raw::c_char)
989 -> *mut AIBinder;
990}
991#[doc = " Function to call when a service is registered. The instance is passed as well as\n ownership of the binder named 'registered'.\n\n WARNING: a lock is held when this method is called in order to prevent races with\n AServiceManager_NotificationRegistration_delete. Do not make synchronous binder calls when\n implementing this method to avoid deadlocks.\n\n \\param instance instance name of service registered\n \\param registered ownership-passed instance of service registered\n \\param cookie data passed during registration for notifications"]
992pub type AServiceManager_onRegister = ::std::option::Option<
993 unsafe extern "C" fn(
994 instance: *const ::std::os::raw::c_char,
995 registered: *mut AIBinder,
996 cookie: *mut ::std::os::raw::c_void,
997 ),
998>;
999#[doc = " Represents a registration to servicemanager which can be cleared anytime."]
1000#[repr(C)]
1001#[derive(Debug, Copy, Clone)]
1002pub struct AServiceManager_NotificationRegistration {
1003 _unused: [u8; 0],
1004}
1005extern "C" {
1006 #[doc = " Get notifications when a service is registered. If the service is already registered,\n you will immediately get a notification.\n\n WARNING: it is strongly recommended to use AServiceManager_waitForService API instead.\n That API will wait synchronously, which is what you usually want in cases, including\n using some feature or during boot up. There is a history of bugs where waiting for\n notifications like this races with service startup. Also, when this API is used, a service\n bug will result in silent failure (rather than a debuggable deadlock). Furthermore, there\n is a history of this API being used to know when a service is up as a proxy for whethre\n that service should be started. This should only be used if you are intending to get\n ahold of the service as a client. For lazy services, whether a service is registered\n should not be used as a proxy for when it should be registered, which is only known\n by the real client.\n\n WARNING: if you use this API, you must also ensure that you check missing services are\n started and crash otherwise. If service failures are ignored, the system rots.\n\n \\param instance name of service to wait for notifications about\n \\param onRegister callback for when service is registered\n \\param cookie data associated with this callback\n\n \\return the token for this registration. Deleting this token will unregister."]
1007 pub fn AServiceManager_registerForServiceNotifications(
1008 instance: *const ::std::os::raw::c_char,
1009 onRegister: AServiceManager_onRegister,
1010 cookie: *mut ::std::os::raw::c_void,
1011 ) -> *mut AServiceManager_NotificationRegistration;
1012}
1013extern "C" {
1014 #[doc = " Unregister for notifications and delete the object.\n\n After this method is called, the callback is guaranteed to no longer be invoked. This will block\n until any in-progress onRegister callbacks have completed. It is therefore safe to immediately\n destroy the void* cookie that was registered when this method returns.\n\n \\param notification object to dismiss"]
1015 pub fn AServiceManager_NotificationRegistration_delete(
1016 notification: *mut AServiceManager_NotificationRegistration,
1017 );
1018}
1019extern "C" {
1020 #[doc = " Check if a service is declared (e.g. VINTF manifest).\n\n \\param instance identifier of the service.\n\n \\return true on success, meaning AServiceManager_waitForService should always\n be able to return the service."]
1021 pub fn AServiceManager_isDeclared(instance: *const ::std::os::raw::c_char) -> bool;
1022}
1023extern "C" {
1024 #[doc = " Returns all declared instances for a particular interface.\n\n For instance, if 'android.foo.IFoo/foo' is declared, and 'android.foo.IFoo' is\n passed here, then [\"foo\"] would be returned.\n\n See also AServiceManager_isDeclared.\n\n \\param interface interface, e.g. 'android.foo.IFoo'\n \\param context to pass to callback\n \\param callback taking instance (e.g. 'foo') and context"]
1025 pub fn AServiceManager_forEachDeclaredInstance(
1026 interface: *const ::std::os::raw::c_char,
1027 context: *mut ::std::os::raw::c_void,
1028 callback: ::std::option::Option<
1029 unsafe extern "C" fn(
1030 arg1: *const ::std::os::raw::c_char,
1031 arg2: *mut ::std::os::raw::c_void,
1032 ),
1033 >,
1034 );
1035}
1036extern "C" {
1037 #[doc = " Check if a service is updatable via an APEX module.\n\n \\param instance identifier of the service\n\n \\return whether the interface is updatable via APEX"]
1038 pub fn AServiceManager_isUpdatableViaApex(instance: *const ::std::os::raw::c_char) -> bool;
1039}
1040extern "C" {
1041 #[doc = " Returns the APEX name if a service is declared as updatable via an APEX module.\n\n \\param instance identifier of the service\n \\param context to pass to callback\n \\param callback taking the APEX name (e.g. 'com.android.foo') and context"]
1042 pub fn AServiceManager_getUpdatableApexName(
1043 instance: *const ::std::os::raw::c_char,
1044 context: *mut ::std::os::raw::c_void,
1045 callback: ::std::option::Option<
1046 unsafe extern "C" fn(
1047 arg1: *const ::std::os::raw::c_char,
1048 arg2: *mut ::std::os::raw::c_void,
1049 ),
1050 >,
1051 );
1052}
1053extern "C" {
1054 #[doc = " Opens a declared passthrough HAL.\n\n \\param instance identifier of the passthrough service (e.g. \"mapper\")\n \\param instance identifier of the implemenatation (e.g. \"default\")\n \\param flag passed to dlopen()\n\n \\return the result of dlopen of the specified HAL"]
1055 pub fn AServiceManager_openDeclaredPassthroughHal(
1056 interface: *const ::std::os::raw::c_char,
1057 instance: *const ::std::os::raw::c_char,
1058 flag: ::std::os::raw::c_int,
1059 ) -> *mut ::std::os::raw::c_void;
1060}
1061extern "C" {
1062 #[doc = " Prevent lazy services without client from shutting down their process\n\n This should only be used if it is every eventually set to false. If a\n service needs to persist but doesn't need to dynamically shut down,\n prefer to control it with another mechanism.\n\n \\param persist 'true' if the process should not exit."]
1063 pub fn AServiceManager_forceLazyServicesPersist(persist: bool);
1064}
1065extern "C" {
1066 #[doc = " Set a callback that is invoked when the active service count (i.e. services with clients)\n registered with this process drops to zero (or becomes nonzero).\n The callback takes a boolean argument, which is 'true' if there is\n at least one service with clients.\n\n \\param callback function to call when the number of services\n with clients changes.\n \\param context opaque pointer passed back as second parameter to the\n callback.\n\n The callback takes two arguments. The first is a boolean that represents if there are\n services with clients (true) or not (false).\n The second is the 'context' pointer passed during the registration.\n\n Callback return value:\n - false: Default behavior for lazy services (shut down the process if there\n are no clients).\n - true: Don't shut down the process even if there are no clients.\n\n This callback gives a chance to:\n 1 - Perform some additional operations before exiting;\n 2 - Prevent the process from exiting by returning \"true\" from the callback."]
1067 pub fn AServiceManager_setActiveServicesCallback(
1068 callback: ::std::option::Option<
1069 unsafe extern "C" fn(arg1: bool, arg2: *mut ::std::os::raw::c_void) -> bool,
1070 >,
1071 context: *mut ::std::os::raw::c_void,
1072 );
1073}
1074extern "C" {
1075 #[doc = " Try to unregister all services previously registered with 'registerService'.\n\n \\return true on success."]
1076 pub fn AServiceManager_tryUnregister() -> bool;
1077}
1078extern "C" {
1079 #[doc = " Re-register services that were unregistered by 'tryUnregister'.\n This method should be called in the case 'tryUnregister' fails\n (and should be called on the same thread)."]
1080 pub fn AServiceManager_reRegister();
1081}
1082extern "C" {
1083 #[doc = " Gets whether or not FDs are allowed by this AParcel\n\n \\return true if FDs are allowed, false if they are not. That is\n if this returns false then AParcel_writeParcelFileDescriptor will\n return STATUS_FDS_NOT_ALLOWED."]
1084 pub fn AParcel_getAllowFds(arg1: *const AParcel) -> bool;
1085}
1086extern "C" {
1087 #[doc = " Data written to the parcel will be zero'd before being deleted or realloced.\n\n The main use of this is marking a parcel that will be used in a transaction\n with FLAG_CLEAR_BUF. When FLAG_CLEAR_BUF is used, the reply parcel will\n automatically be marked as sensitive when it is created.\n\n \\param parcel The parcel to clear associated data from."]
1088 pub fn AParcel_markSensitive(parcel: *const AParcel);
1089}
1090extern "C" {
1091 #[doc = " This creates a threadpool for incoming binder transactions if it has not already been created,\n spawning one thread, and allowing the kernel to lazily start threads according to the count\n that is specified in ABinderProcess_setThreadPoolMaxThreadCount.\n\n For instance, if ABinderProcess_setThreadPoolMaxThreadCount(3) is called,\n ABinderProcess_startThreadPool() is called (+1 thread) then the main thread calls\n ABinderProcess_joinThreadPool() (+1 thread), up to *5* total threads will be started\n (2 directly, and 3 more if the kernel starts them lazily).\n\n When using this, it is expected that ABinderProcess_setupPolling and\n ABinderProcess_handlePolledCommands are not used.\n\n Do not use this from a library. Apps setup their own threadpools, and otherwise, the main\n function should be responsible for configuring the threadpool for the entire application."]
1092 pub fn ABinderProcess_startThreadPool();
1093}
1094extern "C" {
1095 #[doc = " This sets the maximum number of threads that can be started in the threadpool. By default, after\n startThreadPool is called, this is 15. If it is called additional times, it will only prevent\n the kernel from starting new threads and will not delete already existing threads. This should\n be called once before startThreadPool. The number of threads can never decrease.\n\n This count refers to the number of threads that will be created lazily by the kernel, in\n addition to the single threads created by ABinderProcess_startThreadPool (+1) or\n ABinderProcess_joinThreadPool (+1). Note: ABinderProcess_startThreadPool starts a thread\n itself, but it also enables up to the number of threads passed to this function to start.\n This function does not start any threads itself; it only configures\n ABinderProcess_startThreadPool.\n\n Do not use this from a library. Apps setup their own threadpools, and otherwise, the main\n function should be responsible for configuring the threadpool for the entire application."]
1096 pub fn ABinderProcess_setThreadPoolMaxThreadCount(numThreads: u32) -> bool;
1097}
1098extern "C" {
1099 #[doc = " Check if the threadpool has already been started.\n This tells whether someone in the process has called ABinderProcess_startThreadPool. Usually,\n you should use this in a library to abort if the threadpool is not started.\n Programs should configure binder threadpools once at the beginning."]
1100 pub fn ABinderProcess_isThreadPoolStarted() -> bool;
1101}
1102extern "C" {
1103 #[doc = " This adds the current thread to the threadpool. This thread will be in addition to the thread\n configured with ABinderProcess_setThreadPoolMaxThreadCount and started with\n ABinderProcess_startThreadPool.\n\n Do not use this from a library. Apps setup their own threadpools, and otherwise, the main\n function should be responsible for configuring the threadpool for the entire application."]
1104 pub fn ABinderProcess_joinThreadPool();
1105}
1106extern "C" {
1107 #[doc = " This gives you an fd to wait on. Whenever data is available on the fd,\n ABinderProcess_handlePolledCommands can be called to handle binder queries.\n This is expected to be used in a single threaded process which waits on\n events from multiple different fds.\n\n When using this, it is expected ABinderProcess_startThreadPool and\n ABinderProcess_joinThreadPool are not used.\n\n \\param fd out param corresponding to the binder domain opened in this\n process.\n \\return STATUS_OK on success"]
1108 pub fn ABinderProcess_setupPolling(fd: *mut ::std::os::raw::c_int) -> binder_status_t;
1109}
1110extern "C" {
1111 #[doc = " This will handle all queued binder commands in this process and then return.\n It is expected to be called whenever there is data on the fd.\n\n \\return STATUS_OK on success"]
1112 pub fn ABinderProcess_handlePolledCommands() -> binder_status_t;
1113}
1114#[repr(C)]
1115#[derive(Debug, Copy, Clone)]
1116pub struct iovec {
1117 pub iov_base: *mut ::std::os::raw::c_void,
1118 pub iov_len: __kernel_size_t,
1119}
1120#[test]
1121fn bindgen_test_layout_iovec() {
1122 const UNINIT: ::std::mem::MaybeUninit<iovec> = ::std::mem::MaybeUninit::uninit();
1123 let ptr = UNINIT.as_ptr();
1124 assert_eq!(::std::mem::size_of::<iovec>(), 16usize, concat!("Size of: ", stringify!(iovec)));
1125 assert_eq!(
1126 ::std::mem::align_of::<iovec>(),
1127 8usize,
1128 concat!("Alignment of ", stringify!(iovec))
1129 );
1130 assert_eq!(
1131 unsafe { ::std::ptr::addr_of!((*ptr).iov_base) as usize - ptr as usize },
1132 0usize,
1133 concat!("Offset of field: ", stringify!(iovec), "::", stringify!(iov_base))
1134 );
1135 assert_eq!(
1136 unsafe { ::std::ptr::addr_of!((*ptr).iov_len) as usize - ptr as usize },
1137 8usize,
1138 concat!("Offset of field: ", stringify!(iovec), "::", stringify!(iov_len))
1139 );
1140}
1141pub type sa_family_t = ::std::os::raw::c_ushort;
1142#[repr(C)]
1143#[derive(Debug, Copy, Clone)]
1144pub struct timespec {
1145 _unused: [u8; 0],
1146}
1147#[repr(C)]
1148#[derive(Debug, Copy, Clone)]
1149pub struct msghdr {
1150 pub msg_name: *mut ::std::os::raw::c_void,
1151 pub msg_namelen: socklen_t,
1152 pub msg_iov: *mut iovec,
1153 pub msg_iovlen: usize,
1154 pub msg_control: *mut ::std::os::raw::c_void,
1155 pub msg_controllen: usize,
1156 pub msg_flags: ::std::os::raw::c_int,
1157}
1158#[test]
1159fn bindgen_test_layout_msghdr() {
1160 const UNINIT: ::std::mem::MaybeUninit<msghdr> = ::std::mem::MaybeUninit::uninit();
1161 let ptr = UNINIT.as_ptr();
1162 assert_eq!(::std::mem::size_of::<msghdr>(), 56usize, concat!("Size of: ", stringify!(msghdr)));
1163 assert_eq!(
1164 ::std::mem::align_of::<msghdr>(),
1165 8usize,
1166 concat!("Alignment of ", stringify!(msghdr))
1167 );
1168 assert_eq!(
1169 unsafe { ::std::ptr::addr_of!((*ptr).msg_name) as usize - ptr as usize },
1170 0usize,
1171 concat!("Offset of field: ", stringify!(msghdr), "::", stringify!(msg_name))
1172 );
1173 assert_eq!(
1174 unsafe { ::std::ptr::addr_of!((*ptr).msg_namelen) as usize - ptr as usize },
1175 8usize,
1176 concat!("Offset of field: ", stringify!(msghdr), "::", stringify!(msg_namelen))
1177 );
1178 assert_eq!(
1179 unsafe { ::std::ptr::addr_of!((*ptr).msg_iov) as usize - ptr as usize },
1180 16usize,
1181 concat!("Offset of field: ", stringify!(msghdr), "::", stringify!(msg_iov))
1182 );
1183 assert_eq!(
1184 unsafe { ::std::ptr::addr_of!((*ptr).msg_iovlen) as usize - ptr as usize },
1185 24usize,
1186 concat!("Offset of field: ", stringify!(msghdr), "::", stringify!(msg_iovlen))
1187 );
1188 assert_eq!(
1189 unsafe { ::std::ptr::addr_of!((*ptr).msg_control) as usize - ptr as usize },
1190 32usize,
1191 concat!("Offset of field: ", stringify!(msghdr), "::", stringify!(msg_control))
1192 );
1193 assert_eq!(
1194 unsafe { ::std::ptr::addr_of!((*ptr).msg_controllen) as usize - ptr as usize },
1195 40usize,
1196 concat!("Offset of field: ", stringify!(msghdr), "::", stringify!(msg_controllen))
1197 );
1198 assert_eq!(
1199 unsafe { ::std::ptr::addr_of!((*ptr).msg_flags) as usize - ptr as usize },
1200 48usize,
1201 concat!("Offset of field: ", stringify!(msghdr), "::", stringify!(msg_flags))
1202 );
1203}
1204#[repr(C)]
1205#[derive(Debug, Copy, Clone)]
1206pub struct mmsghdr {
1207 pub msg_hdr: msghdr,
1208 pub msg_len: ::std::os::raw::c_uint,
1209}
1210#[test]
1211fn bindgen_test_layout_mmsghdr() {
1212 const UNINIT: ::std::mem::MaybeUninit<mmsghdr> = ::std::mem::MaybeUninit::uninit();
1213 let ptr = UNINIT.as_ptr();
1214 assert_eq!(
1215 ::std::mem::size_of::<mmsghdr>(),
1216 64usize,
1217 concat!("Size of: ", stringify!(mmsghdr))
1218 );
1219 assert_eq!(
1220 ::std::mem::align_of::<mmsghdr>(),
1221 8usize,
1222 concat!("Alignment of ", stringify!(mmsghdr))
1223 );
1224 assert_eq!(
1225 unsafe { ::std::ptr::addr_of!((*ptr).msg_hdr) as usize - ptr as usize },
1226 0usize,
1227 concat!("Offset of field: ", stringify!(mmsghdr), "::", stringify!(msg_hdr))
1228 );
1229 assert_eq!(
1230 unsafe { ::std::ptr::addr_of!((*ptr).msg_len) as usize - ptr as usize },
1231 56usize,
1232 concat!("Offset of field: ", stringify!(mmsghdr), "::", stringify!(msg_len))
1233 );
1234}
1235#[repr(C)]
1236#[derive(Debug, Copy, Clone)]
1237pub struct cmsghdr {
1238 pub cmsg_len: usize,
1239 pub cmsg_level: ::std::os::raw::c_int,
1240 pub cmsg_type: ::std::os::raw::c_int,
1241}
1242#[test]
1243fn bindgen_test_layout_cmsghdr() {
1244 const UNINIT: ::std::mem::MaybeUninit<cmsghdr> = ::std::mem::MaybeUninit::uninit();
1245 let ptr = UNINIT.as_ptr();
1246 assert_eq!(
1247 ::std::mem::size_of::<cmsghdr>(),
1248 16usize,
1249 concat!("Size of: ", stringify!(cmsghdr))
1250 );
1251 assert_eq!(
1252 ::std::mem::align_of::<cmsghdr>(),
1253 8usize,
1254 concat!("Alignment of ", stringify!(cmsghdr))
1255 );
1256 assert_eq!(
1257 unsafe { ::std::ptr::addr_of!((*ptr).cmsg_len) as usize - ptr as usize },
1258 0usize,
1259 concat!("Offset of field: ", stringify!(cmsghdr), "::", stringify!(cmsg_len))
1260 );
1261 assert_eq!(
1262 unsafe { ::std::ptr::addr_of!((*ptr).cmsg_level) as usize - ptr as usize },
1263 8usize,
1264 concat!("Offset of field: ", stringify!(cmsghdr), "::", stringify!(cmsg_level))
1265 );
1266 assert_eq!(
1267 unsafe { ::std::ptr::addr_of!((*ptr).cmsg_type) as usize - ptr as usize },
1268 12usize,
1269 concat!("Offset of field: ", stringify!(cmsghdr), "::", stringify!(cmsg_type))
1270 );
1271}
1272extern "C" {
1273 pub fn __cmsg_nxthdr(__msg: *mut msghdr, __cmsg: *mut cmsghdr) -> *mut cmsghdr;
1274}
1275extern "C" {
1276 pub fn accept(
1277 __fd: ::std::os::raw::c_int,
1278 __addr: *mut sockaddr,
1279 __addr_length: *mut socklen_t,
1280 ) -> ::std::os::raw::c_int;
1281}
1282extern "C" {
1283 pub fn accept4(
1284 __fd: ::std::os::raw::c_int,
1285 __addr: *mut sockaddr,
1286 __addr_length: *mut socklen_t,
1287 __flags: ::std::os::raw::c_int,
1288 ) -> ::std::os::raw::c_int;
1289}
1290extern "C" {
1291 pub fn bind(
1292 __fd: ::std::os::raw::c_int,
1293 __addr: *const sockaddr,
1294 __addr_length: socklen_t,
1295 ) -> ::std::os::raw::c_int;
1296}
1297extern "C" {
1298 pub fn connect(
1299 __fd: ::std::os::raw::c_int,
1300 __addr: *const sockaddr,
1301 __addr_length: socklen_t,
1302 ) -> ::std::os::raw::c_int;
1303}
1304extern "C" {
1305 pub fn getpeername(
1306 __fd: ::std::os::raw::c_int,
1307 __addr: *mut sockaddr,
1308 __addr_length: *mut socklen_t,
1309 ) -> ::std::os::raw::c_int;
1310}
1311extern "C" {
1312 pub fn getsockname(
1313 __fd: ::std::os::raw::c_int,
1314 __addr: *mut sockaddr,
1315 __addr_length: *mut socklen_t,
1316 ) -> ::std::os::raw::c_int;
1317}
1318extern "C" {
1319 pub fn getsockopt(
1320 __fd: ::std::os::raw::c_int,
1321 __level: ::std::os::raw::c_int,
1322 __option: ::std::os::raw::c_int,
1323 __value: *mut ::std::os::raw::c_void,
1324 __value_length: *mut socklen_t,
1325 ) -> ::std::os::raw::c_int;
1326}
1327extern "C" {
1328 pub fn listen(
1329 __fd: ::std::os::raw::c_int,
1330 __backlog: ::std::os::raw::c_int,
1331 ) -> ::std::os::raw::c_int;
1332}
1333extern "C" {
1334 pub fn recvmmsg(
1335 __fd: ::std::os::raw::c_int,
1336 __msgs: *mut mmsghdr,
1337 __msg_count: ::std::os::raw::c_uint,
1338 __flags: ::std::os::raw::c_int,
1339 __timeout: *const timespec,
1340 ) -> ::std::os::raw::c_int;
1341}
1342extern "C" {
1343 pub fn recvmsg(
1344 __fd: ::std::os::raw::c_int,
1345 __msg: *mut msghdr,
1346 __flags: ::std::os::raw::c_int,
1347 ) -> isize;
1348}
1349extern "C" {
1350 pub fn sendmmsg(
1351 __fd: ::std::os::raw::c_int,
1352 __msgs: *const mmsghdr,
1353 __msg_count: ::std::os::raw::c_uint,
1354 __flags: ::std::os::raw::c_int,
1355 ) -> ::std::os::raw::c_int;
1356}
1357extern "C" {
1358 pub fn sendmsg(
1359 __fd: ::std::os::raw::c_int,
1360 __msg: *const msghdr,
1361 __flags: ::std::os::raw::c_int,
1362 ) -> isize;
1363}
1364extern "C" {
1365 pub fn setsockopt(
1366 __fd: ::std::os::raw::c_int,
1367 __level: ::std::os::raw::c_int,
1368 __option: ::std::os::raw::c_int,
1369 __value: *const ::std::os::raw::c_void,
1370 __value_length: socklen_t,
1371 ) -> ::std::os::raw::c_int;
1372}
1373extern "C" {
1374 pub fn shutdown(
1375 __fd: ::std::os::raw::c_int,
1376 __how: ::std::os::raw::c_int,
1377 ) -> ::std::os::raw::c_int;
1378}
1379extern "C" {
1380 pub fn socket(
1381 __af: ::std::os::raw::c_int,
1382 __type: ::std::os::raw::c_int,
1383 __protocol: ::std::os::raw::c_int,
1384 ) -> ::std::os::raw::c_int;
1385}
1386extern "C" {
1387 pub fn socketpair(
1388 __af: ::std::os::raw::c_int,
1389 __type: ::std::os::raw::c_int,
1390 __protocol: ::std::os::raw::c_int,
1391 __fds: *mut ::std::os::raw::c_int,
1392 ) -> ::std::os::raw::c_int;
1393}
1394extern "C" {
1395 pub fn recv(
1396 __fd: ::std::os::raw::c_int,
1397 __buf: *mut ::std::os::raw::c_void,
1398 __n: usize,
1399 __flags: ::std::os::raw::c_int,
1400 ) -> isize;
1401}
1402extern "C" {
1403 pub fn send(
1404 __fd: ::std::os::raw::c_int,
1405 __buf: *const ::std::os::raw::c_void,
1406 __n: usize,
1407 __flags: ::std::os::raw::c_int,
1408 ) -> isize;
1409}
1410extern "C" {
1411 pub fn sendto(
1412 __fd: ::std::os::raw::c_int,
1413 __buf: *const ::std::os::raw::c_void,
1414 __n: usize,
1415 __flags: ::std::os::raw::c_int,
1416 __dst_addr: *const sockaddr,
1417 __dst_addr_length: socklen_t,
1418 ) -> isize;
1419}
1420extern "C" {
1421 pub fn recvfrom(
1422 __fd: ::std::os::raw::c_int,
1423 __buf: *mut ::std::os::raw::c_void,
1424 __n: usize,
1425 __flags: ::std::os::raw::c_int,
1426 __src_addr: *mut sockaddr,
1427 __src_addr_length: *mut socklen_t,
1428 ) -> isize;
1429}
1430extern "C" {
1431 pub fn __sendto_chk(
1432 arg1: ::std::os::raw::c_int,
1433 arg2: *const ::std::os::raw::c_void,
1434 arg3: usize,
1435 arg4: usize,
1436 arg5: ::std::os::raw::c_int,
1437 arg6: *const sockaddr,
1438 arg7: socklen_t,
1439 ) -> isize;
1440}
1441extern "C" {
1442 pub fn __recvfrom_chk(
1443 arg1: ::std::os::raw::c_int,
1444 arg2: *mut ::std::os::raw::c_void,
1445 arg3: usize,
1446 arg4: usize,
1447 arg5: ::std::os::raw::c_int,
1448 arg6: *mut sockaddr,
1449 arg7: *mut socklen_t,
1450 ) -> isize;
1451}
1452#[repr(C)]
1453#[derive(Debug, Copy, Clone)]
1454pub struct ABinderRpc_Accessor {
1455 _unused: [u8; 0],
1456}
1457#[repr(C)]
1458#[derive(Debug, Copy, Clone)]
1459pub struct ABinderRpc_AccessorProvider {
1460 _unused: [u8; 0],
1461}
1462#[repr(C)]
1463#[derive(Debug, Copy, Clone)]
1464pub struct ABinderRpc_ConnectionInfo {
1465 _unused: [u8; 0],
1466}
1467#[doc = " This callback is responsible for returning ABinderRpc_Accessor objects for a given\n service instance. These ABinderRpc_Accessor objects are implemented by\n libbinder_ndk and backed by implementations of android::os::IAccessor in\n libbinder.\n\n \\param instance name of the service like\n `android.hardware.vibrator.IVibrator/default`. This string must remain\n valid and unchanged for the duration of this function call.\n \\param data the data that was associated with this instance when the callback\n was registered.\n \\return The ABinderRpc_Accessor associated with the service `instance`. This\n callback gives up ownership of the object once it returns it. The\n caller of this callback (libbinder_ndk) is responsible for deleting it\n with ABinderRpc_Accessor_delete."]
1468pub type ABinderRpc_AccessorProvider_getAccessorCallback = ::std::option::Option<
1469 unsafe extern "C" fn(
1470 instance: *const ::std::os::raw::c_char,
1471 data: *mut ::std::os::raw::c_void,
1472 ) -> *mut ABinderRpc_Accessor,
1473>;
1474#[doc = " This callback is responsible deleting the `void* data` object that is passed\n in to ABinderRpc_registerAccessorProvider for the ABinderRpc_AccessorProvider_getAccessorCallback\n to use. That object is owned by the ABinderRpc_AccessorProvider and must remain valid for the\n lifetime of the callback because it may be called and use the object.\n This _delete callback is called after the ABinderRpc_AccessorProvider is remove and\n is guaranteed never to be called again.\n\n \\param data a pointer to data that the ABinderRpc_AccessorProvider_getAccessorCallback uses which\n is to be deleted by this call."]
1475pub type ABinderRpc_AccessorProviderUserData_deleteCallback =
1476 ::std::option::Option<unsafe extern "C" fn(data: *mut ::std::os::raw::c_void)>;
1477extern "C" {
1478 #[doc = " Inject an ABinderRpc_AccessorProvider_getAccessorCallback into the process for\n the Service Manager APIs to use to retrieve ABinderRpc_Accessor objects associated\n with different RPC Binder services.\n\n \\param provider callback that returns ABinderRpc_Accessors for libbinder to set up\n RPC clients with.\n \\param instances array of instances that are supported by this provider. It\n will only be called if the client is looking for an instance that is\n in this list. These instances must be unique per-process. If an\n instance is being registered that was previously registered, this call\n will fail and the ABinderRpc_AccessorProviderUserData_deleteCallback\n will be called to clean up the data.\n This array of strings must remain valid and unchanged for the duration\n of this function call.\n \\param number of instances in the instances array.\n \\param data pointer that is passed to the ABinderRpc_AccessorProvider callback.\n IMPORTANT: The ABinderRpc_AccessorProvider now OWNS that object that data\n points to. It can be used as necessary in the callback. The data MUST\n remain valid for the lifetime of the provider callback.\n Do not attempt to give ownership of the same object to different\n providers through multiple calls to this function because the first\n one to be deleted will call the onDelete callback.\n \\param onDelete callback used to delete the objects that `data` points to.\n This is called after ABinderRpc_AccessorProvider is guaranteed to never be\n called again. Before this callback is called, `data` must remain\n valid.\n \\return nullptr on error if the data pointer is non-null and the onDelete\n callback is null or if an instance in the instances list was previously\n registered. In the error case of duplicate instances, if data was\n provided with a ABinderRpc_AccessorProviderUserData_deleteCallback,\n the callback will be called to delete the data.\n If nullptr is returned, ABinderRpc_AccessorProviderUserData_deleteCallback\n will be called on data immediately.\n Otherwise returns a pointer to the ABinderRpc_AccessorProvider that\n can be used to remove with ABinderRpc_unregisterAccessorProvider."]
1479 pub fn ABinderRpc_registerAccessorProvider(
1480 provider: ABinderRpc_AccessorProvider_getAccessorCallback,
1481 instances: *const *const ::std::os::raw::c_char,
1482 numInstances: usize,
1483 data: *mut ::std::os::raw::c_void,
1484 onDelete: ABinderRpc_AccessorProviderUserData_deleteCallback,
1485 ) -> *mut ABinderRpc_AccessorProvider;
1486}
1487extern "C" {
1488 #[doc = " Remove an ABinderRpc_AccessorProvider from libbinder. This will remove references\n from the ABinderRpc_AccessorProvider and will no longer call the\n ABinderRpc_AccessorProvider_getAccessorCallback.\n\n Note: The `data` object that was used when adding the accessor will be\n deleted by the ABinderRpc_AccessorProviderUserData_deleteCallback at some\n point after this call. Do not use the object and do not try to delete\n it through any other means.\n Note: This will abort when used incorrectly if this provider was never\n registered or if it were already unregistered.\n\n \\param provider to be removed and deleted\n"]
1489 pub fn ABinderRpc_unregisterAccessorProvider(provider: *mut ABinderRpc_AccessorProvider);
1490}
1491#[doc = " Callback which returns the RPC connection information for libbinder to use to\n connect to a socket that a given service is listening on. This is needed to\n create an ABinderRpc_Accessor so it can connect to these services.\n\n \\param instance name of the service to connect to. This string must remain\n valid and unchanged for the duration of this function call.\n \\param data user data for this callback. The pointer is provided in\n ABinderRpc_Accessor_new.\n \\return ABinderRpc_ConnectionInfo with socket connection information for `instance`"]
1492pub type ABinderRpc_ConnectionInfoProvider = ::std::option::Option<
1493 unsafe extern "C" fn(
1494 instance: *const ::std::os::raw::c_char,
1495 data: *mut ::std::os::raw::c_void,
1496 ) -> *mut ABinderRpc_ConnectionInfo,
1497>;
1498#[doc = " This callback is responsible deleting the `void* data` object that is passed\n in to ABinderRpc_Accessor_new for the ABinderRpc_ConnectionInfoProvider to use. That\n object is owned by the ABinderRpc_Accessor and must remain valid for the\n lifetime the Accessor because it may be used by the connection info provider\n callback.\n This _delete callback is called after the ABinderRpc_Accessor is removed and\n is guaranteed never to be called again.\n\n \\param data a pointer to data that the ABinderRpc_AccessorProvider uses which is to\n be deleted by this call."]
1499pub type ABinderRpc_ConnectionInfoProviderUserData_delete =
1500 ::std::option::Option<unsafe extern "C" fn(data: *mut ::std::os::raw::c_void)>;
1501extern "C" {
1502 #[doc = " Create a new ABinderRpc_Accessor. This creates an IAccessor object in libbinder\n that can use the info from the ABinderRpc_ConnectionInfoProvider to connect to a\n socket that the service with `instance` name is listening to.\n\n \\param instance name of the service that is listening on the socket. This\n string must remain valid and unchanged for the duration of this\n function call.\n \\param provider callback that can get the socket connection information for the\n instance. This connection information may be dynamic, so the\n provider will be called any time a new connection is required.\n \\param data pointer that is passed to the ABinderRpc_ConnectionInfoProvider callback.\n IMPORTANT: The ABinderRpc_ConnectionInfoProvider now OWNS that object that data\n points to. It can be used as necessary in the callback. The data MUST\n remain valid for the lifetime of the provider callback.\n Do not attempt to give ownership of the same object to different\n providers through multiple calls to this function because the first\n one to be deleted will call the onDelete callback.\n \\param onDelete callback used to delete the objects that `data` points to.\n This is called after ABinderRpc_ConnectionInfoProvider is guaranteed to never be\n called again. Before this callback is called, `data` must remain\n valid.\n \\return an ABinderRpc_Accessor instance. This is deleted by the caller once it is\n no longer needed."]
1503 pub fn ABinderRpc_Accessor_new(
1504 instance: *const ::std::os::raw::c_char,
1505 provider: ABinderRpc_ConnectionInfoProvider,
1506 data: *mut ::std::os::raw::c_void,
1507 onDelete: ABinderRpc_ConnectionInfoProviderUserData_delete,
1508 ) -> *mut ABinderRpc_Accessor;
1509}
1510extern "C" {
1511 #[doc = " Delete an ABinderRpc_Accessor\n\n \\param accessor to delete"]
1512 pub fn ABinderRpc_Accessor_delete(accessor: *mut ABinderRpc_Accessor);
1513}
1514extern "C" {
1515 #[doc = " Return the AIBinder associated with an ABinderRpc_Accessor. This can be used to\n send the Accessor to another process or even register it with servicemanager.\n\n \\param accessor to get the AIBinder for\n \\return binder of the supplied accessor with one strong ref count"]
1516 pub fn ABinderRpc_Accessor_asBinder(accessor: *mut ABinderRpc_Accessor) -> *mut AIBinder;
1517}
1518extern "C" {
1519 #[doc = " Return the ABinderRpc_Accessor associated with an AIBinder. The instance must match\n the ABinderRpc_Accessor implementation.\n This can be used when receiving an AIBinder from another process that the\n other process obtained from ABinderRpc_Accessor_asBinder.\n\n \\param instance name of the service that the Accessor is responsible for.\n This string must remain valid and unchanged for the duration of this\n function call.\n \\param accessorBinder proxy binder from another process's ABinderRpc_Accessor.\n This function preserves the refcount of this binder object and the\n caller still owns it.\n \\return ABinderRpc_Accessor representing the other processes ABinderRpc_Accessor\n implementation. The caller owns this ABinderRpc_Accessor instance and\n is responsible for deleting it with ABinderRpc_Accessor_delete or\n passing ownership of it elsewhere, like returning it through\n ABinderRpc_AccessorProvider_getAccessorCallback.\n nullptr on error when the accessorBinder is not a valid binder from\n an IAccessor implementation or the IAccessor implementation is not\n associated with the provided instance."]
1520 pub fn ABinderRpc_Accessor_fromBinder(
1521 instance: *const ::std::os::raw::c_char,
1522 accessorBinder: *mut AIBinder,
1523 ) -> *mut ABinderRpc_Accessor;
1524}
1525extern "C" {
1526 #[doc = " Wrap an ABinderRpc_Accessor proxy binder with a delegator binder.\n\n The IAccessorDelegator binder delegates all calls to the proxy binder.\n\n This is required only in very specific situations when the process that has\n permissions to connect the to RPC service's socket and create the FD for it\n is in a separate process from this process that wants to serve the Accessor\n binder and the communication between these two processes is binder RPC. This\n is needed because the binder passed over the binder RPC connection can not be\n used as a kernel binder, and needs to be wrapped by a kernel binder that can\n then be registered with service manager.\n\n \\param instance name of the service associated with the Accessor\n \\param binder the AIBinder* from the ABinderRpc_Accessor from the\n ABinderRpc_Accessor_asBinder. The other process across the binder RPC\n connection will have called this and passed the AIBinder* across a\n binder interface to the process calling this function.\n \\param outDelegator the AIBinder* for the kernel binder that wraps the\n 'binder' argument and delegates all calls to it. The caller now owns\n this object with one strong ref count and is responsible for removing\n that ref count with with AIBinder_decStrong when the caller wishes to\n drop the reference.\n \\return STATUS_OK on success.\n STATUS_UNEXPECTED_NULL if instance or binder arguments are null.\n STATUS_BAD_TYPE if the binder is not an IAccessor.\n STATUS_NAME_NOT_FOUND if the binder is an IAccessor, but not\n associated with the provided instance name."]
1527 pub fn ABinderRpc_Accessor_delegateAccessor(
1528 instance: *const ::std::os::raw::c_char,
1529 binder: *mut AIBinder,
1530 outDelegator: *mut *mut AIBinder,
1531 ) -> binder_status_t;
1532}
1533extern "C" {
1534 #[doc = " Create a new ABinderRpc_ConnectionInfo with sockaddr. This can be supported socket\n types like sockaddr_vm (vsock) and sockaddr_un (Unix Domain Sockets).\n\n \\param addr sockaddr pointer that can come from supported socket\n types like sockaddr_vm (vsock) and sockaddr_un (Unix Domain Sockets).\n \\param len length of the concrete sockaddr type being used. Like\n sizeof(sockaddr_vm) when sockaddr_vm is used.\n \\return the connection info based on the given sockaddr"]
1535 pub fn ABinderRpc_ConnectionInfo_new(
1536 addr: *const sockaddr,
1537 len: socklen_t,
1538 ) -> *mut ABinderRpc_ConnectionInfo;
1539}
1540extern "C" {
1541 #[doc = " Delete an ABinderRpc_ConnectionInfo object that was created with\n ABinderRpc_ConnectionInfo_new.\n\n \\param info object to be deleted"]
1542 pub fn ABinderRpc_ConnectionInfo_delete(info: *mut ABinderRpc_ConnectionInfo);
1543}
1544#[doc = " Function to execute a shell command.\n\n Available since API level 30.\n\n \\param binder the binder executing the command\n \\param in input file descriptor, should be flushed, ownership is not passed\n \\param out output file descriptor, should be flushed, ownership is not passed\n \\param err error file descriptor, should be flushed, ownership is not passed\n \\param argv array of null-terminated strings for command (may be null if argc\n is 0)\n \\param argc length of argv array\n\n \\return binder_status_t result of transaction"]
1545pub type AIBinder_handleShellCommand = ::std::option::Option<
1546 unsafe extern "C" fn(
1547 binder: *mut AIBinder,
1548 in_: ::std::os::raw::c_int,
1549 out: ::std::os::raw::c_int,
1550 err: ::std::os::raw::c_int,
1551 argv: *mut *const ::std::os::raw::c_char,
1552 argc: u32,
1553 ) -> binder_status_t,
1554>;
1555extern "C" {
1556 #[doc = " This sets the implementation of handleShellCommand for a class.\n\n If this isn't set, nothing will be executed when handleShellCommand is called.\n\n Available since API level 30.\n\n \\param handleShellCommand function to call when a shell transaction is\n received"]
1557 pub fn AIBinder_Class_setHandleShellCommand(
1558 clazz: *mut AIBinder_Class,
1559 handleShellCommand: AIBinder_handleShellCommand,
1560 );
1561}
1562extern "C" {
1563 #[doc = " This interface has the stability of the system image."]
1564 pub fn AIBinder_markSystemStability(binder: *mut AIBinder);
1565}
1566extern "C" {
1567 #[doc = " Given a binder interface at a certain stability, there may be some\n requirements associated with that higher stability level. For instance, a\n VINTF stability binder is required to be in the VINTF manifest. This API\n can be called to use that same interface within the system partition.\n\n WARNING: you must hold on to a binder instance after this is set, while you\n are using it. If you get a binder (e.g. `...->asBinder().get()`), you must\n save this binder and then\n use it. For instance:\n\n auto binder = ...->asBinder();\n AIBinder_forceDowngradeToSystemStability(binder.get());\n doSomething(binder);"]
1568 pub fn AIBinder_forceDowngradeToSystemStability(binder: *mut AIBinder);
1569}
1570extern "C" {
1571 pub fn AIBinder_markVintfStability(binder: *mut AIBinder);
1572}
1573#[repr(i32)]
1574#[non_exhaustive]
1575#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1576pub enum android_c_interface_StatusCode {
1577 OK = 0,
1578 UNKNOWN_ERROR = -2147483648,
1579 NO_MEMORY = -12,
1580 INVALID_OPERATION = -38,
1581 BAD_VALUE = -22,
1582 BAD_TYPE = -2147483647,
1583 NAME_NOT_FOUND = -2,
1584 PERMISSION_DENIED = -1,
1585 NO_INIT = -19,
1586 ALREADY_EXISTS = -17,
1587 DEAD_OBJECT = -32,
1588 FAILED_TRANSACTION = -2147483646,
1589 BAD_INDEX = -75,
1590 NOT_ENOUGH_DATA = -61,
1591 WOULD_BLOCK = -11,
1592 TIMED_OUT = -110,
1593 UNKNOWN_TRANSACTION = -74,
1594 FDS_NOT_ALLOWED = -2147483641,
1595 UNEXPECTED_NULL = -2147483640,
1596}
1597#[repr(i32)]
1598#[non_exhaustive]
1599#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1600pub enum android_c_interface_ExceptionCode {
1601 NONE = 0,
1602 SECURITY = -1,
1603 BAD_PARCELABLE = -2,
1604 ILLEGAL_ARGUMENT = -3,
1605 NULL_POINTER = -4,
1606 ILLEGAL_STATE = -5,
1607 NETWORK_MAIN_THREAD = -6,
1608 UNSUPPORTED_OPERATION = -7,
1609 SERVICE_SPECIFIC = -8,
1610 PARCELABLE = -9,
1611 #[doc = " This is special, and indicates to native binder proxies that the\n transaction has failed at a low level."]
1612 TRANSACTION_FAILED = -129,
1613}
1614pub const FIRST_CALL_TRANSACTION: android_c_interface_consts__bindgen_ty_1 = 1;
1615pub const LAST_CALL_TRANSACTION: android_c_interface_consts__bindgen_ty_1 = 16777215;
1616pub type android_c_interface_consts__bindgen_ty_1 = ::std::os::raw::c_uint;
1617pub const FLAG_ONEWAY: android_c_interface_consts__bindgen_ty_2 = 1;
1618pub const FLAG_CLEAR_BUF: android_c_interface_consts__bindgen_ty_2 = 32;
1619pub const FLAG_PRIVATE_LOCAL: android_c_interface_consts__bindgen_ty_2 = 0;
1620pub type android_c_interface_consts__bindgen_ty_2 = ::std::os::raw::c_uint;