Forced the Android client to only decode the existing 7 formats, thereby excluding ITF for the time being.

git-svn-id: https://zxing.googlecode.com/svn/trunk@751 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
dswitkin 2008-11-20 21:05:50 +00:00
parent 960a169da7
commit 6d7d507e27

View file

@ -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<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>(3);
Vector<BarcodeFormat> vector = new Vector<BarcodeFormat>();
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);
}
/**