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

Commit e5f2e506 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "binder_ndk: fix read/write interface" am: eb05acaa am: af5fc3ca am: 5e3a6492

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1900588

Change-Id: I58d52ec268aa2c4e485fc8b21a3c2bb12ac65e69
parents df1a5272 5e3a6492
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -482,9 +482,7 @@ static inline binder_status_t AParcel_readVector(
template <typename P>
static inline binder_status_t AParcel_writeParcelable(AParcel* parcel, const P& p) {
    if constexpr (is_interface_v<P>) {
        if (!p) {
            return STATUS_UNEXPECTED_NULL;
        }
        // Legacy behavior: allow null
        return first_template_type_t<P>::writeToParcel(parcel, p);
    } else {
        static_assert(is_parcelable_v<P>);
@@ -502,13 +500,8 @@ static inline binder_status_t AParcel_writeParcelable(AParcel* parcel, const P&
template <typename P>
static inline binder_status_t AParcel_readParcelable(const AParcel* parcel, P* p) {
    if constexpr (is_interface_v<P>) {
        binder_status_t status = first_template_type_t<P>::readFromParcel(parcel, p);
        if (status == STATUS_OK) {
            if (!*p) {
                return STATUS_UNEXPECTED_NULL;
            }
        }
        return status;
        // Legacy behavior: allow null
        return first_template_type_t<P>::readFromParcel(parcel, p);
    } else {
        static_assert(is_parcelable_v<P>);
        int32_t null;