diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 6212ccdd61ec..f78486117e9f 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -86,6 +86,39 @@ const std::map<int, const Camera3Format> camera3FormatsMap = {
 
 LOG_DECLARE_CATEGORY(HAL);
 
+class MappedCamera3Buffer : public MappedBuffer {
+public:
+	MappedCamera3Buffer(const buffer_handle_t camera3buffer, int flags)
+	{
+		maps_.reserve(camera3buffer->numFds);
+		error_ = 0;
+
+		for (int i = 0; i < camera3buffer->numFds; i++) {
+			if (camera3buffer->data[i] == -1)
+				continue;
+
+			off_t length = lseek(camera3buffer->data[i], 0, SEEK_END);
+			if (length < 0) {
+				error_  = errno;
+				LOG(HAL, Error) << "Failed to query plane length";
+				break;
+			}
+
+			void *address = mmap(nullptr, length, flags, MAP_SHARED,
+					camera3buffer->data[i], 0);
+			if (address == MAP_FAILED) {
+				error_ = errno;
+				LOG(HAL, Error) << "Failed to mmap plane";
+				break;
+			}
+
+			maps_.push_back({address, static_cast<size_t>(length)});
+		}
+
+		valid_ = error_ == 0;
+	}
+};
+
 /*
  * \struct Camera3RequestDescriptor
  *
