binder_ndk_sys/
lib.rs

1/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/* automatically generated by rust-bindgen 0.72.0 */
18
19use libc::sockaddr;
20
21unsafe extern "C" {
22    pub fn android_get_application_target_sdk_version() -> ::std::os::raw::c_int;
23}
24unsafe extern "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;
37unsafe extern "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}
44unsafe extern "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}
52unsafe extern "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}
65unsafe extern "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}
69unsafe extern "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}
73unsafe extern "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}
80unsafe extern "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}
84unsafe extern "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}
91unsafe extern "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}
95unsafe extern "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}
99unsafe extern "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}
103unsafe extern "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}
107unsafe extern "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}
111unsafe extern "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}
115unsafe extern "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}
119unsafe extern "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}
123unsafe extern "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#[allow(clippy::unnecessary_operation, clippy::identity_op)]
134const _: () = {
135    ["Size of mbstate_t"][::std::mem::size_of::<mbstate_t>() - 8usize];
136    ["Alignment of mbstate_t"][::std::mem::align_of::<mbstate_t>() - 1usize];
137    ["Offset of field: mbstate_t::__seq"][::std::mem::offset_of!(mbstate_t, __seq) - 0usize];
138    ["Offset of field: mbstate_t::__reserved"]
139        [::std::mem::offset_of!(mbstate_t, __reserved) - 4usize];
140};
141unsafe extern "C" {
142    pub fn c16rtomb(__buf: *mut ::std::os::raw::c_char, __ch16: u16, __ps: *mut mbstate_t)
143    -> usize;
144}
145unsafe extern "C" {
146    pub fn c32rtomb(__buf: *mut ::std::os::raw::c_char, __ch32: u32, __ps: *mut mbstate_t)
147    -> usize;
148}
149unsafe extern "C" {
150    pub fn mbrtoc16(
151        __ch16: *mut u16,
152        __s: *const ::std::os::raw::c_char,
153        __n: usize,
154        __ps: *mut mbstate_t,
155    ) -> usize;
156}
157unsafe extern "C" {
158    pub fn mbrtoc32(
159        __ch32: *mut u32,
160        __s: *const ::std::os::raw::c_char,
161        __n: usize,
162        __ps: *mut mbstate_t,
163    ) -> usize;
164}
165#[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."]
166#[repr(C)]
167#[derive(Debug, Copy, Clone)]
168pub struct AIBinder {
169    _unused: [u8; 0],
170}
171#[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)."]
172#[repr(C)]
173#[derive(Debug, Copy, Clone)]
174pub struct AParcel {
175    _unused: [u8; 0],
176}
177unsafe extern "C" {
178    #[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."]
179    pub fn AParcel_delete(parcel: *mut AParcel);
180}
181unsafe extern "C" {
182    #[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."]
183    pub fn AParcel_setDataPosition(parcel: *const AParcel, position: i32) -> binder_status_t;
184}
185unsafe extern "C" {
186    #[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."]
187    pub fn AParcel_getDataPosition(parcel: *const AParcel) -> i32;
188}
189#[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."]
190pub type AParcel_stringAllocator = ::std::option::Option<
191    unsafe extern "C" fn(
192        stringData: *mut ::std::os::raw::c_void,
193        length: i32,
194        buffer: *mut *mut ::std::os::raw::c_char,
195    ) -> bool,
196>;
197#[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."]
198pub type AParcel_stringArrayAllocator = ::std::option::Option<
199    unsafe extern "C" fn(arrayData: *mut ::std::os::raw::c_void, length: i32) -> bool,
200>;
201#[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."]
202pub type AParcel_stringArrayElementAllocator = ::std::option::Option<
203    unsafe extern "C" fn(
204        arrayData: *mut ::std::os::raw::c_void,
205        index: usize,
206        length: i32,
207        buffer: *mut *mut ::std::os::raw::c_char,
208    ) -> bool,
209>;
210#[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."]
211pub type AParcel_stringArrayElementGetter = ::std::option::Option<
212    unsafe extern "C" fn(
213        arrayData: *const ::std::os::raw::c_void,
214        index: usize,
215        outLength: *mut i32,
216    ) -> *const ::std::os::raw::c_char,
217>;
218#[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."]
219pub type AParcel_parcelableArrayAllocator = ::std::option::Option<
220    unsafe extern "C" fn(arrayData: *mut ::std::os::raw::c_void, length: i32) -> bool,
221>;
222#[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."]
223pub type AParcel_writeParcelableElement = ::std::option::Option<
224    unsafe extern "C" fn(
225        parcel: *mut AParcel,
226        arrayData: *const ::std::os::raw::c_void,
227        index: usize,
228    ) -> binder_status_t,
229>;
230#[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."]
231pub type AParcel_readParcelableElement = ::std::option::Option<
232    unsafe extern "C" fn(
233        parcel: *const AParcel,
234        arrayData: *mut ::std::os::raw::c_void,
235        index: usize,
236    ) -> binder_status_t,
237>;
238#[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)."]
239pub type AParcel_int32ArrayAllocator = ::std::option::Option<
240    unsafe extern "C" fn(
241        arrayData: *mut ::std::os::raw::c_void,
242        length: i32,
243        outBuffer: *mut *mut i32,
244    ) -> bool,
245>;
246#[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)."]
247pub type AParcel_uint32ArrayAllocator = ::std::option::Option<
248    unsafe extern "C" fn(
249        arrayData: *mut ::std::os::raw::c_void,
250        length: i32,
251        outBuffer: *mut *mut u32,
252    ) -> bool,
253>;
254#[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)."]
255pub type AParcel_int64ArrayAllocator = ::std::option::Option<
256    unsafe extern "C" fn(
257        arrayData: *mut ::std::os::raw::c_void,
258        length: i32,
259        outBuffer: *mut *mut i64,
260    ) -> bool,
261>;
262#[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)."]
263pub type AParcel_uint64ArrayAllocator = ::std::option::Option<
264    unsafe extern "C" fn(
265        arrayData: *mut ::std::os::raw::c_void,
266        length: i32,
267        outBuffer: *mut *mut u64,
268    ) -> bool,
269>;
270#[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)."]
271pub type AParcel_floatArrayAllocator = ::std::option::Option<
272    unsafe extern "C" fn(
273        arrayData: *mut ::std::os::raw::c_void,
274        length: i32,
275        outBuffer: *mut *mut f32,
276    ) -> bool,
277>;
278#[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)."]
279pub type AParcel_doubleArrayAllocator = ::std::option::Option<
280    unsafe extern "C" fn(
281        arrayData: *mut ::std::os::raw::c_void,
282        length: i32,
283        outBuffer: *mut *mut f64,
284    ) -> bool,
285>;
286#[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."]
287pub type AParcel_boolArrayAllocator = ::std::option::Option<
288    unsafe extern "C" fn(arrayData: *mut ::std::os::raw::c_void, length: i32) -> bool,
289>;
290#[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."]
291pub type AParcel_boolArrayGetter = ::std::option::Option<
292    unsafe extern "C" fn(arrayData: *const ::std::os::raw::c_void, index: usize) -> bool,
293>;
294#[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."]
295pub type AParcel_boolArraySetter = ::std::option::Option<
296    unsafe extern "C" fn(arrayData: *mut ::std::os::raw::c_void, index: usize, value: bool),
297>;
298#[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)."]
299pub type AParcel_charArrayAllocator = ::std::option::Option<
300    unsafe extern "C" fn(
301        arrayData: *mut ::std::os::raw::c_void,
302        length: i32,
303        outBuffer: *mut *mut u16,
304    ) -> bool,
305>;
306#[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)."]
307pub type AParcel_byteArrayAllocator = ::std::option::Option<
308    unsafe extern "C" fn(
309        arrayData: *mut ::std::os::raw::c_void,
310        length: i32,
311        outBuffer: *mut *mut i8,
312    ) -> bool,
313>;
314unsafe extern "C" {
315    #[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."]
316    pub fn AParcel_writeStrongBinder(
317        parcel: *mut AParcel,
318        binder: *mut AIBinder,
319    ) -> binder_status_t;
320}
321unsafe extern "C" {
322    #[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."]
323    pub fn AParcel_readStrongBinder(
324        parcel: *const AParcel,
325        binder: *mut *mut AIBinder,
326    ) -> binder_status_t;
327}
328unsafe extern "C" {
329    #[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."]
330    pub fn AParcel_writeParcelFileDescriptor(
331        parcel: *mut AParcel,
332        fd: ::std::os::raw::c_int,
333    ) -> binder_status_t;
334}
335unsafe extern "C" {
336    #[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."]
337    pub fn AParcel_readParcelFileDescriptor(
338        parcel: *const AParcel,
339        fd: *mut ::std::os::raw::c_int,
340    ) -> binder_status_t;
341}
342unsafe extern "C" {
343    #[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."]
344    pub fn AParcel_writeStatusHeader(
345        parcel: *mut AParcel,
346        status: *const AStatus,
347    ) -> binder_status_t;
348}
349unsafe extern "C" {
350    #[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."]
351    pub fn AParcel_readStatusHeader(
352        parcel: *const AParcel,
353        status: *mut *mut AStatus,
354    ) -> binder_status_t;
355}
356unsafe extern "C" {
357    #[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."]
358    pub fn AParcel_writeString(
359        parcel: *mut AParcel,
360        string: *const ::std::os::raw::c_char,
361        length: i32,
362    ) -> binder_status_t;
363}
364unsafe extern "C" {
365    #[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."]
366    pub fn AParcel_readString(
367        parcel: *const AParcel,
368        stringData: *mut ::std::os::raw::c_void,
369        allocator: AParcel_stringAllocator,
370    ) -> binder_status_t;
371}
372unsafe extern "C" {
373    #[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."]
374    pub fn AParcel_writeStringArray(
375        parcel: *mut AParcel,
376        arrayData: *const ::std::os::raw::c_void,
377        length: i32,
378        getter: AParcel_stringArrayElementGetter,
379    ) -> binder_status_t;
380}
381unsafe extern "C" {
382    #[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."]
383    pub fn AParcel_readStringArray(
384        parcel: *const AParcel,
385        arrayData: *mut ::std::os::raw::c_void,
386        allocator: AParcel_stringArrayAllocator,
387        elementAllocator: AParcel_stringArrayElementAllocator,
388    ) -> binder_status_t;
389}
390unsafe extern "C" {
391    #[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."]
392    pub fn AParcel_writeParcelableArray(
393        parcel: *mut AParcel,
394        arrayData: *const ::std::os::raw::c_void,
395        length: i32,
396        elementWriter: AParcel_writeParcelableElement,
397    ) -> binder_status_t;
398}
399unsafe extern "C" {
400    #[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."]
401    pub fn AParcel_readParcelableArray(
402        parcel: *const AParcel,
403        arrayData: *mut ::std::os::raw::c_void,
404        allocator: AParcel_parcelableArrayAllocator,
405        elementReader: AParcel_readParcelableElement,
406    ) -> binder_status_t;
407}
408unsafe extern "C" {
409    #[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."]
410    pub fn AParcel_writeInt32(parcel: *mut AParcel, value: i32) -> binder_status_t;
411}
412unsafe extern "C" {
413    #[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."]
414    pub fn AParcel_writeUint32(parcel: *mut AParcel, value: u32) -> binder_status_t;
415}
416unsafe extern "C" {
417    #[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."]
418    pub fn AParcel_writeInt64(parcel: *mut AParcel, value: i64) -> binder_status_t;
419}
420unsafe extern "C" {
421    #[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."]
422    pub fn AParcel_writeUint64(parcel: *mut AParcel, value: u64) -> binder_status_t;
423}
424unsafe extern "C" {
425    #[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."]
426    pub fn AParcel_writeFloat(parcel: *mut AParcel, value: f32) -> binder_status_t;
427}
428unsafe extern "C" {
429    #[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."]
430    pub fn AParcel_writeDouble(parcel: *mut AParcel, value: f64) -> binder_status_t;
431}
432unsafe extern "C" {
433    #[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."]
434    pub fn AParcel_writeBool(parcel: *mut AParcel, value: bool) -> binder_status_t;
435}
436unsafe extern "C" {
437    #[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."]
438    pub fn AParcel_writeChar(parcel: *mut AParcel, value: u16) -> binder_status_t;
439}
440unsafe extern "C" {
441    #[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."]
442    pub fn AParcel_writeByte(parcel: *mut AParcel, value: i8) -> binder_status_t;
443}
444unsafe extern "C" {
445    #[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."]
446    pub fn AParcel_readInt32(parcel: *const AParcel, value: *mut i32) -> binder_status_t;
447}
448unsafe extern "C" {
449    #[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."]
450    pub fn AParcel_readUint32(parcel: *const AParcel, value: *mut u32) -> binder_status_t;
451}
452unsafe extern "C" {
453    #[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."]
454    pub fn AParcel_readInt64(parcel: *const AParcel, value: *mut i64) -> binder_status_t;
455}
456unsafe extern "C" {
457    #[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."]
458    pub fn AParcel_readUint64(parcel: *const AParcel, value: *mut u64) -> binder_status_t;
459}
460unsafe extern "C" {
461    #[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."]
462    pub fn AParcel_readFloat(parcel: *const AParcel, value: *mut f32) -> binder_status_t;
463}
464unsafe extern "C" {
465    #[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."]
466    pub fn AParcel_readDouble(parcel: *const AParcel, value: *mut f64) -> binder_status_t;
467}
468unsafe extern "C" {
469    #[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."]
470    pub fn AParcel_readBool(parcel: *const AParcel, value: *mut bool) -> binder_status_t;
471}
472unsafe extern "C" {
473    #[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."]
474    pub fn AParcel_readChar(parcel: *const AParcel, value: *mut u16) -> binder_status_t;
475}
476unsafe extern "C" {
477    #[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."]
478    pub fn AParcel_readByte(parcel: *const AParcel, value: *mut i8) -> binder_status_t;
479}
480unsafe extern "C" {
481    #[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."]
482    pub fn AParcel_writeInt32Array(
483        parcel: *mut AParcel,
484        arrayData: *const i32,
485        length: i32,
486    ) -> binder_status_t;
487}
488unsafe extern "C" {
489    #[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."]
490    pub fn AParcel_writeUint32Array(
491        parcel: *mut AParcel,
492        arrayData: *const u32,
493        length: i32,
494    ) -> binder_status_t;
495}
496unsafe extern "C" {
497    #[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."]
498    pub fn AParcel_writeInt64Array(
499        parcel: *mut AParcel,
500        arrayData: *const i64,
501        length: i32,
502    ) -> binder_status_t;
503}
504unsafe extern "C" {
505    #[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."]
506    pub fn AParcel_writeUint64Array(
507        parcel: *mut AParcel,
508        arrayData: *const u64,
509        length: i32,
510    ) -> binder_status_t;
511}
512unsafe extern "C" {
513    #[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."]
514    pub fn AParcel_writeFloatArray(
515        parcel: *mut AParcel,
516        arrayData: *const f32,
517        length: i32,
518    ) -> binder_status_t;
519}
520unsafe extern "C" {
521    #[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."]
522    pub fn AParcel_writeDoubleArray(
523        parcel: *mut AParcel,
524        arrayData: *const f64,
525        length: i32,
526    ) -> binder_status_t;
527}
528unsafe extern "C" {
529    #[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."]
530    pub fn AParcel_writeBoolArray(
531        parcel: *mut AParcel,
532        arrayData: *const ::std::os::raw::c_void,
533        length: i32,
534        getter: AParcel_boolArrayGetter,
535    ) -> binder_status_t;
536}
537unsafe extern "C" {
538    #[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."]
539    pub fn AParcel_writeCharArray(
540        parcel: *mut AParcel,
541        arrayData: *const u16,
542        length: i32,
543    ) -> binder_status_t;
544}
545unsafe extern "C" {
546    #[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."]
547    pub fn AParcel_writeByteArray(
548        parcel: *mut AParcel,
549        arrayData: *const i8,
550        length: i32,
551    ) -> binder_status_t;
552}
553unsafe extern "C" {
554    #[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."]
555    pub fn AParcel_readInt32Array(
556        parcel: *const AParcel,
557        arrayData: *mut ::std::os::raw::c_void,
558        allocator: AParcel_int32ArrayAllocator,
559    ) -> binder_status_t;
560}
561unsafe extern "C" {
562    #[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."]
563    pub fn AParcel_readUint32Array(
564        parcel: *const AParcel,
565        arrayData: *mut ::std::os::raw::c_void,
566        allocator: AParcel_uint32ArrayAllocator,
567    ) -> binder_status_t;
568}
569unsafe extern "C" {
570    #[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."]
571    pub fn AParcel_readInt64Array(
572        parcel: *const AParcel,
573        arrayData: *mut ::std::os::raw::c_void,
574        allocator: AParcel_int64ArrayAllocator,
575    ) -> binder_status_t;
576}
577unsafe extern "C" {
578    #[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."]
579    pub fn AParcel_readUint64Array(
580        parcel: *const AParcel,
581        arrayData: *mut ::std::os::raw::c_void,
582        allocator: AParcel_uint64ArrayAllocator,
583    ) -> binder_status_t;
584}
585unsafe extern "C" {
586    #[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."]
587    pub fn AParcel_readFloatArray(
588        parcel: *const AParcel,
589        arrayData: *mut ::std::os::raw::c_void,
590        allocator: AParcel_floatArrayAllocator,
591    ) -> binder_status_t;
592}
593unsafe extern "C" {
594    #[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."]
595    pub fn AParcel_readDoubleArray(
596        parcel: *const AParcel,
597        arrayData: *mut ::std::os::raw::c_void,
598        allocator: AParcel_doubleArrayAllocator,
599    ) -> binder_status_t;
600}
601unsafe extern "C" {
602    #[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."]
603    pub fn AParcel_readBoolArray(
604        parcel: *const AParcel,
605        arrayData: *mut ::std::os::raw::c_void,
606        allocator: AParcel_boolArrayAllocator,
607        setter: AParcel_boolArraySetter,
608    ) -> binder_status_t;
609}
610unsafe extern "C" {
611    #[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."]
612    pub fn AParcel_readCharArray(
613        parcel: *const AParcel,
614        arrayData: *mut ::std::os::raw::c_void,
615        allocator: AParcel_charArrayAllocator,
616    ) -> binder_status_t;
617}
618unsafe extern "C" {
619    #[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."]
620    pub fn AParcel_readByteArray(
621        parcel: *const AParcel,
622        arrayData: *mut ::std::os::raw::c_void,
623        allocator: AParcel_byteArrayAllocator,
624    ) -> binder_status_t;
625}
626unsafe extern "C" {
627    #[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."]
628    pub fn AParcel_reset(parcel: *mut AParcel) -> binder_status_t;
629}
630unsafe extern "C" {
631    #[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."]
632    pub fn AParcel_getDataSize(parcel: *const AParcel) -> i32;
633}
634unsafe extern "C" {
635    #[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."]
636    pub fn AParcel_appendFrom(
637        from: *const AParcel,
638        to: *mut AParcel,
639        start: i32,
640        size: i32,
641    ) -> binder_status_t;
642}
643unsafe extern "C" {
644    #[doc = " Creates a parcel.\n\n Available since API level 31.\n\n \\return A parcel which is not related to any IBinder objects."]
645    pub fn AParcel_create() -> *mut AParcel;
646}
647unsafe extern "C" {
648    #[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."]
649    pub fn AParcel_marshal(
650        parcel: *const AParcel,
651        buffer: *mut u8,
652        start: usize,
653        len: usize,
654    ) -> binder_status_t;
655}
656unsafe extern "C" {
657    #[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."]
658    pub fn AParcel_unmarshal(
659        parcel: *mut AParcel,
660        buffer: *const u8,
661        len: usize,
662    ) -> binder_status_t;
663}
664#[doc = " Flags for AIBinder_transact."]
665pub type binder_flags_t = u32;
666#[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."]
667pub type transaction_code_t = u32;
668#[doc = " Represents a type of AIBinder object which can be sent out."]
669#[repr(C)]
670#[derive(Debug, Copy, Clone)]
671pub struct AIBinder_Class {
672    _unused: [u8; 0],
673}
674#[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."]
675#[repr(C)]
676#[derive(Debug, Copy, Clone)]
677pub struct AIBinder_Weak {
678    _unused: [u8; 0],
679}
680#[doc = " Represents a handle on a death notification. See AIBinder_linkToDeath/AIBinder_unlinkToDeath."]
681#[repr(C)]
682#[derive(Debug, Copy, Clone)]
683pub struct AIBinder_DeathRecipient {
684    _unused: [u8; 0],
685}
686#[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."]
687pub type AIBinder_Class_onCreate = ::std::option::Option<
688    unsafe extern "C" fn(args: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void,
689>;
690#[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"]
691pub type AIBinder_Class_onDestroy =
692    ::std::option::Option<unsafe extern "C" fn(userData: *mut ::std::os::raw::c_void)>;
693#[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."]
694pub type AIBinder_Class_onTransact = ::std::option::Option<
695    unsafe extern "C" fn(
696        binder: *mut AIBinder,
697        code: transaction_code_t,
698        in_: *const AParcel,
699        out: *mut AParcel,
700    ) -> binder_status_t,
701>;
702unsafe extern "C" {
703    #[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."]
704    pub fn AIBinder_Class_define(
705        interfaceDescriptor: *const ::std::os::raw::c_char,
706        onCreate: AIBinder_Class_onCreate,
707        onDestroy: AIBinder_Class_onDestroy,
708        onTransact: AIBinder_Class_onTransact,
709    ) -> *mut AIBinder_Class;
710}
711#[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)"]
712pub type AIBinder_onDump = ::std::option::Option<
713    unsafe extern "C" fn(
714        binder: *mut AIBinder,
715        fd: ::std::os::raw::c_int,
716        args: *mut *const ::std::os::raw::c_char,
717        numArgs: u32,
718    ) -> binder_status_t,
719>;
720unsafe extern "C" {
721    #[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."]
722    pub fn AIBinder_Class_setOnDump(clazz: *mut AIBinder_Class, onDump: AIBinder_onDump);
723}
724unsafe extern "C" {
725    #[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"]
726    pub fn AIBinder_Class_setTransactionCodeToFunctionNameMap(
727        clazz: *mut AIBinder_Class,
728        transactionCodeToFunctionMap: *mut *const ::std::os::raw::c_char,
729        length: usize,
730    );
731}
732unsafe extern "C" {
733    #[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."]
734    pub fn AIBinder_Class_getFunctionName(
735        clazz: *mut AIBinder_Class,
736        code: transaction_code_t,
737    ) -> *const ::std::os::raw::c_char;
738}
739unsafe extern "C" {
740    #[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."]
741    pub fn AIBinder_Class_disableInterfaceTokenHeader(clazz: *mut AIBinder_Class);
742}
743unsafe extern "C" {
744    #[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."]
745    pub fn AIBinder_new(
746        clazz: *const AIBinder_Class,
747        args: *mut ::std::os::raw::c_void,
748    ) -> *mut AIBinder;
749}
750unsafe extern "C" {
751    #[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."]
752    pub fn AIBinder_isRemote(binder: *const AIBinder) -> bool;
753}
754unsafe extern "C" {
755    #[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."]
756    pub fn AIBinder_isAlive(binder: *const AIBinder) -> bool;
757}
758unsafe extern "C" {
759    #[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."]
760    pub fn AIBinder_ping(binder: *mut AIBinder) -> binder_status_t;
761}
762unsafe extern "C" {
763    #[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)"]
764    pub fn AIBinder_dump(
765        binder: *mut AIBinder,
766        fd: ::std::os::raw::c_int,
767        args: *mut *const ::std::os::raw::c_char,
768        numArgs: u32,
769    ) -> binder_status_t;
770}
771unsafe extern "C" {
772    #[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."]
773    pub fn AIBinder_linkToDeath(
774        binder: *mut AIBinder,
775        recipient: *mut AIBinder_DeathRecipient,
776        cookie: *mut ::std::os::raw::c_void,
777    ) -> binder_status_t;
778}
779unsafe extern "C" {
780    #[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."]
781    pub fn AIBinder_unlinkToDeath(
782        binder: *mut AIBinder,
783        recipient: *mut AIBinder_DeathRecipient,
784        cookie: *mut ::std::os::raw::c_void,
785    ) -> binder_status_t;
786}
787unsafe extern "C" {
788    #[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 Warning do not use this as a security identifier! PID is unreliable as it may be re-used. This\n should mostly be used for debugging.\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."]
789    pub fn AIBinder_getCallingUid() -> uid_t;
790}
791unsafe extern "C" {
792    #[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."]
793    pub fn AIBinder_getCallingPid() -> pid_t;
794}
795unsafe extern "C" {
796    #[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."]
797    pub fn AIBinder_isHandlingTransaction() -> bool;
798}
799unsafe extern "C" {
800    #[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."]
801    pub fn AIBinder_incStrong(binder: *mut AIBinder);
802}
803unsafe extern "C" {
804    #[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."]
805    pub fn AIBinder_decStrong(binder: *mut AIBinder);
806}
807unsafe extern "C" {
808    #[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."]
809    pub fn AIBinder_debugGetRefCount(binder: *mut AIBinder) -> i32;
810}
811unsafe extern "C" {
812    #[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."]
813    pub fn AIBinder_associateClass(binder: *mut AIBinder, clazz: *const AIBinder_Class) -> bool;
814}
815unsafe extern "C" {
816    #[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."]
817    pub fn AIBinder_getClass(binder: *mut AIBinder) -> *const AIBinder_Class;
818}
819unsafe extern "C" {
820    #[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."]
821    pub fn AIBinder_getUserData(binder: *mut AIBinder) -> *mut ::std::os::raw::c_void;
822}
823unsafe extern "C" {
824    #[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)."]
825    pub fn AIBinder_prepareTransaction(
826        binder: *mut AIBinder,
827        in_: *mut *mut AParcel,
828    ) -> binder_status_t;
829}
830unsafe extern "C" {
831    #[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."]
832    pub fn AIBinder_transact(
833        binder: *mut AIBinder,
834        code: transaction_code_t,
835        in_: *mut *mut AParcel,
836        out: *mut *mut AParcel,
837        flags: binder_flags_t,
838    ) -> binder_status_t;
839}
840unsafe extern "C" {
841    #[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)."]
842    pub fn AIBinder_Weak_new(binder: *mut AIBinder) -> *mut AIBinder_Weak;
843}
844unsafe extern "C" {
845    #[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."]
846    pub fn AIBinder_Weak_delete(weakBinder: *mut AIBinder_Weak);
847}
848unsafe extern "C" {
849    #[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."]
850    pub fn AIBinder_Weak_promote(weakBinder: *mut AIBinder_Weak) -> *mut AIBinder;
851}
852#[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."]
853pub type AIBinder_DeathRecipient_onBinderDied =
854    ::std::option::Option<unsafe extern "C" fn(cookie: *mut ::std::os::raw::c_void)>;
855#[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."]
856pub type AIBinder_DeathRecipient_onBinderUnlinked =
857    ::std::option::Option<unsafe extern "C" fn(cookie: *mut ::std::os::raw::c_void)>;
858unsafe extern "C" {
859    #[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)."]
860    pub fn AIBinder_DeathRecipient_new(
861        onBinderDied: AIBinder_DeathRecipient_onBinderDied,
862    ) -> *mut AIBinder_DeathRecipient;
863}
864unsafe extern "C" {
865    #[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."]
866    pub fn AIBinder_DeathRecipient_setOnUnlinked(
867        recipient: *mut AIBinder_DeathRecipient,
868        onUnlinked: AIBinder_DeathRecipient_onBinderUnlinked,
869    );
870}
871unsafe extern "C" {
872    #[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)."]
873    pub fn AIBinder_DeathRecipient_delete(recipient: *mut AIBinder_DeathRecipient);
874}
875unsafe extern "C" {
876    #[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."]
877    pub fn AIBinder_getExtension(
878        binder: *mut AIBinder,
879        outExt: *mut *mut AIBinder,
880    ) -> binder_status_t;
881}
882unsafe extern "C" {
883    #[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."]
884    pub fn AIBinder_setExtension(binder: *mut AIBinder, ext: *mut AIBinder) -> binder_status_t;
885}
886unsafe extern "C" {
887    #[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."]
888    pub fn AIBinder_Class_getDescriptor(
889        clazz: *const AIBinder_Class,
890    ) -> *const ::std::os::raw::c_char;
891}
892unsafe extern "C" {
893    #[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"]
894    pub fn AIBinder_lt(lhs: *const AIBinder, rhs: *const AIBinder) -> bool;
895}
896unsafe extern "C" {
897    #[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."]
898    pub fn AIBinder_Weak_clone(weak: *const AIBinder_Weak) -> *mut AIBinder_Weak;
899}
900unsafe extern "C" {
901    #[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"]
902    pub fn AIBinder_Weak_lt(lhs: *const AIBinder_Weak, rhs: *const AIBinder_Weak) -> bool;
903}
904unsafe extern "C" {
905    #[doc = " Set the minimum number of RPC threads required to service this binder.\n\n This value is used to ensure there are enough threads for the RPC binder\n connections.\n\n This is not related to the ProcessState binder threadpool.\n\n \\param binder the local AIBinder (ABBinder) to set this minimum on.\n \\param min number of threads required to service the binder, must be at least 1\n\n \\return STATUS_UNEXPECTED_NULL if binder is nullptr\n         STATUS_BAD_VALUE if min is 0\n         STATUS_OK otherwise"]
906    pub fn AIBinder_setMinRpcThreads(binder: *mut AIBinder, min: u16) -> binder_status_t;
907}
908#[repr(C)]
909#[derive(Debug, Copy, Clone)]
910pub struct APersistableBundle {
911    _unused: [u8; 0],
912}
913unsafe extern "C" {
914    #[doc = " Create a new APersistableBundle.\n\n Available since API level 202404.\n\n \\return Pointer to a new APersistableBundle"]
915    pub fn APersistableBundle_new() -> *mut APersistableBundle;
916}
917unsafe extern "C" {
918    #[doc = " Create a new APersistableBundle based off an existing APersistableBundle.\n This is a deep copy, so the new APersistableBundle has its own values from\n copying the original underlying PersistableBundle.\n\n Available since API level 202404.\n\n \\param pBundle to duplicate\n\n \\return Pointer to a new APersistableBundle"]
919    pub fn APersistableBundle_dup(pBundle: *const APersistableBundle) -> *mut APersistableBundle;
920}
921unsafe extern "C" {
922    #[doc = " Delete an APersistableBundle. This must always be called when finished using\n the object.\n\n \\param pBundle to delete. No-op if null.\n\n Available since API level 202404."]
923    pub fn APersistableBundle_delete(pBundle: *mut APersistableBundle);
924}
925unsafe extern "C" {
926    #[doc = " Check for equality of APersistableBundles.\n\n Available since API level 202404.\n\n \\param lhs bundle to compare against the other param\n \\param rhs bundle to compare against the other param\n\n \\return true when equal, false when not"]
927    pub fn APersistableBundle_isEqual(
928        lhs: *const APersistableBundle,
929        rhs: *const APersistableBundle,
930    ) -> bool;
931}
932unsafe extern "C" {
933    #[doc = " Read an APersistableBundle from an AParcel.\n\n Available since API level 202404.\n\n \\param parcel to read from\n \\param outPBundle bundle to write to\n\n \\return STATUS_OK on success\n         STATUS_BAD_VALUE if the parcel or outBuffer is null, or if there's an\n                          issue deserializing (eg, corrupted parcel)\n         STATUS_BAD_TYPE if the parcel's current data position is not that of\n                         an APersistableBundle type\n         STATUS_NO_MEMORY if an allocation fails"]
934    pub fn APersistableBundle_readFromParcel(
935        parcel: *const AParcel,
936        outPBundle: *mut *mut APersistableBundle,
937    ) -> binder_status_t;
938}
939unsafe extern "C" {
940    #[doc = " Write an APersistableBundle to an AParcel.\n\n Available since API level 202404.\n\n \\param pBundle bundle to write to the parcel\n \\param parcel to write to\n\n \\return STATUS_OK on success.\n         STATUS_BAD_VALUE if either pBundle or parcel is null, or if the\n         APersistableBundle*\n                          fails to serialize (eg, internally corrupted)\n         STATUS_NO_MEMORY if the parcel runs out of space to store the pBundle & is\n                          unable to allocate more\n         STATUS_FDS_NOT_ALLOWED if the parcel does not allow storing FDs"]
941    pub fn APersistableBundle_writeToParcel(
942        pBundle: *const APersistableBundle,
943        parcel: *mut AParcel,
944    ) -> binder_status_t;
945}
946unsafe extern "C" {
947    #[doc = " Get the size of an APersistableBundle. This is the number of mappings in the\n object.\n\n Available since API level 202404.\n\n \\param pBundle to get the size of (number of mappings)\n\n \\return number of mappings in the object"]
948    pub fn APersistableBundle_size(pBundle: *const APersistableBundle) -> i32;
949}
950unsafe extern "C" {
951    #[doc = " Erase any entries added with the provided key.\n\n Available since API level 202404.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8 to erase\n\n \\return number of entries erased. Either 0 or 1."]
952    pub fn APersistableBundle_erase(
953        pBundle: *mut APersistableBundle,
954        key: *const ::std::os::raw::c_char,
955    ) -> i32;
956}
957unsafe extern "C" {
958    #[doc = " Put a boolean associated with the provided key.\n New values with the same key will overwrite existing values.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param value to put for the mapping\n\n Available since API level 202404."]
959    pub fn APersistableBundle_putBoolean(
960        pBundle: *mut APersistableBundle,
961        key: *const ::std::os::raw::c_char,
962        val: bool,
963    );
964}
965unsafe extern "C" {
966    #[doc = " Put an int32_t associated with the provided key.\n New values with the same key will overwrite existing values.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param val value to put for the mapping\n\n Available since API level 202404."]
967    pub fn APersistableBundle_putInt(
968        pBundle: *mut APersistableBundle,
969        key: *const ::std::os::raw::c_char,
970        val: i32,
971    );
972}
973unsafe extern "C" {
974    #[doc = " Put an int64_t associated with the provided key.\n New values with the same key will overwrite existing values.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param val value to put for the mapping\n\n Available since API level 202404."]
975    pub fn APersistableBundle_putLong(
976        pBundle: *mut APersistableBundle,
977        key: *const ::std::os::raw::c_char,
978        val: i64,
979    );
980}
981unsafe extern "C" {
982    #[doc = " Put a double associated with the provided key.\n New values with the same key will overwrite existing values.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param val value to put for the mapping\n\n Available since API level 202404."]
983    pub fn APersistableBundle_putDouble(
984        pBundle: *mut APersistableBundle,
985        key: *const ::std::os::raw::c_char,
986        val: f64,
987    );
988}
989unsafe extern "C" {
990    #[doc = " Put a string associated with the provided key.\n New values with the same key will overwrite existing values.\n The value is copied.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param vec vector to put for the mapping\n\n Available since API level 202404."]
991    pub fn APersistableBundle_putString(
992        pBundle: *mut APersistableBundle,
993        key: *const ::std::os::raw::c_char,
994        val: *const ::std::os::raw::c_char,
995    );
996}
997unsafe extern "C" {
998    #[doc = " Put a boolean vector associated with the provided key.\n New values with the same key will overwrite existing values.\n The values are copied.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param vec vector to put for the mapping\n \\param num number of elements in the vector\n\n Available since API level 202404."]
999    pub fn APersistableBundle_putBooleanVector(
1000        pBundle: *mut APersistableBundle,
1001        key: *const ::std::os::raw::c_char,
1002        vec: *const bool,
1003        num: i32,
1004    );
1005}
1006unsafe extern "C" {
1007    #[doc = " Put an int32_t vector associated with the provided key.\n New values with the same key will overwrite existing values.\n The values are copied.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param vec vector to put for the mapping\n \\param num number of elements in the vector\n\n Available since API level 202404."]
1008    pub fn APersistableBundle_putIntVector(
1009        pBundle: *mut APersistableBundle,
1010        key: *const ::std::os::raw::c_char,
1011        vec: *const i32,
1012        num: i32,
1013    );
1014}
1015unsafe extern "C" {
1016    #[doc = " Put an int64_t vector associated with the provided key.\n New values with the same key will overwrite existing values.\n The values are copied.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param vec vector to put for the mapping\n \\param num number of elements in the vector\n\n Available since API level 202404."]
1017    pub fn APersistableBundle_putLongVector(
1018        pBundle: *mut APersistableBundle,
1019        key: *const ::std::os::raw::c_char,
1020        vec: *const i64,
1021        num: i32,
1022    );
1023}
1024unsafe extern "C" {
1025    #[doc = " Put a double vector associated with the provided key.\n New values with the same key will overwrite existing values.\n The values are copied.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param vec vector to put for the mapping\n \\param num number of elements in the vector\n\n Available since API level 202404."]
1026    pub fn APersistableBundle_putDoubleVector(
1027        pBundle: *mut APersistableBundle,
1028        key: *const ::std::os::raw::c_char,
1029        vec: *const f64,
1030        num: i32,
1031    );
1032}
1033unsafe extern "C" {
1034    #[doc = " Put a string vector associated with the provided key.\n New values with the same key will overwrite existing values.\n The values are copied.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param vec vector to put for the mapping\n \\param num number of elements in the vector\n\n Available since API level 202404."]
1035    pub fn APersistableBundle_putStringVector(
1036        pBundle: *mut APersistableBundle,
1037        key: *const ::std::os::raw::c_char,
1038        vec: *const *const ::std::os::raw::c_char,
1039        num: i32,
1040    );
1041}
1042unsafe extern "C" {
1043    #[doc = " Put an APersistableBundle associated with the provided key.\n New values with the same key will overwrite existing values.\n The value is deep-copied.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param val value to put for the mapping\n\n Available since API level 202404."]
1044    pub fn APersistableBundle_putPersistableBundle(
1045        pBundle: *mut APersistableBundle,
1046        key: *const ::std::os::raw::c_char,
1047        val: *const APersistableBundle,
1048    );
1049}
1050unsafe extern "C" {
1051    #[doc = " Get a boolean associated with the provided key.\n\n Available since API level 202404.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param val pointer to write the value to\n\n \\return true if a value exists for the provided key"]
1052    pub fn APersistableBundle_getBoolean(
1053        pBundle: *const APersistableBundle,
1054        key: *const ::std::os::raw::c_char,
1055        val: *mut bool,
1056    ) -> bool;
1057}
1058unsafe extern "C" {
1059    #[doc = " Get an int32_t associated with the provided key.\n\n Available since API level 202404.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param val pointer to write the value to\n\n \\return true if a value exists for the provided key"]
1060    pub fn APersistableBundle_getInt(
1061        pBundle: *const APersistableBundle,
1062        key: *const ::std::os::raw::c_char,
1063        val: *mut i32,
1064    ) -> bool;
1065}
1066unsafe extern "C" {
1067    #[doc = " Get an int64_t associated with the provided key.\n\n Available since API level 202404.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param val pointer to write the value to\n\n \\return true if a value exists for the provided key"]
1068    pub fn APersistableBundle_getLong(
1069        pBundle: *const APersistableBundle,
1070        key: *const ::std::os::raw::c_char,
1071        val: *mut i64,
1072    ) -> bool;
1073}
1074unsafe extern "C" {
1075    #[doc = " Get a double associated with the provided key.\n\n Available since API level 202404.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param val pointer to write the value to\n\n \\return true if a value exists for the provided key"]
1076    pub fn APersistableBundle_getDouble(
1077        pBundle: *const APersistableBundle,
1078        key: *const ::std::os::raw::c_char,
1079        val: *mut f64,
1080    ) -> bool;
1081}
1082unsafe extern "C" {
1083    #[doc = " Get a string associated with the provided key.\n The caller is responsible for freeing the returned data.\n\n Available since API level 202404.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param val pointer to write the value to in UTF-8\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of string in bytes associated with the provided key on success\n         APERSISTABLEBUNDLE_KEY_NOT_FOUND if the key was not found\n         APERSISTABLEBUNDLE_ALLOCATOR_FAILED if the provided allocator fails"]
1084    pub fn APersistableBundle_getString(
1085        pBundle: *const APersistableBundle,
1086        key: *const ::std::os::raw::c_char,
1087        val: *mut *mut ::std::os::raw::c_char,
1088        stringAllocator: ::std::option::Option<
1089            unsafe extern "C" fn(
1090                arg1: i32,
1091                arg2: *mut ::std::os::raw::c_void,
1092            ) -> *mut ::std::os::raw::c_char,
1093        >,
1094        context: *mut ::std::os::raw::c_void,
1095    ) -> i32;
1096}
1097unsafe extern "C" {
1098    #[doc = " Get a boolean vector associated with the provided key and place it in the\n provided pre-allocated buffer from the user.\n\n This function returns the size in bytes of stored vector.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param buffer pointer to a pre-allocated buffer to write the values to\n \\param bufferSizeBytes size of the pre-allocated buffer\n\n \\return size of the stored vector in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_KEY_NOT_FOUND if the key was not found"]
1099    pub fn APersistableBundle_getBooleanVector(
1100        pBundle: *const APersistableBundle,
1101        key: *const ::std::os::raw::c_char,
1102        buffer: *mut bool,
1103        bufferSizeBytes: i32,
1104    ) -> i32;
1105}
1106unsafe extern "C" {
1107    #[doc = " Get an int32_t vector associated with the provided key and place it in the\n provided pre-allocated buffer from the user.\n\n This function returns the size in bytes of stored vector.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param buffer pointer to a pre-allocated buffer to write the values to\n \\param bufferSizeBytes size of the pre-allocated buffer\n\n \\return size of the stored vector in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_KEY_NOT_FOUND if the key was not found"]
1108    pub fn APersistableBundle_getIntVector(
1109        pBundle: *const APersistableBundle,
1110        key: *const ::std::os::raw::c_char,
1111        buffer: *mut i32,
1112        bufferSizeBytes: i32,
1113    ) -> i32;
1114}
1115unsafe extern "C" {
1116    #[doc = " Get an int64_t vector associated with the provided key and place it in the\n provided pre-allocated buffer from the user.\n\n This function returns the size in bytes of stored vector.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param buffer pointer to a pre-allocated buffer to write the values to\n \\param bufferSizeBytes size of the pre-allocated buffer\n\n \\return size of the stored vector in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_KEY_NOT_FOUND if the key was not found"]
1117    pub fn APersistableBundle_getLongVector(
1118        pBundle: *const APersistableBundle,
1119        key: *const ::std::os::raw::c_char,
1120        buffer: *mut i64,
1121        bufferSizeBytes: i32,
1122    ) -> i32;
1123}
1124unsafe extern "C" {
1125    #[doc = " Get a double vector associated with the provided key and place it in the\n provided pre-allocated buffer from the user.\n\n This function returns the size in bytes of stored vector.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param buffer pointer to a pre-allocated buffer to write the values to\n \\param bufferSizeBytes size of the pre-allocated buffer\n\n \\return size of the stored vector in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_KEY_NOT_FOUND if the key was not found"]
1126    pub fn APersistableBundle_getDoubleVector(
1127        pBundle: *const APersistableBundle,
1128        key: *const ::std::os::raw::c_char,
1129        buffer: *mut f64,
1130        bufferSizeBytes: i32,
1131    ) -> i32;
1132}
1133unsafe extern "C" {
1134    #[doc = " Get a string vector associated with the provided key and place it in the\n provided pre-allocated buffer from the user. The user must provide an\n APersistableBundle_stringAllocator for the individual strings to be\n allocated.\n The caller is responsible for freeing the returned data.\n\n This function returns the size in bytes of stored vector.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param buffer pointer to a pre-allocated buffer to write the string pointers to\n \\param bufferSizeBytes size of the pre-allocated buffer\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of the stored vector in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         0 if no string vector exists for the provided key\n         APERSISTABLEBUNDLE_KEY_NOT_FOUND if the key was not found\n         APERSISTABLEBUNDLE_ALLOCATOR_FAILED if the provided allocator fails"]
1135    pub fn APersistableBundle_getStringVector(
1136        pBundle: *const APersistableBundle,
1137        key: *const ::std::os::raw::c_char,
1138        buffer: *mut *mut ::std::os::raw::c_char,
1139        bufferSizeBytes: i32,
1140        stringAllocator: ::std::option::Option<
1141            unsafe extern "C" fn(
1142                arg1: i32,
1143                arg2: *mut ::std::os::raw::c_void,
1144            ) -> *mut ::std::os::raw::c_char,
1145        >,
1146        context: *mut ::std::os::raw::c_void,
1147    ) -> i32;
1148}
1149unsafe extern "C" {
1150    #[doc = " Get an APersistableBundle* associated with the provided key.\n\n Available since API level 202404.\n\n \\param pBundle to operate on\n \\param key for the mapping in UTF-8\n \\param val pointer to an APersistableBundle pointer to write to point to\n a new copy of the stored APersistableBundle. The caller takes ownership of\n the new APersistableBundle and must be deleted with\n APersistableBundle_delete.\n\n \\return true if a value exists for the provided key"]
1151    pub fn APersistableBundle_getPersistableBundle(
1152        pBundle: *const APersistableBundle,
1153        key: *const ::std::os::raw::c_char,
1154        outBundle: *mut *mut APersistableBundle,
1155    ) -> bool;
1156}
1157unsafe extern "C" {
1158    #[doc = " Get all of the keys associated with this specific type and place it in the\n provided pre-allocated buffer from the user. The user must provide an\n APersistableBundle_stringAllocator for the individual strings to be\n allocated.\n The caller is responsible for freeing the returned data.\n\n This function returns the size in bytes required to fit the fill list of keys.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param outKeys pointer to a pre-allocated buffer to write the UTF-8 keys to\n \\param bufferSizeBytes size of the pre-allocated buffer\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of the buffer of keys in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_ALLOCATOR_FAILED if the provided allocator fails"]
1159    pub fn APersistableBundle_getBooleanKeys(
1160        pBundle: *const APersistableBundle,
1161        outKeys: *mut *mut ::std::os::raw::c_char,
1162        bufferSizeBytes: i32,
1163        stringAllocator: ::std::option::Option<
1164            unsafe extern "C" fn(
1165                arg1: i32,
1166                arg2: *mut ::std::os::raw::c_void,
1167            ) -> *mut ::std::os::raw::c_char,
1168        >,
1169        context: *mut ::std::os::raw::c_void,
1170    ) -> i32;
1171}
1172unsafe extern "C" {
1173    #[doc = " Get all of the keys associated with this specific type and place it in the\n provided pre-allocated buffer from the user. The user must provide an\n APersistableBundle_stringAllocator for the individual strings to be\n allocated.\n The caller is responsible for freeing the returned data.\n\n This function returns the size in bytes required to fit the fill list of keys.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param outKeys pointer to a pre-allocated buffer to write the UTF-8 keys to\n \\param bufferSizeBytes size of the pre-allocated buffer\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of the buffer of keys in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_ALLOCATOR_FAILED if the provided allocator fails"]
1174    pub fn APersistableBundle_getIntKeys(
1175        pBundle: *const APersistableBundle,
1176        outKeys: *mut *mut ::std::os::raw::c_char,
1177        bufferSizeBytes: i32,
1178        stringAllocator: ::std::option::Option<
1179            unsafe extern "C" fn(
1180                arg1: i32,
1181                arg2: *mut ::std::os::raw::c_void,
1182            ) -> *mut ::std::os::raw::c_char,
1183        >,
1184        context: *mut ::std::os::raw::c_void,
1185    ) -> i32;
1186}
1187unsafe extern "C" {
1188    #[doc = " Get all of the keys associated with this specific type and place it in the\n provided pre-allocated buffer from the user. The user must provide an\n APersistableBundle_stringAllocator for the individual strings to be\n allocated.\n The caller is responsible for freeing the returned data.\n\n This function returns the size in bytes required to fit the fill list of keys.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param outKeys pointer to a pre-allocated buffer to write the UTF-8 keys to\n \\param bufferSizeBytes size of the pre-allocated buffer\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of the buffer of keys in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_ALLOCATOR_FAILED if the provided allocator fails"]
1189    pub fn APersistableBundle_getLongKeys(
1190        pBundle: *const APersistableBundle,
1191        outKeys: *mut *mut ::std::os::raw::c_char,
1192        bufferSizeBytes: i32,
1193        stringAllocator: ::std::option::Option<
1194            unsafe extern "C" fn(
1195                arg1: i32,
1196                arg2: *mut ::std::os::raw::c_void,
1197            ) -> *mut ::std::os::raw::c_char,
1198        >,
1199        context: *mut ::std::os::raw::c_void,
1200    ) -> i32;
1201}
1202unsafe extern "C" {
1203    #[doc = " Get all of the keys associated with this specific type and place it in the\n provided pre-allocated buffer from the user. The user must provide an\n APersistableBundle_stringAllocator for the individual strings to be\n allocated.\n The caller is responsible for freeing the returned data.\n\n This function returns the size in bytes required to fit the fill list of keys.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param outKeys pointer to a pre-allocated buffer to write the UTF-8 keys to\n \\param bufferSizeBytes size of the pre-allocated buffer\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of the buffer of keys in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_ALLOCATOR_FAILED if the provided allocator fails"]
1204    pub fn APersistableBundle_getDoubleKeys(
1205        pBundle: *const APersistableBundle,
1206        outKeys: *mut *mut ::std::os::raw::c_char,
1207        bufferSizeBytes: i32,
1208        stringAllocator: ::std::option::Option<
1209            unsafe extern "C" fn(
1210                arg1: i32,
1211                arg2: *mut ::std::os::raw::c_void,
1212            ) -> *mut ::std::os::raw::c_char,
1213        >,
1214        context: *mut ::std::os::raw::c_void,
1215    ) -> i32;
1216}
1217unsafe extern "C" {
1218    #[doc = " Get all of the keys associated with this specific type and place it in the\n provided pre-allocated buffer from the user. The user must provide an\n APersistableBundle_stringAllocator for the individual strings to be\n allocated.\n The caller is responsible for freeing the returned data.\n\n This function returns the size in bytes required to fit the fill list of keys.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param outKeys pointer to a pre-allocated buffer to write the UTF-8 keys to\n \\param bufferSizeBytes size of the pre-allocated buffer\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of the buffer of keys in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_ALLOCATOR_FAILED if the provided allocator fails"]
1219    pub fn APersistableBundle_getStringKeys(
1220        pBundle: *const APersistableBundle,
1221        outKeys: *mut *mut ::std::os::raw::c_char,
1222        bufferSizeBytes: i32,
1223        stringAllocator: ::std::option::Option<
1224            unsafe extern "C" fn(
1225                arg1: i32,
1226                arg2: *mut ::std::os::raw::c_void,
1227            ) -> *mut ::std::os::raw::c_char,
1228        >,
1229        context: *mut ::std::os::raw::c_void,
1230    ) -> i32;
1231}
1232unsafe extern "C" {
1233    #[doc = " Get all of the keys associated with this specific type and place it in the\n provided pre-allocated buffer from the user. The user must provide an\n APersistableBundle_stringAllocator for the individual strings to be\n allocated.\n The caller is responsible for freeing the returned data.\n\n This function returns the size in bytes required to fit the fill list of keys.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param outKeys pointer to a pre-allocated buffer to write the UTF-8 keys to\n \\param bufferSizeBytes size of the pre-allocated buffer\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of the buffer of keys in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_ALLOCATOR_FAILED if the provided allocator fails"]
1234    pub fn APersistableBundle_getBooleanVectorKeys(
1235        pBundle: *const APersistableBundle,
1236        outKeys: *mut *mut ::std::os::raw::c_char,
1237        bufferSizeBytes: i32,
1238        stringAllocator: ::std::option::Option<
1239            unsafe extern "C" fn(
1240                arg1: i32,
1241                arg2: *mut ::std::os::raw::c_void,
1242            ) -> *mut ::std::os::raw::c_char,
1243        >,
1244        context: *mut ::std::os::raw::c_void,
1245    ) -> i32;
1246}
1247unsafe extern "C" {
1248    #[doc = " Get all of the keys associated with this specific type and place it in the\n provided pre-allocated buffer from the user. The user must provide an\n APersistableBundle_stringAllocator for the individual strings to be\n allocated.\n The caller is responsible for freeing the returned data.\n\n This function returns the size in bytes required to fit the fill list of keys.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param outKeys pointer to a pre-allocated buffer to write the UTF-8 keys to\n \\param bufferSizeBytes size of the pre-allocated buffer\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of the buffer of keys in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_ALLOCATOR_FAILED if the provided allocator fails"]
1249    pub fn APersistableBundle_getIntVectorKeys(
1250        pBundle: *const APersistableBundle,
1251        outKeys: *mut *mut ::std::os::raw::c_char,
1252        bufferSizeBytes: i32,
1253        stringAllocator: ::std::option::Option<
1254            unsafe extern "C" fn(
1255                arg1: i32,
1256                arg2: *mut ::std::os::raw::c_void,
1257            ) -> *mut ::std::os::raw::c_char,
1258        >,
1259        context: *mut ::std::os::raw::c_void,
1260    ) -> i32;
1261}
1262unsafe extern "C" {
1263    #[doc = " Get all of the keys associated with this specific type and place it in the\n provided pre-allocated buffer from the user. The user must provide an\n APersistableBundle_stringAllocator for the individual strings to be\n allocated.\n The caller is responsible for freeing the returned data.\n\n This function returns the size in bytes required to fit the fill list of keys.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param outKeys pointer to a pre-allocated buffer to write the UTF-8 keys to\n \\param bufferSizeBytes size of the pre-allocated buffer\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of the buffer of keys in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_ALLOCATOR_FAILED if the provided allocator fails"]
1264    pub fn APersistableBundle_getLongVectorKeys(
1265        pBundle: *const APersistableBundle,
1266        outKeys: *mut *mut ::std::os::raw::c_char,
1267        bufferSizeBytes: i32,
1268        stringAllocator: ::std::option::Option<
1269            unsafe extern "C" fn(
1270                arg1: i32,
1271                arg2: *mut ::std::os::raw::c_void,
1272            ) -> *mut ::std::os::raw::c_char,
1273        >,
1274        context: *mut ::std::os::raw::c_void,
1275    ) -> i32;
1276}
1277unsafe extern "C" {
1278    #[doc = " Get all of the keys associated with this specific type and place it in the\n provided pre-allocated buffer from the user. The user must provide an\n APersistableBundle_stringAllocator for the individual strings to be\n allocated.\n The caller is responsible for freeing the returned data.\n\n This function returns the size in bytes required to fit the fill list of keys.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param outKeys pointer to a pre-allocated buffer to write the UTF-8 keys to\n \\param bufferSizeBytes size of the pre-allocated buffer\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of the buffer of keys in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired."]
1279    pub fn APersistableBundle_getDoubleVectorKeys(
1280        pBundle: *const APersistableBundle,
1281        outKeys: *mut *mut ::std::os::raw::c_char,
1282        bufferSizeBytes: i32,
1283        stringAllocator: ::std::option::Option<
1284            unsafe extern "C" fn(
1285                arg1: i32,
1286                arg2: *mut ::std::os::raw::c_void,
1287            ) -> *mut ::std::os::raw::c_char,
1288        >,
1289        context: *mut ::std::os::raw::c_void,
1290    ) -> i32;
1291}
1292unsafe extern "C" {
1293    #[doc = " Get all of the keys associated with this specific type and place it in the\n provided pre-allocated buffer from the user. The user must provide an\n APersistableBundle_stringAllocator for the individual strings to be\n allocated.\n The caller is responsible for freeing the returned data.\n\n This function returns the size in bytes required to fit the fill list of keys.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param outKeys pointer to a pre-allocated buffer to write the UTF-8 keys to\n \\param bufferSizeBytes size of the pre-allocated buffer\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of the buffer of keys in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         false"]
1294    pub fn APersistableBundle_getStringVectorKeys(
1295        pBundle: *const APersistableBundle,
1296        outKeys: *mut *mut ::std::os::raw::c_char,
1297        bufferSizeBytes: i32,
1298        stringAllocator: ::std::option::Option<
1299            unsafe extern "C" fn(
1300                arg1: i32,
1301                arg2: *mut ::std::os::raw::c_void,
1302            ) -> *mut ::std::os::raw::c_char,
1303        >,
1304        context: *mut ::std::os::raw::c_void,
1305    ) -> i32;
1306}
1307unsafe extern "C" {
1308    #[doc = " Get all of the keys associated with this specific type and place it in the\n provided pre-allocated buffer from the user. The user must provide an\n APersistableBundle_stringAllocator for the individual strings to be\n allocated.\n The caller is responsible for freeing the returned data in bytes.\n\n This function returns the size in bytes required to fit the fill list of keys.\n The supplied buffer will be filled in based on the smaller of the supplied\n bufferSizeBytes or the actual size of the stored data.\n If the buffer is null or if the supplied bufferSizeBytes is smaller than the\n actual stored data, then not all of the stored data will be returned.\n\n Users can call this function with null buffer and 0 bufferSizeBytes to get\n the required size of the buffer to use on a subsequent call.\n\n \\param pBundle to operate on\n \\param outKeys pointer to a pre-allocated buffer to write the UTF-8 keys to\n \\param bufferSizeBytes size of the pre-allocated buffer\n \\param stringAllocator function pointer to the string allocator\n \\param context pointer that will be passed to the stringAllocator\n\n \\return size of the buffer of keys in bytes. This is the required size of the\n pre-allocated user supplied buffer if all of the stored contents are desired.\n         APERSISTABLEBUNDLE_ALLOCATOR_FAILED if the provided allocator fails"]
1309    pub fn APersistableBundle_getPersistableBundleKeys(
1310        pBundle: *const APersistableBundle,
1311        outKeys: *mut *mut ::std::os::raw::c_char,
1312        bufferSizeBytes: i32,
1313        stringAllocator: ::std::option::Option<
1314            unsafe extern "C" fn(
1315                arg1: i32,
1316                arg2: *mut ::std::os::raw::c_void,
1317            ) -> *mut ::std::os::raw::c_char,
1318        >,
1319        context: *mut ::std::os::raw::c_void,
1320    ) -> i32;
1321}
1322unsafe extern "C" {
1323    #[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"]
1324    pub fn AIBinder_setRequestingSid(binder: *mut AIBinder, requestingSid: bool);
1325}
1326unsafe extern "C" {
1327    #[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."]
1328    pub fn AIBinder_getCallingSid() -> *const ::std::os::raw::c_char;
1329}
1330unsafe extern "C" {
1331    #[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 This overrides the setting in ABinderProcess_disableBackgroundScheduling.\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"]
1332    pub fn AIBinder_setMinSchedulerPolicy(
1333        binder: *mut AIBinder,
1334        policy: ::std::os::raw::c_int,
1335        priority: ::std::os::raw::c_int,
1336    );
1337}
1338unsafe extern "C" {
1339    #[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)."]
1340    pub fn AIBinder_setInheritRt(binder: *mut AIBinder, inheritRt: bool);
1341}
1342#[repr(u32)]
1343#[non_exhaustive]
1344#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1345pub enum AServiceManager_AddServiceFlag {
1346    #[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."]
1347    ADD_SERVICE_ALLOW_ISOLATED = 1,
1348    #[doc = " Allows services to dump sections according to priorities and format"]
1349    ADD_SERVICE_DUMP_FLAG_PRIORITY_CRITICAL = 2,
1350    #[doc = " Allows services to dump sections according to priorities and format"]
1351    ADD_SERVICE_DUMP_FLAG_PRIORITY_HIGH = 4,
1352    #[doc = " Allows services to dump sections according to priorities and format"]
1353    ADD_SERVICE_DUMP_FLAG_PRIORITY_NORMAL = 8,
1354    #[doc = " Allows services to dump sections according to priorities and format"]
1355    ADD_SERVICE_DUMP_FLAG_PRIORITY_DEFAULT = 16,
1356    #[doc = " Allows services to dump sections according to priorities and format"]
1357    ADD_SERVICE_DUMP_FLAG_PROTO = 32,
1358}
1359#[repr(u32)]
1360#[non_exhaustive]
1361#[doc = " These are the different SELinux permissions that processes need to have for\n different operations with servicemanager."]
1362#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1363pub enum AServiceManager_PermissionType {
1364    #[doc = " Permission for a process to \"find\" this service through ServiceManager\n APIs like AServiceManager_getService or AServiceManager_waitForService"]
1365    CHECK_ACCESS_PERMISSION_FIND = 0,
1366    #[doc = " Permission for a process to \"list\" services with\n libbinder's IServiceManager::listServices"]
1367    CHECK_ACCESS_PERMISSION_LIST = 1,
1368    #[doc = " Permission for a process to \"add\", or register, a service with\n servicemanager through AServiceManager_addService"]
1369    CHECK_ACCESS_PERMISSION_ADD = 2,
1370}
1371unsafe extern "C" {
1372    #[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."]
1373    pub fn AServiceManager_addService(
1374        binder: *mut AIBinder,
1375        instance: *const ::std::os::raw::c_char,
1376    ) -> binder_exception_t;
1377}
1378unsafe extern "C" {
1379    #[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."]
1380    pub fn AServiceManager_addServiceWithFlags(
1381        binder: *mut AIBinder,
1382        instance: *const ::std::os::raw::c_char,
1383        flags: AServiceManager_AddServiceFlag,
1384    ) -> binder_exception_t;
1385}
1386unsafe extern "C" {
1387    #[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."]
1388    pub fn AServiceManager_checkService(instance: *const ::std::os::raw::c_char) -> *mut AIBinder;
1389}
1390unsafe extern "C" {
1391    #[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."]
1392    pub fn AServiceManager_getService(instance: *const ::std::os::raw::c_char) -> *mut AIBinder;
1393}
1394unsafe extern "C" {
1395    #[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."]
1396    pub fn AServiceManager_registerLazyService(
1397        binder: *mut AIBinder,
1398        instance: *const ::std::os::raw::c_char,
1399    ) -> binder_status_t;
1400}
1401unsafe extern "C" {
1402    #[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."]
1403    pub fn AServiceManager_waitForService(instance: *const ::std::os::raw::c_char)
1404    -> *mut AIBinder;
1405}
1406#[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"]
1407pub type AServiceManager_onRegister = ::std::option::Option<
1408    unsafe extern "C" fn(
1409        instance: *const ::std::os::raw::c_char,
1410        registered: *mut AIBinder,
1411        cookie: *mut ::std::os::raw::c_void,
1412    ),
1413>;
1414#[doc = " Represents a registration to servicemanager which can be cleared anytime."]
1415#[repr(C)]
1416#[derive(Debug, Copy, Clone)]
1417pub struct AServiceManager_NotificationRegistration {
1418    _unused: [u8; 0],
1419}
1420unsafe extern "C" {
1421    #[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."]
1422    pub fn AServiceManager_registerForServiceNotifications(
1423        instance: *const ::std::os::raw::c_char,
1424        onRegister: AServiceManager_onRegister,
1425        cookie: *mut ::std::os::raw::c_void,
1426    ) -> *mut AServiceManager_NotificationRegistration;
1427}
1428unsafe extern "C" {
1429    #[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"]
1430    pub fn AServiceManager_NotificationRegistration_delete(
1431        notification: *mut AServiceManager_NotificationRegistration,
1432    );
1433}
1434unsafe extern "C" {
1435    #[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."]
1436    pub fn AServiceManager_isDeclared(instance: *const ::std::os::raw::c_char) -> bool;
1437}
1438unsafe extern "C" {
1439    #[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"]
1440    pub fn AServiceManager_forEachDeclaredInstance(
1441        interface: *const ::std::os::raw::c_char,
1442        context: *mut ::std::os::raw::c_void,
1443        callback: ::std::option::Option<
1444            unsafe extern "C" fn(
1445                arg1: *const ::std::os::raw::c_char,
1446                arg2: *mut ::std::os::raw::c_void,
1447            ),
1448        >,
1449    );
1450}
1451unsafe extern "C" {
1452    #[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"]
1453    pub fn AServiceManager_isUpdatableViaApex(instance: *const ::std::os::raw::c_char) -> bool;
1454}
1455unsafe extern "C" {
1456    #[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"]
1457    pub fn AServiceManager_getUpdatableApexName(
1458        instance: *const ::std::os::raw::c_char,
1459        context: *mut ::std::os::raw::c_void,
1460        callback: ::std::option::Option<
1461            unsafe extern "C" fn(
1462                arg1: *const ::std::os::raw::c_char,
1463                arg2: *mut ::std::os::raw::c_void,
1464            ),
1465        >,
1466    );
1467}
1468unsafe extern "C" {
1469    #[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"]
1470    pub fn AServiceManager_openDeclaredPassthroughHal(
1471        interface: *const ::std::os::raw::c_char,
1472        instance: *const ::std::os::raw::c_char,
1473        flag: ::std::os::raw::c_int,
1474    ) -> *mut ::std::os::raw::c_void;
1475}
1476unsafe extern "C" {
1477    #[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."]
1478    pub fn AServiceManager_forceLazyServicesPersist(persist: bool);
1479}
1480unsafe extern "C" {
1481    #[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."]
1482    pub fn AServiceManager_setActiveServicesCallback(
1483        callback: ::std::option::Option<
1484            unsafe extern "C" fn(arg1: bool, arg2: *mut ::std::os::raw::c_void) -> bool,
1485        >,
1486        context: *mut ::std::os::raw::c_void,
1487    );
1488}
1489unsafe extern "C" {
1490    #[doc = " Try to unregister all services previously registered with 'registerService'.\n\n \\return true on success."]
1491    pub fn AServiceManager_tryUnregister() -> bool;
1492}
1493unsafe extern "C" {
1494    #[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)."]
1495    pub fn AServiceManager_reRegister();
1496}
1497unsafe extern "C" {
1498    #[doc = " Check if this 'callerSid' has access for the 'permission' for a given service 'name'.\n\n This is useful when a process will be making calls to servicemanager on behalf of another\n process (callerCtx).\n The direct caller of this function also needs to have the permissions it is\n checking on behalf of the other process.\n\n \\param caller_sid - UTF-8 encoded string. SELinux context of the process that is being checked.\n \\param caller_debug_pid - PID of the process that is being checked. This can\n                           only be used in logging for debugging because PIDs are\n                           reused. Servicemanager uses it for logging denials.\n \\param caller_uid - UID of the process that is being checked. Servicemanager\n                     only uses this for logging denials for better debugging.\n \\param instance - UTF-8 encoded string. Instance name of the service that the caller\n                   wants to interact with.\n \\param permission - The servicemanager SELinux permission that the process\n                     is interested in for the service.\n\n \\return True if the process with `caller_sid` has the SELinux `permission`\n         for the given service `instance`. False if it does not have\n         permission or some error occurred."]
1499    pub fn AServiceManager_checkServiceAccess(
1500        caller_sid: *const ::std::os::raw::c_char,
1501        caller_debug_pid: pid_t,
1502        caller_uid: uid_t,
1503        instance: *const ::std::os::raw::c_char,
1504        permission: AServiceManager_PermissionType,
1505    ) -> bool;
1506}
1507unsafe extern "C" {
1508    #[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."]
1509    pub fn AParcel_getAllowFds(arg1: *const AParcel) -> bool;
1510}
1511unsafe extern "C" {
1512    #[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."]
1513    pub fn AParcel_markSensitive(parcel: *const AParcel);
1514}
1515unsafe extern "C" {
1516    #[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."]
1517    pub fn ABinderProcess_startThreadPool();
1518}
1519unsafe extern "C" {
1520    #[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."]
1521    pub fn ABinderProcess_setThreadPoolMaxThreadCount(numThreads: u32) -> bool;
1522}
1523unsafe extern "C" {
1524    #[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."]
1525    pub fn ABinderProcess_isThreadPoolStarted() -> bool;
1526}
1527unsafe extern "C" {
1528    #[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."]
1529    pub fn ABinderProcess_joinThreadPool();
1530}
1531unsafe extern "C" {
1532    #[doc = " Disables (or enables) background scheduling.\n\n By default, binder threads execute at a lower priority. However, this can cause\n priority inversion, so it is recommended to be disabled in high priority\n or in system processes.\n\n See also AIBinder_setMinSchedulerPolicy, which overrides this setting.\n\n \\param disable whether to disable background scheduling"]
1533    pub fn ABinderProcess_disableBackgroundScheduling(disable: bool);
1534}
1535unsafe extern "C" {
1536    #[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"]
1537    pub fn ABinderProcess_setupPolling(fd: *mut ::std::os::raw::c_int) -> binder_status_t;
1538}
1539unsafe extern "C" {
1540    #[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"]
1541    pub fn ABinderProcess_handlePolledCommands() -> binder_status_t;
1542}
1543#[repr(C)]
1544#[derive(Debug, Copy, Clone)]
1545pub struct iovec {
1546    pub iov_base: *mut ::std::os::raw::c_void,
1547    pub iov_len: __kernel_size_t,
1548}
1549#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1550const _: () = {
1551    ["Size of iovec"][::std::mem::size_of::<iovec>() - 16usize];
1552    ["Alignment of iovec"][::std::mem::align_of::<iovec>() - 8usize];
1553    ["Offset of field: iovec::iov_base"][::std::mem::offset_of!(iovec, iov_base) - 0usize];
1554    ["Offset of field: iovec::iov_len"][::std::mem::offset_of!(iovec, iov_len) - 8usize];
1555};
1556pub type sa_family_t = ::std::os::raw::c_ushort;
1557#[repr(C)]
1558#[derive(Debug, Copy, Clone)]
1559pub struct timespec {
1560    _unused: [u8; 0],
1561}
1562#[repr(C)]
1563#[derive(Debug, Copy, Clone)]
1564pub struct msghdr {
1565    pub msg_name: *mut ::std::os::raw::c_void,
1566    pub msg_namelen: socklen_t,
1567    pub msg_iov: *mut iovec,
1568    pub msg_iovlen: usize,
1569    pub msg_control: *mut ::std::os::raw::c_void,
1570    pub msg_controllen: usize,
1571    pub msg_flags: ::std::os::raw::c_int,
1572}
1573#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1574const _: () = {
1575    ["Size of msghdr"][::std::mem::size_of::<msghdr>() - 56usize];
1576    ["Alignment of msghdr"][::std::mem::align_of::<msghdr>() - 8usize];
1577    ["Offset of field: msghdr::msg_name"][::std::mem::offset_of!(msghdr, msg_name) - 0usize];
1578    ["Offset of field: msghdr::msg_namelen"][::std::mem::offset_of!(msghdr, msg_namelen) - 8usize];
1579    ["Offset of field: msghdr::msg_iov"][::std::mem::offset_of!(msghdr, msg_iov) - 16usize];
1580    ["Offset of field: msghdr::msg_iovlen"][::std::mem::offset_of!(msghdr, msg_iovlen) - 24usize];
1581    ["Offset of field: msghdr::msg_control"][::std::mem::offset_of!(msghdr, msg_control) - 32usize];
1582    ["Offset of field: msghdr::msg_controllen"]
1583        [::std::mem::offset_of!(msghdr, msg_controllen) - 40usize];
1584    ["Offset of field: msghdr::msg_flags"][::std::mem::offset_of!(msghdr, msg_flags) - 48usize];
1585};
1586#[repr(C)]
1587#[derive(Debug, Copy, Clone)]
1588pub struct mmsghdr {
1589    pub msg_hdr: msghdr,
1590    pub msg_len: ::std::os::raw::c_uint,
1591}
1592#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1593const _: () = {
1594    ["Size of mmsghdr"][::std::mem::size_of::<mmsghdr>() - 64usize];
1595    ["Alignment of mmsghdr"][::std::mem::align_of::<mmsghdr>() - 8usize];
1596    ["Offset of field: mmsghdr::msg_hdr"][::std::mem::offset_of!(mmsghdr, msg_hdr) - 0usize];
1597    ["Offset of field: mmsghdr::msg_len"][::std::mem::offset_of!(mmsghdr, msg_len) - 56usize];
1598};
1599#[repr(C)]
1600#[derive(Debug, Copy, Clone)]
1601pub struct cmsghdr {
1602    pub cmsg_len: usize,
1603    pub cmsg_level: ::std::os::raw::c_int,
1604    pub cmsg_type: ::std::os::raw::c_int,
1605}
1606#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1607const _: () = {
1608    ["Size of cmsghdr"][::std::mem::size_of::<cmsghdr>() - 16usize];
1609    ["Alignment of cmsghdr"][::std::mem::align_of::<cmsghdr>() - 8usize];
1610    ["Offset of field: cmsghdr::cmsg_len"][::std::mem::offset_of!(cmsghdr, cmsg_len) - 0usize];
1611    ["Offset of field: cmsghdr::cmsg_level"][::std::mem::offset_of!(cmsghdr, cmsg_level) - 8usize];
1612    ["Offset of field: cmsghdr::cmsg_type"][::std::mem::offset_of!(cmsghdr, cmsg_type) - 12usize];
1613};
1614unsafe extern "C" {
1615    pub fn __cmsg_nxthdr(__msg: *mut msghdr, __cmsg: *mut cmsghdr) -> *mut cmsghdr;
1616}
1617unsafe extern "C" {
1618    pub fn accept(
1619        __fd: ::std::os::raw::c_int,
1620        __addr: *mut sockaddr,
1621        __addr_length: *mut socklen_t,
1622    ) -> ::std::os::raw::c_int;
1623}
1624unsafe extern "C" {
1625    pub fn accept4(
1626        __fd: ::std::os::raw::c_int,
1627        __addr: *mut sockaddr,
1628        __addr_length: *mut socklen_t,
1629        __flags: ::std::os::raw::c_int,
1630    ) -> ::std::os::raw::c_int;
1631}
1632unsafe extern "C" {
1633    pub fn bind(
1634        __fd: ::std::os::raw::c_int,
1635        __addr: *const sockaddr,
1636        __addr_length: socklen_t,
1637    ) -> ::std::os::raw::c_int;
1638}
1639unsafe extern "C" {
1640    pub fn connect(
1641        __fd: ::std::os::raw::c_int,
1642        __addr: *const sockaddr,
1643        __addr_length: socklen_t,
1644    ) -> ::std::os::raw::c_int;
1645}
1646unsafe extern "C" {
1647    pub fn getpeername(
1648        __fd: ::std::os::raw::c_int,
1649        __addr: *mut sockaddr,
1650        __addr_length: *mut socklen_t,
1651    ) -> ::std::os::raw::c_int;
1652}
1653unsafe extern "C" {
1654    pub fn getsockname(
1655        __fd: ::std::os::raw::c_int,
1656        __addr: *mut sockaddr,
1657        __addr_length: *mut socklen_t,
1658    ) -> ::std::os::raw::c_int;
1659}
1660unsafe extern "C" {
1661    pub fn getsockopt(
1662        __fd: ::std::os::raw::c_int,
1663        __level: ::std::os::raw::c_int,
1664        __option: ::std::os::raw::c_int,
1665        __value: *mut ::std::os::raw::c_void,
1666        __value_length: *mut socklen_t,
1667    ) -> ::std::os::raw::c_int;
1668}
1669unsafe extern "C" {
1670    pub fn listen(
1671        __fd: ::std::os::raw::c_int,
1672        __backlog: ::std::os::raw::c_int,
1673    ) -> ::std::os::raw::c_int;
1674}
1675unsafe extern "C" {
1676    pub fn recvmmsg(
1677        __fd: ::std::os::raw::c_int,
1678        __msgs: *mut mmsghdr,
1679        __msg_count: ::std::os::raw::c_uint,
1680        __flags: ::std::os::raw::c_int,
1681        __timeout: *const timespec,
1682    ) -> ::std::os::raw::c_int;
1683}
1684unsafe extern "C" {
1685    pub fn recvmsg(
1686        __fd: ::std::os::raw::c_int,
1687        __msg: *mut msghdr,
1688        __flags: ::std::os::raw::c_int,
1689    ) -> isize;
1690}
1691unsafe extern "C" {
1692    pub fn sendmmsg(
1693        __fd: ::std::os::raw::c_int,
1694        __msgs: *const mmsghdr,
1695        __msg_count: ::std::os::raw::c_uint,
1696        __flags: ::std::os::raw::c_int,
1697    ) -> ::std::os::raw::c_int;
1698}
1699unsafe extern "C" {
1700    pub fn sendmsg(
1701        __fd: ::std::os::raw::c_int,
1702        __msg: *const msghdr,
1703        __flags: ::std::os::raw::c_int,
1704    ) -> isize;
1705}
1706unsafe extern "C" {
1707    pub fn setsockopt(
1708        __fd: ::std::os::raw::c_int,
1709        __level: ::std::os::raw::c_int,
1710        __option: ::std::os::raw::c_int,
1711        __value: *const ::std::os::raw::c_void,
1712        __value_length: socklen_t,
1713    ) -> ::std::os::raw::c_int;
1714}
1715unsafe extern "C" {
1716    pub fn shutdown(
1717        __fd: ::std::os::raw::c_int,
1718        __how: ::std::os::raw::c_int,
1719    ) -> ::std::os::raw::c_int;
1720}
1721unsafe extern "C" {
1722    pub fn socket(
1723        __af: ::std::os::raw::c_int,
1724        __type: ::std::os::raw::c_int,
1725        __protocol: ::std::os::raw::c_int,
1726    ) -> ::std::os::raw::c_int;
1727}
1728unsafe extern "C" {
1729    pub fn socketpair(
1730        __af: ::std::os::raw::c_int,
1731        __type: ::std::os::raw::c_int,
1732        __protocol: ::std::os::raw::c_int,
1733        __fds: *mut ::std::os::raw::c_int,
1734    ) -> ::std::os::raw::c_int;
1735}
1736unsafe extern "C" {
1737    pub fn recv(
1738        __fd: ::std::os::raw::c_int,
1739        __buf: *mut ::std::os::raw::c_void,
1740        __n: usize,
1741        __flags: ::std::os::raw::c_int,
1742    ) -> isize;
1743}
1744unsafe extern "C" {
1745    pub fn send(
1746        __fd: ::std::os::raw::c_int,
1747        __buf: *const ::std::os::raw::c_void,
1748        __n: usize,
1749        __flags: ::std::os::raw::c_int,
1750    ) -> isize;
1751}
1752unsafe extern "C" {
1753    pub fn sendto(
1754        __fd: ::std::os::raw::c_int,
1755        __buf: *const ::std::os::raw::c_void,
1756        __n: usize,
1757        __flags: ::std::os::raw::c_int,
1758        __dst_addr: *const sockaddr,
1759        __dst_addr_length: socklen_t,
1760    ) -> isize;
1761}
1762unsafe extern "C" {
1763    pub fn recvfrom(
1764        __fd: ::std::os::raw::c_int,
1765        __buf: *mut ::std::os::raw::c_void,
1766        __n: usize,
1767        __flags: ::std::os::raw::c_int,
1768        __src_addr: *mut sockaddr,
1769        __src_addr_length: *mut socklen_t,
1770    ) -> isize;
1771}
1772unsafe extern "C" {
1773    pub fn __sendto_chk(
1774        arg1: ::std::os::raw::c_int,
1775        arg2: *const ::std::os::raw::c_void,
1776        arg3: usize,
1777        arg4: usize,
1778        arg5: ::std::os::raw::c_int,
1779        arg6: *const sockaddr,
1780        arg7: socklen_t,
1781    ) -> isize;
1782}
1783unsafe extern "C" {
1784    pub fn __recvfrom_chk(
1785        arg1: ::std::os::raw::c_int,
1786        arg2: *mut ::std::os::raw::c_void,
1787        arg3: usize,
1788        arg4: usize,
1789        arg5: ::std::os::raw::c_int,
1790        arg6: *mut sockaddr,
1791        arg7: *mut socklen_t,
1792    ) -> isize;
1793}
1794#[repr(C)]
1795#[derive(Debug, Copy, Clone)]
1796pub struct ABinderRpc_Accessor {
1797    _unused: [u8; 0],
1798}
1799#[repr(C)]
1800#[derive(Debug, Copy, Clone)]
1801pub struct ABinderRpc_AccessorProvider {
1802    _unused: [u8; 0],
1803}
1804#[repr(C)]
1805#[derive(Debug, Copy, Clone)]
1806pub struct ABinderRpc_ConnectionInfo {
1807    _unused: [u8; 0],
1808}
1809#[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."]
1810pub type ABinderRpc_AccessorProvider_getAccessorCallback = ::std::option::Option<
1811    unsafe extern "C" fn(
1812        instance: *const ::std::os::raw::c_char,
1813        data: *mut ::std::os::raw::c_void,
1814    ) -> *mut ABinderRpc_Accessor,
1815>;
1816#[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."]
1817pub type ABinderRpc_AccessorProviderUserData_deleteCallback =
1818    ::std::option::Option<unsafe extern "C" fn(data: *mut ::std::os::raw::c_void)>;
1819unsafe extern "C" {
1820    #[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."]
1821    pub fn ABinderRpc_registerAccessorProvider(
1822        provider: ABinderRpc_AccessorProvider_getAccessorCallback,
1823        instances: *const *const ::std::os::raw::c_char,
1824        numInstances: usize,
1825        data: *mut ::std::os::raw::c_void,
1826        onDelete: ABinderRpc_AccessorProviderUserData_deleteCallback,
1827    ) -> *mut ABinderRpc_AccessorProvider;
1828}
1829unsafe extern "C" {
1830    #[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"]
1831    pub fn ABinderRpc_unregisterAccessorProvider(provider: *mut ABinderRpc_AccessorProvider);
1832}
1833#[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`"]
1834pub type ABinderRpc_ConnectionInfoProvider = ::std::option::Option<
1835    unsafe extern "C" fn(
1836        instance: *const ::std::os::raw::c_char,
1837        data: *mut ::std::os::raw::c_void,
1838    ) -> *mut ABinderRpc_ConnectionInfo,
1839>;
1840#[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."]
1841pub type ABinderRpc_ConnectionInfoProviderUserData_delete =
1842    ::std::option::Option<unsafe extern "C" fn(data: *mut ::std::os::raw::c_void)>;
1843unsafe extern "C" {
1844    #[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."]
1845    pub fn ABinderRpc_Accessor_new(
1846        instance: *const ::std::os::raw::c_char,
1847        provider: ABinderRpc_ConnectionInfoProvider,
1848        data: *mut ::std::os::raw::c_void,
1849        onDelete: ABinderRpc_ConnectionInfoProviderUserData_delete,
1850    ) -> *mut ABinderRpc_Accessor;
1851}
1852unsafe extern "C" {
1853    #[doc = " Delete an ABinderRpc_Accessor\n\n \\param accessor to delete"]
1854    pub fn ABinderRpc_Accessor_delete(accessor: *mut ABinderRpc_Accessor);
1855}
1856unsafe extern "C" {
1857    #[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"]
1858    pub fn ABinderRpc_Accessor_asBinder(accessor: *mut ABinderRpc_Accessor) -> *mut AIBinder;
1859}
1860unsafe extern "C" {
1861    #[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."]
1862    pub fn ABinderRpc_Accessor_fromBinder(
1863        instance: *const ::std::os::raw::c_char,
1864        accessorBinder: *mut AIBinder,
1865    ) -> *mut ABinderRpc_Accessor;
1866}
1867unsafe extern "C" {
1868    #[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."]
1869    pub fn ABinderRpc_Accessor_delegateAccessor(
1870        instance: *const ::std::os::raw::c_char,
1871        binder: *mut AIBinder,
1872        outDelegator: *mut *mut AIBinder,
1873    ) -> binder_status_t;
1874}
1875unsafe extern "C" {
1876    #[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"]
1877    pub fn ABinderRpc_ConnectionInfo_new(
1878        addr: *const sockaddr,
1879        len: socklen_t,
1880    ) -> *mut ABinderRpc_ConnectionInfo;
1881}
1882unsafe extern "C" {
1883    #[doc = " Delete an ABinderRpc_ConnectionInfo object that was created with\n ABinderRpc_ConnectionInfo_new.\n\n \\param info object to be deleted"]
1884    pub fn ABinderRpc_ConnectionInfo_delete(info: *mut ABinderRpc_ConnectionInfo);
1885}
1886#[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"]
1887pub type AIBinder_handleShellCommand = ::std::option::Option<
1888    unsafe extern "C" fn(
1889        binder: *mut AIBinder,
1890        in_: ::std::os::raw::c_int,
1891        out: ::std::os::raw::c_int,
1892        err: ::std::os::raw::c_int,
1893        argv: *mut *const ::std::os::raw::c_char,
1894        argc: u32,
1895    ) -> binder_status_t,
1896>;
1897unsafe extern "C" {
1898    #[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"]
1899    pub fn AIBinder_Class_setHandleShellCommand(
1900        clazz: *mut AIBinder_Class,
1901        handleShellCommand: AIBinder_handleShellCommand,
1902    );
1903}
1904unsafe extern "C" {
1905    #[doc = " This interface has the stability of the system image."]
1906    pub fn AIBinder_markSystemStability(binder: *mut AIBinder);
1907}
1908unsafe extern "C" {
1909    #[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);"]
1910    pub fn AIBinder_forceDowngradeToSystemStability(binder: *mut AIBinder);
1911}
1912unsafe extern "C" {
1913    pub fn AIBinder_markVintfStability(binder: *mut AIBinder);
1914}
1915#[repr(i32)]
1916#[non_exhaustive]
1917#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1918pub enum android_c_interface_StatusCode {
1919    OK = 0,
1920    UNKNOWN_ERROR = -2147483648,
1921    NO_MEMORY = -12,
1922    INVALID_OPERATION = -38,
1923    BAD_VALUE = -22,
1924    BAD_TYPE = -2147483647,
1925    NAME_NOT_FOUND = -2,
1926    PERMISSION_DENIED = -1,
1927    NO_INIT = -19,
1928    ALREADY_EXISTS = -17,
1929    DEAD_OBJECT = -32,
1930    FAILED_TRANSACTION = -2147483646,
1931    BAD_INDEX = -75,
1932    NOT_ENOUGH_DATA = -61,
1933    WOULD_BLOCK = -11,
1934    TIMED_OUT = -110,
1935    UNKNOWN_TRANSACTION = -74,
1936    FDS_NOT_ALLOWED = -2147483641,
1937    UNEXPECTED_NULL = -2147483640,
1938}
1939#[repr(i32)]
1940#[non_exhaustive]
1941#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1942pub enum android_c_interface_ExceptionCode {
1943    NONE = 0,
1944    SECURITY = -1,
1945    BAD_PARCELABLE = -2,
1946    ILLEGAL_ARGUMENT = -3,
1947    NULL_POINTER = -4,
1948    ILLEGAL_STATE = -5,
1949    NETWORK_MAIN_THREAD = -6,
1950    UNSUPPORTED_OPERATION = -7,
1951    SERVICE_SPECIFIC = -8,
1952    PARCELABLE = -9,
1953    #[doc = " This is special, and indicates to native binder proxies that the\n transaction has failed at a low level."]
1954    TRANSACTION_FAILED = -129,
1955}
1956pub const FIRST_CALL_TRANSACTION: android_c_interface_consts__bindgen_ty_1 = 1;
1957pub const LAST_CALL_TRANSACTION: android_c_interface_consts__bindgen_ty_1 = 16777215;
1958pub type android_c_interface_consts__bindgen_ty_1 = ::std::os::raw::c_uint;
1959pub const FLAG_ONEWAY: android_c_interface_consts__bindgen_ty_2 = 1;
1960pub const FLAG_CLEAR_BUF: android_c_interface_consts__bindgen_ty_2 = 32;
1961pub const FLAG_PRIVATE_LOCAL: android_c_interface_consts__bindgen_ty_2 = 0;
1962pub type android_c_interface_consts__bindgen_ty_2 = ::std::os::raw::c_uint;
1963pub const APERSISTABLEBUNDLE_KEY_NOT_FOUND: android_c_interface_consts__bindgen_ty_3 = -1;
1964pub const APERSISTABLEBUNDLE_ALLOCATOR_FAILED: android_c_interface_consts__bindgen_ty_3 = -2;
1965pub type android_c_interface_consts__bindgen_ty_3 = ::std::os::raw::c_int;