gralloc: use gralloctypes helper

Use the gralloctypes helper function to determine if a
PlaneLayoutComponentType is a standard type. Also update the
lock RGBA_8888 function to ignore non-standard
PlaneLayoutComponentTypes.

Bug: 141632767
Test: VtsHalGraphicsMapperV4_0TargetTest

Change-Id: Ie3ea4a22b2c9ecf4b1d85932833978d2e23f77c1
diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp
index 347eca6..b8414d4 100644
--- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp
+++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp
@@ -131,7 +131,9 @@
         int64_t offsetInBitsA = -1;
 
         for (const auto& component : planeLayout.components) {
-            EXPECT_EQ(GRALLOC4_PLANE_LAYOUT_COMPONENT_TYPE, component.type.name);
+            if (!gralloc4::isStandardPlaneLayoutComponentType(component.type)) {
+                continue;
+            }
             EXPECT_EQ(8, component.sizeInBits);
             if (component.type.value == gralloc4::PlaneLayoutComponentType_R.value) {
                 offsetInBitsR = component.offsetInBits;
@@ -221,9 +223,7 @@
 
         for (const auto& planeLayout : planeLayouts) {
             for (const auto& planeLayoutComponent : planeLayout.components) {
-                std::string componentTypeName = planeLayoutComponent.type.name;
-                if (!std::strncmp(componentTypeName.c_str(), GRALLOC4_PLANE_LAYOUT_COMPONENT_TYPE,
-                                  componentTypeName.size())) {
+                if (!gralloc4::isStandardPlaneLayoutComponentType(planeLayoutComponent.type)) {
                     continue;
                 }
                 ASSERT_EQ(0, planeLayoutComponent.offsetInBits % 8);