Safer check for Build SDK; restrict Behold II workaround to Cupcake, per Samsung
[zxing.git] / android / src / com / google / zxing / client / android / camera / CameraConfigurationManager.java
index d0257ca..cb8daa3 100644 (file)
@@ -181,7 +181,9 @@ final class CameraConfigurationManager {
   private void setFlash(Camera.Parameters parameters) {
     // FIXME: This is a hack to turn the flash off on the Samsung Galaxy.
     // And this is a hack-hack to work around a different value on the Behold II
-    if (Build.MODEL.contains("Behold II")) {
+    // Restrict Behold II check to Cupcake, per Samsung's advice
+    if (Build.MODEL.contains("Behold II") &&
+        CameraManager.SDK_INT == Build.VERSION_CODES.CUPCAKE) {
       parameters.set("flash-value", 1);
     } else {
       parameters.set("flash-value", 2);