Camera: Fix VTS failure for depth only camera am: 72f97643fb am: 3d44601e7f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2523160
Change-Id: I325324cc19db91433166f4709eedbfd537a5fb38
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 5ea6ae2..317f02e 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -6346,7 +6346,7 @@
AvailableStream depthPreviewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
static_cast<int32_t>(PixelFormat::Y16)};
const AvailableStream* depthThreshold =
- (threshold != nullptr) ? threshold : &depthPreviewThreshold;
+ isDepthOnly(staticMeta) ? &depthPreviewThreshold : threshold;
fillOutputStreams(&depthEntry, outputStreams, depthThreshold,
ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT);
}
diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp
index 573b8f1..dc106a1 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.cpp
+++ b/camera/provider/aidl/vts/camera_aidl_test.cpp
@@ -779,7 +779,7 @@
AvailableStream depthPreviewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
static_cast<int32_t>(PixelFormat::Y16)};
const AvailableStream* depthThreshold =
- (threshold != nullptr) ? threshold : &depthPreviewThreshold;
+ isDepthOnly(staticMeta) ? &depthPreviewThreshold : threshold;
fillOutputStreams(&depthEntry, outputStreams, depthThreshold,
ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT);
}