From 4f7bc9d8ab69c14f48fd97a00fa6ea913c07d988 Mon Sep 17 00:00:00 2001 From: srowen Date: Sat, 18 Sep 2010 10:45:38 +0000 Subject: [PATCH] Don't use Build.VERSION_CODES as it's not in 1.5 git-svn-id: https://zxing.googlecode.com/svn/trunk@1595 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../client/android/camera/CameraConfigurationManager.java | 5 +++-- .../google/zxing/client/android/camera/CameraManager.java | 3 ++- .../com/google/zxing/client/androidtest/CameraManager.java | 7 ++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java b/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java index 071388f74..e06b01cd4 100644 --- a/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java +++ b/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java @@ -182,8 +182,9 @@ final class CameraConfigurationManager { // 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 // Restrict Behold II check to Cupcake, per Samsung's advice - if (Build.MODEL.contains("Behold II") && - CameraManager.SDK_INT == Build.VERSION_CODES.CUPCAKE) { + //if (Build.MODEL.contains("Behold II") && + // CameraManager.SDK_INT == Build.VERSION_CODES.CUPCAKE) { + if (Build.MODEL.contains("Behold II") && CameraManager.SDK_INT == 3) { // 3 = Cupcake parameters.set("flash-value", 1); } else { parameters.set("flash-value", 2); diff --git a/android/src/com/google/zxing/client/android/camera/CameraManager.java b/android/src/com/google/zxing/client/android/camera/CameraManager.java index 53c11ba88..451c7e6a3 100755 --- a/android/src/com/google/zxing/client/android/camera/CameraManager.java +++ b/android/src/com/google/zxing/client/android/camera/CameraManager.java @@ -107,7 +107,8 @@ public final class CameraManager { // Camera.setPreviewCallback() on 1.5 and earlier. For Donut and later, we need to use // the more efficient one shot callback, as the older one can swamp the system and cause it // to run out of memory. We can't use SDK_INT because it was introduced in the Donut SDK. - useOneShotPreviewCallback = SDK_INT > Build.VERSION_CODES.CUPCAKE; + //useOneShotPreviewCallback = Integer.parseInt(Build.VERSION.SDK) > Build.VERSION_CODES.CUPCAKE; + useOneShotPreviewCallback = Integer.parseInt(Build.VERSION.SDK) > 3; // 3 = Cupcake previewCallback = new PreviewCallback(configManager, useOneShotPreviewCallback); autoFocusCallback = new AutoFocusCallback(); diff --git a/androidtest/src/com/google/zxing/client/androidtest/CameraManager.java b/androidtest/src/com/google/zxing/client/androidtest/CameraManager.java index 0df0f7aed..e92d2ec17 100755 --- a/androidtest/src/com/google/zxing/client/androidtest/CameraManager.java +++ b/androidtest/src/com/google/zxing/client/androidtest/CameraManager.java @@ -123,11 +123,8 @@ final class CameraManager { // Camera.setPreviewCallback() on 1.5 and earlier. For Donut and later, we need to use // the more efficient one shot callback, as the older one can swamp the system and cause it // to run out of memory. We can't use SDK_INT because it was introduced in the Donut SDK. - if (Integer.parseInt(Build.VERSION.SDK) <= Build.VERSION_CODES.CUPCAKE) { - useOneShotPreviewCallback = false; - } else { - useOneShotPreviewCallback = true; - } + //useOneShotPreviewCallback = Integer.parseInt(Build.VERSION.SDK) > Build.VERSION_CODES.CUPCAKE; + useOneShotPreviewCallback = Integer.parseInt(Build.VERSION.SDK) > 3; // 3 = Cupcake } /**