mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 04:54:04 -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;
|
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue