Loading include/binder/Parcel.h +5 −1 Original line number Diff line number Diff line Loading @@ -125,6 +125,8 @@ public: status_t writeCharVector(const std::vector<char16_t>& val); status_t writeString16Vector(const std::vector<String16>& val); status_t writeStrongBinderVector(const std::vector<sp<IBinder>>& val); template<typename T> status_t write(const Flattenable<T>& val); Loading Loading @@ -204,6 +206,8 @@ public: template<typename T> status_t readStrongBinder(sp<T>* val) const; status_t readStrongBinderVector(std::vector<sp<IBinder>>* val) const; status_t readByteVector(std::vector<int8_t>* val) const; status_t readInt32Vector(std::vector<int32_t>* val) const; status_t readInt64Vector(std::vector<int64_t>* val) const; Loading libs/binder/Parcel.cpp +50 −0 Original line number Diff line number Diff line Loading @@ -1073,6 +1073,56 @@ status_t Parcel::writeStrongBinder(const sp<IBinder>& val) return flatten_binder(ProcessState::self(), val, this); } status_t Parcel::writeStrongBinderVector(const std::vector<sp<IBinder>>& val) { if (val.size() > std::numeric_limits<int32_t>::max()) { return BAD_VALUE; } status_t status = writeInt32(val.size()); if (status != OK) { return status; } for (const auto& item : val) { status = writeStrongBinder(item); if (status != OK) { return status; } } return OK; } status_t Parcel::readStrongBinderVector(std::vector<sp<IBinder>>* val) const { val->clear(); int32_t size; status_t status = readInt32(&size); if (status != OK) { return status; } if (size < 0) { return BAD_VALUE; } val->resize(size); for (auto& v : *val) { status = readStrongBinder(&v); if (status != OK) { return status; } } return OK; } status_t Parcel::writeWeakBinder(const wp<IBinder>& val) { return flatten_binder(ProcessState::self(), val, this); Loading Loading
include/binder/Parcel.h +5 −1 Original line number Diff line number Diff line Loading @@ -125,6 +125,8 @@ public: status_t writeCharVector(const std::vector<char16_t>& val); status_t writeString16Vector(const std::vector<String16>& val); status_t writeStrongBinderVector(const std::vector<sp<IBinder>>& val); template<typename T> status_t write(const Flattenable<T>& val); Loading Loading @@ -204,6 +206,8 @@ public: template<typename T> status_t readStrongBinder(sp<T>* val) const; status_t readStrongBinderVector(std::vector<sp<IBinder>>* val) const; status_t readByteVector(std::vector<int8_t>* val) const; status_t readInt32Vector(std::vector<int32_t>* val) const; status_t readInt64Vector(std::vector<int64_t>* val) const; Loading
libs/binder/Parcel.cpp +50 −0 Original line number Diff line number Diff line Loading @@ -1073,6 +1073,56 @@ status_t Parcel::writeStrongBinder(const sp<IBinder>& val) return flatten_binder(ProcessState::self(), val, this); } status_t Parcel::writeStrongBinderVector(const std::vector<sp<IBinder>>& val) { if (val.size() > std::numeric_limits<int32_t>::max()) { return BAD_VALUE; } status_t status = writeInt32(val.size()); if (status != OK) { return status; } for (const auto& item : val) { status = writeStrongBinder(item); if (status != OK) { return status; } } return OK; } status_t Parcel::readStrongBinderVector(std::vector<sp<IBinder>>* val) const { val->clear(); int32_t size; status_t status = readInt32(&size); if (status != OK) { return status; } if (size < 0) { return BAD_VALUE; } val->resize(size); for (auto& v : *val) { status = readStrongBinder(&v); if (status != OK) { return status; } } return OK; } status_t Parcel::writeWeakBinder(const wp<IBinder>& val) { return flatten_binder(ProcessState::self(), val, this); Loading