gralloc: Align protected allocations with the spec
The specification for GRALLOC_USAGE_PROTECTED indicates that
allocations with that flag must be protected by securing with
hardware. If such protection is not possible, the buffer must not
be composited. In our current software only the MM_HEAP is
secured. If we allocate protected buffers from any other heap we
block those from being displayed.
CRs-fixed: 465012
Change-Id: I9d47aba3d28192db3fcc394fd6b38efe42ae118b
diff --git a/liboverlay/overlayMem.h b/liboverlay/overlayMem.h
index d3cabb6..5fbe91b 100644
--- a/liboverlay/overlayMem.h
+++ b/liboverlay/overlayMem.h
@@ -138,21 +138,11 @@
data.uncached = true;
err = mAlloc->allocate(data, allocFlags);
- //see if we can fallback to other heap
- //we can try MM_HEAP once if it's not secure playback
- if (err != 0 && !isSecure) {
- allocFlags |= GRALLOC_USAGE_PRIVATE_MM_HEAP;
- err = mAlloc->allocate(data, allocFlags);
- if (err != 0) {
- ALOGE(" could not allocate from fallback heap");
- return false;
- }
- } else if (err != 0) {
- ALOGE("OvMem: error allocating memory can not fall back");
+ if (err != 0) {
+ ALOGE("OvMem: Error allocating memory");
return false;
}
-
mFd = data.fd;
mBaseAddr = data.base;
mAllocType = data.allocType;