From 9d945005482a782ea649f8d8c5f2dfc4b159268a Mon Sep 17 00:00:00 2001 From: PaoloMessina Date: Tue, 23 Dec 2014 16:06:44 +0100 Subject: [PATCH] Bug fix Continuos auto focus fix for sony device --- android/ZBarScannerActivity.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/android/ZBarScannerActivity.java b/android/ZBarScannerActivity.java index f9302d7..d71b944 100644 --- a/android/ZBarScannerActivity.java +++ b/android/ZBarScannerActivity.java @@ -306,19 +306,19 @@ implements SurfaceHolder.Callback { private AutoFocusCallback autoFocusCb = new AutoFocusCallback() { - public void onAutoFocus(boolean success, Camera camera) { - autoFocusHandler.postDelayed(doAutoFocus, autoFocusInterval); - } + public void onAutoFocus(boolean success, Camera camera) { + camera.cancelAutoFocus(); + autoFocusHandler.postDelayed(doAutoFocus, autoFocusInterval); + } }; private Runnable doAutoFocus = new Runnable() { - public void run() { - if(camera != null){ - camera.cancelAutoFocus(); - camera.autoFocus(autoFocusCb); - } - } + public void run() { + if(camera != null){ + camera.autoFocus(autoFocusCb); + } + } }; // Camera callbacks ------------------------------------------------