diff options
| author | 2022-03-21 17:54:23 -0500 | |
|---|---|---|
| committer | 2022-03-21 17:54:23 -0500 | |
| commit | dcba9e07976c20bb98a3e92aca149eacc6e59d2d (patch) | |
| tree | 61d6c2a294ac17b3bd8eaab56708a06ba7b6fe78 /libs | |
| parent | 1a56d1f7c417a764b805f79a16bdda78543376f1 (diff) | |
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
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/gui/LayerState.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index 49b669eb3f..34db5b1626 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -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 { |