Fix CameraManager#open exception handling.

Bug: 21620938
Change-Id: I062989c5fed6f99c0566da2f56bfb6b657734a33
This commit is contained in:
Ruben Brunk
2015-06-03 19:40:22 -07:00
parent ed9d3494a8
commit a45aa0d549

View File

@@ -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) */