Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ee33176 authored by Alec Mouri's avatar Alec Mouri
Browse files

Add API level for IMapper 4's bad metadata test

Some devices shipped with broken validation for HDR metadata. Relax the
test for vendor freeze purposes.

Bug: 276843519
Test: VtsHalGraphicsMapperV4_0TargetTest
Change-Id: I564f4bd12145f7831faa1e5a0f2d2abe074e4769
parent a7651ff2
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -2223,12 +2223,15 @@ TEST_P(GraphicsMapperHidlTest, SetBadMetadata) {
    // Keep optional metadata types below and populate the encoded metadata vec
    // with some arbitrary different metadata because the common gralloc4::decode*()
    // functions do not distinguish between an empty vec and bad value.
    if (base::GetIntProperty("ro.vendor.api_level", __ANDROID_API_FUTURE__) >= __ANDROID_API_T__) {
        // Some old grallocs shipped with broken validation.
        ASSERT_EQ(NO_ERROR, gralloc4::encodeDataspace(Dataspace::SRGB_LINEAR, &vec));
        ASSERT_EQ(Error::UNSUPPORTED,
                  mGralloc->set(bufferHandle, gralloc4::MetadataType_Smpte2086, vec));
        ASSERT_EQ(Error::UNSUPPORTED,
                  mGralloc->set(bufferHandle, gralloc4::MetadataType_Cta861_3, vec));
    }
}

/**
 * Test IMapper::getFromBufferDescriptorInfo(BufferId)