diff --git a/android/src/com/google/zxing/client/android/DecodeThread.java b/android/src/com/google/zxing/client/android/DecodeThread.java index b31d4c637..f2ad73bf0 100755 --- a/android/src/com/google/zxing/client/android/DecodeThread.java +++ b/android/src/com/google/zxing/client/android/DecodeThread.java @@ -124,8 +124,22 @@ final class DecodeThread extends Thread { mMultiFormatReader.setHints(hints); } + /** + * Instead of calling setHints(null), which would allow new formats like ITF to sneak in, we + * explicitly set which formats are available. + */ private void setDecodeAllMode() { - mMultiFormatReader.setHints(null); + Hashtable hints = new Hashtable(3); + Vector vector = new Vector(); + vector.addElement(BarcodeFormat.UPC_A); + vector.addElement(BarcodeFormat.UPC_E); + vector.addElement(BarcodeFormat.EAN_13); + vector.addElement(BarcodeFormat.EAN_8); + vector.addElement(BarcodeFormat.CODE_39); + vector.addElement(BarcodeFormat.CODE_128); + vector.addElement(BarcodeFormat.QR_CODE); + hints.put(DecodeHintType.POSSIBLE_FORMATS, vector); + mMultiFormatReader.setHints(hints); } /**