From 050b2ce1cf1bb01610b270deeb8908e5b3e2d8dc Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Mon, 8 Jan 2024 16:18:24 -0800 Subject: [PATCH] Handle logical camera devices properly - HighPriorityCameraClient test case is not executed against logical camera devices because clients are not allowed to change camera parameters via logical cameras. - CameraStreamExternalBuffering test case closes logical camera device explicitly, to avoid any influence on following test scenarios. Bug: 319165229 Test: atest VtsHalEvsTargetTest Change-Id: I734d701a2056ab84fe74179b083c3f6c5463447b --- .../evs/aidl/vts/VtsHalEvsTargetTest.cpp | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp index 3419b3c98d..477de31478 100644 --- a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp +++ b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp @@ -1399,6 +1399,12 @@ TEST_P(EvsAidlTest, HighPriorityCameraClient) { // Test each reported camera for (auto&& cam : mCameraInfo) { + bool isLogicalCam = false; + if (getPhysicalCameraIds(cam.id, isLogicalCam); isLogicalCam) { + LOG(INFO) << "Skip a logical device, " << cam.id; + continue; + } + // Request available display IDs uint8_t targetDisplayId = 0; std::vector displayIds; @@ -1973,6 +1979,13 @@ TEST_P(EvsAidlTest, CameraStreamExternalBuffering) { // Test each reported camera for (auto&& cam : mCameraInfo) { + bool isLogicalCam = false; + getPhysicalCameraIds(cam.id, isLogicalCam); + if (isLogicalCam) { + LOG(INFO) << "Skip a logical device, " << cam.id; + continue; + } + // Read a target resolution from the metadata Stream targetCfg = getFirstStreamConfiguration( reinterpret_cast(cam.metadata.data())); @@ -2014,9 +2027,6 @@ TEST_P(EvsAidlTest, CameraStreamExternalBuffering) { } } - bool isLogicalCam = false; - getPhysicalCameraIds(cam.id, isLogicalCam); - std::shared_ptr pCam; ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam).isOk()); EXPECT_NE(pCam, nullptr); @@ -2027,11 +2037,6 @@ TEST_P(EvsAidlTest, CameraStreamExternalBuffering) { // Request to import buffers int delta = 0; auto status = pCam->importExternalBuffers(buffers, &delta); - if (isLogicalCam) { - ASSERT_FALSE(status.isOk()); - continue; - } - ASSERT_TRUE(status.isOk()); EXPECT_GE(delta, kBuffersToHold);