summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilian Peev <epeev@google.com>2019-10-29 18:22:50 -0700
committerEmilian Peev <epeev@google.com>2019-10-29 18:22:50 -0700
commit6b582c48914b1f491a9cafaf2e325e881061e03b (patch)
tree9076a23492ae3300ad26c6247050a43d32fef946
parent83ae13153e81983e59470e1957d8ecb437b80778 (diff)
downloadcamera-6b582c48914b1f491a9cafaf2e325e881061e03b.tar.gz
EmulatedCamera: Return expected error status
Correct error status in case we have: - Invalid physical device characteristics query. - Blob stream combination with unknown usage. Bug: 143568228 Test: VtsHalCameraProviderV2_4TargetTest/VtsHalCameraProviderV2_4TargetTest --hal_service_instance=android.hardware.camera.provider@2.4::ICameraProvider/internal/0 Change-Id: I49d0160e0b1f639ccfedccda91f3e75263e12efb
-rw-r--r--devices/EmulatedCamera/hwl/EmulatedCameraDeviceHWLImpl.cpp2
-rw-r--r--devices/EmulatedCamera/hwl/EmulatedSensor.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/devices/EmulatedCamera/hwl/EmulatedCameraDeviceHWLImpl.cpp b/devices/EmulatedCamera/hwl/EmulatedCameraDeviceHWLImpl.cpp
index 7a5f090..759dc5b 100644
--- a/devices/EmulatedCamera/hwl/EmulatedCameraDeviceHWLImpl.cpp
+++ b/devices/EmulatedCamera/hwl/EmulatedCameraDeviceHWLImpl.cpp
@@ -115,7 +115,7 @@ status_t EmulatedCameraDeviceHwlImpl::GetPhysicalCameraCharacteristics(
physical_device_map_->end()) {
ALOGE("%s: Physical camera id %d is not part of logical camera %d!",
__func__, physical_camera_id, camera_id_);
- return NO_INIT;
+ return BAD_VALUE;
}
*characteristics = HalCameraMetadata::Clone(
diff --git a/devices/EmulatedCamera/hwl/EmulatedSensor.cpp b/devices/EmulatedCamera/hwl/EmulatedSensor.cpp
index 116263e..1ba2bcb 100644
--- a/devices/EmulatedCamera/hwl/EmulatedSensor.cpp
+++ b/devices/EmulatedCamera/hwl/EmulatedSensor.cpp
@@ -273,7 +273,8 @@ bool EmulatedSensor::IsStreamCombinationSupported(
} else {
switch (stream.format) {
case HAL_PIXEL_FORMAT_BLOB:
- if (stream.data_space != HAL_DATASPACE_V0_JFIF) {
+ if ((stream.data_space != HAL_DATASPACE_V0_JFIF) &&
+ (stream.data_space != HAL_DATASPACE_UNKNOWN)) {
ALOGE("%s: Unsupported Blob dataspace 0x%x", __FUNCTION__,
stream.data_space);
return false;