gralloc1: Work around handle delete by hidl wrapper
This works around bug 36355756. Initializing the fds in the
handle to -1 before deleting is probably good practice anyway.
The handle delete needs to move to gralloc1 FreeBuffer() but
currently the client does it.
CRs-Fixed: 2022058
Change-Id: I4ae51e4cd90adb709287a01d66138df51924af8c
diff --git a/libgralloc1/gr_buf_mgr.cpp b/libgralloc1/gr_buf_mgr.cpp
index 04afd35..b471764 100644
--- a/libgralloc1/gr_buf_mgr.cpp
+++ b/libgralloc1/gr_buf_mgr.cpp
@@ -201,7 +201,10 @@
}
// TODO(user): delete handle once framework bug around this is confirmed
- // to be resolved
+ // to be resolved. This is tracked in bug 36355756
+ private_handle_t * handle = const_cast<private_handle_t *>(hnd);
+ handle->fd = -1;
+ handle->fd_metadata = -1;
return GRALLOC1_ERROR_NONE;
}