diff options
| author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-10-30 21:07:02 +0000 |
|---|---|---|
| committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-10-30 21:07:02 +0000 |
| commit | 059215f85d322970bb7e3d8156a8ce55d3c07953 (patch) | |
| tree | 23ccb6be637015b059dd5edb2e1c632900f82eb1 | |
| parent | e41d9220ef686e0d9a10f83d1f486df75d809656 (diff) | |
| parent | dc6da704eda36e050812357a647a59304d73d17b (diff) | |
Snap for 7869222 from dc6da704eda36e050812357a647a59304d73d17b to sc-v2-release
Change-Id: I8f70dbcc27621c906a9f1314fea6eb19d860fb67
| -rw-r--r-- | camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp | 64 |
1 files changed, 19 insertions, 45 deletions
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index ad3da48aa..0f55bc1ed 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -6199,14 +6199,13 @@ TEST_P(CameraHidlTest, grfSMultiCameraTest) { return; } - // Test that if more than one color cameras facing the same direction are - // supported, there must be at least one logical camera facing that - // direction. + // Test that if more than one rear-facing color camera is + // supported, there must be at least one rear-facing logical camera. hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider); - // Front and back facing non-logical color cameras - std::set<std::string> frontColorCameras, rearColorCameras; - // Front and back facing logical cameras' physical camera Id sets - std::set<std::set<std::string>> frontPhysicalIds, rearPhysicalIds; + // Back facing non-logical color cameras + std::set<std::string> rearColorCameras; + // Back facing logical cameras' physical camera Id sets + std::set<std::set<std::string>> rearPhysicalIds; for (const auto& name : cameraDeviceNames) { std::string cameraId; int deviceVersion = getCameraDeviceVersionAndId(name, mProviderType, &cameraId); @@ -6238,8 +6237,8 @@ TEST_P(CameraHidlTest, grfSMultiCameraTest) { return; } - // Check camera facing. Skip if facing is neither FRONT - // nor BACK. If this is not a logical camera, only note down + // Check camera facing. Skip if facing is not BACK. + // If this is not a logical camera, only note down // the camera ID, and skip. camera_metadata_ro_entry entry; int retcode = find_camera_metadata_ro_entry( @@ -6248,18 +6247,12 @@ TEST_P(CameraHidlTest, grfSMultiCameraTest) { ASSERT_GT(entry.count, 0); uint8_t facing = entry.data.u8[0]; bool isLogicalCamera = (isLogicalMultiCamera(metadata) == Status::OK); - if (facing == ANDROID_LENS_FACING_FRONT) { - if (!isLogicalCamera) { - frontColorCameras.insert(cameraId); - return; - } - } else if (facing == ANDROID_LENS_FACING_BACK) { - if (!isLogicalCamera) { - rearColorCameras.insert(cameraId); - return; - } - } else { - // Not FRONT or BACK facing. Skip. + if (facing != ANDROID_LENS_FACING_BACK) { + // Not BACK facing. Skip. + return; + } + if (!isLogicalCamera) { + rearColorCameras.insert(cameraId); return; } @@ -6268,11 +6261,7 @@ TEST_P(CameraHidlTest, grfSMultiCameraTest) { std::unordered_set<std::string> physicalCameraIds; Status s = getPhysicalCameraIds(metadata, &physicalCameraIds); ASSERT_EQ(Status::OK, s); - if (facing == ANDROID_LENS_FACING_FRONT) { - frontPhysicalIds.emplace(physicalCameraIds.begin(), physicalCameraIds.end()); - } else { - rearPhysicalIds.emplace(physicalCameraIds.begin(), physicalCameraIds.end()); - } + rearPhysicalIds.emplace(physicalCameraIds.begin(), physicalCameraIds.end()); for (const auto& physicalId : physicalCameraIds) { // Skip if the physicalId is publicly available for (auto& deviceName : cameraDeviceNames) { @@ -6299,11 +6288,7 @@ TEST_P(CameraHidlTest, grfSMultiCameraTest) { (camera_metadata_t*)chars.data(); if (CameraHidlTest::isColorCamera(physicalMetadata)) { - if (facing == ANDROID_LENS_FACING_FRONT) { - frontColorCameras.insert(physicalId); - } else if (facing == ANDROID_LENS_FACING_BACK) { - rearColorCameras.insert(physicalId); - } + rearColorCameras.insert(physicalId); } }); ASSERT_TRUE(ret.isOk()); @@ -6321,20 +6306,9 @@ TEST_P(CameraHidlTest, grfSMultiCameraTest) { } } - // If there are more than one color cameras facing one direction, a logical - // multi-camera must be defined consisting of all color cameras facing that - // direction. - if (frontColorCameras.size() > 1) { - bool hasFrontLogical = false; - for (const auto& physicalIds : frontPhysicalIds) { - if (std::includes(physicalIds.begin(), physicalIds.end(), - frontColorCameras.begin(), frontColorCameras.end())) { - hasFrontLogical = true; - break; - } - } - ASSERT_TRUE(hasFrontLogical); - } + // If there are more than one rear-facing color camera, a logical + // multi-camera must be defined consisting of all rear-facing color + // cameras. if (rearColorCameras.size() > 1) { bool hasRearLogical = false; for (const auto& physicalIds : rearPhysicalIds) { |
