OK, issue 303, work around different Behold 2 setting
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Sun, 25 Apr 2010 10:23:22 +0000 (10:23 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Sun, 25 Apr 2010 10:23:22 +0000 (10:23 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@1318 59b500cc-1b3d-0410-9834-0bbf25fbcc57

android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java

index e04c352..c22a4d7 100644 (file)
@@ -21,6 +21,7 @@ import java.util.regex.Pattern;
 import android.content.Context;
 import android.graphics.Point;
 import android.hardware.Camera;
+import android.os.Build;
 import android.util.Log;
 import android.view.Display;
 import android.view.WindowManager;
@@ -179,7 +180,12 @@ final class CameraConfigurationManager {
 
   private void setFlash(Camera.Parameters parameters) {
     // FIXME: This is a hack to turn the flash off on the Samsung Galaxy.
-    parameters.set("flash-value", 2);
+    // And this is a hack-hack to work around a different value on the Behold II
+    if (Build.MODEL.contains("Behold II")) {
+      parameters.set("flash-value", 1);
+    } else {
+      parameters.set("flash-value", 2);
+    }
     // This is the standard setting to turn the flash off that all devices should honor.
     parameters.set("flash-mode", "off");
   }