+ comments, >=0, IllegalStateException

This commit is contained in:
slepmog 2014-05-01 06:11:18 -07:00
parent 378553986c
commit 2b6c4ef71b

View file

@ -77,7 +77,7 @@ public final class CameraManager {
Camera theCamera = camera; Camera theCamera = camera;
if (theCamera == null) { if (theCamera == null) {
if (requestedCameraId > -1) { if (requestedCameraId >= 0) {
theCamera = OpenCameraInterface.open(requestedCameraId); theCamera = OpenCameraInterface.open(requestedCameraId);
} else { } else {
theCamera = OpenCameraInterface.open(); theCamera = OpenCameraInterface.open();
@ -277,11 +277,11 @@ public final class CameraManager {
* Allows third party apps to specify the camera ID, rather than determine * Allows third party apps to specify the camera ID, rather than determine
* it automatically based on available cameras and their orientation. * 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) { public synchronized void setManualCameraId(int cameraId) {
if (initialized) { if (initialized) {
// FIXME throw exception? Just store for future use? Do not want to suddenly swap cameras! throw new IllegalStateException();
} else { } else {
requestedCameraId = cameraId; requestedCameraId = cameraId;
} }