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

Commit d7a694c6 authored by chaviw's avatar chaviw Committed by Android Build Coastguard Worker
Browse files

Use CacheId when buffer is null.

It's likely the buffer is null even if eBufferChanged is set because we
already cached the buffer. This can happen when the transaction is sent
over IPC and we automatically cache the buffer.

This change uses the cacheId if the buffer is null

Test: Hard to repro
Bug: 225815507
Change-Id: Ic95bfc179cc86e494943e9bd6e15cb9afd69f1df
(cherry picked from commit dcba9e07)
Merged-In: Ic95bfc179cc86e494943e9bd6e15cb9afd69f1df
parent da21612b
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -774,7 +774,13 @@ status_t LayerCaptureArgs::readFromParcel(const Parcel* input) {
}; // namespace gui

ReleaseCallbackId BufferData::generateReleaseCallbackId() const {
    return {buffer->getId(), frameNumber};
    uint64_t bufferId;
    if (buffer) {
        bufferId = buffer->getId();
    } else {
        bufferId = cachedBuffer.id;
    }
    return {bufferId, frameNumber};
}

status_t BufferData::writeToParcel(Parcel* output) const {