From 62ae37be3cbab314076c531435f52db91c3cc061 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 20 Jan 2022 17:16:38 -0800 Subject: [PATCH] Fix asserts for GetReadbackBufferFenceInactive If there's no readback buffer, then the status is NOT ok(), and the returned fence must be -1. Bug: 213493262 Test: VtsHalGraphicsComposer3_TargetTest Change-Id: Iff1b6e04126bfcc748f0f8d173f63244bfd83be4 --- .../vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index fc527ecb28..3f1e703031 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -521,8 +521,9 @@ TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) { ndk::ScopedFileDescriptor releaseFence; const auto error = mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &releaseFence); - EXPECT_TRUE(error.isOk()); + ASSERT_FALSE(error.isOk()); EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + EXPECT_EQ(-1, releaseFence.get()); } TEST_P(GraphicsCompositionTest, ClientComposition) {