Loading libs/binder/ndk/include_ndk/android/binder_parcel.h +25 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,31 @@ typedef struct AParcel AParcel; */ void AParcel_delete(AParcel* parcel) __INTRODUCED_IN(29); /** * Sets the position within the parcel. * * \param parcel The parcel of which to set the position. * \param position Position of the parcel to set. This must be a value returned by * AParcel_getDataPosition. Positions are constant for a given parcel between processes. * * \return STATUS_OK on success. If position is negative, then STATUS_BAD_VALUE will be returned. */ binder_status_t AParcel_setDataPosition(const AParcel* parcel, int32_t position) __INTRODUCED_IN(29); /** * Gets the current position within the parcel. * * \param parcel The parcel of which to get the position. * * \return The size of the parcel. This will always be greater than 0. The values returned by this * function before and after calling various reads and writes are not defined. Only the delta * between two positions between a specific sequence of calls is defined. For instance, if position * is X, writeBool is called, and then position is Y, readBool can be called from position X will * return the same value, and then position will be Y. */ int32_t AParcel_getDataPosition(const AParcel* parcel) __INTRODUCED_IN(29); /** * This is called to allocate a buffer for a C-style string (null-terminated). The returned buffer * should be at least length bytes. This includes space for a null terminator. For a string, length Loading libs/binder/ndk/libbinder_ndk.map.txt +2 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ LIBBINDER_NDK { # introduced=29 AIBinder_Weak_new; AIBinder_Weak_promote; AParcel_delete; AParcel_getDataPosition; AParcel_readBool; AParcel_readBoolArray; AParcel_readByte; Loading @@ -48,6 +49,7 @@ LIBBINDER_NDK { # introduced=29 AParcel_readUint32Array; AParcel_readUint64; AParcel_readUint64Array; AParcel_setDataPosition; AParcel_writeBool; AParcel_writeBoolArray; AParcel_writeByte; Loading libs/binder/ndk/parcel.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -212,6 +212,19 @@ void AParcel_delete(AParcel* parcel) { delete parcel; } binder_status_t AParcel_setDataPosition(const AParcel* parcel, int32_t position) { if (position < 0) { return STATUS_BAD_VALUE; } parcel->get()->setDataPosition(position); return STATUS_OK; } int32_t AParcel_getDataPosition(const AParcel* parcel) { return parcel->get()->dataPosition(); } binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder) { sp<IBinder> writeBinder = binder != nullptr ? binder->getBinder() : nullptr; return parcel->get()->writeStrongBinder(writeBinder); Loading Loading
libs/binder/ndk/include_ndk/android/binder_parcel.h +25 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,31 @@ typedef struct AParcel AParcel; */ void AParcel_delete(AParcel* parcel) __INTRODUCED_IN(29); /** * Sets the position within the parcel. * * \param parcel The parcel of which to set the position. * \param position Position of the parcel to set. This must be a value returned by * AParcel_getDataPosition. Positions are constant for a given parcel between processes. * * \return STATUS_OK on success. If position is negative, then STATUS_BAD_VALUE will be returned. */ binder_status_t AParcel_setDataPosition(const AParcel* parcel, int32_t position) __INTRODUCED_IN(29); /** * Gets the current position within the parcel. * * \param parcel The parcel of which to get the position. * * \return The size of the parcel. This will always be greater than 0. The values returned by this * function before and after calling various reads and writes are not defined. Only the delta * between two positions between a specific sequence of calls is defined. For instance, if position * is X, writeBool is called, and then position is Y, readBool can be called from position X will * return the same value, and then position will be Y. */ int32_t AParcel_getDataPosition(const AParcel* parcel) __INTRODUCED_IN(29); /** * This is called to allocate a buffer for a C-style string (null-terminated). The returned buffer * should be at least length bytes. This includes space for a null terminator. For a string, length Loading
libs/binder/ndk/libbinder_ndk.map.txt +2 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ LIBBINDER_NDK { # introduced=29 AIBinder_Weak_new; AIBinder_Weak_promote; AParcel_delete; AParcel_getDataPosition; AParcel_readBool; AParcel_readBoolArray; AParcel_readByte; Loading @@ -48,6 +49,7 @@ LIBBINDER_NDK { # introduced=29 AParcel_readUint32Array; AParcel_readUint64; AParcel_readUint64Array; AParcel_setDataPosition; AParcel_writeBool; AParcel_writeBoolArray; AParcel_writeByte; Loading
libs/binder/ndk/parcel.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -212,6 +212,19 @@ void AParcel_delete(AParcel* parcel) { delete parcel; } binder_status_t AParcel_setDataPosition(const AParcel* parcel, int32_t position) { if (position < 0) { return STATUS_BAD_VALUE; } parcel->get()->setDataPosition(position); return STATUS_OK; } int32_t AParcel_getDataPosition(const AParcel* parcel) { return parcel->get()->dataPosition(); } binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder) { sp<IBinder> writeBinder = binder != nullptr ? binder->getBinder() : nullptr; return parcel->get()->writeStrongBinder(writeBinder); Loading