Merge changes from topic "binder-primitive-array" am: d88ac7f787 am: 3466efff36
am: 595549ee3b
Change-Id: Iea7b8c8cd2247e1cb017d50b98669e613f75a13f
diff --git a/libs/binder/ndk/include_ndk/android/binder_parcel.h b/libs/binder/ndk/include_ndk/android/binder_parcel.h
index 73df69c..d36b3c0 100644
--- a/libs/binder/ndk/include_ndk/android/binder_parcel.h
+++ b/libs/binder/ndk/include_ndk/android/binder_parcel.h
@@ -136,12 +136,12 @@
*
* 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.
*/
-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.
@@ -198,8 +198,8 @@
* 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.
*/
-binder_status_t AParcel_readString(const AParcel* parcel, AParcel_string_reallocator reallocator,
- AParcel_string_getter getter, void** stringData)
+binder_status_t AParcel_readString(const AParcel* parcel, AParcel_stringReallocator reallocator,
+ AParcel_stringGetter getter, void** stringData)
__INTRODUCED_IN(29);
// @START-PRIMITIVE-READ-WRITE
diff --git a/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h b/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h
index 6341b46..faeb78f 100644
--- a/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h
+++ b/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h
@@ -270,7 +270,7 @@
* Takes a std::string and reallocates it to the specified length. For use with 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);
str->resize(length - 1);
return stringData;
@@ -279,7 +279,7 @@
/**
* 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);
return &(*str)[0];
}
@@ -296,7 +296,7 @@
*/
static inline binder_status_t AParcel_readString(const AParcel* parcel, std::string* 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);
}
diff --git a/libs/binder/ndk/parcel.cpp b/libs/binder/ndk/parcel.cpp
index 5279b54..29094db 100644
--- a/libs/binder/ndk/parcel.cpp
+++ b/libs/binder/ndk/parcel.cpp
@@ -255,8 +255,8 @@
return STATUS_OK;
}
-binder_status_t AParcel_readString(const AParcel* parcel, AParcel_string_reallocator reallocator,
- AParcel_string_getter getter, void** stringData) {
+binder_status_t AParcel_readString(const AParcel* parcel, AParcel_stringReallocator reallocator,
+ AParcel_stringGetter getter, void** stringData) {
size_t len16;
const char16_t* str16 = parcel->get()->readString16Inplace(&len16);
@@ -287,7 +287,7 @@
char* str8 = getter(*stringData);
if (str8 == nullptr) {
- LOG(WARNING) << __func__ << ": AParcel_string_allocator failed to allocate.";
+ LOG(WARNING) << __func__ << ": AParcel_stringReallocator failed to allocate.";
return STATUS_NO_MEMORY;
}