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

Commit b60c07df authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "libbinder: simplify setIpcSetDataReference" am: 77544811 am: bced19e1

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I22e0f031fece76a70b4fae72b91c7d06dc0b8ae0
parents 3cd6312b bced19e1
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -2509,19 +2509,15 @@ size_t Parcel::ipcObjectsCount() const
void Parcel::ipcSetDataReference(const uint8_t* data, size_t dataSize,
    const binder_size_t* objects, size_t objectsCount, release_func relFunc)
{
    binder_size_t minOffset = 0;
    freeDataNoInit();
    mError = NO_ERROR;
    freeData();

    mData = const_cast<uint8_t*>(data);
    mDataSize = mDataCapacity = dataSize;
    //ALOGI("setDataReference Setting data size of %p to %lu (pid=%d)", this, mDataSize, getpid());
    mDataPos = 0;
    ALOGV("setDataReference Setting data pos of %p to %zu", this, mDataPos);
    mObjects = const_cast<binder_size_t*>(objects);
    mObjectsSize = mObjectsCapacity = objectsCount;
    mNextObjectHint = 0;
    mObjectsSorted = false;
    mOwner = relFunc;

    binder_size_t minOffset = 0;
    for (size_t i = 0; i < mObjectsSize; i++) {
        binder_size_t offset = mObjects[i];
        if (offset < minOffset) {