diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2023-12-22 05:23:11 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-12-22 05:23:11 +0000 |
commit | 8837f1399489422ec1a83f64abdf787c8b201cc1 (patch) | |
tree | 77d78cfb26f0ecbd22beb432812efcdc765a327d | |
parent | 646ad729562be86c4f04aa91e23be85020e64396 (diff) | |
parent | 182ff3e1b156ee1c4fcf30cd9795f149a821b215 (diff) |
Merge "Fix issue with external camera detection" into t-keystone-qcom-dev
-rw-r--r-- | services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp index 630090b4ac..7787d002c0 100644 --- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp +++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp @@ -13,6 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/* + * Changes from Qualcomm Innovation Center are provided under the following license: + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause-Clear +*/ + #include "HidlProviderInfo.h" #include "common/HalConversionsTemplated.h" #include "common/CameraProviderInfoTemplated.h" @@ -156,20 +162,6 @@ status_t HidlProviderInfo::initializeHidlProvider( } } - // cameraDeviceStatusChange callbacks may be called (and causing new devices added) - // before setCallback returns - hardware::Return<Status> status = interface->setCallback(this); - if (!status.isOk()) { - ALOGE("%s: Transaction error setting up callbacks with camera provider '%s': %s", - __FUNCTION__, mProviderName.c_str(), status.description().c_str()); - return DEAD_OBJECT; - } - if (status != Status::OK) { - ALOGE("%s: Unable to register callbacks with camera provider '%s'", - __FUNCTION__, mProviderName.c_str()); - return mapToStatusT(status); - } - hardware::Return<bool> linked = interface->linkToDeath(this, /*cookie*/ mId); if (!linked.isOk()) { ALOGE("%s: Transaction error in linking to camera provider '%s' death: %s", @@ -187,7 +179,21 @@ status_t HidlProviderInfo::initializeHidlProvider( mActiveInterface = interface; } - ALOGV("%s: Setting device state for %s: 0x%" PRIx64, + // cameraDeviceStatusChange callbacks may be called (and causing new devices added) + // before setCallback returns + hardware::Return<Status> status = interface->setCallback(this); + if (!status.isOk()) { + ALOGE("%s: Transaction error setting up callbacks with camera provider '%s': %s", + __FUNCTION__, mProviderName.c_str(), status.description().c_str()); + return DEAD_OBJECT; + } + if (status != Status::OK) { + ALOGE("%s: Unable to register callbacks with camera provider '%s'", + __FUNCTION__, mProviderName.c_str()); + return mapToStatusT(status); + } + + ALOGI("%s: Setting device state for %s: 0x%" PRIx64, __FUNCTION__, mProviderName.c_str(), mDeviceState); notifyDeviceStateChange(currentDeviceState); |