gralloc: stub out IMapper@4.0::lockYCbCr in C2Allocator

IMapper 4.0 does support lockYCbCr functionality through lock and
BufferMetadata getters. However, we will wait to add the support in
one central gralloc library. For now just stub out the call so
there aren't any compiler errors. Also, bytesPerPixel/bytesPerStride
can be gotten through BufferMetadata getters so they are no longer
supported in lock.

Bug: 141631415
Test: Compiles
Change-Id: I8b8adea765c42d7adac7ba86a3ce7ddd2751e8a0
diff --git a/media/codec2/vndk/C2AllocatorGralloc.cpp b/media/codec2/vndk/C2AllocatorGralloc.cpp
index d6bf101..3729f7b 100644
--- a/media/codec2/vndk/C2AllocatorGralloc.cpp
+++ b/media/codec2/vndk/C2AllocatorGralloc.cpp
@@ -605,14 +605,11 @@
                           (int32_t)rect.width, (int32_t)rect.height },
                         // TODO: fence
                         hidl_handle(),
-                        [&err, &pointer](const auto &maperr, const auto &mapPointer,
-                                         int32_t bytesPerPixel, int32_t bytesPerStride) {
+                        [&err, &pointer](const auto &maperr, const auto &mapPointer) {
                             err = maperr2error(maperr);
                             if (err == C2_OK) {
                                 pointer = mapPointer;
                             }
-                            (void)bytesPerPixel;
-                            (void)bytesPerStride;
                         }).isOk()) {
                     ALOGE("failed transaction: lock(RGBA_1010102) (@4.0)");
                     return C2_CORRUPTED;
@@ -743,14 +740,11 @@
                           (int32_t)rect.width, (int32_t)rect.height },
                         // TODO: fence
                         hidl_handle(),
-                        [&err, &pointer](const auto &maperr, const auto &mapPointer,
-                                         int32_t bytesPerPixel, int32_t bytesPerStride) {
+                        [&err, &pointer](const auto &maperr, const auto &mapPointer) {
                             err = maperr2error(maperr);
                             if (err == C2_OK) {
                                 pointer = mapPointer;
                             }
-                            (void)bytesPerPixel;
-                            (void)bytesPerStride;
                         }).isOk()) {
                     ALOGE("failed transaction: lock(RGBA_8888) (@4.0)");
                     return C2_CORRUPTED;
@@ -875,27 +869,14 @@
                     return C2_CORRUPTED;
                 }
             } else {
-                if (!mMapper4->lockYCbCr(
-                        const_cast<native_handle_t *>(mBuffer), grallocUsage,
-                        { (int32_t)rect.left, (int32_t)rect.top,
-                          (int32_t)rect.width, (int32_t)rect.height },
-                        // TODO: fence
-                        hidl_handle(),
-                        [&err, &ycbcrLayout](const auto &maperr, const auto &mapLayout) {
-                            err = maperr2error(maperr);
-                            if (err == C2_OK) {
-                                ycbcrLayout = YCbCrLayout{
-                                        mapLayout.y,
-                                        mapLayout.cb,
-                                        mapLayout.cr,
-                                        mapLayout.yStride,
-                                        mapLayout.cStride,
-                                        mapLayout.chromaStep};
-                            }
-                        }).isOk()) {
-                    ALOGE("failed transaction: lockYCbCr (@4.0)");
-                    return C2_CORRUPTED;
-                }
+                // No device currently supports IMapper 4.0 so it is safe to just return an error
+                // code here.
+                //
+                // This will be supported by a combination of lock and BufferMetadata getters.
+                // We are going to refactor all the IAllocator/IMapper versioning code into a
+                // shared library. We will then add the IMapper 4.0 lockYCbCr support then.
+                ALOGE("failed transaction: lockYCbCr (@4.0)");
+                return C2_CORRUPTED;
             }
             if (err != C2_OK) {
                 ALOGD("lockYCbCr failed: %d", err);