Open the camera, blocking it until it succeeds or fails.
Note that the Handler provided must not be null. Furthermore, if there is a handler,
its Looper must not be the current thread's Looper. Otherwise we'd never receive
the callbacks from the CameraDevice since this function would prevent them from being
processed.
Throws {@link CameraAccessException} for the same reason {@link CameraManager#openCamera}
does.
Throws {@link BlockingOpenException} when the open fails asynchronously (due to
{@link CameraDevice.StateCallback#onDisconnected(CameraDevice)} or
({@link CameraDevice.StateCallback#onError(CameraDevice)}.
Throws {@link TimeoutRuntimeException} if opening times out. This is usually
highly unrecoverable, and all future calls to opening that camera will fail since the
service will think it's busy. This class will do its best to clean up eventually.
if (handler == null) {
throw new IllegalArgumentException("handler must not be null");
} else if (handler.getLooper() == Looper.myLooper()) {
throw new IllegalArgumentException("handler's looper must not be the current looper");
}
return (new OpenListener(mManager, cameraId, listener, handler)).blockUntilOpen();