Loading libs/binder/ndk/include_ndk/android/binder_parcel.h +3 −17 Original line number Diff line number Diff line Loading @@ -297,31 +297,17 @@ typedef int8_t* (*AParcel_byteArrayAllocator)(void* arrayData, size_t length); binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder) __INTRODUCED_IN(29); /** * Reads an AIBinder from the next location in a non-null parcel. This will fail if the binder is * non-null. One strong ref-count of ownership is passed to the caller of this function. * Reads an AIBinder from the next location in a non-null parcel. One strong ref-count of ownership * is passed to the caller of this function. * * \param parcel the parcel to read from. * \param binder the out parameter for what is read from the parcel. This will not be null on * success. * \param binder the out parameter for what is read from the parcel. This may be null. * * \return STATUS_OK on successful write. */ binder_status_t AParcel_readStrongBinder(const AParcel* parcel, AIBinder** binder) __INTRODUCED_IN(29); /** * Reads an AIBinder from the next location in a non-null parcel. This may read a null. One strong * ref-count of ownership is passed to the caller of this function. * * \param parcel the parcel to read from. * \param binder the out parameter for what is read from the parcel. This may be null even on * success. * * \return STATUS_OK on successful write. */ binder_status_t AParcel_readNullableStrongBinder(const AParcel* parcel, AIBinder** binder) __INTRODUCED_IN(29); /** * Writes a file descriptor to the next location in a non-null parcel. This does not take ownership * of fd. Loading libs/binder/ndk/include_ndk/android/binder_parcel_utils.h +22 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,28 @@ static inline void AParcel_stdVectorSetter(void* vectorData, size_t index, T val (*vec)[index] = value; } /** * Convenience method to write a strong binder but return an error if it is null. */ static inline binder_status_t AParcel_writeRequiredStrongBinder(AParcel* parcel, AIBinder* binder) { if (binder == nullptr) { return STATUS_UNEXPECTED_NULL; } return AParcel_writeStrongBinder(parcel, binder); } /** * Convenience method to read a strong binder but return an error if it is null. */ static inline binder_status_t AParcel_readRequiredStrongBinder(const AParcel* parcel, AIBinder** binder) { binder_status_t ret = AParcel_readStrongBinder(parcel, binder); if (ret == STATUS_OK && *binder == nullptr) { return STATUS_UNEXPECTED_NULL; } return ret; } /** * Allocates a std::string to length and returns the underlying buffer. For use with * AParcel_readString. See use below in AParcel_readString(const AParcel*, std::string*). Loading libs/binder/ndk/libbinder_ndk.map.txt +0 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ LIBBINDER_NDK { # introduced=29 AParcel_readInt32Array; AParcel_readInt64; AParcel_readInt64Array; AParcel_readNullableStrongBinder; AParcel_readParcelFileDescriptor; AParcel_readStatusHeader; AParcel_readString; Loading libs/binder/ndk/parcel.cpp +0 −11 Original line number Diff line number Diff line Loading @@ -193,17 +193,6 @@ binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder) { return parcel->get()->writeStrongBinder(writeBinder); } binder_status_t AParcel_readStrongBinder(const AParcel* parcel, AIBinder** binder) { sp<IBinder> readBinder = nullptr; status_t status = parcel->get()->readStrongBinder(&readBinder); if (status != STATUS_OK) { return PruneStatusT(status); } sp<AIBinder> ret = ABpBinder::lookupOrCreateFromBinder(readBinder); AIBinder_incStrong(ret.get()); *binder = ret.get(); return PruneStatusT(status); } binder_status_t AParcel_readNullableStrongBinder(const AParcel* parcel, AIBinder** binder) { sp<IBinder> readBinder = nullptr; status_t status = parcel->get()->readNullableStrongBinder(&readBinder); if (status != STATUS_OK) { Loading Loading
libs/binder/ndk/include_ndk/android/binder_parcel.h +3 −17 Original line number Diff line number Diff line Loading @@ -297,31 +297,17 @@ typedef int8_t* (*AParcel_byteArrayAllocator)(void* arrayData, size_t length); binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder) __INTRODUCED_IN(29); /** * Reads an AIBinder from the next location in a non-null parcel. This will fail if the binder is * non-null. One strong ref-count of ownership is passed to the caller of this function. * Reads an AIBinder from the next location in a non-null parcel. One strong ref-count of ownership * is passed to the caller of this function. * * \param parcel the parcel to read from. * \param binder the out parameter for what is read from the parcel. This will not be null on * success. * \param binder the out parameter for what is read from the parcel. This may be null. * * \return STATUS_OK on successful write. */ binder_status_t AParcel_readStrongBinder(const AParcel* parcel, AIBinder** binder) __INTRODUCED_IN(29); /** * Reads an AIBinder from the next location in a non-null parcel. This may read a null. One strong * ref-count of ownership is passed to the caller of this function. * * \param parcel the parcel to read from. * \param binder the out parameter for what is read from the parcel. This may be null even on * success. * * \return STATUS_OK on successful write. */ binder_status_t AParcel_readNullableStrongBinder(const AParcel* parcel, AIBinder** binder) __INTRODUCED_IN(29); /** * Writes a file descriptor to the next location in a non-null parcel. This does not take ownership * of fd. Loading
libs/binder/ndk/include_ndk/android/binder_parcel_utils.h +22 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,28 @@ static inline void AParcel_stdVectorSetter(void* vectorData, size_t index, T val (*vec)[index] = value; } /** * Convenience method to write a strong binder but return an error if it is null. */ static inline binder_status_t AParcel_writeRequiredStrongBinder(AParcel* parcel, AIBinder* binder) { if (binder == nullptr) { return STATUS_UNEXPECTED_NULL; } return AParcel_writeStrongBinder(parcel, binder); } /** * Convenience method to read a strong binder but return an error if it is null. */ static inline binder_status_t AParcel_readRequiredStrongBinder(const AParcel* parcel, AIBinder** binder) { binder_status_t ret = AParcel_readStrongBinder(parcel, binder); if (ret == STATUS_OK && *binder == nullptr) { return STATUS_UNEXPECTED_NULL; } return ret; } /** * Allocates a std::string to length and returns the underlying buffer. For use with * AParcel_readString. See use below in AParcel_readString(const AParcel*, std::string*). Loading
libs/binder/ndk/libbinder_ndk.map.txt +0 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ LIBBINDER_NDK { # introduced=29 AParcel_readInt32Array; AParcel_readInt64; AParcel_readInt64Array; AParcel_readNullableStrongBinder; AParcel_readParcelFileDescriptor; AParcel_readStatusHeader; AParcel_readString; Loading
libs/binder/ndk/parcel.cpp +0 −11 Original line number Diff line number Diff line Loading @@ -193,17 +193,6 @@ binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder) { return parcel->get()->writeStrongBinder(writeBinder); } binder_status_t AParcel_readStrongBinder(const AParcel* parcel, AIBinder** binder) { sp<IBinder> readBinder = nullptr; status_t status = parcel->get()->readStrongBinder(&readBinder); if (status != STATUS_OK) { return PruneStatusT(status); } sp<AIBinder> ret = ABpBinder::lookupOrCreateFromBinder(readBinder); AIBinder_incStrong(ret.get()); *binder = ret.get(); return PruneStatusT(status); } binder_status_t AParcel_readNullableStrongBinder(const AParcel* parcel, AIBinder** binder) { sp<IBinder> readBinder = nullptr; status_t status = parcel->get()->readNullableStrongBinder(&readBinder); if (status != STATUS_OK) { Loading