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

Commit 66036d50 authored by Zhijun He's avatar Zhijun He Committed by Android (Google) Code Review
Browse files

Merge "camera3: Don't hold mLock during flush call"

parents 3ccf3c1e 7ef20390
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1162,13 +1162,17 @@ status_t Camera3Device::flush(int64_t *frameNumber) {
    ATRACE_CALL();
    ALOGV("%s: Camera %d: Flushing all requests", __FUNCTION__, mId);
    Mutex::Autolock il(mInterfaceLock);
    Mutex::Autolock l(mLock);

    {
        Mutex::Autolock l(mLock);
        mRequestThread->clear(/*out*/frameNumber);
    }

    status_t res;
    if (mHal3Device->common.version >= CAMERA_DEVICE_API_VERSION_3_1) {
        res = mHal3Device->ops->flush(mHal3Device);
    } else {
        Mutex::Autolock l(mLock);
        res = waitUntilDrainedLocked();
    }