gralloc1: Support GRALLOC1_CAPABILITY_RELEASE_IMPLY_DELETE
v2: Handle buffers allocated outside gralloc with flag
PRIV_FLAGS_CLIENT_ALLOCATED.
CRs-Fixed: 2041607
Bug: 36355756
Change-Id: Icb0c4b724f7bf7097812f6306fb0b9a56bb790a9
diff --git a/libgralloc1/gr_device_impl.cpp b/libgralloc1/gr_device_impl.cpp
index b955e19..ee90090 100644
--- a/libgralloc1/gr_device_impl.cpp
+++ b/libgralloc1/gr_device_impl.cpp
@@ -106,11 +106,12 @@
void GrallocImpl::GetCapabilities(struct gralloc1_device *device, uint32_t *out_count,
int32_t /*gralloc1_capability_t*/ *out_capabilities) {
if (device != nullptr) {
- if (out_capabilities != nullptr && *out_count >= 2) {
+ if (out_capabilities != nullptr && *out_count >= 3) {
out_capabilities[0] = GRALLOC1_CAPABILITY_TEST_ALLOCATE;
out_capabilities[1] = GRALLOC1_CAPABILITY_LAYERED_BUFFERS;
+ out_capabilities[2] = GRALLOC1_CAPABILITY_RELEASE_IMPLY_DELETE;
}
- *out_count = 2;
+ *out_count = 3;
}
return;
}