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

Commit b40c761d authored by Shuzhen Wang's avatar Shuzhen Wang Committed by Automerger Merge Worker
Browse files

Merge "Camera: Stop waiting if device enters ERROR state" into udc-dev am: da909306

parents 224c3be2 da909306
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1645,6 +1645,10 @@ status_t Camera3Device::waitUntilStateThenRelock(bool active, nsecs_t timeout,
    bool stateSeen = false;
    nsecs_t startTime = systemTime();
    do {
        if (mStatus == STATUS_ERROR) {
            // Device in error state. Return right away.
            break;
        }
        if (active == (mStatus == STATUS_ACTIVE) &&
            (requestThreadInvocation || !mStatusIsInternal)) {
            // Desired state is current
@@ -1674,6 +1678,11 @@ status_t Camera3Device::waitUntilStateThenRelock(bool active, nsecs_t timeout,
        // they are not paused. This avoids intermediate pause signals from reconfigureCamera as it
        // changes the status to active right after.
        for (size_t i = startIndex; i < mRecentStatusUpdates.size(); i++) {
            if (mRecentStatusUpdates[i].status == STATUS_ERROR) {
                // Device in error state. Return right away.
                stateSeen = true;
                break;
            }
            if (active == (mRecentStatusUpdates[i].status == STATUS_ACTIVE) &&
                (requestThreadInvocation || !mRecentStatusUpdates[i].isInternal)) {
                stateSeen = true;