mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
+ comments, >=0, IllegalStateException
This commit is contained in:
parent
378553986c
commit
2b6c4ef71b
|
@ -77,7 +77,7 @@ public final class CameraManager {
|
|||
Camera theCamera = camera;
|
||||
if (theCamera == null) {
|
||||
|
||||
if (requestedCameraId > -1) {
|
||||
if (requestedCameraId >= 0) {
|
||||
theCamera = OpenCameraInterface.open(requestedCameraId);
|
||||
} else {
|
||||
theCamera = OpenCameraInterface.open();
|
||||
|
@ -277,11 +277,11 @@ public final class CameraManager {
|
|||
* Allows third party apps to specify the camera ID, rather than determine
|
||||
* it automatically based on available cameras and their orientation.
|
||||
*
|
||||
* @param cameraId camera ID of the camera to use
|
||||
* @param cameraId camera ID of the camera to use. A negative value means "no preference".
|
||||
*/
|
||||
public synchronized void setManualCameraId(int cameraId) {
|
||||
if (initialized) {
|
||||
// FIXME throw exception? Just store for future use? Do not want to suddenly swap cameras!
|
||||
throw new IllegalStateException();
|
||||
} else {
|
||||
requestedCameraId = cameraId;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue