From a1185162c486651b856f3cb5ced219b67be735bf Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Wed, 30 Jan 2019 16:41:43 -0800 Subject: [PATCH] Camera: Only report dynamic depth tag related errors Failing to add dynamic depth camera characteristics must not have any additional side effects for the device info constructor. In case we encounter any issues report the failure and try to continue with the intitialization. Additionally fix a minor typo and remove a debug log. Bug: 123660999 Test: Manual using application, Camera CTS Change-Id: I7b4e723ce3bcaf0e5d4c313ba17bca965e8964d8 --- .../common/CameraProviderManager.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp index 3059b0737d..6f1beb13c1 100644 --- a/services/camera/libcameraservice/common/CameraProviderManager.cpp +++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp @@ -648,7 +648,7 @@ status_t CameraProviderManager::ProviderInfo::DeviceInfo3::addDynamicDepthTags() bool isDepthExclusivePresent = std::find(chTags.data.i32, chTags.data.i32 + chTags.count, depthExclTag) != (chTags.data.i32 + chTags.count); bool isDepthSizePresent = std::find(chTags.data.i32, chTags.data.i32 + chTags.count, - depthExclTag) != (chTags.data.i32 + chTags.count); + depthSizesTag) != (chTags.data.i32 + chTags.count); if (!(isDepthExclusivePresent && isDepthSizePresent)) { // No depth support, nothing more to do. return OK; @@ -676,7 +676,6 @@ status_t CameraProviderManager::ProviderInfo::DeviceInfo3::addDynamicDepthTags() getSupportedDynamicDepthSizes(supportedBlobSizes, supportedDepthSizes, &supportedDynamicDepthSizes, &internalDepthSizes); if (supportedDynamicDepthSizes.empty()) { - ALOGE("%s: No dynamic depth size matched!", __func__); // Nothing more to do. return OK; } @@ -1715,11 +1714,10 @@ CameraProviderManager::ProviderInfo::DeviceInfo3::DeviceInfo3(const std::string& __FUNCTION__, strerror(-res), res); return; } - res = addDynamicDepthTags(); - if (OK != res) { - ALOGE("%s: Failed appending dynamic depth tags: %s (%d)", __FUNCTION__, strerror(-res), - res); - return; + auto stat = addDynamicDepthTags(); + if (OK != stat) { + ALOGE("%s: Failed appending dynamic depth tags: %s (%d)", __FUNCTION__, strerror(-stat), + stat); } camera_metadata_entry flashAvailable = mCameraCharacteristics.find(ANDROID_FLASH_INFO_AVAILABLE);