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

Commit 4fb55c15 authored by Igor Murashkin's avatar Igor Murashkin
Browse files

camera: Fix deadlock when sending callbacks during disconnect

Bug: 10552448
Change-Id: Ie93ba744ae6705aa657f980ae8e08ec624feeb39
parent ed474f37
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -500,14 +500,12 @@ void CameraDeviceClient::onFrameAvailable(int32_t frameId,
    ATRACE_CALL();
    ALOGV("%s", __FUNCTION__);

    Mutex::Autolock icl(mBinderSerializationLock);
    SharedCameraCallbacks::Lock l(mSharedCameraCallbacks);

    if (mRemoteCallback != NULL) {
    // Thread-safe. No lock necessary.
    sp<ICameraDeviceCallbacks> remoteCb = mRemoteCallback;
    if (remoteCb != NULL) {
        ALOGV("%s: frame = %p ", __FUNCTION__, &frame);
        mRemoteCallback->onResultReceived(frameId, frame);
        remoteCb->onResultReceived(frameId, frame);
    }

}

// TODO: move to Camera2ClientBase