QCamera2: HAL3: Fix VTS failures
- Per API contract in case flash is not supported Hal should return
"-ENOSYS" as error code.
- Hal should fail when the configured stream rotation value is invalid.
Bug: 63130431
Test: adb shell
/data/nativetest/VtsHalCameraProviderV2_4TargetTest/VtsHalCameraProviderV2_4TargetTest
Change-Id: Ief7049d4b726943d65a865d7e295fe6b1697b118
diff --git a/msm8998/QCamera2/HAL3/QCamera3HWI.cpp b/msm8998/QCamera2/HAL3/QCamera3HWI.cpp
index 5446c5b..84ccdbe 100644
--- a/msm8998/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/msm8998/QCamera2/HAL3/QCamera3HWI.cpp
@@ -13677,6 +13677,21 @@
for (size_t j = 0; j < streamList->num_streams; j++){
camera3_stream_t *newStream = streamList->streams[j];
+ switch(newStream->rotation) {
+ case CAMERA3_STREAM_ROTATION_0:
+ case CAMERA3_STREAM_ROTATION_90:
+ case CAMERA3_STREAM_ROTATION_180:
+ case CAMERA3_STREAM_ROTATION_270:
+ //Expected values
+ break;
+ default:
+ ALOGE("%s: Error: Unsupported rotation of %d requested for stream"
+ "type:%d and stream format:%d", __func__,
+ newStream->rotation, newStream->stream_type,
+ newStream->format);
+ return -EINVAL;
+ }
+
bool isRotated = (newStream->rotation != CAMERA3_STREAM_ROTATION_0);
bool isImplDef = (newStream->format ==
HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED);