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

Commit 02efc704 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Parcel: Avoid realloc on owned Parcels." into main

parents 5236eeda 575fdb34
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1804,6 +1804,15 @@ restart_write:
        return finishWrite(sizeof(flat_binder_object));
    }

    if (mOwner) {
        // continueWrite does have the logic to convert this from an
        // owned to an unowned Parcel. However, this is pretty inefficient,
        // and it's really strange to need to do so, so prefer to avoid
        // these paths than try to support them.
        ALOGE("writing objects not supported on owned Parcels");
        return PERMISSION_DENIED;
    }

    if (!enoughData) {
        const status_t err = growData(sizeof(val));
        if (err != NO_ERROR) return err;