Loading libs/binder/ndk/include_ndk/android/binder_parcel.h +4 −4 Original line number Original line Diff line number Diff line Loading @@ -136,12 +136,12 @@ typedef int8_t* (*AParcel_byteArrayGetter)(void* arrayData); * * * If allocation fails, null should be returned. * If allocation fails, null should be returned. */ */ typedef void* (*AParcel_string_reallocator)(void* stringData, size_t length); typedef void* (*AParcel_stringReallocator)(void* stringData, size_t length); /** /** * This is called to get the buffer from a stringData object. * This is called to get the buffer from a stringData object. */ */ typedef char* (*AParcel_string_getter)(void* stringData); typedef char* (*AParcel_stringGetter)(void* stringData); /** /** * Writes an AIBinder to the next location in a non-null parcel. Can be null. * Writes an AIBinder to the next location in a non-null parcel. Can be null. Loading Loading @@ -198,8 +198,8 @@ binder_status_t AParcel_writeString(AParcel* parcel, const char* string, size_t * If this function returns a success, the buffer returned by allocator when passed stringData will * If this function returns a success, the buffer returned by allocator when passed stringData will * contain a null-terminated c-str read from the binder. * contain a null-terminated c-str read from the binder. */ */ binder_status_t AParcel_readString(const AParcel* parcel, AParcel_string_reallocator reallocator, binder_status_t AParcel_readString(const AParcel* parcel, AParcel_stringReallocator reallocator, AParcel_string_getter getter, void** stringData) AParcel_stringGetter getter, void** stringData) __INTRODUCED_IN(29); __INTRODUCED_IN(29); // @START-PRIMITIVE-READ-WRITE // @START-PRIMITIVE-READ-WRITE Loading libs/binder/ndk/include_ndk/android/binder_parcel_utils.h +3 −3 Original line number Original line Diff line number Diff line Loading @@ -270,7 +270,7 @@ inline binder_status_t AParcel_readVector<int8_t>(const AParcel* parcel, std::ve * Takes a std::string and reallocates it to the specified length. For use with AParcel_readString. * Takes a std::string and reallocates it to the specified length. For use with AParcel_readString. * See use below in AParcel_readString. * See use below in AParcel_readString. */ */ static inline void* AParcel_std_string_reallocator(void* stringData, size_t length) { static inline void* AParcel_stdStringReallocator(void* stringData, size_t length) { std::string* str = static_cast<std::string*>(stringData); std::string* str = static_cast<std::string*>(stringData); str->resize(length - 1); str->resize(length - 1); return stringData; return stringData; Loading @@ -279,7 +279,7 @@ static inline void* AParcel_std_string_reallocator(void* stringData, size_t leng /** /** * Takes a std::string and returns the inner char*. * Takes a std::string and returns the inner char*. */ */ static inline char* AParcel_std_string_getter(void* stringData) { static inline char* AParcel_stdStringGetter(void* stringData) { std::string* str = static_cast<std::string*>(stringData); std::string* str = static_cast<std::string*>(stringData); return &(*str)[0]; return &(*str)[0]; } } Loading @@ -296,7 +296,7 @@ static inline binder_status_t AParcel_writeString(AParcel* parcel, const std::st */ */ static inline binder_status_t AParcel_readString(const AParcel* parcel, std::string* str) { static inline binder_status_t AParcel_readString(const AParcel* parcel, std::string* str) { void* stringData = static_cast<void*>(str); void* stringData = static_cast<void*>(str); return AParcel_readString(parcel, AParcel_std_string_reallocator, AParcel_std_string_getter, return AParcel_readString(parcel, AParcel_stdStringReallocator, AParcel_stdStringGetter, &stringData); &stringData); } } Loading libs/binder/ndk/parcel.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -255,8 +255,8 @@ binder_status_t AParcel_writeString(AParcel* parcel, const char* string, size_t return STATUS_OK; return STATUS_OK; } } binder_status_t AParcel_readString(const AParcel* parcel, AParcel_string_reallocator reallocator, binder_status_t AParcel_readString(const AParcel* parcel, AParcel_stringReallocator reallocator, AParcel_string_getter getter, void** stringData) { AParcel_stringGetter getter, void** stringData) { size_t len16; size_t len16; const char16_t* str16 = parcel->get()->readString16Inplace(&len16); const char16_t* str16 = parcel->get()->readString16Inplace(&len16); Loading Loading @@ -287,7 +287,7 @@ binder_status_t AParcel_readString(const AParcel* parcel, AParcel_string_realloc char* str8 = getter(*stringData); char* str8 = getter(*stringData); if (str8 == nullptr) { if (str8 == nullptr) { LOG(WARNING) << __func__ << ": AParcel_string_allocator failed to allocate."; LOG(WARNING) << __func__ << ": AParcel_stringReallocator failed to allocate."; return STATUS_NO_MEMORY; return STATUS_NO_MEMORY; } } Loading Loading
libs/binder/ndk/include_ndk/android/binder_parcel.h +4 −4 Original line number Original line Diff line number Diff line Loading @@ -136,12 +136,12 @@ typedef int8_t* (*AParcel_byteArrayGetter)(void* arrayData); * * * If allocation fails, null should be returned. * If allocation fails, null should be returned. */ */ typedef void* (*AParcel_string_reallocator)(void* stringData, size_t length); typedef void* (*AParcel_stringReallocator)(void* stringData, size_t length); /** /** * This is called to get the buffer from a stringData object. * This is called to get the buffer from a stringData object. */ */ typedef char* (*AParcel_string_getter)(void* stringData); typedef char* (*AParcel_stringGetter)(void* stringData); /** /** * Writes an AIBinder to the next location in a non-null parcel. Can be null. * Writes an AIBinder to the next location in a non-null parcel. Can be null. Loading Loading @@ -198,8 +198,8 @@ binder_status_t AParcel_writeString(AParcel* parcel, const char* string, size_t * If this function returns a success, the buffer returned by allocator when passed stringData will * If this function returns a success, the buffer returned by allocator when passed stringData will * contain a null-terminated c-str read from the binder. * contain a null-terminated c-str read from the binder. */ */ binder_status_t AParcel_readString(const AParcel* parcel, AParcel_string_reallocator reallocator, binder_status_t AParcel_readString(const AParcel* parcel, AParcel_stringReallocator reallocator, AParcel_string_getter getter, void** stringData) AParcel_stringGetter getter, void** stringData) __INTRODUCED_IN(29); __INTRODUCED_IN(29); // @START-PRIMITIVE-READ-WRITE // @START-PRIMITIVE-READ-WRITE Loading
libs/binder/ndk/include_ndk/android/binder_parcel_utils.h +3 −3 Original line number Original line Diff line number Diff line Loading @@ -270,7 +270,7 @@ inline binder_status_t AParcel_readVector<int8_t>(const AParcel* parcel, std::ve * Takes a std::string and reallocates it to the specified length. For use with AParcel_readString. * Takes a std::string and reallocates it to the specified length. For use with AParcel_readString. * See use below in AParcel_readString. * See use below in AParcel_readString. */ */ static inline void* AParcel_std_string_reallocator(void* stringData, size_t length) { static inline void* AParcel_stdStringReallocator(void* stringData, size_t length) { std::string* str = static_cast<std::string*>(stringData); std::string* str = static_cast<std::string*>(stringData); str->resize(length - 1); str->resize(length - 1); return stringData; return stringData; Loading @@ -279,7 +279,7 @@ static inline void* AParcel_std_string_reallocator(void* stringData, size_t leng /** /** * Takes a std::string and returns the inner char*. * Takes a std::string and returns the inner char*. */ */ static inline char* AParcel_std_string_getter(void* stringData) { static inline char* AParcel_stdStringGetter(void* stringData) { std::string* str = static_cast<std::string*>(stringData); std::string* str = static_cast<std::string*>(stringData); return &(*str)[0]; return &(*str)[0]; } } Loading @@ -296,7 +296,7 @@ static inline binder_status_t AParcel_writeString(AParcel* parcel, const std::st */ */ static inline binder_status_t AParcel_readString(const AParcel* parcel, std::string* str) { static inline binder_status_t AParcel_readString(const AParcel* parcel, std::string* str) { void* stringData = static_cast<void*>(str); void* stringData = static_cast<void*>(str); return AParcel_readString(parcel, AParcel_std_string_reallocator, AParcel_std_string_getter, return AParcel_readString(parcel, AParcel_stdStringReallocator, AParcel_stdStringGetter, &stringData); &stringData); } } Loading
libs/binder/ndk/parcel.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -255,8 +255,8 @@ binder_status_t AParcel_writeString(AParcel* parcel, const char* string, size_t return STATUS_OK; return STATUS_OK; } } binder_status_t AParcel_readString(const AParcel* parcel, AParcel_string_reallocator reallocator, binder_status_t AParcel_readString(const AParcel* parcel, AParcel_stringReallocator reallocator, AParcel_string_getter getter, void** stringData) { AParcel_stringGetter getter, void** stringData) { size_t len16; size_t len16; const char16_t* str16 = parcel->get()->readString16Inplace(&len16); const char16_t* str16 = parcel->get()->readString16Inplace(&len16); Loading Loading @@ -287,7 +287,7 @@ binder_status_t AParcel_readString(const AParcel* parcel, AParcel_string_realloc char* str8 = getter(*stringData); char* str8 = getter(*stringData); if (str8 == nullptr) { if (str8 == nullptr) { LOG(WARNING) << __func__ << ": AParcel_string_allocator failed to allocate."; LOG(WARNING) << __func__ << ": AParcel_stringReallocator failed to allocate."; return STATUS_NO_MEMORY; return STATUS_NO_MEMORY; } } Loading