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

Commit 008175be authored by Ruben Brunk's avatar Ruben Brunk Committed by Android Git Automerger
Browse files

am 74fc1837: Merge "Fix CameraManager#open exception handling." into mnc-dev

* commit '74fc1837':
  Fix CameraManager#open exception handling.
parents 1caa54f5 74fc1837
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -906,7 +906,6 @@ public class CameraDeviceImpl extends CameraDevice {
            }

            mRemoteDevice = null;
            mInError = false;
        }
    }

@@ -1889,13 +1888,13 @@ public class CameraDeviceImpl extends CameraDevice {
    }

    private void checkIfCameraClosedOrInError() throws CameraAccessException {
        if (mRemoteDevice == null) {
            throw new IllegalStateException("CameraDevice was already closed");
        }
        if (mInError) {
            throw new CameraAccessException(CameraAccessException.CAMERA_ERROR,
                    "The camera device has encountered a serious error");
        }
        if (mRemoteDevice == null) {
            throw new IllegalStateException("CameraDevice was already closed");
        }
    }

    /** Whether the camera device has started to close (may not yet have finished) */