Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ffaa2a23 authored by Ravneet's avatar Ravneet Committed by Ravneet Dhanjal
Browse files

CameraManager: Add path to update vendorTag info upon HAL update

- Add setupVendorTag to onStatusChanged callback to update
vendor tag information upon status changes in case HAL does
not load the vendorTag information during connect

Bug: 181579423
Test: Manual; GCA Validity check; Removed setUpVendorTag in enumerateProviders to force initial vendorTag info update using
onStatusChanged

Change-Id: I8d8c00159d49a13a7b5bbc9b26a2b474fc99aee4
parent fe138c84
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2200,6 +2200,14 @@ public final class CameraManager {
                return;
            }

            // Setup vendor tag on status change in case it was not set correctly
            // during connect due to issues in HAL
            try {
                CameraMetadataNative.setupGlobalVendorTagDescriptor();
            } catch (ServiceSpecificException e) {
                handleRecoverableSetupErrors(e);
            }

            Integer oldStatus;
            if (status == ICameraServiceListener.STATUS_NOT_PRESENT) {
                oldStatus = mDeviceStatus.remove(id);
+8 −1
Original line number Diff line number Diff line
@@ -947,8 +947,15 @@ static jint CameraMetadata_setupGlobalVendorTagDescriptor(JNIEnv *env, jclass th
        return hardware::ICameraService::ERROR_DISCONNECTED;
    }

    binder::Status res = cameraService->setUpVendorTags();
    if (!res.isOk()) {
        ALOGE("%s: Failed to setup vendor tags for camera providers: %s", __FUNCTION__,
              res.toString8().string());
        return res.serviceSpecificErrorCode();
    }

    sp<VendorTagDescriptor> desc = new VendorTagDescriptor();
    binder::Status res = cameraService->getCameraVendorTagDescriptor(/*out*/desc.get());
    res = cameraService->getCameraVendorTagDescriptor(/*out*/ desc.get());

    if (res.serviceSpecificErrorCode() == hardware::ICameraService::ERROR_DISCONNECTED) {
        // No camera module available, not an error on devices with no cameras