From 2b6c4ef71b0c776ae49e80cdd2770d1f6dfd818d Mon Sep 17 00:00:00 2001 From: slepmog Date: Thu, 1 May 2014 06:11:18 -0700 Subject: [PATCH] + comments, >=0, IllegalStateException --- .../google/zxing/client/android/camera/CameraManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/src/com/google/zxing/client/android/camera/CameraManager.java b/android/src/com/google/zxing/client/android/camera/CameraManager.java index 46dd5a095..b9e8b2ca7 100755 --- a/android/src/com/google/zxing/client/android/camera/CameraManager.java +++ b/android/src/com/google/zxing/client/android/camera/CameraManager.java @@ -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; }