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

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

Merge "Camera3: Fix flush call deadlock"

parents 32ce52b0 69a37489
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -999,6 +999,10 @@ status_t Camera3Device::waitUntilDrained() {
    Mutex::Autolock il(mInterfaceLock);
    Mutex::Autolock l(mLock);

    return waitUntilDrainedLocked();
}

status_t Camera3Device::waitUntilDrainedLocked() {
    switch (mStatus) {
        case STATUS_UNINITIALIZED:
        case STATUS_UNCONFIGURED:
@@ -1209,7 +1213,7 @@ status_t Camera3Device::flush() {
    if (mHal3Device->common.version >= CAMERA_DEVICE_API_VERSION_3_1) {
        res = mHal3Device->ops->flush(mHal3Device);
    } else {
        res = waitUntilDrained();
        res = waitUntilDrainedLocked();
    }

    return res;
+7 −0
Original line number Diff line number Diff line
@@ -245,6 +245,13 @@ class Camera3Device :
     */
    status_t waitUntilStateThenRelock(bool active, nsecs_t timeout);

    /**
     * Implementation of waitUntilDrained. On success, will transition to IDLE state.
     *
     * Need to be called with mLock and mInterfaceLock held.
     */
    status_t waitUntilDrainedLocked();

    /**
     * Do common work for setting up a streaming or single capture request.
     * On success, will transition to ACTIVE if in IDLE.