Surface: Use buffer id to synchronize slots
For the same buffer, GraphicBuffer's buffer_handle_t* may change when
doing attach/detach. Use Id instead.
Test: Call attach/detach, and observe mRemovedBuffers is updated
Bug: 38238747
Change-Id: I6ab1ae5340565f98cb981b7e38c31a4f85190e56
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index ff0a5d4..6583a62 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -1231,7 +1231,7 @@
for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
if (mSlots[i].buffer != NULL &&
- mSlots[i].buffer->handle == buffer->handle) {
+ mSlots[i].buffer->getId() == buffer->getId()) {
if (mReportRemovedBuffers) {
mRemovedBuffers.push_back(mSlots[i].buffer);
}