* commit '557fab42fae1347bd9137a376747a8fbd7612103': Fix CameraManager#open exception handling.
This commit is contained in:
@@ -906,7 +906,6 @@ public class CameraDeviceImpl extends CameraDevice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mRemoteDevice = null;
|
mRemoteDevice = null;
|
||||||
mInError = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1889,13 +1888,13 @@ public class CameraDeviceImpl extends CameraDevice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void checkIfCameraClosedOrInError() throws CameraAccessException {
|
private void checkIfCameraClosedOrInError() throws CameraAccessException {
|
||||||
|
if (mRemoteDevice == null) {
|
||||||
|
throw new IllegalStateException("CameraDevice was already closed");
|
||||||
|
}
|
||||||
if (mInError) {
|
if (mInError) {
|
||||||
throw new CameraAccessException(CameraAccessException.CAMERA_ERROR,
|
throw new CameraAccessException(CameraAccessException.CAMERA_ERROR,
|
||||||
"The camera device has encountered a serious 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) */
|
/** Whether the camera device has started to close (may not yet have finished) */
|
||||||
|
|||||||
Reference in New Issue
Block a user