[SCM] Multi-format 1D/2D barcode image processing library branch, upstream, updated. 24d4480bc48cf9eabf7b2bd2f528248b0e458809
dswitkin
dswitkin at 59b500cc-1b3d-0410-9834-0bbf25fbcc57
Wed Aug 4 01:31:13 UTC 2010
The following commit has been merged in the upstream branch:
commit af2c063671d50999a94f70762e7b554dc188e81f
Author: dswitkin <dswitkin at 59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Date: Thu Apr 29 22:07:11 2010 +0000
Fixed a crash with using SCAN_FORMATS - Pattern.split() does not like null as an argument.
git-svn-id: http://zxing.googlecode.com/svn/trunk@1323 59b500cc-1b3d-0410-9834-0bbf25fbcc57
diff --git a/android/src/com/google/zxing/client/android/CaptureActivity.java b/android/src/com/google/zxing/client/android/CaptureActivity.java
index 068d578..aa476c0 100755
--- a/android/src/com/google/zxing/client/android/CaptureActivity.java
+++ b/android/src/com/google/zxing/client/android/CaptureActivity.java
@@ -264,11 +264,14 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
}
private static Vector<BarcodeFormat> parseDecodeFormats(Intent intent) {
- return parseDecodeFormats(
- Arrays.asList(COMMA_PATTERN.split(intent.getStringExtra(Intents.Scan.SCAN_FORMATS))),
- intent.getStringExtra(Intents.Scan.MODE));
+ String formats = intent.getStringExtra(Intents.Scan.SCAN_FORMATS);
+ if (formats != null) {
+ return parseDecodeFormats(Arrays.asList(COMMA_PATTERN.split(formats)),
+ intent.getStringExtra(Intents.Scan.MODE));
+ }
+ return null;
}
-
+
private static Vector<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
List<String> formats = inputUri.getQueryParameters(Intents.Scan.SCAN_FORMATS);
if (formats.size() == 1){
@@ -276,7 +279,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
}
return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
-
+
private static Vector<BarcodeFormat> parseDecodeFormats(List<String> scanFormats,
String decodeMode) {
if (scanFormats != null) {
--
Multi-format 1D/2D barcode image processing library
More information about the Pkg-google-commits
mailing list