Merge "Fix VTS fail for GraphicsMapperHidlTest" am: eef384a88e
Change-Id: I346104d31743741ebac4c4fe1539179f3353d207
diff --git a/graphics/mapper/2.1/utils/passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h b/graphics/mapper/2.1/utils/passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h
index 8540068..13df3bc 100644
--- a/graphics/mapper/2.1/utils/passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h
+++ b/graphics/mapper/2.1/utils/passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h
@@ -49,7 +49,12 @@
mModule, bufferHandle, descriptorInfo.width, descriptorInfo.height,
static_cast<int32_t>(descriptorInfo.format),
static_cast<uint64_t>(descriptorInfo.usage), stride);
- return static_cast<Error>(ret);
+ if (ret == -EINVAL) {
+ return Error::BAD_BUFFER;
+ } else if (ret < 0) {
+ return Error::BAD_VALUE;
+ }
+ return Error::NONE;
}
Error getTransportSize(const native_handle_t* bufferHandle, uint32_t* outNumFds,
uint32_t* outNumInts) override {