Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aee2cf7a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add Parcel::writeParcelableVector(std::shared_ptr)"

parents 57a58d91 8d747090
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -153,6 +153,8 @@ public:
    template<typename T>
    status_t            writeParcelableVector(const std::unique_ptr<std::vector<std::unique_ptr<T>>>& val);
    template<typename T>
    status_t            writeParcelableVector(const std::shared_ptr<std::vector<std::unique_ptr<T>>>& val);
    template<typename T>
    status_t            writeParcelableVector(const std::vector<T>& val);

    template<typename T>
@@ -833,7 +835,16 @@ status_t Parcel::writeParcelableVector(const std::unique_ptr<std::vector<std::un
        return this->writeInt32(-1);
    }

    return unsafeWriteTypedVector(*val, &Parcel::writeParcelable);
    return unsafeWriteTypedVector(*val, &Parcel::writeNullableParcelable<T>);
}

template<typename T>
status_t Parcel::writeParcelableVector(const std::shared_ptr<std::vector<std::unique_ptr<T>>>& val) {
    if (val.get() == nullptr) {
        return this->writeInt32(-1);
    }

    return unsafeWriteTypedVector(*val, &Parcel::writeNullableParcelable<T>);
}

// ---------------------------------------------------------------------------