Skip to content

Commit

Permalink
Closes issue #492 : correctly restart autofocus after light is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
srowen committed Nov 6, 2015
1 parent d1615cc commit e449915
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -174,11 +174,14 @@ public synchronized void setTorch(boolean newSetting) {
OpenCamera theCamera = camera;
if (theCamera != null) {
if (newSetting != configManager.getTorchState(theCamera.getCamera())) {
if (autoFocusManager != null) {
boolean wasAutoFocusManager = autoFocusManager != null;
if (wasAutoFocusManager) {
autoFocusManager.stop();
autoFocusManager = null;
}
configManager.setTorch(theCamera.getCamera(), newSetting);
if (autoFocusManager != null) {
if (wasAutoFocusManager) {
autoFocusManager = new AutoFocusManager(context, theCamera.getCamera());
autoFocusManager.start();
}
}
Expand Down

0 comments on commit e449915

Please sign in to comment.