From e33822c0d9b88bbd4cc74d9a41dbfd4ed24012a6 Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Tue, 22 Sep 2020 13:31:05 -0700 Subject: [PATCH] Camera: Expect physical results in the last partial notification Per API specification the physical device capture results will only be part of the last/final partial result notification. Bug: 165476824 Test: adb shell /data/nativetest64/VtsHalCameraProviderV2_4TargetTest/VtsHalCameraProviderV2_4TargetTest Change-Id: I0aa860b10ed2bd30c46f58ad0ee530c740f1f5d6 --- .../vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index f6f8a8e521..23ebf10365 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -1209,7 +1209,12 @@ bool CameraHidlTest::DeviceCb::processCaptureResultLocked(const CaptureResult& r return notify; } - if (physicalCameraMetadata.size() != request->expectedPhysicalResults.size()) { + // Physical device results are only expected in the last/final + // partial result notification. + bool expectPhysicalResults = !(request->usePartialResult && + (results.partialResult < request->numPartialResults)); + if (expectPhysicalResults && + (physicalCameraMetadata.size() != request->expectedPhysicalResults.size())) { ALOGE("%s: Frame %d: Returned physical metadata count %zu " "must be equal to expected count %zu", __func__, frameNumber, physicalCameraMetadata.size(), request->expectedPhysicalResults.size());