Skip to content

Commit

Permalink
Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuriy Budiyev committed Sep 21, 2017
1 parent 7ab1ee9 commit e6d2883
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,18 @@ public void run() {
List<String> focusModes = parameters.getSupportedFocusModes();
boolean autoFocusSupported =
focusModes != null && focusModes.contains(Camera.Parameters.FOCUS_MODE_AUTO);
if (!autoFocusSupported) {
mAutoFocusEnabled = false;
}
if (autoFocusSupported && mAutoFocusEnabled) {
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);
}
List<String> flashModes = parameters.getSupportedFlashModes();
boolean flashSupported =
flashModes != null && flashModes.contains(Camera.Parameters.FLASH_MODE_TORCH);
if (!flashSupported) {
mFlashEnabled = false;
}
camera.setParameters(Utils.optimizeParameters(parameters));
camera.setDisplayOrientation(orientation);
mInitializeLock.lock();
Expand Down Expand Up @@ -594,6 +600,7 @@ private FinishInitializationTask(@NonNull Point frameSize) {
@Override
public void run() {
mScannerView.setFrameSize(mFrameSize);
mScannerView.setCodeScanner(CodeScanner.this);
startPreview();
}
}
Expand Down

0 comments on commit e6d2883

Please sign in to comment.