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

Commit 0d117f2c authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Camera: remove the camera device version check during statusCallback" am: 086eb84e

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1758410

Change-Id: I540670f137f173bf424fab05da7ef27d3b74b1ed
parents d5d253e8 086eb84e
Loading
Loading
Loading
Loading
+3 −15
Original line number Diff line number Diff line
@@ -3758,25 +3758,13 @@ void CameraService::updateStatus(StatusInternal status, const String8& cameraId,
        ALOGE("%s: Invalid camera id %s, skipping", __FUNCTION__, cameraId.string());
        return;
    }
    bool supportsHAL3 = false;
    // supportsCameraApi also holds mInterfaceMutex, we can't call it in the
    // HIDL onStatusChanged wrapper call (we'll hold mStatusListenerLock and
    // mInterfaceMutex together, which can lead to deadlocks)
    binder::Status sRet =
            supportsCameraApi(String16(cameraId), hardware::ICameraService::API_VERSION_2,
                    &supportsHAL3);
    if (!sRet.isOk()) {
        ALOGW("%s: Failed to determine if device supports HAL3 %s, supportsCameraApi call failed",
                __FUNCTION__, cameraId.string());
        return;
    }

    // Collect the logical cameras without holding mStatusLock in updateStatus
    // as that can lead to a deadlock(b/162192331).
    auto logicalCameraIds = getLogicalCameras(cameraId);
    // Update the status for this camera state, then send the onStatusChangedCallbacks to each
    // of the listeners with both the mStatusLock and mStatusListenerLock held
    state->updateStatus(status, cameraId, rejectSourceStates, [this, &deviceKind, &supportsHAL3,
    state->updateStatus(status, cameraId, rejectSourceStates, [this, &deviceKind,
                        &logicalCameraIds]
            (const String8& cameraId, StatusInternal status) {

@@ -3804,8 +3792,8 @@ void CameraService::updateStatus(StatusInternal status, const String8& cameraId,
                bool isVendorListener = listener->isVendorListener();
                if (shouldSkipStatusUpdates(deviceKind, isVendorListener,
                        listener->getListenerPid(), listener->getListenerUid()) ||
                        (isVendorListener && !supportsHAL3)) {
                    ALOGV("Skipping discovery callback for system-only camera/HAL1 device %s",
                        isVendorListener) {
                    ALOGV("Skipping discovery callback for system-only camera device %s",
                            cameraId.c_str());
                    continue;
                }